From e9d383c2417126ed833727fc5bcecbed7cfdcd4f Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Wed, 30 Jun 2021 08:17:02 +0800 Subject: [PATCH] =?UTF-8?q?P5082=20=E6=88=90=E7=BB=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R52203603 --- Luogu/problem/P5082/P5082.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Luogu/problem/P5082/P5082.cpp diff --git a/Luogu/problem/P5082/P5082.cpp b/Luogu/problem/P5082/P5082.cpp new file mode 100644 index 00000000..5578535f --- /dev/null +++ b/Luogu/problem/P5082/P5082.cpp @@ -0,0 +1,21 @@ +#include + +using namespace std; + +long long n, a[10000005], b[10000005], c[10000005], a1, b1, c1; + +int main() { + cin >> n; + for (int i = 0; i < n; i++) { + cin >> a[i]; + a1 += a[i]; + } + for (int i = 0; i < n; i++) { + cin >> b[i]; + c[i] = a[i] - b[i]; + b1 += b[i]; + c1 += c[i]; + } + cout << fixed << setprecision(6) << 1.00 * (a1 * 3 - b1 * 2) / c1 << endl; + return 0; +}