#!/usr/bin/perl -na$j=s/./0 x$&/ger;print+($j|$i.1x$_)=~s/\B/ /gr x($i.=0 x$_,$_)for@F
1 2 3 1
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
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!