perl -MTime::Local -lane'END{exit 1+($d<=>0)}$F[1]--;$d+=($.*2-3)*timelocal@F[5,4,3,2,1,6]'