enter the no of test cases
enter the length of the rod
enter the cost of size 0 :
0
enter the cost of size 1 :
1
enter the cost of size 2 :
5
enter the cost of size 3 :
7
enter the cost of size 4 :
9
enter the cost of size 5 :
10
enter the cost of size 6 :
16
enter the cost of size 7 :
18
enter the cost of size 8 :
20
enter the cost of size 9 :
22
max revenue is : 23
array s is :
0 0 2 3 2 2 6 7 2 2
array dp is :
0 1 5 7 10 12 16 18 21 23
enter the length of the rod
enter the cost of size 0 :
0
enter the cost of size 1 :
1
enter the cost of size 2 :
5
enter the cost of size 3 :
8
enter the cost of size 4 :
9
enter the cost of size 5 :
10
enter the cost of size 6 :
17
enter the cost of size 7 :
17
enter the cost of size 8 :
20
enter the cost of size 9 :
24
enter the cost of size 10 :
30
max revenue is : 30
array s is :
0 0 2 3 2 2 6 1 2 3 10
array dp is :
0 1 5 8 10 13 17 18 22 25 30