Rounding P92613


Statement
 

pdf   zip

thehtml

Write a program that reads a real number x≥0 and prints ⌊ x ⌋ (the floor of x), ⌈ x ⌉ (the ceiling of x), and the rounding of x.

Input

Input consists of a real number x ≥ 0.

Output

Print the floor of x, the ceiling of x, and the integer number closer to x (⌈ x ⌉ if there is a tie).

Public test cases
  • Input

    4.5
    

    Output

    4 5 5
    
  • Input

    0.999999
    

    Output

    0 1 1
    
  • Input

    123345.33
    

    Output

    123345 123346 123345
    
  • Input

    1500000000
    

    Output

    1500000000 1500000000 1500000000
    
  • Information
    Author
    Jordi Petit
    Language
    English
    Translator
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Pascal Python
    User solutions
    C C++ Java Lua Perl PHP Python Ruby Rust