SP3442 LASTDIG - The last digit
Description
Nestor was doing the work of his math class about three days but he is tired of make operations a lot and he should deliver his task tomorrow. His math’s teacher gives him two numbers a and b. The problem consist of finding the last digit of the potency of base a and index b. Help Nestor with his problem. You are given two integer numbers: the base a (0
Input Format
The first line of input contains an integer t, the number of test cases (t
Output Format
For each test case output an integer per line representing the result.