#arc176b. B - Simple Math 4
B - Simple Math 4
Score : points
问题陈述
当 除以 时,找出余数的最后一位数字。
你将得到 个测试用例,每个都必须解决。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
Find the last digit of the remainder when is divided by .
You are given test cases, each of which must be solved.
Constraints
- are integers.
Input
The input is given from Standard Input in the following format, where represents the -th test case:
Each test case is given in the following format:
Output
Print the answer.
Sample Input 1
5
9 6 2
123 84 50
95 127 79
1000000007 998244353 924844033
473234053352300580 254411431220543632 62658522328486675
Sample Output 1
2
8
8
8
4
For the first test case, the remainder of divided by is . Thus, the answer is the last digit of , which is .