CSA

Problem Of The Day

💻 Question:

Discounts EASY

Input Format:

n prices, m queries q_i.

Output Format:

Cost if q_i-th most expensive is free.

Example:

Input:
5
7 1 3 1 4
1
2

Output:
12

Explanation:

TC1: Sum 16. 2nd expensive is 4. 16-4=12.