Олимпиадный тренинг

Задача 38874. Various squares


Задача

Темы: Цикл while
Petya has n unit squares. He wants to add as many different squares as possible from them at the same time. It takes k2 unit squares to fold a square of side k. Petya may not use all the squares he has.
Determine the maximum number of squares Petya can add.

Input
The input is an integer n (1 ≤ n ≤ 1018). Note that a 64-bit data type is required to store such a number (int64 in Pascal, long long in C++).

Imprint
Print one number — the maximum number of different squares that Petya can add.
 
Examples
# Input Output
1 10 2