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

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.


5 6 7 9

Expected Output


Your Output

1 Like

Thanks!I finally understood what the problem was.