Easy Problem

发布时间: 2017年6月19日 00:22   最后更新: 2017年6月20日 04:20   时间限制: 1000ms   内存限制: 128M

As we know, gcd(A, B) means the Greatest Common Divisor (GCD) of A and B.

But zy thinks it is so easy to just let you calculate it.
So now your task is to calculate gcd(A, B^B),it is easy right?

Notice: B ^ B means B multiply by himself B times.

Multiply test case, each case per line.
Each line 2 integers A, B, 1 <= A, B <= 1000

For each test case output one line( one number ), indicating the value of gcd (A, B^B)

100 1
100 2


number theory