You are given two integers: n and k, your task is to find the most significant
three digits, and least significant three digits of n^k.
【Input】
Input starts withaninteger T (≤ 1000), denoting thenumberof test cases.
Each case starts withaline containing two integers: n (2 ≤ n < 2^31) and k (1 ≤ k
≤ 10^7).
【Output】
For eachcase, print thecasenumberandthethree leading digits (most significant
) andthree trailing digits (least significant). You can assume that the input is
given such that n^k containsat least six digits.