10289_ClassStatistics

2022-5-16 18:16| 发布者: Hocassian| 查看: 47| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504733186100-Problem List-采集的数据-后羿采集器.html

Pro.ID

10289

Title

Class Statistics

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=10289

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    The new principal of 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.

    输入

    The input starts with an integer K (1 ≤ K 100) indicating the number of classes on a line by itself. Each of the following K lines gives a class's data, which starts with an integer N (2 N 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.

    输出

    Description

    The new principal of 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.

    Input

    The input starts with an integer K (1 ≤ K 100) indicating the number of classes on a line by itself. Each of the following K lines gives a class's data, which starts with an integer N (2 N 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.

    Output

    The report for each class consists of two lines.

    • The first line consists of the sentence: "Class X", where X indicates the class number starting with the value of one.

    • 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 sample below.

    Sample Input

    2
    5 30 25 76 23 78
    6 25 50 70 99 70 90

    Sample Output

    Class 1
    Max 78, Min 23, Largest gap 46
    Class 2
    Max 99, Min 25, Largest gap 25

    Source

    样例输入

    2
    5 30 25 76 23 78
    6 25 50 70 99 70 90

    样例输出

    Class 1
    Max 78, Min 23, Largest gap 46
    Class 2
    Max 99, Min 25, Largest gap 25

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部