Problem2273--幂的末尾

2273: 幂的末尾

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 6  Solved: 6
[Status] [Submit] [Creator:]

Description

幂a^b的末3位数是多少?

Input

两个正整数a,b。1≤a≤100,1≤b≤10000。

Output

从高位到低位输出幂的末三位数字,中间无分隔符。若幂本身不足三位,在前面补零,例如幂为1时输出001。

Sample Input Copy

7 2011

Sample Output Copy

743

Source/Category