Processing math: 100%
Robot - MarisaOJ: Marisa Online Judge

Robot

Time limit: 1500 ms
Memory limit: 256 MB
You have a robot located at point (0,0) on a 2D plane. The robot can run n command. If the robot are now at (x,y), and you execute the ith command, your robot will move to (x+xi,y+yi). Each command can only be executed only once. Count the number of way to reach point (a,b). ### Input - The first line contains an integer n. - The second line contains 2 integers a,b. - The next n lines, each line contains 2 integers xi,yi. ### Output - Print the number of ways to reach point (a,b). ### Constraints - 1≤n≤40. - −109≤xi,yi,a,b≤109. ### Example Input: 2110110 Output: 1