System of Equations
Limits: 2 sec., 256 MiB
You are given two non-negative integers \(a\) and \(b\).
Find any non-negative integers \(x\), \(y\), \(z\) such that
\(x+y+z=a\)
\(x \mbox{ XOR } y \mbox{ XOR } z = b\)
or report that they don’t exist.
Input
The single line of the input contains two integers \(a\) and \(b\).
Output
If there exist non-negative integers \(x\), \(y\), \(z\) which satisfy the condition print any such triple.
Otherwise print the only integer -1.
Constraints
\(0 \le a, b \le 10^9\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 74 44 | 15 13 46 |
| Input (stdin) | Output (stdout) |
|---|---|
| 4 7 | -1 |
Notes
\(15+13+46=74\),
\(15 \mbox{ XOR } 13 \mbox{ XOR } 46 = {1111}_2 \mbox{ XOR } {1101}_2 \mbox{ XOR } {101110}_2 = {101100}_2 = 44\).
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|