-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1539A.cpp
More file actions
56 lines (46 loc) · 783 Bytes
/
1539A.cpp
File metadata and controls
56 lines (46 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define vt vector
#define ll long long
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()
#define en '\n'
int T = 1;
vt<pii> v;
int bs(int l, int r, ll val) { // [l,r) -> [0,n)
while(l+1 < r) {
int mid = (l+r) / 2;
if(v[mid].first == val) {
return mid;
} else if(v[mid].first > val) {
r = mid;
} else {
l = mid;
}
}
return r;
}
void sol() {
ll n,x,t;
ll ans = 0;
cin >> n >> x >> t;
ans = t/x;
ll res = 0;
if(ans >= n-1) {
res = n*(n-1)/2;
} else {
res = ans*(n-(ans+1)) + ans*(ans+1)/2;
}
cout << res << '\n';
return;
}
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> T;
while(T--) {
sol();
}
return 0;
}