public static void main(String[] args){
		int[] dimension = {30,1,40,10,25};

		// method 1
		int min = CMMNo(dimension);
		System.out.println(min);

		// method 2
		int[][] array = new int[dimension.length-1][dimension.length-1];
		String[][] sequence = new String[dimension.length-1][dimension.length-1];
		for(int i = 0; i < dimension.length-1; i++){
			array[i][i] = 0;
			sequence[i][i] = "" + i;
		}
		for(int i = 0; i < dimension.length-1; i++){
			for(int j = i+1; j < dimension.length-1; j++){
				array[i][j] = Integer.MAX_VALUE;
				sequence[i][j] = "";
			}
		}
		int min2 = CMM2(dimension, array, sequence, 0, dimension.length-1-1);
		System.out.println(min2);
		System.out.println(sequence[0][dimension.length-1-1]);
	}