$L[$j]) { $first = $L[$j]; $index = $j; $temp = $R[$j]; } } if($last < $M - 1 - $R[$j]) { if($first > $M - 1 - $R[$j]) { $first = $M - 1 - $R[$j]; $index = $j; $temp = $M - 1 - $L[$j]; } } } } if($index >= 0) { $last = $temp; $flg++; $choice[$index] = 1; } else { break; } } $ans = 'YES'; if($flg < $N) $ans = 'NO'; print($ans); print("\n"); ?>