#P12365. Paper Folding Dimensions
Paper Folding Dimensions
Paper Folding Dimensions
In the ISO standard, the paper size A0 is defined to be \(1189\ mm \times 841\ mm\). When an A0 paper is folded along its longer side, it becomes an A1 paper with dimensions \(841\ mm \times 594\ mm\) (here, the length is halved with rounding down, i.e. \(\lfloor 1189/2\rfloor = 594\)). Similarly, an A1 paper is folded along its longer side to get an A2 paper, and so on.
Given the paper name (e.g. A0, A1, A2, ...), output the dimensions of the paper. The paper dimensions should be output as two space-separated integers (in millimeters) where the first number is the longer side and the second is the shorter side.
inputFormat
The input consists of a single string which represents the name of the paper (e.g. A0, A1, A2, ...).
outputFormat
Output two integers separated by a space: the first is the longer side and the second is the shorter side, both in millimeters.
sample
A0
1189 841