A=10*100
B=100*20
C=20*5
D=5*80
m going to use DP bottom up evaluation tabular approach to find min no of scalar multiplication...
we will start with
(1,1),(2,2),(3,3),(4,4)....they all will be 0
now, compute
(1,2)=10*100*20=20.000
(2,3)=100*20*5=10,000
(3,4)=20*5*80=8000
now,
(1,3)=min{ (1,1)+(2,3)+10*100*5 =15,000
(1,2)+(3,3)+10*20*5
}
(2,4)=min{ (2,2)+(3,4)+100*20*80 =50,000
(2,3)+(4,4)+100*5*80
}
finally compute
(1,4)=min { (1,1)+(2,4)+10*100*80
(1,2)+(4,4)+10*20*80 =19,000(Ans!!)
(1,3)+(4,4)+10*5*80
}