- محدودیت زمان: ۱ ثانیه
- محدودیت حافظه: ۲۵۶ مگابایت
- Hey good-hearted professor, come to my office please.
- Hello evil professor, what can I do for you?
- Look at the questions I’ve prepared for the final exam.
- Oh professor, it’s pretty difficult. No calculator can save such a big number.
- Yes, I know. I gave this question, so hens of the sky will cry for them.
Hearing this conversation, roosters of the sky became angry with the evil professor. They don’t want hens to be crying, so they tried to solve evil professor’s problem, and give the answer to students.
The problem is given two numbers $n$ and $m$. calculate $n \times {245}^m$ then print the least significant digit.
ورودی
The first line contains single integer $t$ — the number of tests. $$1 \leq t \leq 100$$
Each test contains two numbers, $n$ and $m$ respectively. $$0 \leq n, m \leq 10^9$$
خروجی
For each test, print one integer in one line — the answer to the problem.
مثالها
ورودی نمونه ۱
3
1 1
2 1
2 2
خروجی نمونه ۱
5
0
0
ارسال پاسخ برای این سؤال