Geunwoo spends all his time playing and suddenly wants to know his grade average. He finds logging in to the academic system too much trouble, so compute the credit total and the GPA of each semester for him.
The credit total of a semester is the sum of the credits C of every course taken that semester. The GPA is the sum of C times the grade G over all courses, divided by the credit total.
GPA=∑i=1NCi∑i=1NCi×Gi
The first line contains the number of semesters T. T is an integer of at least 1.
The information for the T semesters follows. Each semester starts with a line holding the number of courses N taken that semester, then N lines follow, each holding the credit C and the grade G of one course, separated by a space. (1≤N≤10, 1≤C≤6, C is an integer)
G is one of 0, 0.7, 1, 1.3, 1.7, 2, 2.3, 2.7, 3, 3.3, 3.7, 4, 4.3, and its fractional part is given to at most one digit. A grade whose fractional part is 0 can appear as an integer such as 4 or in decimal form such as 4.0.
For each semester, print the credit total and the GPA on one line, separated by a space.
Print the credit total as an integer. Print the GPA rounded to one decimal place, rounding up when the second decimal digit is exactly 5. Always print one digit after the decimal point, so an exact integer GPA prints as 0.0 or 4.3.