0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2025-01-11 22:12:00 +00:00

B - Update Files

https://codeforces.com/contest/1606/submission/133512364
This commit is contained in:
Baoshuo Ren 2021-10-30 00:14:08 +08:00 committed by Baoshuo Ren
parent 41f631db5c
commit 7536cc5945
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

24
CodeForces/1606/B/B.cpp Normal file
View File

@ -0,0 +1,24 @@
#include <bits/stdc++.h>
using namespace std;
int t;
long long n, k, f, ans;
int main() {
cin >> t;
while (t--) {
f = 1;
ans = 0;
cin >> n >> k;
while (f <= k && f < n) {
ans++;
f <<= 1;
}
if (f < n) {
ans += (n - f) / k + !!((n - f) % k);
}
cout << ans << endl;
}
return 0;
}