Artsem is on vacation and wants to buy souvenirs for his two teammates. There are
Artsem has visited the shopping street
In other words, for each Artsem's visit you should find the minimum possible value of
Subtasks # | Score | Constraits |
---|---|---|
1 | 21 | |
2 | 30 | |
3 | 49 | - |
The first line contains
The next line contains
The next line contains
The next
Print the answer to each query in a separate line.
Sample Input 1 | Sample Output 1 |
8
|
0
|
Subtask | Score |
---|---|
1 | 21 |
2 | 30 |
3 | 49 |
4 | 0 |