#574
Unrated
Robot Instructions
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Bessie is learning how to control a robot she has recently received as a gift.

The robot begins at point (0,0)(0, 0) on the coordinate plane and Bessie wants the robot to end at point (xg,yg)(x_g, y_g). Bessie initially has a list of NN (1N401\le N\le 40) instructions to give to the robot, the ii-th of which will move the robot xix_i units right and yiy_i units up (or left or down when xix_i and yiy_i are negative, respectively).

For each KK from 11 to NN, help Bessie count the number of ways she can select KK instructions from the original NN such that after the KK instructions are executed, the robot will end at point (xg,yg)(x_g, y_g).

Note: the time and memory limits for this problem are 4s and 512MB, twice the defaults.

입력

The first line contains NN. The next line contains xgx_g and ygy_g, each in the range 109109-10^9 \ldots 10^9. The final NN lines describe the instructions. Each line has two integers xix_i and yiy_i, also in the range 109109-10^9 \ldots 10^9.

It is guaranteed that (xg,yg)(0,0)(x_g,y_g)\neq (0,0) and (xi,yi)(0,0)(x_i,y_i)\neq (0,0) for all ii.

출력

Print NN lines, the number of ways Bessie can select KK instructions from the original NN for each KK from 11 to NN.

예제 입력 1

7
5 10
-2 0
3 0
4 0
5 0
0 10
0 -10
0 10

예제 출력 1

0
2
0
3
0
1
0

점수

Test cases 2-4 satisfy N20N\le 20.Test cases 5-16 satisfy no additional constraints.

코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.