| Adam Gąsienica‑Samek Contest 1 |
|---|
| Finished |
Given two sequences $$$a_0,a_1,\dots,a_{n-1}$$$ and $$$b_0,b_1,\dots,b_{m-1}$$$, the sequence $$$c_0,c_1,\dots,c_{n+m-2}$$$ is defined as follows:
$$$$$$ c_k = \sum_{i+j=k} a_i b_j .$$$$$$
Your task is to find the value of $$$$$$ \sum_{k=0}^{n+m-2} c_k. $$$$$$
The first line of input contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 10^5$$$).
The second line of input contains $$$n$$$ integers $$$a_0,a_1,\dots,a_{n-1}$$$ ($$$0 \le a_i \le 10^4$$$).
The third line of input contains $$$m$$$ integers $$$b_0,b_1,\dots,b_{m-1}$$$ ($$$0 \le b_i \le 10^4$$$).
Print one integer — the value described above.
4 5 2 1 3 7 4 2 0 6 9
273
| Name |
|---|


