ski.inThe Mooville city officials have been trying to bring in business and entertainment to their small town. Recently, the ferry closed the canal that passes through the town. After witnessing a water ski show at Cypress Gardens, Mayor Moocky came up with an interesting twist that might just suit his small town. Every Saturday night on the closed canal, they will stage a ski jumping dual jump, using two connected ramps, where skiers will approach from opposite ends of the canal and jump over the ramp simultaneously. (The boats don't hit each other because they are kept perfectly straight on opposite sides of the canal.) The problem is, the boats they will use have different top speeds and accelerations, so they need to figure out what point on the canal to place the grandstands each week.
Given a length of canal with a boat at each end, and the acceleration and top speed of each boat, determine the meeting point. (You may assume each boat has constant acceleration until top speed is reached and they continue at top speed until after the amazing jump.)
Each input line contains five integer values separated by white space. The first integer will be the length of the canal in miles and will be between 1 and 20. The second integer will be the top speed of boat A and the third integer will be the acceleration of boat A. The fourth integer will be the top speed of boat B and the fifth integer will be the acceleration of boat B. The top speed of a boat will be in miles per hour and will be greater than zero. The acceleration of a boat will be given in miles per hour per second and will be greater than zero. The last line of the input file will have a canal length value of zero.
The first line of output should
read "SKI OUTPUT".
After that, for each line of input, there should be one line of output
consisting of "JUMP POINT:
" followed by the distance in miles to the collision point from the
starting point of boat A. The distance must be rounded to two decimal places.
The last line of output should read "END OF OUTPUT".
20 50 5 60 6 20 40 2 80 4 20 60 6 30 3 0 1 1 1 1
SKI OUTPUT JUMP POINT: 9.09 JUMP POINT: 6.67 JUMP POINT: 13.33 END OF OUTPUT