Bishops
시간 제한2초메모리 제한2048 MB
n x m 체스판에 서로 공격하지 않는 비숍을 최대로 놓고 그 좌표를 출력한다.
문제
A chess bishop attacks every square that shares a diagonal with it.
Place the maximum number of bishops on an chessboard in such a way that none of them attack each other.
입력
The first line contains two integers and : the dimensions of the chessboard ().
출력
On the first line, print an integer : the maximum possible number of bishops on an chessboard such that they don't attack each other. On each of the next lines, print two integers: the coordinates of bishops. The first coordinate should be in the range , and the second in the range . If there are several possible answers, print any one of them.