#include using namespace std; typedef long long ll; #define REP(i,n) for(ll i=0; i #define VP vector> #define VPP vector>> #define VLL vector #define VVI vector> #define VVLL vector> #define VC vector #define VS vector #define VVC vector> #define VB vector #define VVB vector> #define fore(i,a) for(auto &i:a) typedef pair P; template using min_priority_queue = priority_queue, greater>; const int INF = 1 << 29; const ll INFL = 1LL << 60; const ll mod = 1000000007; int main() { int n; cin >> n; VI a(n), b(n); REP(i, n)cin >> a[i]; REP(i, n)cin >> b[i]; sort(ALL(a)); sort(ALL(b)); double win = 0; double lose = 0; do { do { int c = 0; int d = 0; REP(i, n) { if (a[i] > b[i])c++; else d++; } if (c > d)win++; lose++; } while (next_permutation(ALL(b))); } while (next_permutation(ALL(a))); cout << fixed << setprecision(15) << win / lose << endl; }