#CCBCHBAHAI0000120. Miền chỉ số của mảng 10 phần tử (Index Range of a 10-Element Array)
Miền chỉ số của mảng 10 phần tử (Index Range of a 10-Element Array)
Index Range of a 10-Element Array
Source: C Primer Plus
Version: Phuoc Hung OJ Extended
Problem Statement
Consider a one-dimensional array with exactly elements. Under C's zero-based indexing, the valid index range is
that is, indices through . You are given indices. For each one, determine whether accessing that array index is within the valid range.
Input
- The first line contains .
- The second line contains exactly integers .
Output
For each index, print VALID if ; otherwise print INVALID. Print one result per line.
Subtasks
Subtask 1 (20 points): every index is in .
Subtask 2 (30 points): every index is in and at least one index is invalid.
Subtask 3 (50 points): , .
Examples
Input
7
-1 0 4 9 10 100 -5
Output
INVALID
VALID
VALID
VALID
INVALID
INVALID
INVALID
Explanation
Indices are valid because they lie in . Indices are outside the range. The program prints one classification for each input index in order.