
please wait
Compiled Successfully Test 1 ACCEPTED Test 2 ACCEPTED Test 3 ACCEPTED Test 4 ACCEPTED Test 5 ACCEPTED Test 6 ACCEPTED Test 7 ACCEPTED Test 8 ACCEPTED Test 9 ACCEPTED Test 10 ACCEPTED Test 11 WRONG ANSWER Test 12 Time Limit Exceeded Test 13 ACCEPTED Test 14 ACCEPTED Test 15 ACCEPTED Test 16 ACCEPTED Test 17 Time Limit Exceeded Test 18 ACCEPTED |
|
|
n = number of steps x = length of his feet y = width of his feet |
numSteps for 'n' footLength for 'x' footWidth for 'y' |
|
|
n = number of steps x = length of his feet y = width of his feet |
|
|
for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if ((i * x) + (j * y) == n) { cout << i << " " << j; return 0; } } } |
***UPDATE (ASSIGNMENT): The game is that he stands at a distance of n cm from the wall and wants to reach the wall. To do this, he can put his foot in front of his other foot Longitudinal or transverse(till his foot is tangent with wall ) .u need to tell him to keep this several times to eventually travel the exact distance n cm and tangle with the wall. Or tell him this is impossible. In the only input row you are given three numbers n, x, and y, representing his distance to the wall and the length and width of the his legs, respectively. |
|
|
Compiled Successfully Test 1 ACCEPTED Test 2 ACCEPTED Test 3 ACCEPTED Test 4 ACCEPTED Test 5 ACCEPTED Test 6 ACCEPTED Test 7 ACCEPTED Test 8 ACCEPTED Test 9 ACCEPTED Test 10 ACCEPTED Test 11 WRONG ANSWER Test 12 ACCEPTED Test 13 ACCEPTED Test 14 ACCEPTED Test 15 ACCEPTED Test 16 ACCEPTED Test 17 ACCEPTED Test 18 ACCEPTED |
|
|
The game is that he stands at a distance of n cm from the wall and wants to reach the wall. To do this, he can put his foot in front of his other foot Longitudinal or transverse(till his foot is tangent with wall ) .u need to tell him to keep this several times to eventually travel the exact distance n cm and tangle with the wall. Or tell him this is impossible. In the only input row you are given three numbers n, x, and y, representing his distance to the wall and the length and width of the his legs, respectively. |
|
|