Need help debugging why I got WA in Oct Long 2021 div 3 THREEBOX question.

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

So what I tried was to get answer by applying the logic of if the sum of size of boxes completely divides by the size of the bag which meant I could directly print the quotient which would give me the answer else I could add 1 to the quotient for all other cases meaning one extra bag was required.

Consider this test case.

Input

1
5 6 7 9

Expected Output

3

Your Output

2
1 Like

Thanks!I finally understood what the problem was.