10654: 多多洛的礼物
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:1
Solved:0
Input
首先有一个数字T,代表有T组数据;每组数据有一个数字n,接下来有n行,每行包括两个数字s和t,s表示小朋友们的性别(0是女生,1是男生),t表示该小朋友将会送给多多洛多少颗糖果或巧克力。(0<=s<=1, 1<=t<=10)
Output
对于每组数据输出两个数字,分别表示多多洛会收到的巧克力和糖果的总数,两个数字之间用一个空格隔开(第二个数字后面没有空格,不要多加)。
Sample Input Copy
2
1
0 1
3
0 5
1 6
0 3
Sample Output Copy
1 0
8 6