Tile
Medium
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Father Baytik, a builder, returned home one evening and decided to tackle this problem. He has tiles with widths of a cm and b cm. Each type of tile can be placed with a gap ranging from 1 to 5 mm. The task is to determine values for x and y in mm such that the total distance of the two placements is equal and minimized.
Input
The widths of the tiles are given as integers a and b (a, b < 10^8
).
Output
Provide the gap values x and y (in mm) and the minimum common length of the placement in cm, formatted as a real number with one decimal place.
Examples
Input #1
Answer #1
Submissions 388
Acceptance rate 8%