Tommy has a multiset of
Constraints
Test | Other restrictions | |||
---|---|---|---|---|
1, 2 | ||||
3, 4, 5 | None | |||
6, 7, 8 | ||||
9, 10, 11 | ||||
12, 13 | None | |||
14, 15, 16, 17 | None | |||
18, 19, 20 | None |
Input Specification
The first line contains a positive integer
The second line contains
The third line contains a positive integer
The next
Output Specification
Output
Sample Input 1
Copy
5
10 2 10 5 46
4
2 2 5
2 2 23
1 3
1 23
Sample Output 1
Copy
27
16
0
16
Attachments
Attachments can be found here.
Comments