Work done by A in 1 hours = 1/8 = 10/80
B = 1/20 = 4/80
C = 1/40 = 2/80
D = 1/80
For simplicity sake, lets assume that 80 units of work to be accomplished (it can be easily taken as 1 unit, but for simplification sake , lets take it as 80. For 1 unit calculation, divide everything by 80)
then A does 10 units in 1 hours, B 4, C 2 ad D 1.
For minimum time, fastest has to work first, so cycle becomes: ABCDABCDA...each working for 1 hour
so work completed in one cycle(of 4 hours) is 10(A)+4(B)+2(C)+1(D)= 17
work completed in 4 such cycle of total 16 hours = 17*4 = 68
then comes A's turn for 1 hour, total work done = 68+10 = 78, total hrs = 17
then 2 units left and B's turn(of 4 unit in 1 hour) means only 0.5 hrs req. , total hrs = 17.5
for max, cycle should be DCBADCBA..
first 16 hours same as above,(4 cycles of DCBA)
for hour 17, D's turn , work done = 1, total work = 69
for hour 18, C's turn, work done = 2, total work = 71
for hour 19, B's turn, work done = 4, total = 75
for hour 20, A's turn , work done = 10, needed 5, so only 0.5 hour needed
therefore total time = 19.5