| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 1000 | The A+B Problem |
|
| 1001 | Simple Relation |
|
| 9999 | MultiTest |
|
Description
Given two integer sequences A, B. Add them in some specific order O.
O is described via a representation of the location relationship from input.
For example, O = 100101 means A[i] + B[i+2] write to result C[i+1];
O = 111 means A[i] + B[i] write to C[i].
Note that if index is out of the length of B or C, imagine that B,C are circular.
Input
N
L
A
B
O
N is the number of total test data.
L is the number of element in A,B.
A,B sequences have the same number of elements, each element e:
0< e < 1000000
1<= num. of A,B <= 1000
O is the description of the order
3 <= length of O < 1000
there are exactly three ones in O, and the leading one is always happen!
Output
Output your result by the same format of input sequence.