Help me in solving GAME_XI problem

My issue

?

My code

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
    int t;cin>>t;
    while(t--){
        int n,m;
        cin>>n>>m;
        int sum_b=0;
        int sum_bo=0;
        int ts;
        vector<int>b(n);
        vector<int>bo(m);
        for(int i=0;i<n;i++){
            cin>>b[i];
            sum_b=sum_b+b[i];
        }
        for(int i=0;i<m;i++){
            cin>>bo[i];
            sum_bo=sum_bo+bo[i];
        }
        ts=sum_b+sum_bo;
        if(n+m==11){
            cout<<ts<<endl;
        }
        else if(n+m<11||n<4||m<4){cout<<-1<<endl;}
        else{
            sort(b.begin(),b.end());
            sort(bo.begin(),bo.end());
            int y=(n+m)-11;
            while(y--){
                if(n<m){
                for(int i=0;i<b.size();i++){
                  ts=ts-min(b[i],bo[i]);
                
                }


            }
            else{
           for(int i=0;i<bo.size();i++){
                    ts=ts-min(b[i],bo[i]);
                       
           }
         }
            }
            
         cout<<ts<<endl;
        }
       
        
    }
}

Problem Link: GAME 11 Practice Coding Problem - CodeChef

The problem also asks you to have at least 4 members of “b” and “bo

You consider it in you else if, but you don’t in if and else