Codeforces Round #727 (Div. 2)

该博客讨论了Codeforces Round #727 (Div. 2)比赛中关于计算参赛者不满意度的问题。参赛者按一定时间间隔开始比赛,不满意度是他们在结束时仍有其他人正在比赛的人数。博客提供了样例解析、问题分析以及解决问题的公式和代码实现。
摘要由CSDN通过智能技术生成

727div.2补题

A. Contest Start

原地址

There are n people participating in some contest, they start participating in x minutes intervals. That means the first participant starts at time 0, the second participant starts at time x, the third — at time 2⋅ x, and so on.
Duration of contest is t minutes for each participant, so the first participant finishes the contest at time t, the second — at time t+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.

Input

The first line contains a single integer k (1≤k≤1000) — the number of test cases.
Each of the next k lines contains three integers n, x, t (1≤n,x,t≤2⋅109) — the number of participants, the start interval and the contest duration.

Output

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

Example

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

5
3
3
1999999999000000000

题意:
有n个人参加比赛,第一个人参赛时间是0,第二个人参赛时间是x,第三个人参赛时间是x2,以此类推。。。
每个人的表演时间是t,第一个人在 t 时刻表演结束,第二个人在 t+x 时刻表演结束,第三个人在第 t+x
2 时刻表演结束,以此类推。。。
每个人都有自己的不满意度,他的不满意度是他结束时正在表演的人数。注意&#x

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值