#K51942. Marathon Runner Categorization
Marathon Runner Categorization
Marathon Runner Categorization
You are given the task of categorizing marathon runners based on the type of marathon and their finishing time. The input consists of three integers D, H, and M, where:
- D indicates the marathon type (1 for full marathon, 0 for half marathon).
- H is the finishing time in hours.
- M is the finishing time in minutes.
The categorization rules are as follows:
- For a full marathon ($D=1$): If $H < 4$, the runner is classified as "Category A"; otherwise, "Category B".
- For a half marathon ($D=0$): If $H < 2$ or if $H = 2$ and $M = 0$, the runner is classified as "Category B"; otherwise, "Category C".
Your program should read the input from standard input (stdin) and output the correct category to standard output (stdout).
inputFormat
The input consists of a single line containing three space-separated integers:
- D (an integer, where 1 represents a full marathon and 0 a half marathon).
- H (an integer representing the number of hours).
- M (an integer representing the number of minutes).
outputFormat
Output a single line containing the category of the runner. The possible outputs are:
- "Category A"
- "Category B"
- "Category C"
1 3 45
Category A