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