АВТ
Language:

Remote Training on Programming

Problems On-line status Contests FAQ
For authors:
Register  ||  Login
 
Hello, Guest! Login or register.

954. Number with max sum of divisors

Time Limit: 1 seconds
Memory Limit:65536KB
Points:10
View Problem Statistics Submit Problem added Undefined

Дано натуральное число N, не превышающее 100 000. Найти число из диапазона от 1 до N с максимальной суммой делителей (включая непростые делители, 1 и само число).

Input

Вводится число N

Output

Выводится число с максимальной суммой делитетей. Если таких чисел несколько, выведите любое из них.

Sample

InputOutput
Пример 1. Вход:
5
Пример 1. Выход:
4

View Problem Statistics Submit Author/source:
Educational Courses / Programming and Basics of Algorithmization / Cycles /
169. Lucky Tickets 954. 133. Palindrom 167. Power of Number 135. Rotation of Bits
We can all benefit by doing occasional "toy" programs, when artificial restrictions are set up, so that we are forced to push our abilities to the limit. The art of tackling miniproblems with all our energy will sharpen our talents for the real problems. Donald E. Knuth.
time generating 0.094 sec.
© Copyright VSTU, AVT, Nosov D.A.