#include using namespace std; #include using namespace atcoder; //using mint = static_modint<998244353>; //using mint = modint; using mint = static_modint<1000000007>; using vm = vector; using vvm = vector; ostream &operator<<(ostream &o,const mint &m){cout<; using vvl = vector; using pl = pair; using vp = vector; #define rep(i,n) for(ll i=0;i<(ll)(n);++i) #define reps(i,s,n) for(ll i=(s);i<(ll)(n);++i) #define rep1(i,n) for(ll i=1;i<=(ll)(n);++i) #define chmin(x,y) x=min(x,y) #define chmax(x,y) x=max(x,y) #define fi first #define se second #define pb push_back #define eb emplace_back const long long INF = 1e18; #ifdef DEBUG #include #endif int main(){ #ifdef DEBUG cout << "--- Input ---" << endl; #endif ll N;cin>>N; vl A(N),B(N); rep(i,N)cin>>A.at(i); rep(i,N)cin>>B.at(i); sort(A.begin(),A.end()); sort(B.begin(),B.end()); #ifdef DEBUG cout << "--- Logic ---" << endl; #endif ll a=0,n=0; do{ do{ ll p=0; rep(i,N){ if(A.at(i)>B.at(i))++p; } if(p>N/2)++a; ++n; }while(next_permutation(B.begin(),B.end())); }while(next_permutation(A.begin(),A.end())); #ifdef DEBUG cout<<"a="<