#P1539A. Contest Start

    ID: 2077 Type: RemoteJudge 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: 3 Uploaded By: Tags>combinatoricsgeometrygreedymath*1000

Contest Start

Description

There are nn people participating in some contest, they start participating in xx minutes intervals. That means the first participant starts at time 00, the second participant starts at time xx, the third — at time 2x2 \cdot x, and so on.

Duration of contest is tt minutes for each participant, so the first participant finishes the contest at time tt, the second — at time t+xt + x, and so on. When a participant finishes the contest, their dissatisfaction equals to the number of participants that started the contest (or starting it now), but haven't yet finished it.

Determine the sum of dissatisfaction of all participants.

The first line contains a single integer kk (1k10001 \le k \le 1000) — the number of test cases.

Each of the next kk lines contains three integers nn, xx, tt (1n,x,t21091 \le n, x, t \le 2 \cdot 10^9) — the number of participants, the start interval and the contest duration.

Print kk lines, in the ii-th line print the total dissatisfaction of participants in the ii-th test case.

Input

The first line contains a single integer kk (1k10001 \le k \le 1000) — the number of test cases.

Each of the next kk lines contains three integers nn, xx, tt (1n,x,t21091 \le n, x, t \le 2 \cdot 10^9) — the number of participants, the start interval and the contest duration.

Output

Print kk lines, in the ii-th line print the total dissatisfaction of participants in the ii-th test case.

Sample Input 1

4
4 2 5
3 1 2
3 3 10
2000000000 1 2000000000

Sample Output 1

5
3
3
1999999999000000000

Note

In the first example the first participant starts at 00 and finishes at time 55. By that time the second and the third participants start, so the dissatisfaction of the first participant is 22.

The second participant starts at time 22 and finishes at time 77. By that time the third the fourth participants start, so the dissatisfaction of the second participant is 22.

The third participant starts at 44 and finishes at 99. By that time the fourth participant starts, so the dissatisfaction of the third participant is 11.

The fourth participant starts at 66 and finishes at 1111. By time 1111 everyone finishes the contest, so the dissatisfaction of the fourth participant is 00.

In the second example the first participant starts at 00 and finishes at time 22. By that time the second participants starts, and the third starts at exactly time 22. So the dissatisfaction of the first participant is 22.

The second participant starts at time 11 and finishes at time 33. At that time the third participant is solving the contest.