#PU1502. USACO 2025 February Contest, Platinum — Problem 3. True or False Test
USACO 2025 February Contest, Platinum — Problem 3. True or False Test
USACO 2025 February Contest, Platinum — Problem 3. True or False Test
题目描述
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.
输入格式
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.
输出格式
The answer for each on a separate line.
数据范围
Inputs 2-4: Inputs 5-7: , Inputs 7-20: No additional constraints. Problem credits: Benjamin Qi
样例
样例 1
2 3
3 1
4 2
2
1
0
-3
1
7
For each value of $k$, it is optimal for Bessie to answer all of the questions.