Help me in solving TEAMFOR problem

My issue

i cant understand the problem

My code

# cook your dish here
q=int(input())
for i in range(q):
    n=int(input())
    s=[]
    t=[]
    

Problem Link: Team Formation Practice Coding Problem

you have to make pair of index in which atleast one person should know a programming language and at least one person should know about the English language

#include <iostream>
#include<bits/stdc++.h>
#define ll long long int
#define mod 1000000007
using namespace std;
int main() {
    cin.tie(0)->sync_with_stdio(false);
	int t;cin>>t;
	while(t--){
	    int n;cin>>n;
	    string s,t;
	    cin>>s>>t;
	    int a=0,b=0,c=0,d=0;
	    for(int i=0;i<n;i++){
	        if(s[i]=='1' && t[i]=='0')a++;
	        if(s[i]=='0' && t[i]=='1')b++;
	        if(s[i]=='1' && t[i]=='1')c++;
	        if(s[i]=='0' && t[i]=='0')d++;
	    }
	    int ans=min(a,b);
	    a-=ans;
	    b-=ans;
	    ans+=min(c,a+b+d);
	    c-=min(c,(a+b+d));
	    ans+=c/2;
	    cout<<ans<<endl;
	}
	cerr << "Time : " << 1000 * ((double)clock()) / CLOCKS_PER_SEC << "ms" << endl;
	return 0;
}