The first line contains a single integer t (1 ≤ t ≤ 105), denoting the number of test cases.
Each test case is described with two integers n and m (1 ≤ n ≤ 105; 1 ≤ m ≤ 109), followed by n lines containing a pair of integers ci and ai each (|ci| = 1; 0 ≤ ai ≤ 109).
The sum of n over all test cases does not exceed 105.