|
|||||||||||||||||||
|
SPOJ time: 2012-05-26 14:03:43 |
Roll or PushProblem code: HS09ROL
You have to transport a cube by a distance of S meters. The edge of the cube is A meters long and the cube weighs M kilograms. S is a multiple of A. One can proceed in two ways:
You are given the coefficient of friction F and have to decide which way is better. InputStandard input contains N (1 ≤ N ≤ 60 000) lines, each containing four values A, M, S, F (10 ≤ A, M, S ≤ 30 000; 0.001 ≤ F ≤ 1.000)) separated by spaces. In line N+1 there are four zeros separated by spaces. Do not process this test case. OutputWrite N lines to standard output. Each should contain a single number 1 if less work is done when rolling the box and 2 if less work is done when pushing it. You are guaranteed that the difference between the works counted in both ways will never be closer than 1% of the larger of the considered values. You can assume the following value of gravitational acceleration: g=9.80665.
ExampleInput: ScoringFor solving this problem you will score 10 points.
|
||||||||||||||||||
| |||||||||||||||||||