#include #define _GLIBCXX_DEBUG #define all(v) (v).begin(),(v).end() using namespace std; using ll=long long; using pii=pair; using vi=vector; using vii=vector>; const ll LINF=1LL<<60; const int INF=1<<29; const int MOD=1e9+7; int main(){ int N; cin >> N; vi a(N), b(N); for(auto &x : a) cin >> x; for(auto &x : b) cin >> x; vi ord1(N), ord2(N); for(int i=0; i b[ord2[i]]) k++; } if(k > N-k) win++; }while(next_permutation(all(ord2))); }while(next_permutation(all(ord1))); cout << fixed << setprecision(4) << (double)win/cnt << endl; return 0; }