package no250; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.math.BigInteger; import java.util.InputMismatchException; import java.util.NoSuchElementException; public class Main { static IO io = new IO(); public static void main(String[] args) { BigInteger[] fact = new BigInteger[3001]; fact[0] = BigInteger.ONE; for(int i=1;i<=3000;i++) { fact[i] = fact[i-1].multiply(BigInteger.valueOf(i)); } int q = io.nextInt(); for(int qq=0;qq Integer.MAX_VALUE) { throw new NumberFormatException(); } return (int) nl; } public char nextChar() { if (!hasNext()) { throw new NoSuchElementException(); } return (char) readByte(); } public double nextDouble() { return Double.parseDouble(next());} public int[] nextIntArray(int n) { int[] a = new int[n]; for(int i=0;i