hello codeforces community At the last contest (codeforces round Div2 1101 ) , i tried to solve C2 before C1 and take 8 wrong submissions on test 16 in C2 at the last three minutes I submitted solutions for C2 and C1 the same same code but The strange thing is that the C1 get accepted and C2 wrong on test 16 and the most strange thing is that when I saw test 16 it was 1000 test cases and the correct answer is 43 so i thing n may be small may this test can be put in C1 if n <= 3000 and make my code fails this is my submission on C1 : https://mirror.codeforces.com/contest/2232/submission/376701327 and this for C2 : https://mirror.codeforces.com/contest/2232/submission/376701241
can the author explain why that happen and sorry for bad english








Submitted same code for both worked and together passed
36champ take a look
consider the worst possible case where both x and s are O(10^5) and all the tables are have been opened, this means the total remaining seats available is O(10^10), which you are storing in an int data type...if you replace int cnt with long long cnt in your code, it will run just fine
#define int long long
on line 4