#K79732. Minimum Promotional Codes Required
Minimum Promotional Codes Required
Minimum Promotional Codes Required
You are given T test cases. Each test case contains two integers: the current number of points P and a target number of points N. In order to boost the points, you can use a promotional code. Each usage of a promotional code multiplies your current points by 3 (i.e. \(P \gets 3\times P\)). Your task is to determine the minimum number of promotional codes needed such that \(P\) is greater than or equal to \(N\). If the initial points \(P\) are already greater than or equal to \(N\), then no promotional codes are needed.
Input Format: The first line contains T, the number of test cases. The following T lines each contain two integers P and N, separated by space.
Output Format: For each test case, print a single integer representing the minimum number of promotional codes needed, each on its own line.
inputFormat
The input begins with an integer T denoting the number of test cases. Following this, there are T lines, each containing two space-separated integers P and N, where:
- P is the current number of points.
- N is the target number of points.
\(1 \leq T \leq 10^5\) and \(1 \leq P, N \leq 10^9\).
outputFormat
For each test case, output a single line containing one integer: the minimum number of promotional codes the customer needs to use to have at least N points.
## sample3
5 10
10 40
4 100
1
2
3
</p>