/* -*- coding: utf-8 -*- * * 553.cc: No.553 AlphaCoder Rating - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_N = 100; const int INF = 1 << 30; /* typedef */ /* global variables */ int rps[MAX_N]; /* subroutines */ inline double sumexp(double p, int n) { // sum_(i=1..n) p^i return p * (1.0 - pow(p, (double)n)) / (1.0 - p); } inline double sumexpinf(double p) { // sum_(i=1..inf) p^i return p / (1.0 - p); } inline double F(int n) { return (n >= INF) ? sqrt(sumexpinf(0.81)) / sumexpinf(0.9) : sqrt(sumexp(0.81, n)) / sumexp(0.9, n); } inline double f(int n) { return (F(n) - F(INF)) / (F(1) - F(INF)) * 1200; } inline double g(double x) { return pow(2.0, x / 800); } // y = 2.0^(x/800) -> x/800 = log2(y) -> x = log2(y) * 800; inline double invg(double x) { return log(x) / log(2.0) * 800; } double rat(int n) { double sum = 0.0, d = 0.9; for (int i = 0; i < n; i++, d *= 0.9) sum += g((double)rps[i]) * d; return invg(sum / sumexp(0.9, n)) - f(n); } /* main */ int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d", &rps[i]); double r = rat(n); printf("%d\n", (int)r); return 0; }