시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 128 MB66191836.000%

문제

김상근과 김정인이 그녀의 마음을 얻기 위해 경쟁을 벌이고 있다. 그들은 다음과 같은 방법으로 승자를 결정하기로 했다.

무한한 크기의 2차원 평면에 어떤 지점에서 그녀가 걷기 시작한다. 그리고 그녀는 상, 하, 좌, 우 4방향으로 걸어갈 수 있는데 한번 걸어갈때마다 마음이 바뀐다. 즉, 상근이를 좋아하고 있었다면 정인이를 좋아하게 되고 정인이를 좋아하고 있었다면 상근이를 좋아하게 된다. 시작점에서는 그녀가 상근이를 좋아한다고 한다. 또한 2차원 좌표판 중에는 장애물이 있는 곳이 있어서 그런 곳은 지나가지 못한다고 하자. 이때 그녀는 그 시작점에서 (0, 0)까지 장애물을 피하여 최단거리로 걸어온다고 가정한다.

그녀가 무한한 체력을 가진 것은 아니므로 그녀가 걷는 걸음수를 S걸음 이하로 제한할 때 2차원 좌표 중 최종적으로 그녀가 (0, 0)에 왔을때 상근이를 좋아하게 될 시작점의 개수와 정인이를 좋아하게 될 시작점의 개수를 구하라.

입력

첫 줄에는 장애물의 개수 B와 걸음수 S가 주어진다. (1<=B<=10000, 1<=S<=10000000) 그리고 다음 B줄에는 장애물의 좌표가 주어진다. 장애물의 x, y값의 절댓값은 1000보다 작다고 하자.

출력

상근이를 좋아하게 될 시작점의 개수와 정인이를 좋아하게 될 시작점의 개수를 출력하라.

예제 입력 1

0 2

예제 출력 1

9 4

예제 입력 2

4 5
-1 1
0 -1
0 1
1 0

예제 출력 2

10 16

예제 입력 3

4 50000
1 1
-1 -1
1 -1
-1 1

예제 출력 3

2500099997 2500000000
W3sicHJvYmxlbV9pZCI6IjEyMjciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWFkZjhcdWIxNDBcdWM3NTggXHViOWM4XHVjNzRjIiwiZGVzY3JpcHRpb24iOiI8cD5cdWFlNDBcdWMwYzFcdWFkZmNcdWFjZmMgXHVhZTQwXHVjODE1XHVjNzc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