sub c{ ($t,$p,@r)=@_;@p=map{int($_*100)}@$p; $t=int($t*100);while($v=pop@p and$t>0 ){while($t>=$v){push@r,$v/100;$t-=$v; }}@r }