#include using namespace std; // #include // using namespace atcoder; using ll =long long; typedef pair P; #define SORT(a) sort((a).begin(),(a).end()) #define REV(a) reverse((a).begin(),(a).end()) #define For(i, a, b) for(int i = (a) ; i < (b) ; ++i) #define rep(i, n) For(i, 0, n) #define debug(x) cerr << #x << " = " << (x) << endl; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } void coY() {cout <<"Yes"<> n; vector a(n); rep(i, n)cin>>a[i]; vector b(n); rep(i, n)cin>>b[i]; SORT(a); REV(a); SORT(b); vector v(n); rep(i,n) v[i] = i; ll M = 0; rep(i,n){ M += max(a[i] - b[i], 0); } ll ans = 0; do { ll tmp = 0; rep(i,n){ tmp += max(a[v[i]]-b[i],0); } if(tmp == M) ans++; } while (next_permutation(v.begin(), v.end())); cout << ans << endl; }