/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>

#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
#define mp make_pair

using namespace std;

typedef long long int64;
typedef vector<int> vi;
typedef pair<int, int> ii;

class TaskE {
 public:
  int n;
  vector<int64> a;
  vector<int64> b;
  vector<int64> b0;
  vector<int64> b1;
  vector<int64> b2;

  int64 score(int left, int right) {
    int n = right - left - 1;
    assert(n >= 0);
    int64 res = a[right] * 2;
    res += n * (a[left] + a[right]);
    int o = n + left + 1;
    res -= (-(b2[right] - b2[left + 1]) + (b1[right] - b1[left + 1]) * (o + left) - (b0[right] - b0[left + 1]) * left * o) * 2;
    return res;
  }

  void solveOne(istream &in, ostream &out) {
    in >> n;
    a = vector<int64>(2 * n);
    b = vector<int64>(2 * n);
    vector<pair<int64, int>> items(n);
    for (int i = 0; i < n; ++i) {
      in >> a[i];
      a[i + n] = a[i];
      items[i].first = a[i];
      items[i].second = i;
    }
    for (int i = 0; i < n; ++i) {
      in >> b[i];
      b[i + n] = b[i];
    }
    b0.resize(b.size() + 1);
    b1.resize(b.size() + 1);
    b2.resize(b.size() + 1);
    for (int i = 0; i < b.size(); ++i) {
      b0[i + 1] = b0[i] + b[i];
      b1[i + 1] = b1[i] + b[i] * i;
      b2[i + 1] = b2[i] + b[i] * i * i;
    }
    sort(all(items), [](const auto& p, const auto& q) {
      return p.first > q.first;
    });
    int start = items[0].second;
    vector<int> taken;
    taken.push_back(start);
    int64 res = 0;
    for (int i = 1; i <= n; ++i) {
      int cur = start + i;
      while (taken.size() >= 2) {
        int first = taken[taken.size() - 2];
        int second = taken[taken.size() - 1];
        if (score(first, second) + score(second, cur) < score(first, cur)) {
          res -= score(first, second);
          taken.pop_back();
        } else {
          break;
        }
      }
      res += score(taken.back(), cur);
      taken.push_back(cur);
    }
    /*set<int> taken;
    int64 res = 0;
    for (const auto& p : items) {
      int at = p.second;
      if (taken.empty()) {
        taken.insert(at);
        res += score(at, at + n);
      } else {
        auto it = taken.lower_bound(at);
        int next;
        int prev;
        int we = at;
        if (it == taken.end()) {
          next = *taken.begin() + n;
        } else {
          next = *it;
        }
        if (it == taken.begin()) {
          prev = *taken.rbegin() - n;
          prev += n;
          we += n;
          next += n;
        } else {
          --it;
          prev = *it;
        }
        int64 delta = -score(prev, next) + score(prev, we) + score(we, next);
        if (delta >= 0) {
          res += delta;
          taken.insert(at);
        }
      }
    }*/
    printf("%.20f\n", res / (double) (2 * n));
  }

  void solve(std::istream &in, std::ostream &out) {
    out.precision(30);
    int nt = 1;
    for (int it = 0; it < nt; ++it) {
      solveOne(in, out);
    }
  }
};


int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  TaskE solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}


Measured memory_bytes: 22864