eolymp
bolt
Try our new interface for solving problems
Məsələlər

Class Statistics

Class Statistics

The new principal of \textit{Woop Woop} Public plans to meet the teaching team to discuss the performance of the classes/teachers and, being a bean counting fundamentalist, he wants to arm himself with some statistics for the meetings. Your task is to write a program that reads the pupils' marks in each class and generates performance reports for the principal prior to the meetings. \InputFile The input starts with an integer \textbf{K} (\textbf{1} ≤ \textbf{K} ≤ \textbf{100}) indicating the number of classes on a line by itself. Each of the following \textbf{K} lines gives a class's data, which starts with an integer \textbf{N} (\textbf{2} ≤ \textbf{N} ≤ \textbf{50}) indicating the number of pupils in the class. The number of pupils is followed by their marks, given as integers, in the range of zero to one hundred, separated by single spaces. \OutputFile The report for each class consists of two lines. \begin{itemize} \item The first line consists of the sentence: "\textbf{Class X}", where \textbf{X} indicates the class number starting with the value of one. \item The second line reports the maximum class mark, minimum class mark and the largest difference between consecutive marks (when sorted in non-decreasing order) in the class using the formats shown in the class using the formats shown in the sample below. \end{itemize}
Zaman məhdudiyyəti 1 saniyə
Yaddaşı istafadə məhdudiyyəti 64 MiB
Giriş verilənləri #1
2
5 30 25 76 23 78
6 25 50 70 99 70 90
Çıxış verilənləri #1
Class 1
Max 78, Min 23, Largest gap 46
Class 2
Max 99, Min 25, Largest gap 25
Mənbə The 2011 South Pacific Programming Contest