Skip to content

Commit d2e5a50

Browse files
15.09.2025 09:12
1 parent 450aa70 commit d2e5a50

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

492A Vanya and Cubes.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <iostream>
2+
using namespace std;
3+
int main()
4+
{
5+
int n;
6+
cin >> n;
7+
int c = 0, i = 0;
8+
while (true)
9+
{
10+
if (c > n)
11+
{
12+
break;
13+
}
14+
c += (i * (i + 1)) / 2;
15+
i += 1;
16+
}
17+
cout << i - 2 << endl;
18+
return 0;
19+
}

0 commit comments

Comments
 (0)