public static void main(String[] args) throws Exception
	{
		int p[] = { 30, 35, 15, 5, 10, 20, 25 };
		TDMatrixChainMultiplication td = new TDMatrixChainMultiplication(p);

		System.out.println("Number of scalar multiplications");
		for (int i = 1; i < p.length; i++)
		{
			for (int j = i; j < p.length; j++)
				System.out.print(td.minCost(i, j) + " ");
			System.out.println();
		}

		System.out.println("\nSplit");
		for (int i = 1; i < p.length; i++)
		{
			for (int j = i + 1; j < p.length; j++)
				System.out.print(td.split(i, j) + " ");
			System.out.println();
		}
	}