1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include <iostream> using namespace std; int main() { int n; cin >> n; int i = 0; for (int sum = 2; sum <= n; i++) sum += 6 * i; if (n == 1) i = 1; cout << i << endl; return 0; } | cs |