use strict; use warnings; use utf8; my ($A, $B) = ($ARGV[0], $ARGV[1]); my $max = 0; for (my $i = 0; $i <= $A; $i++) { for (my $j = 0; $j <= $B; $j++) { my $min = $i; if ($min > $j) { $min = $j; } if ($min > ($i^$j)) { $min = ($i^$j); } if ($min > $max) { $max = $min; } } } print "$max\n";