public TDMatrixChainMultiplication(int p[])
	{
		n = p.length - 1;
		m = new int[n + 1][n + 1]; // the 0'th row and column are not used
		split = new int[n + 1][n + 1]; // the 0'th row and column are not used

		for (int i = 1; i <= n; i++)
			for (int j = 1; j <= n; j++)
			{
				if (i == j)
					m[i][j] = 0;
				else
					m[i][j] = Integer.MAX_VALUE;
			}
		matrixChainOrder(p, 1, n);
	}