-
Notifications
You must be signed in to change notification settings - Fork 0
/
D.cpp
41 lines (37 loc) · 855 Bytes
/
D.cpp
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
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
const int MAX = 200007;
const int MOD = 1000000007;
void solve() {
int n;
cin >> n;
unsigned long long res = 0;
//k/2 * floor(n/k) * floor(1 + n/k)
for (int i = 1; i <= n; i++) {
res += (i/(long double)2.0) * (n/i) * floor(1 + n/i);
}
cout << res;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
//int tt; cin >> tt; for (int i = 1; i <= tt; i++) {solve(); cout << endl;}
solve();
}