You are given an array of n numbers, find any prime number that appears a prime number of times in the array.
The first line contains an integer n(1≤n≤106).
The second line contains the numbers given separated by spaces, ai(1≤ai≤106).
Output the solution on a single line. If there are multiple answers, output any of them. If there is no solution, output −1.
4 1 2 2 3
2
5 1 2 2 2 2
-1
5 1 1 1 2 2
2
Login to be able to submit.
Language | Specific limits |
---|---|
Python 3.12 | 4.0 s / - MB |