this is a codeforces problem please write correct C++ code FuuFuu the Panda, together…
- User
this is a codeforces problem please write correct C++ code 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 a1,a2,…an , and sets k constraints, the i -th of which is limitxi=yi , indicating that the maximum number of occurrences of xi is yi . Then Pico and FuuFuu take turns playing the game, where each player can choose a positive integer among a1,a2,…an 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 a1,a2,…an is chosen, there exists an integer x whose number of occurrences will be strictly greater than limitx . a1=a2=⋯=an=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≤T≤10^5 ), indicating the number of test cases.
The first line of each test case contains two integers n and k (1≤n≤10^5 , 0≤k≤10^5 ), indicating the number of integers and constraints.
The second line contains n integers a1,a2,…an (0≤ai≤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 xi and yi (0≤xi≤10^9 , 0≤yi≤n ), indicating that limitxi=yi . It is guaranteed that x1,x2,…xk are all distinct.
It's guaranteed that ∑n≤10^5 and ∑k≤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.
Example Input 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. .
- Assistant