55 - ZOJ Monthly, September 2006 - 1008
After Michael Scofield break out of Fox River, other prisoners hope that they could follow his example. Careful preparation and perfect plan make these guys get close to their goal. However they still meet some trouble. The only road to the outside world has been obstructed. There exists a wall at the end of the road, and at the front of the wall is a wide pit. The prisoners only have a piece of rope. Fortunately they succeed to tie it to a pole in the sky. The scene is like this:
Their method to get out is: Run as quickly as possible and at the end of the road grasp the rope, it's just like single pendulum. When the height equals the height of the wall, release the rope. If the prisoner strikes the wall, he fails. Only those who succeed to fly over the wall can get freedom again.
As a talent programmer, you know whether they will succeed. Please calculate the number of those who succeed and list their names.
Note: Acceleration of gravity is 9.8.
The input contains multiple test cases.
For each test case: The first line is an integer M (1 <= M <= 100) indicating the number of prisoners.
For each test case: Output an integer indicating the number of prisoners who succeed in the first line. Then list their names one in a line, in lexicographic order.
2 10.0 6.0 2.0 Michael 60.0 18.0 C-notes 70.0 6.0
Author: JIN, Qiang