Gold bars problem

Question

Hints

Answer