#K64932. Valid Sequence Check
Valid Sequence Check
Valid Sequence Check
Given a sequence of integers, determine if the sequence is non-decreasing. A sequence is considered non-decreasing if for every index \(i\) (where \(1 \leq i < n\)), the condition \(scores[i] \geq scores[i-1]\) holds. If the sequence is non-decreasing, output "Valid"; otherwise, output "Invalid".
The input is provided via standard input and the output should be on standard output. Make sure your solution reads input in the specified format and produces the required output format.
inputFormat
The first line contains a single integer \(n\) representing the number of elements in the sequence. The second line contains \(n\) space-separated integers representing the sequence.
Constraints: \(1 \leq n \leq 10^5\) (you may assume input sizes are moderate for this problem).
outputFormat
Output a single line which is either "Valid" if the sequence is non-decreasing, or "Invalid" otherwise.
## sample5
10 20 20 30 40
Valid
</p>