#K65367. Taco - Score Sequence Validation
Taco - Score Sequence Validation
Taco - Score Sequence Validation
You are given the scores of multiple participants in a contest. For each participant, the scores are provided in a single line containing space-separated integers. The scores for each participant must be non-decreasing, i.e., for every consecutive pair of scores, the following condition must hold:
\(a_i \leq a_{i+1}\)
Your task is to check if all participants have valid score sequences. If every participant's score sequence is valid, output VALID
; otherwise, output INVALID
.
The input starts with an integer P representing the number of participants, followed by P lines each containing the scores for one participant.
inputFormat
The first line of input contains a single integer P denoting the number of participants.
The following P lines each contain a sequence of space-separated integers representing scores of a participant.
outputFormat
Output a single line with the word VALID
if every participant's scores are non-decreasing. Otherwise, output INVALID
.
3
5 10 15
8 8 10 12
9 10 11 11
VALID