7 my @pl1 = <> =~ /^(\d+)$/gxms;
8 my @pl2 = <> =~ /^(\d+)$/gxms;
10 print "sum=", play(\@pl1, \@pl2), "\n";
19 while (@pl1 && @pl2) {
20 my $conf = join('|', @pl1, "#", @pl2);
27 if ($p1 <= @pl1 && $p2 <= @pl2) {
28 my @sub1 = @pl1[0 .. $p1-1];
29 my @sub2 = @pl2[0 .. $p2-1];
30 if (play(\@sub1, \@sub2) > 0) {
54 $sum += +$pl1[0] * @pl1;