#CCBCMCHIN0000047. Phân loại giờ có điều kiện (Conditional Time Classification)
Phân loại giờ có điều kiện (Conditional Time Classification)
Conditional Time Classification
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given integers representing hour and minute on a 24-hour clock, print INVALID for an invalid time. Otherwise, print AM when , or PM for .
Input
A line contains integers .
Output
Print exactly one of INVALID, AM, or PM.
Subtasks
-
Subtask 1 (20 points): Both values are in [-1,23].
-
Subtask 2 (30 points): Both values are in [-1,59].
-
Subtask 3 (50 points): Both values are in [-1,60].
Examples
Example 1
Input
12 0
Output
PM
Explanation
For this input, the case-specific computation and the required exact output are shown above. 12:00 is a valid time in the PM interval.
Example 2
Input
24 0
Output
INVALID
Explanation
For this input, the case-specific computation and the required exact output are shown above. Hour 24 is outside the allowed range 0–23.