Medium
Merge Tables
Read customers
id name until ---, then orders id amount until END. Merge on id and print each customer's total spending (customers with orders only), sorted by name.Input
Customers, ---, orders, END.
Output
Lines.
Sample 1
Input
1 Mim 2 Rafi 3 Sara --- 1 250 3 900 1 120 END
Output
Mim 370 Sara 900
Sample 2
Input
1 A --- 1 5 END
Output
A 5
Output appears here