国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

CF 492A - Vanya and Cubes

2023-07-22 10:54 作者:您是打尖兒還是住店呢  | 我要投稿

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

The first line contains integer?n?(1?≤?n?≤?104) — the number of cubes given to Vanya.

Output

Print the maximum possible height of the pyramid in the single line.

Examples

input

1

output

1

input

25

output

4

Note

Illustration to the second sample:

------------------------------------------

Vanya 有 n 個立方體。 他決定用它們建造一座金字塔。 Vanya想要建造金字塔如下:金字塔的頂層必須由1個立方體組成,第二層必須由1?+?2?=?3個立方體組成,第三層必須由1?+?2?+?3?=?6個立方體組成,依此類推。 因此,金字塔的第 i 層必須有 1?+?2?+?...?+?(i?-?1)?+?i 個立方體。


Vanya 想知道他使用給定的立方體可以制作的金字塔的最大高度是多少。


輸入

第一行包含整數(shù) n (1?≤?n?≤?104) — 給予 Vanya 的立方體數(shù)量。


輸出

在一行中打印金字塔的最大可能高度。

-------------------------------------

下面是代碼:

這里面++i跟i++沒理清楚,結(jié)果錯了一次,++i是當前循環(huán)就加上1,i++是下個循環(huán)再加1的。

CF 492A - Vanya and Cubes的評論 (共 條)

分享到微博請遵守國家法律
大庆市| 神木县| 贵阳市| 阜新市| 会宁县| 含山县| 东兰县| 高台县| 张家川| 乌兰察布市| 西充县| 高陵县| 关岭| 扎赉特旗| 岳西县| 霞浦县| 莱西市| 洛宁县| 仙游县| 高邑县| 温宿县| 韩城市| 屏山县| 方城县| 安阳市| 宁海县| 庄河市| 锡林浩特市| 宁南县| 临邑县| 喀喇沁旗| 科技| 甘洛县| 济南市| 航空| 保靖县| 新昌县| 铜川市| 綦江县| 九龙城区| 洛宁县|