Grove
시간 제한3초메모리 제한2048 MB
한 변의 길이가 n인 정사각형 안에 정수 좌표의 점을 최대한 많이 놓되, 반지름 r인 원판이 정사각형 안에 들어가고 서로 경계에서만 만나야 한다.
문제
You want to plant trees in a square lawn of size whose corners have Cartesian coordinates , , , and . Trees can only be planted at locations with integer coordinates. Every tree will grow roots within a disk of radius centered at the location where the tree was planted; such disks must be fully contained in the lawn (possibly touching the boundary of the lawn) and can only intersect each other on their boundaries.
Find a configuration that maximizes the number of trees.
입력
The first and only line contains an integer () and a real number () — the length of the sides of the lawn, and the radius of the disks where each tree will grow roots. The real number is given in decimal notation with at least and at most digits after the decimal point.
출력
In the first line, print the maximum number of trees that can be planted.
In the next lines, print a configuration that maximizes the number of trees. Specifically, in the -th line, print two integers and — the coordinates of the location where the -th tree should be planted. You can print the trees in any order.
If there are multiple solutions, print any of them.