#C13552. Student Grade Calculator

    ID: 43103 Type: Default 1000ms 256MiB

Student Grade Calculator

Student Grade Calculator

You are given a list of student scores. Each score is a floating point number in the range \(0 \leq score \leq 100\). Your task is to convert each score into a letter grade based on the following criteria:

  • \(90 \leq score \leq 100\): Grade A
  • \(80 \leq score < 90\): Grade B
  • \(70 \leq score < 80\): Grade C
  • \(60 \leq score < 70\): Grade D
  • \(0 \leq score < 60\): Grade F

After computing the grades, you must print the grade distribution and the list of grades for the scores received.

The output should first display the header Grade distribution: on its own line, followed by five lines showing the frequency of each grade in the order A, B, C, D, F. Finally, print a single line containing the computed letter grades (in order) separated by a single space.

inputFormat

The input is read from standard input and consists of two lines:

  1. The first line contains a single integer \(n\) denoting the number of student scores.
  2. The second line contains \(n\) space-separated floating-point numbers, each representing a student's score.

outputFormat

The output is printed to standard output in the following format:

  1. The first line should be exactly: Grade distribution:
  2. The next five lines should list the count of grades A, B, C, D, and F respectively in the format: Grade: count.
  3. The last line should list the letter grades corresponding to each score in the same order, separated by a single space.
## sample
5
95 82 74 61 59
Grade distribution:

A: 1 B: 1 C: 1 D: 1 F: 1 A B C D F

</p>