Maximum Product
InterviewTime limit2sMemory limit128 MB
Split S into K positive integers as equal as possible to maximize their product, given S and K up to 100 and 20.
Problem
Given integers S and K, choose K positive integers whose sum is S. Among all possible choices, find the maximum possible product of the chosen integers.
Input
The first line contains two integers S and K.
Kis at most20.Sis at most100.Kis less than or equal toS.
Output
Print the maximum possible product. The answer is less than 9223372036854775807.