I. Supporters
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3 2
1 2 3
1
1
Output
1
Input
7 10
215 942 988 25 306 945 171
3
7
4
1
Output
332749733
617961713
903173693