Bessie wants to navigate her spaceship through a dangerous asteroid
field in the shape of an N x N grid (1
输入格式
Line 1: Two integers N and K, separated by a single space.
Lines 2..K+1: Each line contains two space-separated integers R and
C (1
输出格式
Line 1: The integer representing the minimum number of times Bessie
must shoot.
样例
样例输入
3 4
1 1
1 3
2 2
3 2
INPUT DETAILS:
The following diagram represents the data, where "X" is an
asteroid and "." is empty space:
X.X
.X.
.X.
样例输出
2
OUTPUT DETAILS:
Bessie may fire across row 1 to destroy the asteroids at (1,1) and
(1,3), and then she may fire down column 2 to destroy the asteroids
at (2,2) and (3,2).