#K49712. Taco's Prime Heaps Game
Taco's Prime Heaps Game
Taco's Prime Heaps Game
In this problem, two players participate in a game that involves several heaps of stones. For each test case, you are given an integer ( n ) representing the number of heaps, followed by ( n ) integers where each integer denotes the number of stones in the corresponding heap. The winning condition is determined as follows: if there exists at least one heap with more than one stone such that the number of stones is a prime number, then the first player has a winning strategy and is declared the winner by outputting "First"; otherwise, the second player wins and you should output "Second".
Formally, let ( H = {a_1, a_2, \ldots, a_n} ) be the multiset of heap sizes. If there exists an ( a_i ) with ( a_i > 1 ) and ( a_i ) is prime, then the answer is "First". Otherwise, the answer is "Second".
Note: A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.
inputFormat
The input is read from standard input (stdin). The first line contains a single integer ( t ) denoting the number of test cases. Each test case consists of two lines. The first line of each test case contains a single integer ( n ) representing the number of heaps. The second line contains ( n ) space-separated integers, where each integer represents the number of stones in that heap.
outputFormat
For each test case, print a single line to standard output (stdout) containing either "First" if the first player has a winning strategy according to the game rules, or "Second" if otherwise.## sample
3
1
2
2
2 5
3
1 4 6
First
First
Second
</p>