# ACM NEERC 2019

# High Load Database

Henry profiles a high load database migration script. The script is the list of **n** transactions. The **i**-th transaction consists of `a`

queries. Henry wants to split the script to the minimum possible number of batches, where each batch contains either one transaction or a sequence of consecutive transactions, and the total number of queries in each batch does not exceed _{i}**t**.

Unfortunately, Henry does not know the exact value of **t** for the production database, so he is going to estimate the minimum number of batches for **q** possible values of **t**: `t`

, _{1}`t`

, . . . , _{2}`t`

. Help Henry to calculate the number of transactions for each of them._{q}

#### Input

The first line contains the number of transactions **n** (**1** ≤ **n** ≤ **200 000**) in the migration script.

The second line consists of **n** integers `a`

, _{1}`a`

, . . . , _{2}`a`

- the number of queries in each transaction (_{n}**1** ≤ `a`

; Σ _{i}`a`

≤ _{i}`10`

).^{6}

The third line contains the number of queries **q** (**1** ≤ **q** ≤ `10`

).^{5}

The fourth line contains **q** integers `t`

, _{1}`t`

, . . . , _{2}`t`

(_{q}**1** ≤ `t`

≤ Σ _{i}`a`

)._{i}

#### Output

Print **q** lines. The **i**-th line should contain the minimum possible number of batches, having at most `t`

queries each. If it is not possible to split the script into the batches for some _{i}`t`

, output _{i}**"Impossible"** instead.

Remember that you may not rearrange transactions, only group consecutive transactions in a batch.

6 4 2 3 1 3 4 8 10 2 5 4 6 7 8 8

2 Impossible 4 5 4 3 3 3