Miku was going to her concert when suddenly she encountered of her fans. The -th fan has a_i Miku dolls.
A fan is called obsessed if they have at least Miku dolls. Miku wants to achieve the maximum number of obsessed fans possible.
To achieve this, she can move Miku dolls from one fan to another. More formally, she can do the following operation:
Choose two integers such that a_i \ge k. Set a_i = a_i - k and a_j = a_j + k.
She is short on time for her concert, so she wants to perform the minimum number of operations required to achieve the maximum number of obsessed fans.
As a Miku fan yourself, you decide to help her.
Given scenarios with various values of and , for each scenario output the maximum number of obsessed fans possible, and the minimum number of operations to achieve that.
Note: For every scenario, is a divisor of .
The first line contains two integers and (1 \le n, q \le 10^6)—the number of fans and the number of scenarios.
The next line contains integers a_1, a_2, \ldots, a_n (0 \le a_i \le 10^6)—the number of Miku dolls each fan currently has.
Each of the next lines contains two integers and (1 \le x \le 10^9, 1 \le k \le 10^6). Note: is a divisor of for every scenario.
For each scenario, output two integers—the maximum number of obsessed fans that can be achieved, and the minimum number of operations required to achieve that, on a new line.
Example 1
In the first query, x = 4, k = 2. Fans and are already obsessed since a_2 \ge 4 and a_3 \ge 4. By taking one block ( dolls) from fan and giving it to fan (i=3, j=1), all three fans become obsessed. Thus, the answer is 3 obsessed fans, 1 operation.
In the second query, x=4, k=1. Fans and are already obsessed. By moving doll from fan to fan (i=3, j=1), all three reach at least dolls. So, the answer is 3 obsessed fans, 1 operation.
In the third query, x=3, k=3. No operations are necessary; all fans are already obsessed. The answer is 3 obsessed fans, 0 operations.
In the fourth query, x=13, k=13. Only fan is initially obsessed. By moving one block ( dolls) from fan to fan (i=3, j=1), and one block from fan to fan (i=3, j=2), all three become obsessed. The answer is 3 obsessed fans, 2 operations.
In the fifth query, x=13, k=1. Only fan is initially obsessed; fans and have deficits of 13-3 and 13-9 dolls, respectively, totaling dolls. By transferring doll at a time from fan to fans and , operations are needed. The answer is 3 obsessed fans, 14 operations.
In the sixth query, x=24, k=2. Only fan is initially obsessed. To make two fans obsessed, we focus on fans and , whose blocks sum to 19+4=23; one more block ( dolls) is needed. By moving dolls from fan to fan (i=3, j=2), the answer is 2 obsessed fans, 1 operation.
In the seventh query, x=40, k=10. The total number of blocks is , which is insufficient for any fan to become obsessed. The answer is 0 obsessed fans, 0 operations.
Subtask ( points): 1 \le n, q \le 10
Subtask ( points): 1 \le n, q \le 100
Subtask ( points): 1 \le n, q \le 1000
Subtask ( points): a_1 = a_2 = \ldots = a_n
Subtask ( points): k = x
Subtask ( points): k = 1
Subtask ( points): 1 \le k \le 100
Subtask ( points): 1 \le n, q \le 10^5; a_i, k \le 10^4
Subtask ( points): 1 \le n, q, a_i, k \le 3 \cdot 10^5
Subtask ( points): No additional constraints.