Files
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

21 lines
370 B
C++

#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int res = 0;
int k = 0;
for (int i = 1;; i++)
for (int j = 0; j < i; j++) {
k++;
res += i;
if (k >= n) {
cout << res << endl;
return 0;
}
}
return 0;
}