#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define int long long #define P pair #define Graph vector> #define float long double #define rep(i,a,b) for(int i=(a);i<(b);++i) #define repi(itr,m) for(auto itr=(m).begin();itr!=(m).end();itr++) #define all(a) (a).begin(), (a).end() #define vi vector const int INF=100000000000000; vectordx4={-1,1,0,0}; vectordy4={0,0,-1,1}; vectordx8={-1,-1,-1,0,0,1,1,1}; vectordy8={-1,0,1,-1,1,-1,0,1}; template inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false));} template inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false));} int solve(){ int n; cin>>n; float ans=0; float cnt=0; vectora(n); vectorb(n); rep(i,0,n){cin>>a[i];} rep(i,0,n){cin>>b[i];} sort(all(a)); sort(all(b)); do { do { int num=0; cnt++; rep(i,0,n){ if(a[i]>b[i]){ num++; } } if(num*2>n){ ans++; } } while (next_permutation(all(b))); } while (next_permutation(all(a))); cout<