P2903 [USACO08MAR] The Loathesome Hay Baler S
Description
Farmer John has purchased the world's most loathesome hay baler. Instead of having a drive-roller that drives maybe an idler roller that drives the power take-off for the baler, it has N rollers (2
Input Format
\* Line 1: Three space-separated integers: N, X\_t, and Y\_t
\* Lines 2..N+1: Line i+1 describes roller i's properties: X\_i, Y\_i, and R\_i
Output Format
\* Line 1: A single integer that is the truncated version of the sum of the absolute value of the speeds of the rollers in the power-train including the drive-roller, all the driven rollers, and the power take-off roller.
Explanation/Hint
$2 \leq N \leq 1050$,$-5000 \leq x,y \leq 5000$,$3 \leq r \leq 800$。
Four rollers: the drive-roller at 0,0 with radius 10. It drives the roller above it at 0,30 with radius 20. That roller drives both the power take-off roller at 32,54 (r=20) and a random roller (not in the power train) at -40,30 (r=20).
Roller Radius Speed
1 (0,0) 10 10,000
2 (0,30) 20 -5,000
3 (32,54) 20 5,000
------
Sum of abs values: 20,000