// Arup Guha
// 3/16/2017
// Solution to 2017 UCF HS Contest Problem: Yertle the Turtle

import java.util.*;

public class yertle {

	public static int n;
	public static int w;
	public static int[] list;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Process each case.
		for (int loop=1; loop<=numCases; loop++) {

			// Read data and sort - add Yertle as 0 in list[0].
			n = stdin.nextInt();
			w = stdin.nextInt();
			list = new int[n];
			for (int i=1; i<n; i++) list[i] = stdin.nextInt();
			Arrays.sort(list);

			// Run a binary search - 144 is safe max because 144*145/2 > 10000.
			int low = 1, high = 144;
			while (low < high) {

				// Try halfway, +1 is to avoid infinite loop
				int mid = (low+high+1)/2;

				// If we can do it, our lowest value is this.
				if (cando(mid))
					low = mid;

				// Or, if we can't this is our highest value.
				else
					high = mid-1;
			}

			// Output result.
			if (low == 1)
				System.out.println("Pond #"+loop+": Poor Yertle.");
			else
				System.out.println("Pond #"+loop+": The pyramid is "+low+" turtles high!");

		}
	}

	public static boolean cando(int rows) {

		// To avoid AOOB error.
		if (rows == 1) return true;

		// Get this out of the way.
		if (rows*(rows+1)/2 > n) return false;

		// Generate what we need.
		double[] min = gen(rows);

		// Just do a greedy compare here with biggest turtle to largest needed in sequence.
		for (int i=n-1,j=min.length-1; j>=0; i--,j--)
			if (list[i] < min[j]-1e-9)
				return false;

		// If we get here, each turtle was big enough!
		return true;
	}

	// Generates the sorted list of the turtles in rows # of rows for weight w.
	public static double[] gen(int rows) {

		// Make the triangle.
		double[][] tri = new double[rows][];
		for (int i=0; i<rows; i++) tri[i] = new double[i+1];
		tri[1][0] = tri[1][1] = w/2.0;

		// Do what the rules say, pretty similar to Pascal's Triangle.
		for (int i=2; i<rows; i++) {

			// Edges are special since they build off 1 turtle.
			tri[i][0] = tri[i][i] = (w + tri[i-1][0])/2.0;

			// This is the general rule.
			for (int j=1; j<i; j++)
				tri[i][j] = w + (tri[i-1][j-1] + tri[i-1][j])/2.0;
		}

		// Copy triangle values into an array then sort.
		double[] res = new double[rows*(rows+1)/2];
		int index = 0;
		for (int i=0; i<rows; i++)
			for (int j=0; j<=i; j++)
				res[index++] = tri[i][j];
		Arrays.sort(res);
		return res;
	}
}