Problem F
Matarinnkaup
Languages
en
is

A lot of food and drinks were sold at Nauthóll over the last few days. Now it is time to take inventory and figure out necessary purchases. This job falls to you. Given the recipes used at Nauthóll and all receipts from the past few days, how much was used of each ingredient?
Input
The first line of the input contains two integers
Output
Print how much is needed of every ingredient, one ingredient per line. On each line the name of the ingredient, a space and an integer denoting how much is needed should be printed. The ingredients should be printed in alphabetical order. Underscores are considered to go before all the letters in this order. If an ingredient isn’t needed, it shouldn’t be printed.
Scoring
Group |
Points |
Constraints |
1 |
50 |
There are at most |
2 |
50 |
No further constraints. |
Sample Input 1 | Sample Output 1 |
---|---|
2 2 hamborgaramaltid 4 buff 1 braud 2 franskar 100 salat 1 hamborgari 2 buff 1 braud 2 1 hamborgaramaltid 4 1 hamborgari 2 |
braud 12 buff 6 franskar 400 salat 4 |