#Lutece1036. C(i,j) and F(x,y)

C(i,j) and F(x,y)

Migrated from Lutece 1036 C(i,j) and F(x,y)

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

There are tow function, CC and FF;

Fuction C(i,j)=[j*(j-1)*(j-2)*....*(j-i+1)]/[1*2*3....*i].
Fuction F(x,y)can be caculator by following code
int F(long long x,long long y)
{
    int tot=0;
    while(x%y==0)
    {
       tot++;
       x=x/y;
    }
    return tot;
}

Please find out answer of following function:

$max((F(C(1,m), t), F(C(2,m), t),F(C(3,m), t),\cdots,F(C(m-1,m), t),F(C(m,m),t))$

Since the answer could be very large. you just need to find nn,that F(C(n,m),t)F(C(n,m),t) is the largest one.

Input

tow nunmber tm(0<tm1000000000)t,m(0 < t \leq m \leq 1000000000)

It is guranteed that tt is a prime number, and mm can be divided by tt with no remainder.

Output

One number nn, (If there are mutiple solution, just output the larget one)

Samples

3 6
5
37 62123
50652

Resources

The 13th UESTC Programming Contest Preliminary