最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(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的評論 (共 條)

分享到微博請遵守國家法律
宝鸡市| 灵武市| 青海省| 玛多县| 东台市| 娱乐| 阳朔县| 金平| 米泉市| 阿图什市| 孝义市| 黄骅市| 香港| 蒲江县| 常州市| 锦州市| 藁城市| 孟村| 彝良县| 仙桃市| 贵溪市| 乾安县| 文水县| 东光县| 夏津县| 临朐县| 木兰县| 酒泉市| 濮阳县| 乐东| 白水县| 昭觉县| 巧家县| 宕昌县| 宁河县| 兴安县| 富锦市| 团风县| 沐川县| 亳州市| 南木林县|