P28578 [洛谷] [AHOI2004] Digital Matrix
提高+
题目描述

Problem Description

Input Format

Each line contains three positive integers: i, j, m, where i, j <= 10^9 and 2 <= m <= 10^4.

Output Format

For each line, output the result of the positive integer at the i-th row and j-th column modulo m.

Sample Input and Output

Sample Input #1

1 2 99

Sample Output #1

2

Sample Input #2

9 1 999

Sample Output #2

22
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
1 2 99
样例输出
2