AlgoLensArena
ContestlərProblemlərOtaqlar
Vizualizator
← Məsələlər

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 hhh consists of hhh layers of people. As seen from below, it has hhh people on the first layer, h−1h-1h−1 on the second, h−2h-2h−2 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 nnn (1≤n≤10121 \leq n \leq 10^{12}1≤n≤1012), the number of people available to build the pyramid.

Çıxış formatı

Output the height of the highest possible pyramid you can build with nnn 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