Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
After 3 years of university, Beo is still FA. So Beo decide to find a girlfriend before graduation. Beo knew that the first impression was very important. Therefore, Beo wants to have an impressive performance in the first meeting with a beautiful girl. Because of upcoming chirstmas, he want to build a pyramid to replace the Christmas tree:
The top of the pyramid contains one brick.
2nd layer has 1 + 2 = 3 bricks.
3rd layer has 1 + 2 + 3 = 6 bricksh.
….
~n~-th layer has 1 + 2 + … + ~n~ bricks.
Given the number of bricks Beo has, calculate the maximum number of layers Beo can build.
Input
- The first line contains the number n (1 <= n <= 10,000) which is the number of bricks
Output
- The maximum number of layers that can be build
Sample Input:
1
SampleOutput:
1
Sample Input:
25
Sample Output:
4
Bình luận