By Paulo E. D. Pinto, UERJ-Universidade do Estado do Rio de Janeiro Brazil
Three cyclists are training on the velodrome for the next Olympics. They start up together and make thousands of laps every day, on a regular basis. Each takes a certain time to complete the lap and always runs at the same speed. The coach scored the time of one lap for the first two cyclists and only knows, in relation to the third, the time it takes for the three to line up again on the line of departure.
You will help the technician by calculating all the possible times the third rider takes a lap.
Each input line contains three integers: T, 1 ≤ T ≤ 106, the time that the cyclists take to meet again in the departure line, A, B, 1 ≤ A, B ≤ 102, the respective times that cyclists 1 and 2 take to complete one lap.
For each input line, print, in an orderly way, the possible times that the third rider takes to complete a lap, so that the mentioned coincidence occurs.
Input Sample | Output Sample |
42 6 7 |
1 2 3 6 7 14 21 42 |