#C7970. Potion IDs Validation

    ID: 51900 Type: Default 1000ms 256MiB

Potion IDs Validation

Potion IDs Validation

You are given a number of test cases. In each test case, you are given a list of potion IDs represented by integers. Your task is to verify if the potion IDs in each test case are unique and in strictly ascending order.

The input begins with an integer T representing the number of test cases. For each test case, the first line contains an integer n indicating the number of potion IDs, followed by a line containing n integers separated by spaces. A test case is considered "valid" if the list is in strictly increasing order (i.e. every subsequent number is greater than the previous one) and all numbers are unique; otherwise, it is "invalid". Note that an empty list is considered valid.

The answer should be output with one result ("valid" or "invalid") per test case on a separate line.

inputFormat

The first line contains a single integer T which denotes the number of test cases. For each test case:

  1. The first line contains an integer n, the number of potion IDs.
  2. The next line contains n space-separated integers representing the potion IDs.

All input is provided via standard input.

outputFormat

For each test case, output a single line containing either "valid" or "invalid" based on whether the potion IDs are unique and in strictly ascending order. The output should be written to standard output.

## sample
2
5
1 2 3 4 5
5
1 3 2 5 4
valid

invalid

</p>