#C13075. Total Cost Calculation
Total Cost Calculation
Total Cost Calculation
You are given a list of items available in a store. Each item is described by its name, price, and quantity. Your task is to compute the total cost of those items that satisfy both of the following conditions:
- The quantity is greater than \(1\) (i.e., \(\texttt{quantity} > 1\)).
- The price is greater than a given threshold \(T\) (i.e., \(\texttt{price} > T\)).
The total cost for an item is defined as the product of its price and quantity. The final answer is the sum of the total costs of all items meeting the criteria.
Input/Output Requirements: Read the input from stdin
and output the result to stdout
.
inputFormat
The input is given in the following format:
N T name1 price1 quantity1 name2 price2 quantity2 ... nameN priceN quantityN
where:
N
is an integer that denotes the number of items.T
is a float representing the price threshold.- Each of the next
N
lines contains an item's information: a stringname
, a floatprice
, and an integerquantity
, separated by spaces.
outputFormat
Output a single number representing the total cost computed as the sum of \(\texttt{price} \times \texttt{quantity}\) for each item that satisfies \(\texttt{quantity} > 1\) and \(\texttt{price} > T\). If the result is an integer, you may output it without decimals.
## sample0
5
0
</p>