sub c {($a,$c)=@_;@c=@$c;grep$_,map{$a>$_? &{sub{$a-=$_*($b=int($a/$_));"$b x $_"}}:""} reverse @c}