This problem is a programming version of Problem 41 from projecteuler.net
We shall say that an -digit number is pandigital if it makes use of all the digits 1 to exactly once. For example, is a -digit pandigital and is also prime.
What is the largest -digit pandigital prime ? If there is none, print -1
First line contains that denotes the number of test cases. This is followed by lines, each containing an integer, .
Print the required answer for each test case.