public static void main(String args[])
	{ // Generate an array with random elements, count the inversions. print
		// them

		final int MAX_NUM_ELEMENTS = 10000;
		final int MULTIPLIER = 1000;

		int N = Math.min(MAX_NUM_ELEMENTS,
				(int) (Math.random() * MAX_NUM_ELEMENTS));
		Integer[] a = new Integer[N];

		for (int i = 0; i < a.length; i++)
			a[i] = (int) (Math.random() * MULTIPLIER);

		// show(a);

		assert SortHelper.isSorted(a);
		System.out.println("N = " + N + "\nInversions = " + new InversionsUsingMergeSort<Integer>().count(a));
		
	}