五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

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

分享到微博請遵守國家法律
信丰县| 安吉县| 定安县| 通榆县| 南康市| 饶阳县| 晋州市| 巨鹿县| 巴林左旗| 密山市| 陕西省| 偃师市| 镇康县| 汉沽区| 会同县| 会理县| 错那县| 伊宁市| 景德镇市| 西和县| 绍兴县| 余江县| 连南| 日照市| 宜丰县| 天峻县| 凤台县| 长沙县| 玉环县| 安化县| 云梦县| 南安市| 泸溪县| 双城市| 鲁山县| 顺昌县| 沙洋县| 赤峰市| 讷河市| 营口市| 盐城市|