atcoder#WTF19C1. Triangular Lamps Easy
Triangular Lamps Easy
Score : points
Problem Statement
There is an infinitely large triangular grid, as shown below. Each point with integer coordinates contains a lamp.
Initially, only the lamp at was on, and all other lamps were off. Then, Snuke performed the following operation zero or more times:
- Choose two integers and . Toggle (on to off, off to on) the following three lamps: .
After the operations, lamps are on, and all other lamps are off. Find .
Constraints
- are pairwise distinct.
- The input is consistent with the statement, and you can uniquely determine .
Input
Input is given from Standard Input in the following format:
Output
Print .
4
-2 1
-2 2
0 1
1 0
-1
The following picture shows one possible sequence of operations: