forked from seeditsolution/cprogram
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeForces_Solution
More file actions
Latest commit
34 lines (34 loc) · 699 Bytes
/
Copy pathCodeForces_Solution
File metadata and controls
34 lines (34 loc) · 699 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
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define endl '\n'
#define mod 1000000007
int min(int a, int b) {
if (a < b)
return a;
else
return b;
}
bool compare(int a, int b) {
return a > b;
}
int32_t main() {
fio;
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int>v;
v.push_back(0);
for (int i = 3; i <= n; i += 2) {
v.push_back(2 * i + (i - 2) * 2);
}
int cnt = 0;
for (int i = 0; i < v.size(); i++) {
cnt += v[i] * i;
}
cout << cnt << endl;
}
}