package no432a; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.InputMismatchException; import java.util.NoSuchElementException; public class Main { static final int NMAX = 1000; static int[][] combMod = new int[NMAX+1][NMAX+1]; public static void main(String[] args) { IO io = new IO(); for(int i=0;i<=NMAX;i++) { combMod[i][0] = 1; combMod[i][i] = 1; } for(int i=0;i<=NMAX;i++) { for(int j=1;j 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