1299: fireworks

内存限制:64 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:47 解决:20

题目描述

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 positionx1and one inx+1. They can continue spliting without limits, as Hmz likes.

Now there arenfireworks on the number axis. Hmz wants to know afterTseconds, how many fireworks are there in positionw?


输入

Input contains multiple test cases.
For each test case:

  • The first line contains 3 integersn,T,w(n,T,|w|≤105)
  • In nextnlines, each line contains two integersxiandci, indicating there arecifireworks in positionxiat the beginning(ci,|xi|≤105).

输出

For each test case, you should output the answer MOD 1000000007.

样例输入复制

1 2 0 2 2 2 2 2 0 3 1 2

样例输出复制

2 3
Baidu
map