#K65112. Customers Above Threshold
Customers Above Threshold
Customers Above Threshold
You are given n transactions. Each transaction consists of a customer identifier and an amount spent. For each customer, compute the total amount spent over all transactions. Let \(S_i\) represent the sum of spending for customer \(i\). The task is to output all customer identifiers for which \(S_i > t\), where \(t\) is a given threshold.
If no customer fulfills the condition, output None
.
The output list should be sorted alphabetically.
inputFormat
Input is read from stdin. The first line contains two integers n
and t
separated by a space. Here, n
is the number of transactions and t
is the threshold value. Each of the following n
lines contains a string and an integer separated by a space, representing a customer identifier and the amount spent in that transaction.
outputFormat
Output to stdout a single line containing the customer identifiers that have spent more than t
, sorted in alphabetical order and separated by a single space. If no customer meets the threshold, print None
.## sample
5 500
alice 200
bob 300
alice 400
charlie 100
bob 250
alice bob