ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<map>
using namespace std;
long long summ(vector<int> & v){

    long long sum = 0;
    for(int i=0;i<v.size();i++){
        sum+=v[i];
    }
    return abs(sum);
}
int main(){
    int t;
    cin>>t;
    for(int i=1;i<=t;i++){
        int n;
        cin>>n;
        vector<int> v(n);
        long long maxsum = 0;
        for(int i=0;i<n;i++){
            cin>>v[i];
        }
        for(int i=0;i<n;i++){
            maxsum+=v[i];
        }
        while(v.size()>1){
            vector<int> newv;
            for(int i=0;i<v.size()-1;i++){
                newv.push_back(v[i+1]-v[i]);
            }
            v = newv;

            maxsum = max(maxsum,summ(v));
        }
        cout<<maxsum<<endl;
    }
}

Submission (verdict: Accepted):
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<map>
using namespace std;
long long summ(vector<long long> & v){

    long long sum = 0;
    for(int i=0;i<v.size();i++){
        sum+=v[i];
    }
    return abs(sum);
}
int main(){
    int t;
    cin>>t;
    for(int i=1;i<=t;i++){
        long long n;
        cin>>n;
        vector<long long> v(n);
        long long maxsum = 0;
        for(int i=0;i<n;i++){
            cin>>v[i];
        }
        for(int i=0;i<n;i++){
            maxsum+=v[i];
        }
        while(v.size()>1){
            vector<long long> newv;
            for(int i=0;i<v.size()-1;i++){
                newv.push_back(v[i+1]-v[i]);
            }
            v = newv;

            maxsum = max(maxsum,summ(v));
        }
        cout<<maxsum<<endl;
    }
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Compilation error):
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<map>
using namespace std;
int summ(vector<int> & v){

    int sum = 0;
    for(int i=0;i<v.size();i++){
        sum+=v[i];
    }
    return abs(sum);
}
int main(){
    int t;
    cin>>t;
    for(int i=1;i<=t;i++){
        int n;
        cin>>n;
        vector<long long> v(n);
        int maxsum = 0;
        for(int i=0;i<n;i++){
            cin>>v[i];
        }
        for(int i=0;i<n;i++){
            maxsum+=v[i];
        }
        while(v.size()>1){
            vector<long long> newv;
            for(int i=0;i<v.size()-1;i++){
                newv.push_back(v[i+1]-v[i]);
            }
            v = newv;

            maxsum = max(maxsum,summ(v));
        }
        cout<<maxsum<<endl;
    }
}

Submission (verdict: Wrong answer on test 2):
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<map>
using namespace std;
long long summ(vector<int> & v){

    long long sum = 0;
    for(int i=0;i<v.size();i++){
        sum+=v[i];
    }
    return abs(sum);
}
int main(){
    int t;
    cin>>t;
    for(int i=1;i<=t;i++){
        int n;
        cin>>n;
        vector<int> v(n);
        long long maxsum = 0;
        for(int i=0;i<n;i++){
            cin>>v[i];
        }
        for(int i=0;i<n;i++){
            maxsum+=v[i];
        }
        while(v.size()>1){
            vector<int> newv;
            for(int i=0;i<v.size()-1;i++){
                newv.push_back(v[i+1]-v[i]);
            }
            v = newv;

            maxsum = max(maxsum,summ(v));
        }
        cout<<maxsum<<endl;
    }
}
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)

Previous submission (verdict: Runtime error on test 4):
#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;
        vector<int> arr(n);
        int maxi=INT_MIN;
        for(int i=0;i<n;i++){
            cin>>arr[i];
            maxi=max(maxi,arr[i]);
        }
        vector<int> count(maxi+1,0);
        for(int num : arr){
            count[num]++;
        }
        sort(count.begin(),count.end());
        vector<int> nonzero;
        for(int i=0;i<maxi;i++){
            if(count[i]>0){
                nonzero.push_back(count[i]);
            }
        }
        int s=nonzero.size();
        int i=0;
        int j=0;
        int sum=0;
        while(sum<=k && i<s){
            if(sum+nonzero[i]<=k){
                j++;
                sum+=nonzero[i];
            }
            i++;
        }
        cout<<s-j+1<<endl;
    }
    return 0;
}

Submission (verdict: Time limit exceeded on test 14):
#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;
        vector<int> arr(n);
        for(int i=0;i<n;i++){
            cin>>arr[i];   
        }
        unordered_map<int,int> freq;
        for(int num: arr){
            freq[num]++;
        }
        vector<int> counts;
        for(auto &entry: freq){
            counts.push_back(entry.second);
        }
        sort(counts.begin(),counts.end());
        int sum=0;
        int i=0;
        for(int count: counts){
            if(sum+count<=k){
                i++;
                sum+=count;
            }
            else{
                break;
            }
        }
        int ans=counts.size()-i;
        if(ans!=0){
            cout<<ans<<endl;
        }
        else{
            cout<<1<<endl;
        }
    }
    return 0;
}
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)


Submission (verdict: Runtime error on test 4):
#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;
        vector<int> arr(n);
        int maxi=INT_MIN;
        for(int i=0;i<n;i++){
            cin>>arr[i];
            maxi=max(maxi,arr[i]);
        }
        vector<int> count(maxi+1,0);
        for(int num : arr){
            count[num]++;
        }
        sort(count.begin(),count.end());
        vector<int> nonzero;
        for(int i=0;i<maxi;i++){
            if(count[i]>0){
                nonzero.push_back(count[i]);
            }
        }
        int s=nonzero.size();
        int i=0;
        int j=0;
        int sum=0;
        while(sum<=k && i<s){
            if(sum+nonzero[i]<=k){
                j++;
                sum+=nonzero[i];
            }
            i++;
        }
        cout<<s-j+1<<endl;
    }
    return 0;
}
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)

Previous submission (verdict: Time limit exceeded on test 14):
#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;
        vector<int> arr(n);
        for(int i=0;i<n;i++){
            cin>>arr[i];   
        }
        unordered_map<int,int> freq;
        for(int num: arr){
            freq[num]++;
        }
        vector<int> counts;
        for(auto &entry: freq){
            counts.push_back(entry.second);
        }
        sort(counts.begin(),counts.end());
        long long sum=0;
        int i=0;
        for(int count: counts){
            if(sum+count<=k){
                i++;
                sum+=count;
            }
            else{
                break;
            }
        }
        int ans=counts.size()-i;
        if(ans>0){
            cout<<ans<<endl;
        }
        else{
            cout<<1<<endl;
        }
    }
    return 0;
}


Submission (verdict: Time limit exceeded on test 14):
#include <bits/stdc++.h>
using namespace std;
int main() {
    int t;
    cin>>t;
    while(t--){
        int n, k;
        cin >> n >> k;
        vector<int> arr(n);
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }

        unordered_map<int, int> freq;
        for(int num : arr){
            freq[num]++;
        }

        priority_queue<int, vector<int>, greater<int>> minHeap;
        for(auto &entry : freq){
            minHeap.push(entry.second);
        }

        int sum=0,removed=0;
        while(!minHeap.empty() && sum + minHeap.top()<=k){
            sum+=minHeap.top();
            minHeap.pop();
            removed++;
        }
        int ans = minHeap.size();
        cout << (ans > 0 ? ans : 1) << endl;
    }
    return 0;
}
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)

Previous submission (verdict: Time limit exceeded on test 14):
#include <bits/stdc++.h>
using namespace std;
int main() {
    int t;
    cin>>t;
    while(t--){
        int n, k;
        cin >> n >> k;
        vector<int> arr(n);
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }

        unordered_map<int, int> freq;
        for(int num : arr){
            freq[num]++;
        }

        priority_queue<int, vector<int>, greater<int>> minHeap;
        for(auto &entry : freq){
            minHeap.push(entry.second);
        }

        int sum=0,removed=0;
        while(!minHeap.empty() && sum + minHeap.top()<=k){
            sum+=minHeap.top();
            minHeap.pop();
            removed++;
        }
        int ans = minHeap.size();
        cout << (ans > 0 ? ans : 1) << endl;
    }
    return 0;
}


Submission (verdict: Accepted):
#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;
        vector<int> arr(n);
        for(int i=0;i<n;i++){
            cin>>arr[i];   
        }
        map<int,int> freq;
        for(int num: arr){
            freq[num]++;
        }
        vector<int> counts;
        for(auto &entry: freq){
            counts.push_back(entry.second);
        }
        sort(counts.begin(),counts.end());
        long long sum=0;
        int i=0;
        for(int count: counts){
            if(sum+count<=k){
                i++;
                sum+=count;
            }
            else{
                break;
            }
        }
        int ans=counts.size()-i;
        if(ans>0){
            cout<<ans<<endl;
        }
        else{
            cout<<1<<endl;
        }
    }
    return 0;
}
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)

Previous submission (verdict: Time limit exceeded on test 14):
#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;
        vector<int> arr(n);
        for(int i=0;i<n;i++){
            cin>>arr[i];   
        }
        unordered_map<int,int> freq;
        for(int num: arr){
            freq[num]++;
        }
        vector<int> counts;
        for(auto &entry: freq){
            counts.push_back(entry.second);
        }
        sort(counts.begin(),counts.end());
        int sum=0;
        int i=0;
        for(int count: counts){
            if(sum+count<=k){
                i++;
                sum+=count;
            }
            else{
                break;
            }
        }
        int ans=counts.size()-i;
        if(ans!=0){
            cout<<ans<<endl;
        }
        else{
            cout<<1<<endl;
        }
    }
    return 0;
}

Submission (verdict: Time limit exceeded on test 14):
#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;
        vector<int> arr(n);
        for(int i=0;i<n;i++){
            cin>>arr[i];   
        }
        unordered_map<int,int> freq;
        for(int num: arr){
            freq[num]++;
        }
        vector<int> counts;
        for(auto &entry: freq){
            counts.push_back(entry.second);
        }
        sort(counts.begin(),counts.end());
        long long sum=0;
        int i=0;
        for(int count: counts){
            if(sum+count<=k){
                i++;
                sum+=count;
            }
            else{
                break;
            }
        }
        int ans=counts.size()-i;
        if(ans>0){
            cout<<ans<<endl;
        }
        else{
            cout<<1<<endl;
        }
    }
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Time limit exceeded on test 2):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll sum(vector<ll> &nums){
    ll count = 0;
    for(int i=0 ; i<nums.size() ; i++){
        count += nums[i];
    }
    return count;
}

void solve(vector<ll> &str,ll &ans){
    // base case
    if(str.size()==1){
        ans = max(ans,str[0]);
        return;
    }
    
    ans = max(ans,sum(str));
    
    vector<ll> diff1(str.size()-1);
    for(int i=0 ; i<str.size()-1 ; i++){
        diff1[i] = str[i+1] - str[i];
    }
    
    vector<ll> diff2(str.size()-1);
    for(int i=0 ; i<str.size()-1 ; i++){
        diff2[i] = (-1)*diff1[i];
    }
    
    solve(diff1,ans);
    solve(diff2,ans);
}

int main(){
    int t;
    cin>>t;
    
    while(t--){
        int n;
        cin>>n;
        
        vector<ll> str(n);
        for(int i=0 ; i<n ; i++){
            cin>>str[i];
        }
        
        if(str.size()==1){
            cout<<str[0]<<endl;
        }
        else{
            ll ans = 0;
            solve(str,ans);
            cout<<ans<<endl;
        } 
    }
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    int t;
    cin>>t;
    
    while(t--){
        int n;
        cin>>n;
        
        vector<ll> arr(n);
        for(int i=0 ; i<n ; i++){
            cin>>arr[i];
        }
        
        ll ans = -1e18;
        int p = n;
        for(int i=0 ; i<n ; i++){
            ll sum = 0;
            for(int i=0 ; i<p ; i++){
                sum += arr[i];
            }
            if(i==0) ans = max(ans,sum);
            else ans = max(ans,max(sum,(-sum)));
            for(int i=0 ; i<p-1 ; i++){
                arr[i] = arr[i+1]-arr[i];
            }
            p--;
        }
        cout<<ans<<endl;
    }
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Time limit exceeded on test 2):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll sum(vector<ll> &nums){
    ll count = 0;
    for(int i=0 ; i<nums.size() ; i++){
        count += nums[i];
    }
    return count;
}

void solve(vector<ll> str,ll &ans){
    // base case
    if(str.size()==1){
        ans = max(ans,str[0]);
        return;
    }
    
    ans = max(ans,sum(str));
    
    vector<ll> diff1(str.size()-1);
    for(int i=0 ; i<str.size()-1 ; i++){
        diff1[i] = str[i+1] - str[i];
    }
    
    vector<ll> diff2(str.size()-1);
    for(int i=0 ; i<str.size()-1 ; i++){
        diff2[i] = (-1)*diff1[i];
    }
    
    solve(diff1,ans);
    solve(diff2,ans);
}

int main(){
    int t;
    cin>>t;
    
    while(t--){
        int n;
        cin>>n;
        
        vector<ll> str(n);
        for(int i=0 ; i<n ; i++){
            cin>>str[i];
        }
        
        if(str.size()==1){
            cout<<str[0]<<endl;
        }
        else{
            ll ans = 0;
            solve(str,ans);
            cout<<ans<<endl;
        } 
    }
}

Submission (verdict: Time limit exceeded on test 2):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll sum(vector<ll> &nums){
    ll count = 0;
    for(int i=0 ; i<nums.size() ; i++){
        count += nums[i];
    }
    return count;
}

void solve(vector<ll> &str,ll &ans){
    // base case
    if(str.size()==1){
        ans = max(ans,str[0]);
        return;
    }
    
    ans = max(ans,sum(str));
    
    vector<ll> diff1(str.size()-1);
    for(int i=0 ; i<str.size()-1 ; i++){
        diff1[i] = str[i+1] - str[i];
    }
    
    vector<ll> diff2(str.size()-1);
    for(int i=0 ; i<str.size()-1 ; i++){
        diff2[i] = (-1)*diff1[i];
    }
    
    solve(diff1,ans);
    solve(diff2,ans);
}

int main(){
    int t;
    cin>>t;
    
    while(t--){
        int n;
        cin>>n;
        
        vector<ll> str(n);
        for(int i=0 ; i<n ; i++){
            cin>>str[i];
        }
        
        if(str.size()==1){
            cout<<str[0]<<endl;
        }
        else{
            ll ans = 0;
            solve(str,ans);
            cout<<ans<<endl;
        } 
    }
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Time limit exceeded on test 2):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll sum(vector<ll> &nums){
    ll count = 0;
    for(int i=0 ; i<nums.size() ; i++){
        count += nums[i];
    }
    return count;
}

void solve(vector<ll> str, vector<ll> rev,ll &ans){
    // base case
    if(str.size()==1){
        ans = max(ans,str[0]);
        return;
    }
    if(rev.size()==1){
        ans = max(ans,rev[0]);
        return;
    }
    ll maxSum = max(sum(str),sum(rev));
    ans = max(ans,maxSum);
    
    vector<ll> revDiff1(str.size()-1);
    for(int i=0 ; i<str.size()-1 ; i++){
        revDiff1[i] = str[i+1] - str[i];
    }
    
    vector<ll> revDiff2(rev.size()-1);
    for(int i=0 ; i<rev.size()-1 ; i++){
        revDiff2[i] = rev[i+1] - rev[i];
    }
    
    vector<ll> diff1 = revDiff1;
    reverse(revDiff1.begin(),revDiff1.end());
    
    vector<ll> diff2 = revDiff2;
    reverse(revDiff2.begin(),revDiff2.end());
    
    solve(diff1,revDiff1,ans);
    solve(diff2,revDiff2,ans);
}

int main(){
    int t;
    cin>>t;
    
    while(t--){
        int n;
        cin>>n;
        
        vector<ll> rev(n);
        for(int i=0 ; i<n ; i++){
            cin>>rev[i];
        }
        
        vector<ll> str = rev;
        reverse(rev.begin(),rev.end());
        if(str.size()==1){
            cout<<str[0]<<endl;
        }
        else{
            ll ans = 0;
            solve(str,rev,ans);
            cout<<ans<<endl;
        } 
    }
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Time limit exceeded on test 2):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll sum(vector<ll> &nums){
    ll count = 0;
    for(int i=0 ; i<nums.size() ; i++){
        count += nums[i];
    }
    return count;
}

void solve(vector<ll> str, vector<ll> rev,ll &ans){
    // base case
    if(str.size()==1){
        ans = max(ans,str[0]);
        return;
    }
    if(rev.size()==1){
        ans = max(ans,rev[0]);
        return;
    }
    ll maxSum = max(sum(str),sum(rev));
    ans = max(ans,maxSum);
    
    vector<ll> revDiff1(str.size()-1);
    for(int i=0 ; i<str.size()-1 ; i++){
        revDiff1[i] = str[i+1] - str[i];
    }
    
    vector<ll> revDiff2(rev.size()-1);
    for(int i=0 ; i<rev.size()-1 ; i++){
        revDiff2[i] = rev[i+1] - rev[i];
    }
    
    vector<ll> diff1 = revDiff1;
    reverse(revDiff1.begin(),revDiff1.end());
    
    vector<ll> diff2 = revDiff2;
    reverse(revDiff2.begin(),revDiff2.end());
    
    solve(diff1,revDiff1,ans);
    solve(diff2,revDiff2,ans);
}

int main(){
    int t;
    cin>>t;
    
    while(t--){
        int n;
        cin>>n;
        
        vector<ll> rev(n);
        for(int i=0 ; i<n ; i++){
            cin>>rev[i];
        }
        
        vector<ll> str = rev;
        reverse(rev.begin(),rev.end());
        if(str.size()==1){
            cout<<str[0]<<endl;
        }
        else{
            ll ans = 0;
            solve(str,rev,ans);
            cout<<ans<<endl;
        } 
    }
}

Submission (verdict: Time limit exceeded on test 2):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll sum(vector<ll> &nums){
    ll count = 0;
    for(int i=0 ; i<nums.size() ; i++){
        count += nums[i];
    }
    return count;
}

void solve(vector<ll> str,ll &ans){
    // base case
    if(str.size()==1){
        ans = max(ans,str[0]);
        return;
    }
    
    ans = max(ans,sum(str));
    
    vector<ll> diff1(str.size()-1);
    for(int i=0 ; i<str.size()-1 ; i++){
        diff1[i] = str[i+1] - str[i];
    }
    
    vector<ll> diff2(str.size()-1);
    for(int i=0 ; i<str.size()-1 ; i++){
        diff2[i] = (-1)*diff1[i];
    }
    
    solve(diff1,ans);
    solve(diff2,ans);
}

int main(){
    int t;
    cin>>t;
    
    while(t--){
        int n;
        cin>>n;
        
        vector<ll> str(n);
        for(int i=0 ; i<n ; i++){
            cin>>str[i];
        }
        
        if(str.size()==1){
            cout<<str[0]<<endl;
        }
        else{
            ll ans = 0;
            solve(str,ans);
            cout<<ans<<endl;
        } 
    }
}
Problem: 2050E - Three Strings
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 7):
#include <iostream>
#include <bits/stdc++.h>

#define ll long long
#define ld long double
#define INF 9

using namespace std;

int main()
{
    int t;
    cin >> t;
    for (int q = 0; q < t; q++) {
        string a, b, c;
        cin >> a >> b >> c;
        int n = a.size();
        int m = b.size();
        a = "-" + a;
        b = "-" + b;
        vector<vector<int>> dp(n + 2, vector<int>(m + 2, INF));
        // for (int i = 0; i < n + 2; i++) {
        //     dp[i][0] = 0;
        // }
        // for (int i = 0; i < m + 2; i++) {
        //     dp[0][i] = 0;
        // }
        dp[1][1] = 0;
        int k = 0;
        while (k < n + m) {
            k++;
            for (int i = 0; i < min(n, k) + 1; i++) {
                int j = k - i;
                if (j < 0 || j > m) continue;
                dp[i + 1][j + 1] = min(dp[i][j + 1] + (c[k - 1] != a[i]), dp[i + 1][j] + (c[k - 1] != b[j]));
            }
        }
        // for (int i = 0; i < n + 2; i++) {
        //     for (int j = 0; j < m + 2; j++) {
        //         cout << dp[i][j] << " ";
        //     }
        //     cout << "\n";
        // }
        // cout << "\n";
        cout << dp[n + 1][m + 1] << "\n";
    }
    return 0;
}

Submission (verdict: Wrong answer on test 7):
#include <iostream>
#include <bits/stdc++.h>

#define ll long long
#define ld long double
#define INF 9

using namespace std;

int main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    int t;
    cin >> t;
    for (int q = 0; q < t; q++) {
        string a, b, c;
        cin >> a >> b >> c;
        int n = a.size();
        int m = b.size();
        a = "`" + a;
        b = "`" + b;
        vector<vector<int>> dp(n + 2, vector<int>(m + 2, INF));
        // for (int i = 0; i < n + 2; i++) {
        //     dp[i][0] = 0;
        // }
        // for (int i = 0; i < m + 2; i++) {
        //     dp[0][i] = 0;
        // }
        dp[1][1] = 0;
        int k = 0;
        while (k < n + m) {
            k++;
            for (int i = 0; i < min(n, k) + 1; i++) {
                int j = k - i;
                if (j < 0 || j > m) continue;
                dp[i + 1][j + 1] = min(dp[i][j + 1] + (c[k - 1] != a[i]), dp[i + 1][j] + (c[k - 1] != b[j]));
            }
        }
        // for (int i = 0; i < n + 2; i++) {
        //     for (int j = 0; j < m + 2; j++) {
        //         cout << dp[i][j] << " ";
        //     }
        //     cout << "\n";
        // }
        // cout << "\n";
        cout << dp[n + 1][m + 1] << "\n";
    }
    return 0;
}