CF2094B.Bobritto Bandito

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Bobritto Bandito

In Bobritto Bandito's home town of residence, there are an infinite number of houses on an infinite number line, with houses at ,2,1,0,1,2,\ldots, -2, -1, 0, 1, 2, \ldots. On day 00, he started a plague by giving an infection to the unfortunate residents of house 00. Each succeeding day, the plague spreads to exactly one healthy household that is next to an infected household. It can be shown that each day the infected houses form a continuous segment.

Let the segment starting at the ll-th house and ending at the rr-th house be denoted as [l,r][l, r]. You know that after nn days, the segment [l,r][l, r] became infected. Find any such segment [l,r][l', r'] that could have been infected on the mm-th day (mnm \le n).

Input

The first line contains an integer tt (1t1001 \leq t \leq 100) – the number of independent test cases.

The only line of each test case contains four integers nn, mm, ll, and rr ($1 \leq m\leq n \leq 2000, -n \leq l \leq 0 \leq r \leq n, r-l=n$).

Output

For each test case, output two integers ll' and rr' on a new line. If there are multiple solutions, output any.

Note

In the first test case, it is possible that on the 11-st, 22-nd, and 33-rd days the interval of houses affected is [1,0][-1,0], [1,1][-1,1], [2,1][-2,1]. Therefore, [1,1][-1,1] is a valid output.

Samples

4
4 2 -2 2
4 1 0 4
3 3 -1 2
9 8 -6 3
-1 1
0 1
-1 2
-5 3

在线编程 IDE

建议全屏模式获得最佳体验