Problem link : - TWOGRS Problem - CodeChef
Lets make it easy and clear !
Observation : - Answer is “NO” if (a+2*b+3*c) is odd. Agree?
If (a+2*b+3*c) is even:-
Answer is always “YES” , if a>=1 , b>=1 and c>=1
Proof:-
1)If a,b,c are even, answer is “YES”
2)If a,b,c are odd, answer is “YES”
3)If a=even and b,c=odd , this case is not allowed as the sum is odd
4) If a=odd and b,c=even, this case is not allowed as the sum is odd
5)If b=even and a,c=odd , answer is “YES”
6) If b=odd and a,c=even,answer is “YES”
5)If c=even and a,b=odd , this case is not allowed as the sum is odd
6) If c=odd and a,b=even,this case is not allowed as the sum is odd
Now, the only cases left are :- When one of the values (a,b,c) are zero or two of the values of (a,b,c) are zero.
I have discussed them here :- TWOGRS - Editorial - #15 by anon55659401
That exact post : -
This is the easiest I can explain guys -
1] If the sum (1*a+2*b+3*c==even) of all numbers is even, we check for something , else (Answer–>No).
(If sum is even, then only a set can be divided into 2-equal sets, agreed?)
2]If sum is even, and all a,b,c are positive. Answer is always Yes(you can try it yourself).
3)If sum is even and a=0 and c=0, just check the value of 'b'.
4)If sum is even, a=1 and c=odd number and b=0, answer is No.
5)If sum is even, b=1 and c=even number and a=0, answer is No.
6)For all others, answer is yes.
Link to my solution : -Very Short Code(CodeChef: Practical coding for everyone)