#K70232. Calculate Total Sales
Calculate Total Sales
Calculate Total Sales
This problem requires you to compute the total sales for each flower from a set of transactions. Each transaction contains a flower ID and the quantity sold. Your task is to aggregate the sales for each flower and output the result sorted by flower ID.
The mathematical formulation can be described as: $$T_i = \sum_{j=1}^{n_i} q_j$$, where \(T_i\) is the total sales for flower \(i\), and \(q_j\) represents the quantity sold in the \(j\)-th transaction for that flower.
inputFormat
The first line contains an integer n indicating the number of transactions. The following n lines each contain two space-separated integers: flower_id and quantity_sold.
outputFormat
Output one line for each unique flower_id. Each line should contain the flower_id and its total quantity_sold separated by a space. The output should be sorted in ascending order of flower_id.
## sample5
1 5
2 3
1 7
3 10
2 1
1 12
2 4
3 10
</p>