#P7614. [2018年杭电多校]GuGuFishtion
[2018年杭电多校]GuGuFishtion
GuGuFishtion
Problem Description
Input
Input contains an integer indicating the number of cases, followed by lines. Each line contains three integers ,, as described above. And given is a prime.
Output
Please output exactly lines and each line contains only one integer representing the answer.
Sample Input
1
5 7 23
Sample Output
2
Source
2018 Multi-University Training Contest 7