题库练习 Simple Molecules
← 上一题 下一题 →

A9074 | Simple Molecules

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Mad scientist Mike is busy carrying out experiments in chemistry. Today he will attempt to join three atoms into one molecule.

A molecule consists of atoms, with some pairs of atoms connected by atomic bonds. Each atom has a valence number — the number of bonds the atom must form with other atoms. An atom can form one or multiple bonds with any other atom, but it cannot form a bond with itself. The number of bonds of an atom in the molecule must be equal to its valence number.

![](/uploads/acgo/image/2d33c99ae991afdf_c341983ba867.jpeg)Mike knows valence numbers of the three atoms. Find a molecule that can be built from these atoms according to the stated rules, or determine that it is impossible.

输入格式

The single line of the input contains three space-separated integers $a$ , $b$ and $c$ ( $1<=a,b,c<=10^{6}$ ) — the valence numbers of the given atoms.

输出格式

If such a molecule can be built, print three space-separated integers — the number of bonds between the 1-st and the 2-nd, the 2-nd and the 3-rd, the 3-rd and the 1-st atoms, correspondingly. If there are multiple solutions, output any of them. If there is no solution, print "Impossible" (without the quotes).

输入输出样例

输入 #1
1 1 2
输出 #1
0 1 1
输入 #2
3 4 5
输出 #2
1 3 2
输入 #3
4 1 1
输出 #3
Impossible
C++ 编辑器
输入
输出