Skip to main content

Sample Problem

A-Range-ing Data

One of the measures taken on a group of data is the range of the data. The range of a group of data is defined to be the absolute value of the difference of the largest element and the smallest element.

Write a program to compute the range of different data sets.

Input

The input to your program will be one or more data sets. The first value in each data set will be n, the number of values in the data set, where 1 <= n <= 100. The next n values will be the integers in the data set.

The end of all input is indicated by end of file.

Output

For each list, print the set number and the range of the set. Have a blank line after each line of output.

Sample Input

3
10
20
15
2
-1
1

Sample Output (corresponding to the sample input)

Data set 1 has range = 10
Data set 2 has range = 2

Solutions

See Sample Solutions.