use POSIX qw/ceil/; my $h = ; my $k = ; print ceil($k / $h); print "\n";