($y,$n,$d)=glob<>; $z=$y-12; $a=365+(($y%100==0?$y/100:$y)%4==0); $b=365+(($z%100==0?$z/100:$z)%4==0); if($a==$b){ $-=$n-$d; $c=$a-$d; } if($a<$b){ $-=$n-$d-($d>59); $c=$a-$d+($d<=$a-59); } if($a>$b){ $-=$n-$d+($d>60); $c=$a-$d-($d<=$a-60); } print $-, $", $n<=$c?$n:$c;