Skip to content

Commit

Permalink
Add 29538.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Jul 5, 2024
1 parent 984787b commit 39a1460
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions 29xxx/29538.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <iomanip>
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;

void solve(void) {
int m, n, a; cin >> m >> n >> a;
vector<int> w(n);
for (int i=0; i<n; i++) cin >> 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;
}

0 comments on commit 39a1460

Please sign in to comment.