mirror of
https://github.com/tiennm99/codeforces.git
synced 2026-06-09 06:13:28 +00:00
21 lines
285 B
C#
21 lines
285 B
C#
using System;
|
|
|
|
namespace _492A
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
int n = int.Parse(Console.ReadLine());
|
|
int a = 0, b = 0, c = 0;
|
|
while (n > c)
|
|
{
|
|
a++;
|
|
b = a * (a + 1) / 2;
|
|
c += b;
|
|
}
|
|
Console.WriteLine(c > n ? a - 1 : a);
|
|
}
|
|
}
|
|
}
|