You are misunderstanding the question. The cost of the first cut on a log of length 20 is 20, no matter where you cut it. The dumbest thing to do would be to cut off the smallest piece first. The biggest first might work.
Doing it in order 4, 7, 6, 3, yields:
Code:
. 20
/ \
4 16 cost: 20
/ \
7 9 cost: 16
/ \
6 3 cost: 9
=========
total: 45
Doing it in order 7, 6, 4, 3 yields:
Code:
. 20
/ \
7 13 cost: 20
/ \
6 7 cost: 13
/ \
4 3 cost: 7
=========
total: 40
Other optimal orders are possible:
Code:
. 20
/ \
11 9 cost: 20
/ \ / \
7 4 6 3 cost: 20 (11 + 9)
=========
total: 40