Oscar's Round Must Have a Constructive Problem
면접 대비시간 제한1초메모리 제한1024 MB
수열 A가 주어질 때 모든 i에서 P[i] != A[i]인 순열 P를 만들거나, 불가능하면 불가능하다고 답한다.
문제
Grammy has a sequence of length .
Please find a permutation such that for all .
입력
There are multiple test cases.
The first line contains a single integer (), denoting the number of test cases.
For each test case:
The first line contains a single integer ().
The second line contains integers ().
It is guaranteed that the sum of does not exceed .
출력
For each test case:
If the permutation does not exist, output "NO" on a single line.
Otherwise, output "YES" one the first line, then output integers one the second line, denoting the permutation .