题目描述
Jagjit Singh (Jaggi) is among the few fastest athletes of Thapar. Just before the Thapar Olympics he thought of a new way to practice. He decided he will run in intervals. In each interval , he will run at a particular speed. You have to calculate the total distance traveled by him, given the speed M and time S for each interval.
Input
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
Each test case will contain a single number N, the number of intervals. Then N lines follow.
Each of the next N lines will contain the length of the interval in seconds (S) and speed (M) in that interval in(m/sec).
Output
For each test case output the total distance covered by him in meters(m) separated by new line.
Constraints
0 < T < 100
0 < N <= 10000
0 <= S <= 10^5
0 <= M <= 10^5
Don't get shocked after looking at constraints, sometimes he becomes super fast. ;)
Example
Input:
2
3
2 5
1 6
3 10
5
1 1
2 2
3 3
4 10
5 1
Output:
46
59
输入格式
见题面
输出格式
见题面