#3553. Soldier 士兵控制的棋盘

Soldier 士兵控制的棋盘

Background

Special for beginners, ^_^

Description

Format

Input

Output

被控制的棋子的总数

Samples

10 10 10
2 7 2
2 1 3
7 7 5
5 9 0
2 6 0
8 1 2
9 1 0
10 8 6
9 3 0
1 9 2
89

Limitation

1s, 1024KiB for each test case.