Problem D: 魔法商店(2023-T4)

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:1 Solved:1

Description

Input

Output

输出共 T 行,对于每组数据,输出一行一个整数表示答案。

Sample Input Copy

1
3 1
10 5
8 1
20 12

Sample Output Copy

7

HINT




Source/Category