From 39a14605bf95d9cff4c7f3fa5c1e87029b160594 Mon Sep 17 00:00:00 2001 From: Jihoon Lee Date: Sat, 6 Jul 2024 00:22:26 +0900 Subject: [PATCH] Add 29538.cpp --- 29xxx/29538.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 29xxx/29538.cpp diff --git a/29xxx/29538.cpp b/29xxx/29538.cpp new file mode 100644 index 00000000..82ed63b3 --- /dev/null +++ b/29xxx/29538.cpp @@ -0,0 +1,25 @@ +#include +#include +#include +#include +using namespace std; + +void solve(void) { + int m, n, a; cin >> m >> n >> a; + vector w(n); + for (int i=0; i> w[i]; + + if (a >= 1000) { + cout << "Impossible\n"; + } else { + cout << fixed << setprecision(7) << (a * (m + accumulate(w.begin(), w.end(), 0))) / (1000.0 - a); + } +} + +int main(void) { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + solve(); + return 0; +} \ No newline at end of file