Score | |
---|---|
Problem A | 470 |
Problem B | 705 |
Problem C | 1175 |
Problem D | 1410 |
Problem E | 1880 |
Problem F1 | 1410 |
Problem F2 | 940 |
Successful hack | 100 |
Unsuccessful hack | -50 |
Unsuccessful submission | -50 |
Resubmission | -50 |
Did you know you can download more RAM? There is a shop with
Note that you can't use a RAM-increasing software if it takes more GB of RAM to use than what you currently have.
Since RAM is the most important thing in the world, you wonder, what is the maximum possible amount of RAM achievable?
The first line of the input contains a single integer
The first line of each test case contains the integers
For each test case, output a single line containing the largest amount of RAM you can achieve.
4 3 10 20 30 10 9 100 10 5 1 1 1 5 1 1 1 1 1 1 1 5 1 2 2 2 2 2 100 100 100 100 100 5 8 128 64 32 16 8 128 64 32 16 8
29 6 1 256
In the first test case, you only have enough RAM to run the third software initially, but that increases your RAM to
In the second test case, you can use the first, second, fourth and fifth software that need only
In the third test case, all the software need more than
Name | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
No items |