# Can anyone help me with this?

There are N soldiers on a straight numbered line. The soldiers have conveniently numbered 1 through N . The coordinate of the initial position of a soldier i is xi .

The soldiers will now do warmup on the numbered line, by performing sets described below.

• A set consists of M jumps. The j-th jump of a set is performed by soldier aj (2≤aj≤N−1). For this jump, either soldier aj−1 or soldier aj+1 is chosen with equal probability (let the chosen soldier be soldier x), then soldier aj will jump to the symmetric point of its current position with respect to soldier x.

The soldiers will perform K sets in succession. For each soldier, find the expected value of the coordinate of its eventual position after K sets are performed.

Constraints:

• 3≤N≤105
• 3≤N≤105
• xi is an integer.
• |xi|≤109
• |xi|≤109
• 1≤M≤105
• 1≤M≤105
• 2≤aj≤N−1
• 2≤aj≤N−1
• 1≤K≤1018

#### Input Format

The input is given from Standard Input in the following format:

N
x1 x2 . . . xN

M K

a1 a2 . . . aM

#### Output Format

Print N lines. The i-th line should contain the expected value of the coordinate of the eventual position of soldier i after K sets are performed. The output is considered correct if the absolute or relative error is at most 10−9.

3
-1 0 2
1 1
2

-1.0
1.0
2.0

3
1 -1 1
2 2

1.0
-1.0
1.0

4 Likes