private void cutRod(int n)
	{
		// For each incrementally greater length of the rod
		// determine the cut which will produce the greatest revenue
		for (int i = 1; i <= n; i++)
		{ 
			int max = Integer.MIN_VALUE;
			
			// The maximal revenue of all possible cuts of length i
			for (int j = 1; j <= i; j++)
				if (p[j] + r[i - j] > max)
				{
					max = p[j] + r[i - j];
					cuts[i] = new String(j + " " + cuts[i - j]);
				}
			r[i] = max;
		}
	}