You have 40 minutes to exercise at the gym, and you want to burn 300 calories total using both machines. How much time should you spend on each machine?

first machine is 8 cal. per minute
the second one is 6 cal. per minute