#K82037. Valid 4x4 Grid Checker
Valid 4x4 Grid Checker
Valid 4x4 Grid Checker
You are given a 4x4 grid. Your task is to check whether the grid contains every integer from \(1\) to \(16\) exactly once. In other words, the grid must contain the set \(\{1,2,\dots,16\}\) with no duplicates and no missing numbers.
Read the input from standard input (stdin) and print the result to standard output (stdout). If the grid is valid, output VALID
; otherwise, output INVALID
.
inputFormat
The input consists of 4 lines. Each line contains 4 space-separated integers representing a row of the grid.
outputFormat
Output a single line containing either 'VALID' or 'INVALID' based on whether the grid is valid.## sample
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
VALID