func_code_string: #include <bits/stdc++.h>   using namespace std;   int N, K;   long double ans, s;   int R[1000010], data[100010];   int v[1000010], c[1000010];   int STv[20][1000010], STc[20][1000010];   int calcv(int l, int r) {     int delta = r - l + 1;     int t = log(delta) / log(2);     return max(STv[t][l], STv[t][r - (1 << t) + 1]);   }   int calcc(int l, int r) {     int delta = r - l + 1;     int t = log(delta) / log(2);     return min(STc[t][l], STc[t][r - (1 << t) + 1]);   }   int main() {     scanf( %d%d , &N, &K);     for (int i = 1; i <= N; i++) scanf( %d , &v[i]), v[i] *= 100;     for (int i = 1; i <= N; i++) scanf( %d , &c[i]);     for (int i = 1; i <= N; i++) STv[0][i] = v[i], STc[0][i] = c[i];     for (int step = 1; step <= 19; step++)       for (int i = 1; i <= N; i++) {         STv[step][i] = STv[step - 1][i];         STc[step][i] = STc[step - 1][i];         int x = i + (1 << (step - 1));         if (x <= N) {           STv[step][i] = max(STv[step][i], STv[step - 1][x]);           STc[step][i] = min(STc[step][i], STc[step - 1][x]);         }       }     R[0] = 1;     for (int l = 1; l <= N; l++) {       R[l] = R[l - 1];       for (int r = max(R[l - 1], l); r <= N; r++)         if (calcv(l, r) <= calcc(l, r))           R[l] = r;         else           break;     }     for (int l = 1; l <= N; l++) {       if (R[l] < N && min(calcv(l, R[l]), calcc(l, R[l])) <                           min(calcv(l, R[l] + 1), calcc(l, R[l] + 1)))         R[l]++;       data[l] = min(calcv(l, R[l]), calcc(l, R[l]));     }     sort(data + 1, data + N + 1);     s = double(K) / (N - K + 1);     for (int l = 1; l + K - 1 <= N; l++) {       s = s / (N - l + 1) * (N - K - l + 2);       ans = ans + data[l] * s;     }     printf( %.15lf , double(ans));   }   