#P11847. [USACO25FEB] True or False Test P
[USACO25FEB] True or False Test P
Description
Note: The time limit for this problem is 3s, 1.5x the default. The memory limit for this problem is 512MB, twice the default.
Bessie is taking an -question true or false test (). For the -th question, she will gain points if she gets it correct, lose points if she gets it incorrect, or remain even if she does not answer it ().
Bessie knows all the answers because she is a smart cow, but worries that Elsie (who is administering the test) will retroactively change up to of the questions after the test such that Bessie does not get those questions correct.
Given () candidate values of (), determine the number of points Bessie can guarantee for each , given that she must answer at least questions.
Input Format
The first line contains and .
The next lines each contain and .
The next lines each contain a value of . No value of appears more than once.
Output Format
The answer for each on a separate line.
2 3
3 1
4 2
2
1
0
-3
1
7
Hint
For each value of , it is optimal for Bessie to answer all of the questions.
SCORING:
- Inputs 2-4:
- Inputs 5-7: ,
- Inputs 7-20: No additional constraints.
京公网安备 11011102002149号