Square pasture
Limits: 2 sec., 256 MiB
This statement was translated automatically from Ukrainian.
Zenyk and Marichka’s horse farm has \(a\) foals, \(b\) mares, and \(c\) stallions. The horse breeders want to set up a pasture on their farm.
A foal needs a grazing plot of exactly \(10\) meters \(\times\) \(10\) meters.
A mare needs a grazing plot of exactly \(10\) meters \(\times\) \(20\) meters.
A stallion needs a grazing plot of exactly \(20\) meters \(\times\) \(20\) meters.
The orientations of the grazing plots for each horse do not matter.
Zenyk and Marichka have the following requirements for the pasture:
the pasture has a square shape;
every horse on the farm has its own plot on the pasture;
the horses’ plots do not overlap;
the entire area of the pasture is occupied by the horses’ plots.
Determine whether such a pasture can be fenced.
Input
The single line contains three integers \(a\), \(b\), and \(c\) — the number of foals, mares, and stallions on the farm, respectively.
Output
Print Yes if it is possible to fence a pasture that
satisfies Zenyk and Marichka’s requirements, and No
otherwise.
Constraints
\(0 \le a, b, c \le 10^6\),
\(a + b + c \ge 1\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 0 0 1 | Yes |
| Input (stdin) | Output (stdout) |
|---|---|
| 7 7 37 | No |
| Input (stdin) | Output (stdout) |
|---|---|
| 11 7 36 | Yes |
Notes
In the first example, one needs to fence a pasture of size \(20\) meters \(\times\) \(20\) meters, on which one stallion will graze.
In the second example, it is impossible to fence a square pasture that satisfies the requirements.
In the third example, one needs to fence a pasture of size \(130\) meters \(\times\) \(130\) meters. One of the possible partitions of the pasture into plots for the horses is shown in the figure.
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|