Well it can be solved by many methods and two of those that ill tell you are the following.
Well it can either be solved by a system of equations and a simultaneously solving them by checking out when the final answer equates and is the same.
The method ill use is hit and trial which is just keep solving till the cost is same. So the answer is 16 hours as 800 + 256 = 1056 and 720 + 336 also equates to 1056. Hence solved.