LOCKER - Magic of the locker
Vertu, the clever businessman, sells the ropes to his customers at the rate of 1 rupee per meter. He can only sell an integer length of a rope to a customer. Also, he has a magic locker which functions this way:
Suppose the locker has 'x' rupees. Now if 'y' rupees more are put into this locker, it multiplies them and total money in the locker now is 'x*y'.
This morning, Vertu starts his bussiness with 'n' meters of rope. He puts 1 rupee in the locker as to have good luck.
Find the maximum money he can earn today considering that he sold all of his rope at the end of the day.
NOTE: Vertu has to put all rupees into the locker as soon as he gets it, and can get rupees from locker only at the end of the day.
Input and Output
The first line contains t, the number of test cases. t lines follow, each containing one positive integer n. For each of these integers, print the required answer modulo(109+7).
In simple words, you are given a number n , and break it into parts such that product of all parts is maximum.
Hint : Month of the question added !
tle in c++
can anyone please check my solution n I am getting WA id->27861418
incomplete problem ...
Also take care of base case
Don't really understand. Python gives me TLE, but c++ gives me accepted.
modular exponentiation... AC
@lalitkundu please tell why am i getting a wa my submission id is 25779593
test case ?