From a52e52c40d5204e4324753574e0412be98a4c500 Mon Sep 17 00:00:00 2001 From: Manuel Pineda Date: Wed, 24 Jul 2024 16:16:10 +0200 Subject: [PATCH] Add test problem using jujutsu. (#8) --- .../Codeforces Round 961 (Div. 2)/A.cc | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 solved/Codeforces/Codeforces Round 961 (Div. 2)/A.cc diff --git a/solved/Codeforces/Codeforces Round 961 (Div. 2)/A.cc b/solved/Codeforces/Codeforces Round 961 (Div. 2)/A.cc new file mode 100644 index 00000000..3f7105dc --- /dev/null +++ b/solved/Codeforces/Codeforces Round 961 (Div. 2)/A.cc @@ -0,0 +1,31 @@ +#include + +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; +} \ No newline at end of file