Member card management

Xem dạng PDF

Gửi bài giải

Điểm: 1,00 (OI)
Giới hạn thời gian: 1.0s
Giới hạn bộ nhớ: 256M
Input: stdin
Output: stdout

Nguồn bài:
Ha Minh Ngoc
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

After demonstrating the function of calculating the discount (https://www.spoj.com/EIUDISC2/problems/EIMEMCARD/)for a member. You are requested to complete the discount calculation program for all customers of the company. The company's data is a list of transactions, including customer id and product price customers bought. Transactions have been arranged in chronological order.

Input

  • The first line contains the number ~n~, which is the number of transactions (~n~ ≤ ~10^{5}~).

  • The next ~n~ lines contain the transaction data, including a 10-character string that is the customer id, and an integer that is the price of the product the customer purchased.

Output

  • Print out the total amount of discount money.

Sample Input:

5
KH00000001 3000000
KH00000002 12000000
KH00000001 30000000
KH00000002 8000000
KH00000002 80000000

Sample Output:

3160000

Bình luận

Hãy đọc nội quy trước khi bình luận.


Không có bình luận tại thời điểm này.