The criteria which i wrote was a1 needs to go before a2 if max(a1+d1,a1+a2+d2) < max(a2+d2,a2+a1+d1).

If a1 goes before a2 then according to u r statement a1+d1< a2+d2, which need not be the case.

For example consider a1=5, d1=6 and a2=3, d2=2. a1 goes before a2 if:

max(5+6, 5+3+2) < max( 3+2 , 3+5+6)

max(11,10) < max(5, 14)

11< 14.

Hence a1 goes before a2.

But a1+d1 > a2+d2

5+6 > 3+2

11 > 5.

Hence i did not understand "since a1+d1< a2+ d2 "...