ENG  RUSTimus Online Judge
Online Judge
Online contests
About Online Judge
Frequently asked questions
Site news
Problem set
Submit solution
Judge status
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests

USU Championship 2002

About     Problems     Submit solution     Judge status     Standings
Contest is over

G. Chernobyl’ Eagles

Time limit: 1.0 second
Memory limit: 64 MB
Problem illustration
A Chernobyl’ eagle has several heads (for example, the eagle on the Russian National Emblem is a very typical one, having two heads; there exist Chernobyl’ eagles having twenty-six, one and even zero heads). As all eagles, Chernobyl’ eagles are very intelligent. Moreover, IQ of a Chernobyl’ eagle is exactly equal to the number of its heads. These eagles can also enormously enlarge their IQ, when they form a group for a brainstorm. IQ of a group of Chernobyl’ eagles equals to the product of IQ’s of eagles in the group. So for example, the IQ of a group, consisting of two 4-headed eagles and one 7-headed is 4*4*7=112. The question is, how large can be an IQ of a group of eagles with a given total amount of heads.


There is one positive integer N in the input, N ≤ 3000 — the total number of heads of Chernobyl’ eagles in a group.


Your program should output a single number — a maximal IQ, which could have a group of Chernobyl’ eagles, with the total amount of heads equal to N.


Problem Author: folklore, proposed by Leonid Volkov
Problem Source: The Seventh Ural State University collegiate programming contest
To submit the solution for this problem go to the Problem set: 1222. Chernobyl’ Eagles