ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Арифметика > задача:


50640 - Cubes

Гость
• Обсуждение задачи (1)

Задачи раздела

• 50583 - Numri ma te madhe nga 3 ...
• 50585 - Prodhimi i brendshem
• 50587 - Shnderrimi i numrit ne nje s...
• 50633 - Разложение на простые мн...
• 50650 - Prime numbers
• 50661 - Степень
• 50249 - Ladders
• 50641 - Strong Prime Power
• 50640 - Cubes
• 50412 - K numbers
• 50310 - Kinetic Energy
• 50316 - Population Bar Chart
• 50314 - Falling Distance
• 50392 - How much space
• 50330 - Find the average of n numbers
• 50297 - Divisible By Five
• 50394 - Water Bills

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Автор: Михаил Копачев, РГАТА. Сложность Бета

Vasya and Petya are playing with cubes. Each of them has brought his own box of cubes to play with. The boxes previously contained an equal number of cubes (k), but after Petya has lost one of them, he has one cube less. The boys' cubes are quite identical, so they can be used to assemble various flat structures (solid one-layer figures with contacting sides).
It is known that using all the cubes (except lost) the boys can assemble a square (each side of the square having the same number of cubes), but cannot assemble any other rectangle.
What is the largest number of the cubes that the box can contain, if we know that the total number of the cubes the boys have got does not exceed n?
Your task is to make a program that will use the specified number n to define the maximum k (the number of the cubes in Vasya's box) and fit the problem specification.

Input
The input contains only one integer n.
Output
The output should contain only one integer k.
Limitations
10 ≤ n ≤ 109.

Input 1 Output 1
10
5
Input 2 Output 2
25
13

Для отправки решений необходимо выполнить вход.

www.contester.ru