Manhattan

Interview

Time limit1sMemory limit512 MB

Summary
Given the Euclidean distance between two grid-aligned houses, find the maximum Manhattan distance achievable between them.
Level

Easy3 of 10

Topics
Geometry, Math, Implementation
Solved
No attempts yet

Problem

In Manhattan, there are streets x=ix = i and y=iy = i for every integer ii. Both Snuke's house and Smeke's house lie on streets, and the Euclidean distance between them is exactly dd. Find the largest possible distance between their houses when they travel along streets.

Input

The input consists of a single number dd.

  • 0<d≤100 < d \le 10
  • dd has exactly three digits after the decimal point.

Output

Print the answer. The answer is considered correct if its absolute or relative error is at most 10−910^{-9}.

Examples2

  1. Example 1

    Input
    1.000
    
    Expected output
    2.000000000000
    
  2. Example 2

    Input
    2.345
    
    Expected output
    3.316330803765