Problem1123--排座位

1123: 排座位

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 60  Solved: 22
[Status] [Submit] [Creator:]

Description


Input

 

第一行:包括两个数,rc1<=r,c<=100),表示报告厅座位共有rc列。

第二行:一个整数n1<=n<=r*c),代表有n个学生想知道自己的具体位置。

接下来n行:每一行一个整数,代表询问具体位置的座位号。

Output

 

输出n行,每一行两个整数,代表询问的座位号所在的行和列。

Sample Input Copy

4 5
3
4
13
19

Sample Output Copy

1 4
3 3
4 2

Source/Category