#include <bits/stdc++.h>

#define all(x) (x).begin(), (x).end()
#define itn int
#define make_unique(x) sort((x).begin(), (x).end()); (x).erase(unique((x).begin(), (x).end()), (x).end())

using namespace std;

inline int nxt() {
	int x;
	scanf("%d", &x);
	return x;
}

void solve() {
	int n = nxt();
	vector<int> a(n), b(n);
	generate(all(a), nxt);
	generate(all(b), nxt);
	long long sum = accumulate(all(b), 0ll);
	vector<int> ar[2];
	for (int i = 0; i < n; ++i) {
		ar[i % 2].push_back(a[i] - b[i]);
	}
	sort(all(ar[0]));
	sort(all(ar[1]));
	reverse(all(ar[0]));
	reverse(all(ar[1]));

	long long ans = sum;
	for (int i = 0; i < n / 2; ++i) {
		sum += ar[0][i] + ar[1][i];
		ans = max(ans, sum);
	}
	cout << ans << "\n";
}

int main() {
	int t = 1; // nxt();
	while (t--) {
		solve();
	}

	return 0;
}

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

int main() {
	long long n,m,i,j,ans,cur,res,mod=1000000007;
	cin >> n;
	vector<long long> a(n);
	vector<vector<long long>> dp(n,vector<long long>(2,0));
	for(i=0; i<n; i++){
		cin >> a[i];
	}
	sort(a.begin(),a.end());
	cur=a[n/2];
	for(i=0; i<n; i++){
		a[i]*=2;
	}
	ans=0;
	for(i=0; i<n; i++){
		ans+=abs(a[i]-2*cur)+a[i];
	}
	//cout << cur << endl;
	//cout << ans << endl;
	double ans2=ans/(4.0*n);
	cout << setprecision(10);
	cout << ans2 << endl;
	return 0;
}