diff --git a/CodeForces/1606/B/B.cpp b/CodeForces/1606/B/B.cpp new file mode 100644 index 00000000..069c6e3d --- /dev/null +++ b/CodeForces/1606/B/B.cpp @@ -0,0 +1,24 @@ +#include + +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; +}