DAPC24-084.Human Pyramid
Medium · 1 s · 256 MB
- icpc
- dapc
- 2024
As chairman of the Building A Pyramid Committee, you are specialized in breaking one specific world record: building the highest human pyramid. Unfortunately, you only know a limited number of people who are willing to be in the pyramid. After all, building human pyramids does not make much money, so most people are volunteers.
A full human pyramid of height consists of layers of people. As seen from below, it has people on the first layer, on the second, on the third, and so forth until eventually the final layer has just a single person. To determine whether you can break the world record, you need to know how high a pyramid you can build. Given how many people are available, how tall is the highest possible human pyramid that these people can make?
Giriş formatı
The input consists of:
• One line with an integer (), the number of people available to build the pyramid.
Çıxış formatı
Output the height of the highest possible pyramid you can build with people.
Qeyd
Source: Delft Algorithm Programming Contest 2024 · Author: Mees de Vries · License: CC BY-SA 4.0 · Original: https://dapc.wisv.ch · Statement adapted for AlgoLens and shared under the same license.
Nümunələr
Giriş #1
3
Çıxış #1
2
Giriş #2
12
Çıxış #2
4