If you can't figure out what the input file is supposed to look like, here are some samples:#!/usr/bin/perl do shift;{($t[$h],$*,$m)=@{$b{$m}{$t[$h]||0}};$h+=$*;$m?redo:die@t,$/}
%b=(1,{0,[0,1],1,[0,1,2]},2,{0,[0,1,3],1,[1,1,2]},3,{0,[1,-1,4],1,[1,1 ,3]},4,{0,[0,-1,5],1,[1,-1,4]},5,{0,[(1)x3],1,[1,-1,5]}),($m,@t)=(1)x7
|
|---|