CF1606B Update Files
题目描述
### 题意简述
有 $n$ 台电脑需要安装更新文件,开始时仅有 $1$ 号电脑有更新文件。
在每一个小时内,已安装文件的电脑可以通过一条电缆把文件传给另一个未安装文件的电脑。你只有 $k$ 条电缆,也就是说每个小时至多只能有 $k$ 台电脑进行传输。
问所有电脑都接受到更新文件需要多少小时。
输入格式
多组数据,第一行一个整数 $T\ (1\le T\le 10^5)$。
接下来 $T$ 行,每行两个整数 $n,k\ (1\le n\le k\le 10^{18})$。
输出格式
对于每组数据,输出一个整数表示答案。
说明/提示
Let's consider the test cases of the example:
- $ n=8 $ , $ k=3 $ :
1. during the first hour, we copy the update files from the computer $ 1 $ to the computer $ 2 $ ;
2. during the second hour, we copy the update files from the computer $ 1 $ to the computer $ 3 $ , and from the computer $ 2 $ to the computer $ 4 $ ;
3. during the third hour, we copy the update files from the computer $ 1 $ to the computer $ 5 $ , from the computer $ 2 $ to the computer $ 6 $ , and from the computer $ 3 $ to the computer $ 7 $ ;
4. during the fourth hour, we copy the update files from the computer $ 2 $ to the computer $ 8 $ .
- $ n=6 $ , $ k=6 $ :
1. during the first hour, we copy the update files from the computer $ 1 $ to the computer $ 2 $ ;
2. during the second hour, we copy the update files from the computer $ 1 $ to the computer $ 3 $ , and from the computer $ 2 $ to the computer $ 4 $ ;
3. during the third hour, we copy the update files from the computer $ 1 $ to the computer $ 5 $ , and from the computer $ 2 $ to the computer $ 6 $ .
- $ n=7 $ , $ k=1 $ :
1. during the first hour, we copy the update files from the computer $ 1 $ to the computer $ 2 $ ;
2. during the second hour, we copy the update files from the computer $ 1 $ to the computer $ 3 $ ;
3. during the third hour, we copy the update files from the computer $ 1 $ to the computer $ 4 $ ;
4. during the fourth hour, we copy the update files from the computer $ 4 $ to the computer $ 5 $ ;
5. during the fifth hour, we copy the update files from the computer $ 4 $ to the computer $ 6 $ ;
6. during the sixth hour, we copy the update files from the computer $ 3 $ to the computer $ 7 $ .