Language: C++

//#include <bits/stdc++.h>
using namespace std;

double e(int x) {
    return = x*(x+1)/2.0/x;
}

int main() {
    int N, K;
    cin >> N >> K;

    vector<int> v(N);
    vector<double> ev(N);
    for (int i = 0; i < N; ++i) {
        cin >> v[i];
        ev[i] = e(v[i]);
    }

    double ans = 0;
    for (int i = 0; i < N - (K - 1); ++i) {
        double sum = 0;
        for (int j = i; j < i + K; ++j) {
            sum += ev[j];
        }
        ans = max(ans, sum);
    }
    cout << std::fixed << std::setprecision(12) << ans << endl;
}

Compiler output:
a.cc: In function 'double e(int)':
a.cc:5:12: error: expected primary-expression before '=' token
    5 |     return = x*(x+1)/2.0/x;
      |            ^
a.cc: In function 'int main()':
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin >> N >> K;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | //#include <bits/stdc++.h>
a.cc:12:5: error: 'vector' was not declared in this scope
   12 |     vector<int> v(N);
      |     ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | //#include <bits/stdc++.h>
a.cc:12:12: error: expected primary-expression before 'int'
   12 |     vector<int> v(N);
      |            ^~~
a.cc:13:12: error: expected primary-expression before 'double'
   13 |     vector<double> ev(N);
      |            ^~~~~~
a.cc:15:16: error: 'v' was not declared in this scope
   15 |         cin >> v[i];
      |                ^
a.cc:16:9: error: 'ev' was not declared in this scope; did you mean 'e'?
   16 |         ev[i] = e(v[i]);
      |         ^~
      |         e
a.cc:23:20: error: 'ev' was not declared in this scope; did you mean 'e'?
   23 |             sum += ev[j];
      |                    ^~
      |                    e
a.cc:25:15: error: 'max' was not declared in this scope
   25 |         ans = max(ans, sum);
      |               ^~~
a.cc:27:5: error: 'cout' was not declared in this scope
   27 |     cout << std::fixed << std::setprecision(12) << ans << endl;
      |     ^~~~
a.cc:27:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:18: error: 'fixed' is not a member of 'std'
   27 |     cout << std::fixed << std::setprecision(12) << ans << endl;
      |                  ^~~~~
a.cc:1:1: note: 'std::fixed' is defined in header '<ios>'; this is probably fixable by adding '#include <ios>'
  +++ |+#include <ios>
    1 | //#include <bits/stdc++.h>
a.cc:27:32: error: 'setprecision' is not a member of 'std'
   27 |     cout << std::fixed << std::setprecision(12) << ans << endl;
      |                                ^~~~~~~~~~~~
a.cc:1:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
  +++ |+#include <iomanip>
    1 | //#include <bits/stdc++.h>
a.cc:27:59: error: 'endl' was not declared in this scope
   27 |     cout << std::fixed << std::setprecision(12) << ans << endl;
      |                                                           ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | //#include <bits/stdc++.h>