/* Author:zeke pass System Test! GET AC!! */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using ll = long long; using ld = long double; using namespace std; #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define all(x) (x).begin(),(x).end() #define rep3(var, min, max) for (ll (var) = (min); (var) < (max); ++(var)) #define repi3(var, min, max) for (ll (var) = (max) - 1; (var) + 1 > (min); --(var)) #define Mp(a,b) make_pair((a),(b)) #define F first #define S second #define Icin(s) ll (s);cin>>(s); #define Scin(s) ll (s);cin>>(s); templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b P; typedef vector V; typedef vector VV; typedef vector

VP; //ここから struct BipartiteMatching { vector< vector< int > > graph; vector< int > match, alive, used; int timestamp; BipartiteMatching(int n) : graph(n), alive(n, 1), used(n, 0), match(n, -1), timestamp(0) {} void add_edge(int u, int v) { graph[u].push_back(v); graph[v].push_back(u); } bool dfs(int idx) { used[idx] = timestamp; for(auto &to : graph[idx]) { int to_match = match[to]; if(alive[to] == 0) continue; if(to_match == -1 || (used[to_match] != timestamp && dfs(to_match))) { match[idx] = to; match[to] = idx; return true; } } return false; } int bipartite_matching() { int ret = 0; for(int i = 0; i < graph.size(); i++) { if(alive[i] == 0) continue; if(match[i] == -1) { ++timestamp; ret += dfs(i); } } return ret; } void output() { for(int i = 0; i < graph.size(); i++) { if(i < match[i]) { cout << i << "-" << match[i] << endl; } } } }; //BipartiteMatching(n) 頂点n個 //add_edge(s,t) //bipartite_matching()最大マッチング数 int main() { int n;cin>>n; V vec1(n); rep(i,n)cin>>vec1[i]; V vec2(n); rep(i,n)cin>>vec2[i]; sort(all(vec1)); sort(all(vec2)); ld c=0; int k=0; do{ sort(all(vec1)); do{ k++; int s=0; int e=0; rep(i,n){ if(vec1[i]>vec2[i])s++; else e++; } if(s>e)c++; }while(next_permutation(all(vec1))); }while(next_permutation(all(vec2))); cout<