#include #include #include using namespace std; int main(){ int n; cin >> n; vector a(n),b(n),ind(n); for(auto &x : a) cin >> x; for(auto &x : b) cin >> x; for(int i=0;i < n;i++) ind[i] = i; int all = 0,win = 0; do{ int aa = 0; for(int i=0;i < n;i++){ if(a[ind[i]] > b[i]) aa++; else aa--; } all++; if(aa > 0) win++; }while(next_permutation(ind.begin(),ind.end())); double ans = (double)win/(double)all; cout << ans << endl; return 0; }