Intervals (2) P56559


Statement
 

pdf   zip

thehtml

Write a program that, given two intervals, tells if one is inside the other.

Input

Input consists of four integer numbers a1, b1, a2, b2 that represent the intervals [a1,b1] and [a2,b2]. Assume a1b1 and a2b2.

Output

Print ‘=’ if the intervals are equal, ‘1’ if the first is inside the second (but they are not equal), ‘2’ if the second is inside the first (but they are not equal), or ‘?’ otherwise.

Public test cases
  • Input

    20 30   10 40
    

    Output

    1
    
  • Input

    10 20   10 20
    

    Output

    =
    
  • Input

    20 30   10 20
    

    Output

    ?
    
  • Input

    10 20   30 40
    

    Output

    ?
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Python
    User solutions
    C C++ Java PHP Python Rust