For this Question: <i> No more Rick and Morty :D</i>

Tono and Solo, the small girls, are ready for the great <i> Super Small League</i>.

There are N participants for the league standing in a queue. Each player has an associated happiness H<sub>i</sub> and associated strength S<sub>i</sub>. Now, here's the selection procedure.

Both Tono and Solo take alternate turns. In a turn, the small girl can choose to either select the first player in the queue, doing this increases her happiness by H<sub>i</sub> and her team's strength by S<sub>i</sub>, or not select the first player in the queue, doing this makes the her sad and decreases her happiness by 1 and has no impact on the team's strength. 

Note: If a player is chosen, she is removed from the queue (Of course :P) and the selection process stops when the queue becomes empty.

The initial happiness of Tono and Solo are X and Y respectively.

Now, both Tono and Solo want to select their team so as to maximize their team's strength. Can you find the strength of their teams if their happiness should never fall below 0? 

As Tono is smaller, she goes first!The first line of the input contains three integers N, X, and Y denoting the number of participants, and the initial happiness of Tono and Solo respectively.
The next lines contains two integers H<sub>i</sub> and S<sub>i</sub>, the happiness received by taking the i-th player in the team, and the strength of the i-th player.

Constraints
1 <= N <= 150
0 <= X, Y, H<sub>i</sub> <= 10<sup>9</sup>
S<sub>i</sub> >= 0
Sum of S<sub>i</sub> of all players <= 150
Output two integers, the strength of Tono's and Solo's team.Sample Input 1
2 5 4
5 6
4 9

Sample Output 1
9 6

Sample Input 2
3 50 1
49 1
0 9
0 1

Sample Output 2
9 2, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d", &x)
#define sz(v) (int) v.size()
#define pr(v) For(i, 0, sz(v)) {cout<<v[i]<<" ";} cout<<endl;
#define slld(x) scanf("%lld", &x)
#define all(x) x.begin(), x.end()
#define For(i, st, en) for(ll i=st; i<en; i++)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define ll long long
#define ld long double
#define int long long
#define double long double
#define mp make_pair
#define F first
#define S second
typedef pair<int, int> pii;
typedef vector<int> vi;
#define pi 3.141592653589793238
const int MOD = 1e9+7;
const int INF = 1LL<<60;


const int N = 2e5+5;

// it's swapnil07 ;)
 
#ifdef SWAPNIL07
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
int begtime = clock();
#define end_routine() cout << "\n\nTime elapsed: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define endl '\n'
#define trace(...)
#define end_routine()
#endif


int dp[304][305];
int s[305],sum[304];ll r[305];

void solve(){
    int n; ll a,b;
    cin>>n>>a>>b;

    int tot = 0;

    for(int i=1;i<=n;i++) {
        cin>>r[i]>>s[i];
        tot += s[i];
    }

    assert(tot <= 150);

    sum[n+1]=0;
    for(int i=n; i>=1; i--)sum[i]=sum[i+1]+s[i];
    for(int j=s[n]+1; j<=300; j++)dp[n][j]=INF;
    for(int j=0; j<=s[n]; j++)dp[n][j]=-INF;

    for(int i=n-1; i>=1; i--)
    {
        for(int j=300; j>=0; j--)
        {
            if(j>sum[i]){
                dp[i][j]=INF;
                continue;
            }

            dp[i][j]=dp[i][j+1];

            int u=sum[i]-j;
            
            dp[i][j]=min(dp[i][j],-r[i]-dp[i+1][u+1]+1);

            if(j <= sum[i+1])
            {
                dp[i][j]=min(dp[i][j], max(1LL, dp[i+1][j]+r[i]+1LL));
            }
        }
    }
    for(int j=sum[1];j>=0;j--)if(dp[1][j]<=a-b){cout<<j<<" "<<sum[1]-j<<endl;return;}
}


signed main()
{
    fast
    #ifdef SWAPNIL07
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    int t=1; 
    // cin>>t;
    while(t--){
        solve();
        cout<<"\n";
    }
    return 0;
}

, In this Programming Language: C++, Now tell me if this Code is compilable or not?