#B2090. Patient Age Group Ratio Analysis

    ID: 11172 Type: Default 1000ms 256MiB

Patient Age Group Ratio Analysis

Patient Age Group Ratio Analysis

A hospital is conducting a study to determine whether a certain disease is related to age. The hospital has collected diagnostic records and needs to calculate the proportion of patients in four age groups: 0-18, 19-35, 36-60, and 61 and above. Given the ages of patients, your task is to compute the ratio of patients in each group relative to the total number of patients. Print the results with two decimal places.

Mathematically, if the counts for the four groups are \(c_1, c_2, c_3, c_4\) and the total number of patients is \(N\), then the ratios are computed as:

[ \text{ratio}_i = \frac{c_i}{N} \quad \text{for } i=1,2,3,4 ]

Output these four ratios separated by spaces.

inputFormat

The first line contains an integer \(N\), representing the number of patients. The second line contains \(N\) integers separated by spaces, where each integer represents the age of a patient.

outputFormat

Output four numbers separated by a space. Each number is the proportion (ratio) of patients in the respective age group (0-18, 19-35, 36-60, and 61 & above) relative to the total number of patients. Each ratio should be displayed with two decimal places.

sample

8
5 20 40 70 15 25 55 80
0.25 0.25 0.25 0.25