Vanya and Cubes

TimeLimit:1000ms  MemoryLimit:128000KB
64-bit integer IO format:%lld
未提交 | 登录后收藏
Problem Description

Vanya got n cubes. He decided to build a pyramid from them. Vanya wants to build the pyramid as follows: the top level of the pyramid must consist of 1 cube, the second level must consist of 1 + 2 = 3 cubes, the third level must have 1 + 2 + 3 = 6 cubes, and so on. Thus, the i-th level of the pyramid must have 1 + 2 + ... + (i - 1) + i cubes.

Vanya wants to know what is the maximum height of the pyramid that he can make using the given cubes.

Input

Input contains multiple test cases.Each test case contains a integer n (1 ≤ n ≤ 10^4) — the number of cubes given to Vanya.

Output

For each group of input integers you should print the maximum possible height of the pyramid in the single line.

SampleInput
1
25
SampleOutput
1
4
Submit
题目统计信息详细
总AC数52
通过人数48
尝试人数50
总提交量78
AC率61.54%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: