This page is still under construction.

Parts of this page are still being built. What you see may change.

Statistics

Interview

Time limit2sMemory limit1024 MB

Summary
For each line of input, read n numbers and print the case number along with the minimum, maximum, and range of the sample.
Level

Easy1 of 10

Topics
Array, Implementation
Solved
No attempts yet

Problem

Research often involves dealing with large quantities of data, and those data are often too massive to examine manually. Statistical descriptions of data can help humans understand their basic properties. Consider a sample of n numbers X = (x1, x2, . . . , xn). Of many statistics that can be computed on X, some of the most important are the following:

  • min(X): the smallest value in X
  • max(X): the largest value in X
  • range(X): max(X) − min(X)

Write a program that will analyze samples of data and report these values for each sample.

Input

Each test case is described by one line of input, which begins with an integer 1 ≤ n ≤ 30 and is followed by n integers which make up the sample to be analyzed. Each value in the sample will be in the range -1,000,000 to 1,000,000.

Output

For each case, display the case number followed by the min, max, and range of the sample (in that order). Follow the format of the sample output.

Examples1

  1. Example 1

    Input
    2 4 10
    9 2 5 6 4 5 9 2 1 4
    7 6 10 1 2 5 10 9
    1 9
    
    Expected output
    Case 1: 4 10 6
    Case 2: 1 9 8
    Case 3: 1 10 9
    Case 4: 9 9 0