Hand Detection -------------- Hobbits like games of chance and skill. As such they play a game very much like our poker, though their decks of cards and rules are a bit different. - Cards can have one of 21 values (1 to 21 inclusive). - Cards can have one of 5 suits (Elf, Man, Hobbit, Ent, Orc). A deck of cards therefore has 105 cards. Each hand has 5 cards, just like poker. Your task is to write a program to identify two types of hands: a spread and a rainbow. The rules for a spread are as follows: the suits don't matter but the values do. The values must be such that the difference between any two card values is not the same as the difference between any other two card values. For example, a hand with containing cards with values 1, 2, 4, 8, 16 is a spread because any pair of values has a unique difference. The rule for a rainbow is simply that the hand must have exactly one card of each suit. Input ----- The first line in the test data contains the number of test cases (< 100). After that each line will contain a test case, with each card being represented by two integers (thus each test case comprises of 10 integers). The first number is the card's suit (an int that takes values between 0 and 4, inclusive), and the second represents the card's value (an int that takes values between 1 and 21, inclusive). Output ------ For each test case, the program needs to indicate whether or not that hand of cards has a spread and whether or not that hand of cards has a rainbow. The exact format is shown below. Sample input ------------ 2 0 1 0 2 0 4 0 8 0 16 0 1 1 1 2 1 3 1 4 1 Sample output ------------- spread, no rainbow no spread, rainbow