But it’s given to print Yes and No I don’t think we are supposed to print in upper case
Consider the testcase:
10
1 1000000000
1 999999999
2 999999999
3 999999999
2 999999999
3 999999999
2 999999999
3 999999999
2 999999999
3 999999999
On my machine, it gives the output:
Yes
Yes
Yes
Yes
1000000000
1000000000
1000000000
1000000000
Commenting-out the cin.tie(0); gives the correct result; using cout everywhere instead of puts would be better.
Don’t mix C-style and iostream-based I/O if you’re going to remove synchronisation between them
(puts is C-style I/O).
2 Likes