private void begin() {
		Scanner scn = new Scanner(System.in);
		int length = scn.nextInt();
		while ( length != 0 ) {
			int qtCuts = scn.nextInt();
			int cuts[] = new int[qtCuts+2];
			cuts[0] = 0;
			cuts[qtCuts+1] = length;
			for ( int c = 1; c <= qtCuts; c++ ) {
				cuts[c] = scn.nextInt();
			}
			
			int table[][] = new int[qtCuts+2][];
			for ( int i = 0; i < qtCuts+2; i++ ) {
				table[i] = new int[qtCuts+2];
			}
			
			//Dinamic!!
			for ( int offset = 0; offset < qtCuts; offset++ ) {
				int i = 1;
				int e = 1 + offset;
				for (; e <= qtCuts; i++, e++) {
					int min = Integer.MAX_VALUE;
					for ( int k = i; k <= e; k++ ) {
						int thisTry = 0;
						if ( k != i ) {
							thisTry += table[i][k-1];
						}
						if ( k != e ) {
							thisTry += table[k+1][e];
						}
						if ( thisTry < min ) {
							min = thisTry;
						}
					}
					table[i][e] = min + cuts[e+1] - cuts[i-1];
				}
			}
			
			System.out.println("The minimum cutting is " + table[1][qtCuts] + ".");
			length = scn.nextInt();
		}
	}