The box does not tell you the dimensions of the puzzle, but you can quickly count the three types of pieces in the box:
Corner pieces, which touch two of the edges of the puzzle.
Edge pieces, which touch one of the edges of the puzzle.
Center pieces, which touch none of the edges of the puzzle.
Do these pieces add up to a complete jigsaw puzzle? If so, what was the original size of the jigsaw puzzle?
The input consists of:
- One line containing three integers,
, and
(
), the number of corner pieces, edge pieces, and center pieces respectively.
If there exist numbers
and
satisfying
such that the original size of the jigsaw puzzle could have been
, then output a single line containing
and
. Otherwise, output "impossible".
If there are multiple valid solutions, you may output any one of them.