SRM462 Div2 Easy(250) Archery
#include <vector> using namespace std; class Archery { public: double expectedPoints( int N, vector <int> ringPoints ); }; double Archery::expectedPoints( int N, vector <int> ringPoints ) { double p = 0; for ( int i=0; i<=N; i++ ) p += (double)ringPoints[i] * ( (i+1)*(i+1) - i*i ) / ((N+1)*(N+1)); return p; }