#include <vector>
#include <algorithm>
#include <iostream>
#include <math.h>

int main () 
{
    int n=400000,  m=1000;  
    double x=0,y=0;
    double s=0;
    std::vector< double > shifts(n,0);


    #pragma omp parallel for 
    for (int j=0; j<n; j++) {

        double r=0.0;
        for (int i=0; i < m; i++){

            double rand_g1 = cos(i/double(m));
            double rand_g2 = sin(i/double(m));     

            x += rand_g1;
            y += rand_g2;
            r += sqrt(rand_g1*rand_g1 + rand_g2*rand_g2);
        }
        shifts[j] = r / m;
    }

    std::cout << *std::max_element( shifts.begin(), shifts.end() ) << std::endl;
}
