- محدودیت زمان: ۳ ثانیه
- محدودیت حافظه: ۲۵۶ مگابایت
Amin and Niloufar need to travel from point \((0, 0)\) to \((3n, 3n)\). In normal terrain, they can travel \(1\) km per day. Their path is interrupted by a wide swamp that runs parallel to the \(x\)-axis. The swamp is \(n\) kilometers wide, with boundaries at \(y = n\) and \(y = 2n\). The map of the area is shown in the diagram below:

The travel speed of Amin and Niloufar through the swamp is \(\frac{1}{k}\) kilometers per day. Find the shortest possible time to travel from point \((0, 0)\) to \((3n, 3n)\) and print the result in days.
If the shortest travel time is \(d\) days \(h\) hours \(m\) minutes, and so on, print only the value \(d\).
ورودی
The first line of input contains a positive integer \(t\), representing the number of test cases.
\[1 \leq t \leq 10^5\]
For each test case, the only line contains two integers \(n\) and \(k\).
\[1 \leq n, k \leq 10^7\]
خروجی
For each test case, print a single integer representing the minimum number of days required to reach the destination.
مثالها
ورودی نمونه ۱
2
1 1
100 2
خروجی نمونه ۱
4
543
ارسال پاسخ برای این سؤال