Jigsaw
题号:NC222551
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

You have found an old jigsaw puzzle in the attic of your house, left behind by the previous occupants. Because you like puzzles, you decide to put this one together. But before you start, you want to know whether this puzzle was left behind for a reason. Maybe it is incomplete? Maybe the box contains pieces from multiple puzzles? 
If it looks like a complete puzzle, you also need to know how big your work surface needs to be. Nothing worse than having to start a jigsaw over because you started on a small table.  The box does not tell you the dimensions w × h 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 c, e, and m (0 ≤ c,e,m ≤ 10 9 ), the number of corner pieces, edge pieces, and center pieces respectively.

输出描述:

If there exist numbers w and h satisfying w ≥ h ≥ 2 such that the original size of the jigsaw puzzle could have been w×h, then output a single line containing w and h. Otherwise, output “impossible”.
If there are multiple valid solutions, you may output any one of them.
示例1

输入

复制
4 8 4

输出

复制
4 4
示例2

输入

复制
4 10 14

输出

复制
impossible
示例3

输入

复制
4 12 6

输出

复制
impossible
示例4

输入

复制
4 2048 195063

输出

复制
773 255