#B2067. Medication Inventory Management
Medication Inventory Management
Medication Inventory Management
The pharmacy manager needs a computer program to help manage daily drug inventory. At the start of each day, the total number of available drugs \(S\) is known. Throughout the day, \(M\) patients come to obtain drugs. Each patient requests a certain number of drugs. If a patient's request exceeds the current available stock, the pharmacy will refuse the request.
Your program must determine the number of patients who did not obtain their requested drugs.
Note: The initial stock decreases only when a patient's request is successfully met. If a request is refused, the stock remains unchanged.
inputFormat
The first line of input contains two integers \(S\) and \(M\), where \(S (1 \leq S \leq 10^9)\) represents the initial stock at the start of the day, and \(M (1 \leq M \leq 10^5)\) represents the number of patients.
The second line contains \(M\) space-separated integers, with the \(i\)-th integer denoting the number of drugs requested by the \(i\)-th patient.
outputFormat
Output a single integer representing the number of patients who were not able to collect their drugs.
sample
10 3
3 5 7
1