0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-26 20:12:00 +00:00
OI-codes/Codeforces/1606/B/B.cpp

25 lines
396 B
C++
Raw Normal View History

#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;
}