QOJ.ac

QOJ

Süre Sınırı: 1 s Bellek Sınırı: 256 MB Toplam puan: 100

#3219. Manhattan

İstatistikler

在 Manhattan,對每個整數 $i$,都有街道 $x = i$ 和 $y = i$。已知 Snuke 的家和 Smeke 的家都位於街道上,且兩家的歐幾里得距離恰好為 $d$。計算沿街道行走時,兩家之間距離的最大可能值。

輸入格式

輸入包含一個數 $d$。

  • $0 < d \le 10$

  • $d$ 的小數點後恰好有三位數字。

輸出格式

輸出答案。如果答案的絕對誤差或相對誤差不超過 $10^{-9}$,就會被視為正確。

範例

輸入格式 1

1.000

輸出格式 1

2.000000000000

輸入格式 2

2.345

輸出格式 2

3.316330803765

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.