DIGITD - Digit Dilemma
Prime Numbers are most mysterious number in mathematics. I know you love prime numbers. Now, the problem is easy. For a set of 3 positive integers, determine the degree to which they are relatively prime.
- DEGREE 0 – no relatively prime pairs.
- DEGREE 1 – 1 pair of relatively prime numbers.
- DEGREE 2 – 2 pairs of relatively prime numbers.
- DEGREE 3 – all 3 numbers are relatively prime.
Two integers are relatively prime if they have no common factors other than 1.
Input
The first line in the data set is an integer N (1 <= N <= 200) that represents the number of data collections that follow. Each data set contains 3 integers a, b and c (1 <= a <= b <= c <= 500)
Output
Give the number of degree. All letters are uppercase. The output is to be formatted exactly like that for the sample output given below.
Example
Input: 3 6 8 10 5 7 25 3 4 5 Output: Case 1: 0 DEGREE Case 2: 2 DEGREE Case 3: 3 DEGREE
Problem Setter: Shipu Ahamed, Dept. of CSE
Bangladesh University of Business and Technology (BUBT)
Added by: | Shipu Ahamed |
Date: | 2013-06-29 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |