A village hall has a white-and-grey chessboard of size N x N painted on it.
Rows and columns are numbered from 1 to N. If a cell has column x and row y, the bottom-left cell is (1, 1), and that cell is grey. Adjacent cells have different colors.
There are also two types of diagonals, each numbered from 1 to 2N - 1. A type 1 diagonal with number d contains exactly the cells with x + y - 1 = d. A type 2 diagonal with number d contains exactly the cells with x - y + N = d.
![]() | ![]() | ![]() |
| Rows and columns | Type 1 diagonals | Type 2 diagonals |
One night, someone painted black every cell in one row, one column, one type 1 diagonal, and one type 2 diagonal.
To restore the chessboard, every blackened cell must be repainted either grey or white. Find the total number of distinct cells that must be repainted, and how many of them must be painted grey and white.
The first line contains the integer N, the side length of the chessboard. (1 <= N <= 10 000 000)
The second line contains four integers r c d1 d2: the painted row number, column number, type 1 diagonal number, and type 2 diagonal number, in that order.
On the first line, output the total number of distinct cells that must be repainted.
On the second line, output how many of those cells must be painted grey and how many must be painted white, in that order.