TWOGRS - Editorial

See my solution I think its way more simple then the editorial…
Just follow greedy approach. If u can’t make it check an additional case. Try to take exactly 1 less C and exactly 2 more B if it is possible to do so and after doing that if u found the desire sum then print YES otherwise print NO.
Now why its working??? Try to find out yourself . If u can’t I will explain.
my solution: CodeChef: Practical coding for everyone

well u explained the cases pretty well… thanks… it helped understand why all positive cases give a YES.
i was enjoying ur post but when it came to the last line it was :rofl: :rofl:

anyways where i think the mistake might be is… the zero cases… do we have to consider them seperately?

After much thinking i deduced that lets assume a>2 then the answer for (a,b,c) will be the same for the values (a-2,b,c) . This holds true for both b and c as well. But the problem cannot simply be solved by just replacing a with a%2 (same for b and c). The problem is all the values will then become either 0 or 1 which will give wrong answer . I just figured that if b is greater than 2 then we can make it either make it 2 or 3 depending on its parity. Same case with a and c. The reason i choose to make the values 2/3 and not 1/2 is because the sum of values of 2 or 3 should be atleast 6. Thats why i initially made them 3/4 and it gave me AC. Then i tried to do it with 2/3 it gave me AC as well(not sure how this worked exactly) . And as expected making the values 1/2 gave WA.
here is the link to my solution → solution link

https://www.codechef.com/viewsolution/27379225

my solution is this passes pre-test case but not full
and i wonder too I not use 2+2+2=3+3 and 1+1+1=3…etc

plz help

In editorial solution why it is needed the outer loop runs for 2 times and inner loop runs for 3 times ?

Please Can someone tell me why my approach is failing ?

Approach :
is total sum is odd ans is NO also if b = 0 and a = 1 and c = 1 then also NO
else YES