sub roundup { my ($n, $d) = @_; return ( int( $n / $d ) + 1 ) * $d; }