The sequence of Fibonacci numbers is defined as: F_n=⎩⎨⎧1 2 F_n−1+F_n−2n=1n=2otherwise
The first few elements of the sequence are 1,2,3,5,8,13,21,34,…
For a given positive integer n, let partition(n) be the maximum value of m such that n can be expressed as a sum of m distinct Fibonacci numbers. For example, partition(1)=partition(2)=1, partition(3)=partition(4)=partition(5)=partition(7)=2, partition(6)=partition(8)=3.
Chiaki has an integer X which initially equals to 0. She will perform some operations on X: the i-th operation will add a_i⋅F_b_i to X.
After each operation, Chiaki would like to know the value of partition(X). It is guaranteed that, after each operation, X will be a positive integer.
There are multiple test cases. The first line of input contains an integer T, indicating the number of test cases. For each test case:
The first line contains an integer n (1≤n≤5⋅104): the number of operations.
Each of the next n lines contains two integers a_i and b_i (1≤∣a_i∣,b_i≤109).
It is guaranteed that the sum of n for all test cases will not exceed 5⋅104.
For each test case, output n integers: the i-th integer denotes the value of partition(X) after the i-th operation.
The value of X after each operation in the sample: 1,2,4,7,12,20,33,54,88,72.