Jenith is a student of CSE of Metropolitan University (MU). Recently her fifth term’s result has been published. She obtained CGPA 4 out of 4. Her classmates ask her to calculate their CGPA. Actually she helps her friends to calculate their CGPA from the first term. Sometimes she feels bore, so she wants to write a program now that will help her friends to calculate their CGPA. As you are a very good programmer she needs your help.

CGPA stands for “Cumulative Grade Point Average”. It is calculated based on all the courses you take along with the total number of credit hours. The total marks or numeral grades of a course is multiplied by the total credits of that course. Then summing the results of all the courses divide by the total credits of a term or semester you will get your CGPA.

In Metropolitan University important courses including major and non-major courses carry 3 to 4 credits and some less important courses including lab courses carry 1 to 2 credits.

Marks Range

Grade

Grade Point

80-100

A+

4.00

75-79

A

3.75

70-74

A-

3.50

65-69

B+

3.25

60-64

B

3.00

55-59

B-

2.75

50-54

C+

2.50

45-49

C

2.25

40-44

C-

2.00

0-39

F

0.00

Input

The first line of input contains an integer T (T ≤ 50) denoting the number of test cases. Next line contains an integer C the number of courses you take in a term or semester. Next C lines contains two numbers (can be float or double) m, n (0 ≤ m ≤ 100, n ≥ 1), the marks of a course and the credit of that course.

Output

For each test case print the case no and print the floating point result R (two digits after decimal) that denotes your CGPA. If your input m contains less than 40 then print "Sorry, you have failed in F courses!" Where F is an integer that denotes the number of courses you have failed.

Case 1: 3.89
Case 2: 3.52
Case 3: Sorry, you have failed in 2 courses!

Note: If you have failed in 1 course, then you have to print "Sorry, you have failed in 1 course!". Otherwise print "Sorry, you have failed in F courses!", where F denotes the the total number of courses you have failed.