eolymp
bolt
Try our new interface for solving problems
Problems

Multifactorial

Multifactorial

The k-multifactorial of n is denoted by fack(n) and is defined as the product of every positive number of the form nk * x, x = 0, 1, 2, … .

A formal definition of multifactorial is:

fack(n) = n, if kn;

fack(n) = n * fack(nk), if k < n;

You will be given n and k and have to evaluate the value of fack(n). If the result is strictly greater than 1018, you must print "overflow".

Input

Two integers n and k (1n, k2 * 109).

Output

Print the value of fack(n). If it is strictly greater than 1018, print "overflow".

Time limit 1 second
Memory limit 128 MiB
Input example #1
14 3
Output example #1
12320
Input example #2
1000 2
Output example #2
overflow