private int matrixChainOrder(int p[], int i, int j)
	{
		if (m[i][j] < Integer.MAX_VALUE)
			return m[i][j];

		for (int k = i; k < j; k++)
		{
			int min = matrixChainOrder(p, i, k) + matrixChainOrder(p, k + 1, j)
					+ p[i - 1] * p[k] * p[j];
			if (min < m[i][j])
			{
				m[i][j] = min;
				split[i][j] = k;
			}
		}
		return m[i][j];
	}