use strict; use warnings; use POSIX 'floor'; my $n = <>; chomp $n; for (my $i = 0; $i < $n; $i++) { my ($a, $b) = split /[ \n]/, <>; my $c = sqrt($a) + sqrt($b); print floor($c) + 1, "\n"; }