#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <climits>
#include <cassert>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <algorithm>
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define pb push_back
using namespace std;
long double getWinProbability(long double ra, long double rb) {
return 1.0 / (1.0 + pow((long double) 10.0, (rb - ra) / 400.0));
}
long double aggregateRatings(vector<long double> teamRatings)
{
long double left = 1;
long double right = 1E4;
for (int tt = 0; tt < 100; tt++) {
long double r = (left + right) / 2.0;
long double rWinsProbability = 1.0;
forn(i, teamRatings.size())
rWinsProbability *= getWinProbability(r, teamRatings[i]);
long double rating = log10(1 / (rWinsProbability) - 1) * 400 + r;
if (rating > r)
left = r;
else
right = r;
}
return (left + right) / 2.0;
}
int main(int argc, char* argv[])
{
vector<long double> SpbSU_Base;
SpbSU_Base.pb(2765); // aid
SpbSU_Base.pb(2739); // ershov.stanislav
SpbSU_Base.pb(2551); // -XraY-
vector<long double> LatviaU;
LatviaU.pb(2904); //Alex_2oo8
LatviaU.pb(2148); //Pakalns
LatviaU.pb(1919); //A_Le_K
vector<long double> HSE1;
HSE1.pb(2998); //Um_nik
HSE1.pb(2055); //WYOCMWYH
// HSE1.pb(???); //Vadim Kalashnikov
//@jinotega3000
vector<long double> Jinotega;
Jinotega.pb(2741); //zemen
Jinotega.pb(2721); //ifsmirnov
Jinotega.pb(2506); //Arterm
vector<long double> ITMO1;
ITMO1.pb(2762); //izban
ITMO1.pb(2550); //enot.1.10
ITMO1.pb(2545); //Belonogov
vector<long double> PermSU;
PermSU.pb(2650); //I_love_Tanya_Romanova
PermSU.pb(2576); //mmaxio
PermSU.pb(2411); //KuchumovIlya
vector<long double> SaratovSU;
SaratovSU.pb(2537); //HellKitsune
SaratovSU.pb(2485); //dans
SaratovSU.pb(2349); //IlyaLos
vector<long double> ITMO2;
ITMO2.pb(2450); //BudAlNik
ITMO2.pb(2422); //YakutovDmitriy
ITMO2.pb(2413); //SpyCheese
vector<long double> BSUIR;
BSUIR.pb(2571); //netman
BSUIR.pb(2318); //andrew.volchek
BSUIR.pb(2247); //teleport
vector<long double> SpbSU3;
SpbSU3.pb(2474); //Kaban-5
SpbSU3.pb(2431); //pavel.savchenkov
SpbSU3.pb(2226); // tunyash
vector<long double> UralFU;
UralFU.pb(2438); //Tinsane
UralFU.pb(2363); //kb.
UralFU.pb(2262); // KungA
// 2900+
printf("HSE#1 %.10lf\n", double(aggregateRatings(HSE1)));
printf("SpbSU Base %.10lf\n", double(aggregateRatings(SpbSU_Base)));
printf("Jinotega %.10lf\n", double(aggregateRatings(Jinotega)));
printf("Latvia U 1 %.10lf\n", double(aggregateRatings(LatviaU)));
// 2800+
printf("ITMO 1 %.10lf\n", double(aggregateRatings(ITMO1)));
printf("PermSU %.10lf\n", double(aggregateRatings(PermSU)));
// 2700+
printf("Saratov SU %.10lf\n", double(aggregateRatings(SaratovSU)));
// 2600+
printf("ITMO 2 %.10lf\n", double(aggregateRatings(ITMO2)));
printf("B SUIR %.10lf\n", double(aggregateRatings(BSUIR)));
printf("SpbSU 3 %.10lf\n", double(aggregateRatings(SpbSU3)));
// 2500+
printf("UralFU Ch. %.10lf\n", double(aggregateRatings(UralFU)));
return 0;
}