• + 0 comments
    <?php
    
    $handle = fopen ("php://stdin", "r");
    function isSatisfiable($c1, $c2, $h1, $h2){
        // Complete this function
        $cmin = min($c1, $c2);
        $cmax = max($c1, $c2);
        $hmin = min($h1, $h2);
        $hmax = max($h1, $h2);
        if($cmin<=$hmin && $cmin<=$hmax && $cmax<=$hmin && $cmax<=$hmax){
            if(($hmin-$cmin) >= 0)
                return 'YES';
            else
                return 'NO';
        }
        else
            return 'NO';
    }
    
    // Return "YES" if all four conditions can be satisfied, and "NO" otherwise
    fscanf($handle, "%d %d %d %d", $c1, $c2, $h1, $h2);
    $result = isSatisfiable($c1, $c2, $h1, $h2);
    echo $result . "\n";
    
    ?>