传统题 1000ms 64MiB

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 2
2
3

国庆训练赛

未参加
状态
已结束
规则
XCPC
题目
11
开始于
2017-10-1 20:00
结束于
2017-10-2 1:00
持续时间
5 小时
主持人
参赛人数
51