410465: GYM104023 J Eat, Sleep, Repeat

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

J. Eat, Sleep, Repeattime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

FuuFuu the Panda, together with Pico and Kotsuki, lives in the KFP apartment. As a rare species, FuuFuu is well-treated. Therefore, his daily activities are only eating and sleeping.

One afternoon, Kotsuki is still working outside, and FuuFuu has finished his lunch and intends to go to sleep. But Pico feels too bored to play alone every day and wants to play a game with FuuFuu for a while. Although not very reluctant, FuuFuu agrees.

Pico picks $$$n$$$ integers $$$a_1, a_2, \dots a_n$$$, and sets $$$k$$$ constraints, the $$$i$$$-th of which is $$$\text{limit}_{x_i}=y_i$$$, indicating that the maximum number of occurrences of $$$x_i$$$ is $$$y_i$$$. Then Pico and FuuFuu take turns playing the game, where each player can choose a positive integer among $$$a_1, a_2, \dots a_n$$$ for each turn and reduce it by $$$1$$$. A player will lose the game if he cannot perform any action on his turn, where there are two cases:

  • No matter which of $$$a_1, a_2, \dots a_n$$$ is chosen, there exists an integer $$$x$$$ whose number of occurrences will be strictly greater than $$$\text{limit}_x$$$.
  • $$$a_1=a_2=\dots=a_n=0$$$.

Even though FuuFuu is sleepy, he does not want to lose the game. Please tell him who will win if Pico goes first and both of them play optimally.

Input

The first line contains an integer $$$T$$$ ($$$1 \le T \le 10^5$$$), indicating the number of test cases.

The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10^5$$$, $$$0 \le k \le 10^5$$$), indicating the number of integers and constraints.

The second line contains $$$n$$$ integers $$$a_1, a_2, \dots a_n$$$ ($$$0 \le a_i \le 10^9$$$), indicating the initial integers. It is guaranteed that the initial number of occurrences of each integer does not exceed the limit.

The $$$i$$$-th of the following $$$k$$$ lines contains two integers $$$x_i$$$ and $$$y_i$$$ ($$$0 \le x_i \le 10^9$$$, $$$0 \le y_i \le n$$$), indicating that $$$\text{limit}_{x_i}=y_i$$$. It is guaranteed that $$$x_1, x_2, \dots x_k$$$ are all distinct.

It's guaranteed that $$$\sum n \le 10^5$$$ and $$$\sum k \le 10^5$$$ over all test cases.

Output

For each test case, output the name of the winner in a single line, which is either Pico or FuuFuu.

ExampleInput
5
2 0
1 2
2 1
1 2
0 1
3 2
3 3 4
0 2
1 1
3 2
2 3 3
1 2
0 1
5 4
6 7 8 12 17
1 1
2 1
9 0
10 1
Output
Pico
FuuFuu
Pico
FuuFuu
Pico
Note

For the first test case of the sample, since there are no constraints, the game ends only if all the integers are reduced to zero. So FuuFuu will lose the game after three turns.

For the second test case of the sample, the maximum number of occurrences of $$$0$$$ is $$$1$$$. Obviously, there must be two zeros after Pico's action in the third turn, so FuuFuu will win the game.

加入题单

算法标签: