Help for this page

Select Code to Download


  1. or download this
    19999
    19111
    19191
    19191
    11191
    
  2. or download this
    # run with perl -ln prog.pl input
    push@a,/./g;$r||=@a}{print$s{-1+map{$u{$_}||=$a[$_]+$s{$g-1}for
    grep$a[$_]*!$s{$_},$g+$r,$g-!!($g%$r),$g-$r*($g>=$r),++$g*!!($g
    %$r);($g)=sort{$u{$a}-$u{$b}}keys%u;$s{$g}=delete$u{$g}}@a}
    
  3. or download this
    1       push @a,/./g;
    2       $r||=@a
    ...
    13              $s{$g}=delete$u{$g}
    14          }@a
    15      }