Marble exchanges

0.65 Edgar has a collection of red, blue and yellow marbles. As many
times as he wishes, he can only make one operation: exchanging two
marbles of different colours (one of each colour) for one of the
remaining colour. Given (R, B, Y) (the number of marbles of each
colour), can you determine whether Edgar will be capable of keeping just
one of the marbles?

For instance, from (1, 1, 2) he can move to (2, 0, 1), from there to
(1, 1, 0), and from there to (0, 0, 1). By contrast, it is not difficult
to see that from (1, 1, 3) he cannot reach any of (1, 0, 0), (0, 1, 0)
or (0, 0, 1).

0.33

[image]

Input

Input consists of several cases, each one with three integers R, B and
Y, all of them between 0 and 10⁹. Assume R + B + Y > 0.

Output

For every case, print “YES” if Edgar can achieve a situation where
R^(′) + B^(′) + Y^(′) = 1, and print “NO” otherwise. Obviously, none of
the three variables can go below zero at any moment.

Problem information

Author: Jordi Rodriguez

Generation: 2026-01-25T10:21:58.958Z

© Jutge.org, 2006–2026.
https://jutge.org
