Easiest way to do this: Machine A and B can do the task in 24 minutes thus Rate of A and B = 1/24. Now given A can do the task in 60 minutes therefore Rate of A= 1/60. We know that Rate of A and B = Rate of A + Rate of B therefore Rate of B= Rate of A and B - Rate of A = 1/24-1/60= 1/40. Now we know that Rate of B = 1/40 thus B can do the work in 40 minutes.
Let pages printed per minute by A = x, given that pages printed by B per minute is 5 more than that of A
Pages printed by B per minute = x+5
Now Complete task is done by A in 60 minutes therefore total number of pages printed by A = x * 60
Also Complete task is done by B in 40 minutes therefore total number of pages printed by B = (x+5) * 40
therefore x * 60 = (x+5) * 40
therefore x=10
thus the total number of pages in task = x*60 = 10*60 = 600