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

문제

Note: The time limit for this problem is 6s, three times the default. The memory limit for this problem is 512MB, twice the default.

Bessie is a hungry cow. Each day, for dinner, if there is a haybale in the barn, she will eat one haybale. Farmer John does not want Bessie to starve, so some days he sends a delivery of haybales, which arrive in the morning (before dinner). In particular, on day did_i, Farmer John sends a delivery of bib_i haybales (1di10141\leq d_i \leq 10^{14}, 0bi1090\leq b_i \leq 10^9).

Process UU (1U1051\le U\le 10^5) updates as follows: Given a pair (d,b)(d, b), update the number of haybales arriving on day dd to bb. After each update, output the sum of all days on which Bessie eats haybales modulo 109+710^9+7.

입력

UU, followed by UU lines containing the updates.

출력

The sum after each update modulo 109+710^9+7.

예제 입력 1

3
4 3
1 5
1 2

예제 출력 1

15
36
18

예제 입력 2

9
1 89
30 7
101 26
1 24
5 1
60 4
5 10
101 0
1 200

예제 출력 2

4005
4656
7607
3482
3507
3753
4058
1107
24531

점수

Input 3: U5000U\le 5000Inputs 4-10: Updates only increase the number of haybales arriving on day dd.Inputs 11-22: No additional constraints.

코드 제출

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

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