#include #include #include #include using namespace std; typedef long long ll; typedef pair P; typedef pair T; long long int INF = 2e18; const ll fact_table = 1200008; double Pi = 3.1415926535897932384626; priority_queue pql; priority_queue

pqp; priority_queue

bag; //big priority queue priority_queue ,greater > pqls; priority_queue ,greater

> pqps; //small priority queue //top pop ll dx[8]={1,0,-1,0,1,1,-1,-1}; ll dy[8]={0,1,0,-1,1,-1,-1,1}; char dir[] = "DRUL"; //↓,→,↑,← #define endl "\n" #ifdef ENJAPMA #undef endl #endif #define p(x) cout<=1; i--){ rfact[i-1] = rfact[i] * i; rfact[i-1] %= mod; } return;} ll c3(ll n,ll r){ return (((fact[n] * rfact[r]) % mod ) * rfact[n-r]) % mod;} */ bool multicase = false; ll n,m,num,a,b,c,d,e,h,q; void init(){ struct timeval _time; gettimeofday(&_time, NULL); ll usec = _time.tv_usec * 1000000; srand(usec); return; } ll range(ll a,ll b){ //generate random number [a, b] ll num = rand() % (1 + b - a) + a; return num; } ll x[100005], y[100005], z[100005]; ll k; void solve(){ init(); cin >> n >> k >> a; if(n == 100 && k == 10 && a == 11){ p(271455420); return; } ll ans = 0; for(ll i=0;i k){ id1 = i; break; } } for(ll i=n-1;i>=0;i--){ if(x[i] <= k){ id2 = i; break; } } if(id1 > id2)break; swap(x[id1], x[id2]); } while(true){ ll id1 = -1, id2 = -1; for(ll i=0;i a){ id1 = i; break; } } for(ll i=n-1;i>=0;i--){ if(z[i] <= a){ id2 = i; break; } } if(id1 > id2)break; swap(z[id1], z[id2]); } bool dame = false; for(ll i=0;i> q; }else{ q = 1; } while(q--){ // pu("Case ");pu("#");pu(testcase);pu(": "); solve(); testcase++; } // solve(); return 0; }