3
Order Input: The input consists of one or more sets of strings, followed by a final line containing only the value 0. Each set starts with a line containing an integer, n, which is the number of strings in the set, followed by n strings, one per line, sorted in nondescending order by length. None of the strings contain spaces. There is at least one and no more than 15 strings per set. Each string is at most 25 characters long. Output: For each input set print "SET n" on a line, where n starts at 1, followed by the output set as shown in the sample output.

6
Speed Input: The input consists of one or more data sets. Each set starts with a line containing an integer n, 1 n 10, followed by n pairs of values, one pair per line. The first value in a pair, s, is the speed in miles per hour and the second value, t, is the total elapsed time. Both s and t are integers, 1 s 90 and 1 t 12. The values for t are always in strictly increasing order. A value of -1 for n signals the end of the input. Output: For each input set, print the distance driven, followed by a space, followed by the word "miles".

7

8
Longnight The input contains several test cases. The first line of a test case contains one integer N, which indicates the number of museums participating in the event (1 <= N <= 20). The second line of a test case contains N integers indicating the time, in minutes, needed to visit each museum. Then there are N lines describing the times to go from one museum to every other. You may assume that the i-th integer in the i-th line is equal to zero. The end of input is indicated by N = 0 For each test case in the input, your program must produce one line containing the maximum number of museums that can be visited during the Long Night of Museums.

16
Tax ICPC needs to divide it into lots. 1.land can only be divided using a sequence of land divisions; 2.a land division is an operation that divides one piece of land into two pieces of land; and 3.for each land division, a land division tax must be paid. Denoting by A the area of the largest resulting part of the division, the value of the land division tax is A×F, where F is the division tax factor.