Ieumjul
Time limit1sMemory limit64 MB
Given a rectangle's width and height, compute the dimensions of the poster after the folded shape is determined geometrically.
- Level
Medium4 of 10
- Topics
- Geometry, Math, Implementation
- Solved
- No attempts yet
Problem
Ieumjul is the 49th student council leadership team of Korea University. During last autumn's campaign, Ieumjul handed out this poster.

The folded parts of the poster open up. Once every fold is opened, the poster is a single rectangular sheet.


Jino was impressed by the poster and wants to make a similar one. All Jino has is one rectangular sheet that is cm wide and cm tall. What size of poster comes out when Jino folds that sheet?
The folding goes like this. Label the corners of the sheet , , , counterclockwise, starting at the bottom left corner. Sides and are the horizontal sides of length , and sides and are the vertical sides of length .
- Fold along a line through so that side lands on the diagonal . This fold line bisects angle and meets side .
- Fold along a line through so that side lands on the diagonal . This fold line bisects angle and meets side . Both flaps go to the back.
- After the two folds, what is left is a parallelogram whose long sides are the two fold lines. Fold that parallelogram in half along its length and the poster is done. The finished poster is a rectangle. Its width is half the length of one fold line, and its height is the distance between the two fold lines.
Input
The first line has the width and the height of the sheet, separated by a space. Both values are given with two digits after the decimal point, and .
Output
Print the width and the height of the finished poster in centimeters on one line, separated by a space. Round both values at the third digit after the decimal point and print two digits after the decimal point. Keep a trailing zero instead of dropping it.