Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- const int N = 1e5 + 5;
- int n;
- int a[N];
- void solve() {
- if(n == 1) {
- cout << a[1];
- return;
- }
- double ans = (double)(a[1] + a[2]) / 2.000000;
- for(int i = 3; i <= n; ++i) {
- ans = ((double)a[i] + ans) / 2.000000;
- }
- cout << fixed << setprecision(6) << ans << '\n';
- }
- int main() {
- #ifdef DN
- freopen("in.txt", "r", stdin);
- #endif
- freopen("COALESCE.inp", "r", stdin);
- freopen("COALESCE.out", "w", stdout);
- ios_base::sync_with_stdio(false);
- cin.tie(NULL); cout.tie(NULL);
- cin >> n;
- for(int i = 1; i <= n; ++i)
- cin >> a[i];
- sort(a + 1, a + n + 1);
- solve();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment