public static void main(String[] args) {
	  Random gen = new Random();
	  for (int times = 0; times < 1000; ++times) {
	    int n, m;
	    if (args.length == 1) {
	      n = Integer.valueOf(args[0]);
	      m = gen.nextInt(n) + 1;
	    } else if (args.length == 2) {
	    	n = Integer.valueOf(args[0]);
	    	m = Integer.valueOf(args[1]);
	    } else {
	      n = gen.nextInt(1000) + 1;
	      m = gen.nextInt(n) + 1;
	    }
	    System.out.println("n = " + n + ", m = " + m);
	    int[] A = new int[n];
	    iota(A, 0, A.length, 0);
	    shuffle(A);
	    
	    /*
	    System.out.print("A = ");
	    System.out.println(Arrays.toString(A));
	    */
	    int[] E = new int[m];
	    for (int i = 0; i < m; ++i) {
	      E[i] = gen.nextInt(n - i) + i;
	    }
	    Arrays.sort(E);
	    /*
	    System.out.print("E = ");
	    System.out.println(Arrays.toString(E));
	    */
	    int[] ans = offline_minimum(A, E);
	    /*
	    System.out.print("ans1 = ");
	    System.out.println(Arrays.toString(ans));
	    */
	    int[] tmp = check_answer(A, E);
	    assert(Arrays.equals(ans, tmp));
	  }
	}