2763amazing road

2763   amazing road

题目描述

Little X will go to cell(N,M) from cell(1,1).He can only go down(X + 1,Y) or go right(X,Y + 1).But some cells are broken.And he can't go to the broken cells.Cound you tell him how many ways he can find?

输入格式:

Input contains multiple test cases. Each test contains three integers N(2 <= N <= 100),M(2 <= M <= 100) and K(0 <= K <= N * M - 2).cell(1,1) and cell(N,M) are not broken.Next K lines contain two integer ai and bi,which means that cell(ai,bi) is broken.

输出格式:

the number of ways modulo 1e9 + 7 in one line.

输入样例 复制
2 2 1
2 1
3 3 1
2 2
 
输出样例 复制
1
2

说明

11
45
通过提交
时空限制1000ms/64mb
题目来源
评测方式在线评测
题目类型
难        度