CF1539A.Contest Start

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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.

输入输出样例

  • 输入#1

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

    输出#1

    5
    3
    3
    1999999999000000000

说明/提示

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.

首页