fork(1) download
  1. #!/usr/bin/perl -na
  2. $j=s/./0 x$&/ger;print+($j|$i.1x$_)=~s/\B/ /gr x($i.=0 x$_,$_)for@F
Success #stdin #stdout 0s 6044KB
stdin
1 2 3 1
stdout
1 0 0 0 0 0 00 1 1 0 0 0 00 1 1 0 0 0 00 0 0 1 1 1 00 0 0 1 1 1 00 0 0 1 1 1 00 0 0 0 0 0 1