#P7632. [2018年杭电多校]Rikka with APSP
[2018年杭电多校]Rikka with APSP
Rikka with APSP
Problem Description
Input
The first line contains one single integer , the number of the testcases. For each testcase, the first line contains exactly one integer . The input guarantees that there are at most testcases with .
Output
For each testcase, output a single integer, the answer modulo .
Sample Input
3
4
10
100
Sample Output
16
243
190371
Source
2018 Multi-University Training Contest 9