How is this WA in CNOTE

Solution: 48812118 | CodeChef Getting WA, my logic is pretty straightforward and should work, pls help.

Got AC as a similar mistake was made by another person who complained in the editorial.
Can you please tell why we have to allow for it to iterate over all values and not just break it as soon as we get desired result? AC’fied code Solution: 48812738 | CodeChef
Also really appreciate your efforts towards the community, keep it up

1 Like

If you don’t read all the values for one testcase, they’ll still be in stdin when you come to read the next testcase, so you’ll read that testcase in incorrectly.

Oh! Such a silly mistake smh, thank you!

1 Like