Loading...
The Picky Penguins' Party
Time: 1 s
Memory: 125 MB
A party is being thrown by some penguins in Penguinland! For their feast, they've gathered a variety of fish, numbered A with N elements. However, these penguins are quite particular: they insist that the party can only start if they can divide their fish stash into two groups with an equal sum. Your job is to help these picky penguins. If it's possible, announce "Party Time!" followed by the rearranged array. If not, sadly declare "Party's Cancelled".
Input
The first line of input contains a single integer T (1 ≤ T ≤ 100), representing the number of test cases. Each test case follows the following format:

The first line of each test case contains a single integer N (1 ≤ N ≤ 10^5), representing the number of fish at the penguins' party for that test case.
The second line contains N space-separated integers A[i] (1 ≤ A[i] ≤ 10^9), where each integer represents the value of the ith fish in that test case.
Constraint
1 ≤ N ≤ 10^5
1 ≤ A[i] ≤ 10^9, where A[i] is the ith fish's value in the array.
Output
For each test case, if it's possible to divide the fish into two groups with equal total values, print "Party Time!" in the first line of the test case's output. If dividing the fish equally is impossible, print "Party's Cancelled". Each test case's output should be separated by a new line.
Examples
Input
Output
2
2
2 2
4
1 2 4 3
Party Time!
Party Time!
Problem Info
Problem ID 202
Time Limit 1000 ms
Memory Limit 128000 KB
Moderators abujafar492 , Alom_Shanto
Statistics
Submit
You need to Login or Registration for submit your solution