Day Streak#11135

Day Streak

4 seconds
512 megabytes
Very hard

Recently Deltaforces, a famous competitive programming website, added a lot of new visual information to user profiles. In particular, there is a maximum day streak — the maximum number of days in a row with at least one problem solved. You decided that the maximum day streak in your profile does not accurately represent your training efforts. So you came up with a thought — what if you could change the time zone in your profile to increase the maximum day streak?

Let's formalize this setting as follows. Suppose you have solved problems, and the -th problem was solved at time a_i. There are time zones, numbered from to m - 1. The default time zone is . If you decide to change your time zone to , all solutions' timestamps increase by : the problem solved at time a_i is now considered to be solved at time a_i + t, for all simultaneously.

The problem solved at time is considered to be solved on day number \lfloor \frac{x}{m} \rfloor. Here means rounded down to the greatest integer less than or equal to .

To display the maximum day streak, Deltaforces finds such and that you have solved at least one problem on each of days l, l+1, \ldots, r, and r - l + 1 is as large as possible. Then your maximum day streak is shown as r - l + 1.

Find the maximum day streak you can achieve by selecting a time zone.

Input

Each test contains multiple test cases. The first line contains the number of test cases (1 \le t \le 2 \cdot 10^5). Description of the test cases follows.

The first line of each test case contains two integers and  — the number of solved problems and the number of time zones (1 \le n \le 2 \cdot 10^5; 1 \le m \le 10^9). The second line contains integers a_1, a_2, \ldots, a_n — distinct timestamps of your solutions, in chronological order (0 \le a_1 < a_2 < \dotsb < a_n \le 10^9).

It is guaranteed that the sum of over all test cases does not exceed 2 \cdot 10^5.

Output

For each test case, print two integers and  — the maximum day streak and any time zone that achieves it (1 \le s \le n; 0 \le t < m).

Examples

Example 1

Loading
Loading

Note

In the first example test case, when you select time zone , the timestamps of your solutions change to , , , and . It means the problems are now considered to be solved on days , , , and ; that is a -day streak. Time zones , , and yield the same answer.

In the second example test case, timestamps of your solutions are and in time zone , which corresponds to days and . Time zones and also work.

In the third example test case, only one time zone exists, and your maximum day streak is .

In the fourth example test case, you have solved many problems but in a short period of time, and you can't obtain more than a -day streak.