use strict; use warnings; use utf8; use List::Util qw(max); use List::Util qw(min); my $input = ; chomp($input); my @arr = split(/ /, $input); my $a = $arr[0]; my $b = $arr[1]; my $bigger = max ($a, $b); my $smaller = min ($a, $b); my $ans = 0; if ($bigger == $smaller){ $ans = sqrt($bigger**2 + $smaller**2); print "$ans\n"; }else{ $ans = sqrt($bigger**2 - $smaller**2); print "$ans\n"; }