my ($pocky, $bite) = split (/ /, <>); chomp ($pocky, $bite); my $loss = $bite * 2;#2人が同時にポッキーを食べるときになくなる長さ if($pocky<=$bite){ print "0\n"; } elsif($pocky % $loss == 0){ my $eat = ($pocky / $loss) - 1; $eat *= $bite; print "$eat\n"; }else{ my $remainder = $pocky % $loss; my $eat = ($pocky - $remainder) / $loss; $eat *= $bite; print "$eat\n"; }