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:
parent
41f631db5c
commit
7536cc5945
24
CodeForces/1606/B/B.cpp
Normal file
24
CodeForces/1606/B/B.cpp
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user