Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n, m, k = map(int, input().split())
- x = k+1
- y = k+1
- a = []
- for i in range(k):
- ri, ci = map(int, input().split())
- a.append([ri, ci])
- for i in range(2):
- for j in range(k-1):
- if (a[0][j]-a[0][j+1] == 0) or (a[0][j]-a[0][j+1] == 1):
- x = x-1
- for i in range(2):
- for j in range (k-1):
- if (a[1][j]-a[1][j+1] == 0) or (a[1][j]-a[1][j+1] == 1):
- y = y-1
- print(x*y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement