406988: GYM102651 A The Battle of Giants

Memory Limit:512 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. The Battle of Giantstime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard output

The famous programming contest organizer decided to hold competition for champions "The Battle of Giants". There are two teams competing in the battle. Several matches are organized for the competition.

Each match can end with a win for one of the teams, or with a draw. When a team wins the match it scores 3 points, in this case the opposite team doesn't score any point. In the case of a draw, teams score 1 point each. After all the matches end, the final score $$$a$$$:$$$b$$$ is calculated: $$$a$$$ and $$$b$$$ — the number of points scored by the first and second team, respectively.

For example, if the first match is won by the first team, the second match ended with a draw, and the third match is also won by the first team, the final score is 7:1.

You are given the final score. Find out whether the given score is possible, and what is the minimum number of matches could be. Print the number of matches won by the first team, the number of matches ended with a draw, and the number of matches won by the second team.

Input

The first line contains a single integer $$$a$$$ — the number of points scored by the first team.

The first line contains a single integer $$$b$$$ — the number of points scored by the second team.

The given $$$a$$$ and $$$b$$$ are nonnegative and don't exceed $$$10^9$$$.

Output

If the given final score isn't possible, print $$$-1$$$.

Otherwise, print three integers: the number of matches won by the first team, the number of matches ended with a draw, and the number of matches won by the second team, respectively. Find any solution with the minimum number of matches played.

Scoring
{Subtask}{Score}{Constraints}
121$$$0 \le a \le 50$$$; $$$b = 0$$$
223$$$0 \le a, b \le 50$$$; $$$a = b$$$
325$$$0 \le a, b \le 50$$$
431$$$0 \le a, b \le 10^9$$$
ExamplesInput
7
1
Output
2 1 0
Input
2
1
Output
-1

加入题单

算法标签: