From c1db271f6b15ed0f42f8d84277225cb3cbf20223 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Sat, 2 Apr 2022 20:09:37 +0800 Subject: [PATCH] B - Get Closer https://atcoder.jp/contests/abc246/submissions/30633472 --- AtCoder/ABC246/B/B.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 AtCoder/ABC246/B/B.cpp diff --git a/AtCoder/ABC246/B/B.cpp b/AtCoder/ABC246/B/B.cpp new file mode 100644 index 00000000..67a92574 --- /dev/null +++ b/AtCoder/ABC246/B/B.cpp @@ -0,0 +1,21 @@ +#include +#include +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int a, b; +double c; + +int main() { + std::ios::sync_with_stdio(false); + + cin >> a >> b; + c = std::sqrt(std::pow(a, 2) + std::pow(b, 2)); + + cout << std::fixed << std::setprecision(12) << 1.0 * a / c << ' ' << std::fixed << std::setprecision(12) << 1.0 * b / c << endl; + + return 0; +}