| 2025 ICPC, Chula Selection Contest |
|---|
| Finished |
Nobita has once again forgotten his homework. This time, Ajarn Nat asked him to design a special grid. Luckily, Doraemon pulls out a grid-maker-from-anywhere gadget that instantly creates such a grid.
The rules of the grid-maker-from-anywhere are as follows:
After the grid is built, Ajarn Nat provides Nobita with another sequence $$$x$$$ of length $$$n$$$. For each row $$$i$$$ of the grid, the gadget aligns $$$x$$$ with that row and computes the value $$$ y_i = \sum\limits_{j=1}^{n} f(i,j)\cdot x_j $$$
Collecting all $$$y_i$$$ for all $$$1 \le i \le n$$$ forms a new sequence $$$y$$$ of length $$$n$$$. Nobita must report this sequence $$$y$$$ to finally complete his homework.
The first line contains an integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$).
The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 \leq a_i \lt 100$$$).
The third line contains $$$n$$$ integers $$$b_1, b_2, \dots, b_n$$$ ($$$0 \leq b_i \lt 100$$$).
The fourth line contains $$$n$$$ integers $$$x_1, x_2, \dots, x_n$$$ ($$$0 \leq x_i \lt 100$$$).
It is guaranteed that $$$a_1 = b_1$$$.
A single line consists of $$$n$$$ integers — the sequence $$$y$$$.
41 3 5 71 2 4 81 4 1 2
29 17 22 32
From $$$a = [1, 3, 5, 7]$$$ and $$$b = [1, 2, 4, 8]$$$, the gadget constructs the following grid.
| $$$1$$$ | $$$2$$$ | $$$4$$$ | $$$8$$$ |
| $$$3$$$ | $$$1$$$ | $$$2$$$ | $$$4$$$ |
| $$$5$$$ | $$$3$$$ | $$$1$$$ | $$$2$$$ |
| $$$7$$$ | $$$5$$$ | $$$3$$$ | $$$1$$$ |
The sequence is $$$x=[1,4,1,2]$$$.
| Name |
|---|


