Shaass and Oskols

题意翻译

Shaass要打一些鸟。 有 $n$ 根水平电线彼此平行排列,电线从顶到底编号为 $1$ 到 $n$ ,每根电线上都有一些鸟彼此相邻,第 $i$ 根电线上有 $a_i$ 只鸟。 如果Shaass击中其中的一只鸟(假设这只鸟在第 $i$ 条电线上),在它左侧的鸟会跳向电线 $i$-1,在它右侧的鸟会跳向电线 $i$+1 ,如果没有这样的电线,它们就会飞走。 Shaass打了 $m$ 只鸟,告诉你每条电线上初始时鸟的个数,你的任务是计算出 $m$ 次射击后每根电线上有多少只鸟。 **输入输出格式:** 输入格式: 第一行一个整数 $n$, (1<=$n$<=100),接下来一行 $n$ 个整数$a_1,a_2,a_3...a_n$ (0<=$a_i$<=100). 第三行一个整数 $m$(0<=$m$<=100),接下来 $m$ 行每行包含两个整数 $x_i$ 和 $y_i$ ,意味着Shaass射击在电线 $x_i$ 的第 $y_i$ 只(左起)鸟,(1<=$x_i$<=$n$, 1<=$y_i$)。保证在那一时刻电线 $x_i$ 上至少会有 $y_i$ 只鸟。 输出格式: 在第 $i$ 行打印第 $i$ 根电线上鸟的数量。

题目描述

Shaass has decided to hunt some birds. There are $ n $ horizontal electricity wires aligned parallel to each other. Wires are numbered $ 1 $ to $ n $ from top to bottom. On each wire there are some oskols sitting next to each other. Oskol is the name of a delicious kind of birds in Shaass's territory. Supposed there are $ a_{i} $ oskols sitting on the $ i $ -th wire. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF294A/73007671070cf7450001e3a2fd81bd3bfb5da54a.png)Sometimes Shaass shots one of the birds and the bird dies (suppose that this bird sat at the $ i $ -th wire). Consequently all the birds on the $ i $ -th wire to the left of the dead bird get scared and jump up on the wire number $ i-1 $ , if there exists no upper wire they fly away. Also all the birds to the right of the dead bird jump down on wire number $ i+1 $ , if there exists no such wire they fly away. Shaass has shot $ m $ birds. You're given the initial number of birds on each wire, tell him how many birds are sitting on each wire after the shots.

输入输出格式

输入格式


The first line of the input contains an integer $ n $ , $ (1<=n<=100) $ . The next line contains a list of space-separated integers $ a_{1},a_{2},...,a_{n} $ , $ (0<=a_{i}<=100) $ . The third line contains an integer $ m $ , $ (0<=m<=100) $ . Each of the next $ m $ lines contains two integers $ x_{i} $ and $ y_{i} $ . The integers mean that for the $ i $ -th time Shaass shoot the $ y_{i} $ -th (from left) bird on the $ x_{i} $ -th wire, $ (1<=x_{i}<=n,1<=y_{i}) $ . It's guaranteed there will be at least $ y_{i} $ birds on the $ x_{i} $ -th wire at that moment.

输出格式


On the $ i $ -th line of the output print the number of birds on the $ i $ -th wire.

输入输出样例

输入样例 #1

5
10 10 10 10 10
5
2 5
3 13
2 12
1 13
4 6

输出样例 #1

0
12
5
0
16

输入样例 #2

3
2 4 1
1
2 2

输出样例 #2

3
0
3