I completed this with a lot of gold left over, is it an unintended solution? :'D
my solution actually takes less gold. i didnt spend much time balancing the gold amounts