#K46457. Valid Meeting Day Preferences
Valid Meeting Day Preferences
Valid Meeting Day Preferences
You are given several test cases. In each test case, an integer \( n \) is provided representing the number of consecutive days. Following that, a sequence of \( n \) integers is provided, representing a list of preferred meeting days. The task is to determine whether the provided sequence is a valid permutation of the numbers from \( 1 \) to \( n \), meaning that each number in that range appears exactly once in the sequence.
In other words, for a given test case with integer \( n \) and list \( P \), the sequence is valid if and only if:
[ \text{sorted}(P) = [1, 2, \dots, n] ]
Input and output are handled via the standard input and output streams.
inputFormat
The first line of input contains an integer ( T ) representing the number of test cases. Each test case consists of two lines:
- The first line contains a single integer ( n ), the number of days.
- The second line contains ( n ) space-separated integers representing the preferred meeting days.
All input is provided via standard input.
outputFormat
For each test case, output a single line containing "Yes" if the sequence is a valid permutation of ( 1 ) to ( n ), otherwise output "No". The answers for different test cases should be printed on separate lines via standard output.## sample
4
3
1 3 2
4
4 3 2 1
5
2 3 5 1 4
3
3 1 1
Yes
Yes
Yes
No
</p>