public static Point getLayout(int numWindows, int maxX, int maxY) {
		// Look for rectangular layout
		Set<Integer> divisors = findDivisors(numWindows);
		for (int x : divisors) {
			int y = numWindows / x;
			if (x <= maxX && y <= maxY) {
				return new Point(x, y);
			}
		}
		
		// No rectangular layout found. Use a jagged one, possibly overflowing the screen.
		int x = (int)Math.ceil((double)numWindows / maxY);
		int y = maxY;
		return new Point(x, y);
	}