| TheForces Round #41 (Magical-Forces) |
|---|
| Закончено |
You are given a permutation $$$ p $$$ of length $$$n$$$.
You can do the following operation any number of times (possibly zero):
A composite number is a positive integer greater than $$$1$$$ that is not a prime number. In other words, a composite number has divisors other than $$$1$$$ and itself. For example, $$$4, 6, 8$$$, and $$$9$$$ are composite numbers.
Determine if you can sort the permutation in increasing order after performing the given operation any number of times (possibly zero).
The first line contains one positive integer $$$t$$$ $$$(1≤t≤2 \cdot 10^5)$$$ — the number of test cases.
Each test case begins with a line containing one integer $$$n$$$ $$$(1≤n≤2 \cdot 10^5)$$$.
The second line of each test case contains n integers $$$p_1…p_n (1≤p_i ≤ n)$$$. It is guaranteed that $$$p$$$ is a permutation.
The sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, output on a separate line:
41122 121 242 1 4 3
Yes No Yes No
| Название |
|---|


