#1172. 比x大的数字总和

比x大的数字总和

Cannot parse: (0 , import_utils.normalizeSubtasks) is not a function or its return value is not iterable

Background

Special for beginners, ^_^

Description

有一个 nn 个数字的序列 A1,A2,...,An\mathcal{A_1,A_2,... ,A_n},将会有 qq 次询问,每次询问比 xx 大的数字的数字总和是多少。

Format

Input

N\mathcal{N}

A1 A2 ... An\mathcal{A_1\ A_2\ ... \ A_n}

Q\mathcal{Q}

X1 X2 ... Xn\mathcal{X_1\ X_2\ ... \ X_n}

Output

一行输出 Q\mathcal{Q} 个整数,分别表示一次针对 Xi\mathcal{X_i} 的回答

Samples

5
1 2 3 4 5
5
1 2 3 4 5
14 12 9 5 0
5
5 2 3 1 4
5
4 6 3 1 2
5 0 9 14 12

Limitation

30%30\% 的数据,1n,q1001\leq n, q \leq 100

100%100\% 的数据如下:

1n,q500001 \leq n, q \leq 50000

1Xin1 \leq X_i \leq n

109Ai109-10^9 \leq A_i \leq 10^9

1s, 1024KiB for each test case.