sub part{ my( $n, $m ) = @_; my @parts = (int( $n / $m )) x $m; $n -= $_ for @parts; my $i =0; $parts[ $i++ ]++ while $n--; return @parts; }