Files

21 lines
370 B
C++
Raw Permalink Normal View History

2025-08-30 18:35:01 +08:00
#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;
}