atcoder#AGC051C. [AGC051C] Flipper
[AGC051C] Flipper
Score : points
Problem Statement
There is a square grid of dimensions . The cells are numbered through . Cell is in the -th row from the top, and the -th column from the left. Initially, cells are black, and all other cells are white.
Snuke can perform the following operation an arbitrary number of times:
- Choose an integer and an integer , and flip (black to white, white to black) the colors of the following six cells: $(x, y), (x, y+1), (x, y+2), (x+1, y), (x+1, y+1), (x+1, y+2)$
Compute the minimum possible number of black cells after the operations.
Constraints
- are pairwise distinct.
- All values in the input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
9
1 2
1 3
2 1
2 3
2 4
3 2
3 3
3 4
4 2
3
In the diagram below, the -th letter of the -th string from the top represents the cell .
#
is black, .
is white.
.##.
#.##
.###
.#..
->
#...
.#.#
.###
.#..
->
#...
..#.
....
.#..