Getting WA in BTAR

I did the exact same thing explained in the tutorial. It’s passing the sample test cases but giving WA when submitted.Please help!

Problem

My solution

for testcase

1

6

2 2 4 6 3 1

Correct Output:-1

Your Code’s Output:2

Why don’t you find the sum of all elements first and then check whether it is divisible by 4 or not rather than checking every time

I made few adjustments to your


[1]


  [1]: https://www.codechef.com/viewsolution/16829238