fireworks
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Problem Description
Hmz likes to play fireworks, especially
when they are put regularly.
Now he puts some fireworks in a line. This time he put a trigger on each
firework. With that trigger, each firework will explode and split into two
parts per second, which means if a firework is currently in position x, then in next second one part will be in position x−1 and one in x+1. They can continue spliting without limits, as Hmz likes.
Now there are n fireworks on the number axis. Hmz wants to know after T seconds, how many fireworks are there in position w?

Input Format
Input contains multiple test cases.
For each test case:
- The first line contains 3 integers n,T,w(n,T,|w|≤105)
- In next n lines, each line contains two integers xi and ci, indicating there are ci fireworks in position xi at the beginning(ci,|xi|≤105).
Output Format
For each test case, you should output the answer MOD 1000000007.
1 2 0
2 2
2 2 2
0 3
1 22
3