��=maximum revenue obtainable by cutting up a rod of length �.
Rod_Cut(p, n):
�1=�
1
for���2,�:
�=�
�## price of i-inch rod
for j in �,�/�:##floor(i/2)
�=�??????�{�,R�−�+��}
��=�
Return ��
•�2=max�
2,R1+R1=
max5,1+1=�→�
•R3=����
3,�1+�2=
max8,1+5=�→�
•R4=���{
}
�
4,�1+�3,�2+
�[2]=max9,1+8,5+5=
��→�,�
•�5=max{
}
�
5,R1+R4,R2+
R3=max10,1+10,5+8=
��→�,�
•R6=���{
}
�
6,�1+�5,�2+�4,
�3+�3=max{
}
17,1+13,5+10,
8+8=��→�
•R7=���{
}
�
7,�1+�6,�2+
�[5],�3+�4=max{
}
17,1+17,
5+13,8+10=��→
�,��??????�,�,��??????�,�,�
•R8=���{
}
�
8,�1+�7,�2+
�6,�3+�5,�4+�4=
max{
}
20,1+18,5+17,8+13,10+
10=��→�,�
•R9=���{
}
�
9,�1+�8,�2+
�7,�3+�6,�4+�5=
max{
}
24,1+22,5+18,8+17,10+
13=��→�,�
•R10=���{
}
�
10,�1+�9,�2+
�8,�3+�7,�4+�6,�5+
�5=max{
}
30,1+25,5+22,8+
18,10+17,13+13=��→��