Skip to content

Commit

Permalink
Add test problem using jujutsu. (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
pin3da authored Jul 24, 2024
1 parent fc33098 commit a52e52c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions solved/Codeforces/Codeforces Round 961 (Div. 2)/A.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <bits/stdc++.h>

using namespace std;

int main() {
int tc;
cin >> tc;
while (tc--) {
int n, k;
cin >> n >> k;
int ans = 0;
if (k != 0) {
ans++;
k -= n;
n--;
while (k > 0) {
ans++;
k -= n;
if (k <= 0) {
break;
}
ans++;
k -= n;
n--;
}
}
assert(k <= 0);
cout << ans << endl;
}
return 0;
}

0 comments on commit a52e52c

Please sign in to comment.