Problem4539--搭积木

4539: 搭积木

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

用积木搭起一座金字塔。每层积木比上一层多一块。

  • 第 lns="http://www.w3.org/1998/Math/MathML">1 层需要 lns="http://www.w3.org/1998/Math/MathML">1 块积木;
  • 第 lns="http://www.w3.org/1998/Math/MathML">2 层需要 lns="http://www.w3.org/1998/Math/MathML">2 块积木;
  • 更高层以此类推;

给定一个整数 lns="http://www.w3.org/1998/Math/MathML">n,表示积木总数,请问最高可以搭出多少层的金字塔?

Input

  • 单个整数:表示 lns="http://www.w3.org/1998/Math/MathML">n
  • 对于 lns="http://www.w3.org/1998/Math/MathML">50% 的数据,lns="http://www.w3.org/1998/Math/MathML">1n1,000
  • 对于 lns="http://www.w3.org/1998/Math/MathML">100% 的数据,lns="http://www.w3.org/1998/Math/MathML">1n1,000,000,000



Output

  • 单个整数:表示积木的高度。

Sample Input Copy

12

Sample Output Copy

4

HINT

4层金字塔需要1+2+3+4=10块积木,而5层金字塔需要1+2+3+4+5=15块积木,在12块积木的情况下,最多搭4层金字塔

Source/Category