The code is fine. You should remove the duplicate part from your code, below the first print statement.
# cook your dish here
for _ in range(int(input())):
a1,a2=map(int,input().split())
b1,b2=map(int,input().split())
c1,c2=map(int,input().split())
print(max((a1+a2),(b1+b2),(c1+c2)))
int main() {
int t, i , sum;
cin>>t;
while(t–)
{
i=0,sum=0;
while(i<3)
{
int a1,a2;
cin>>a1>>a2;
if(sum<(a1+a2))
{
sum = a1+a2;
// cout<<t<<" “<<i<<” “<<a1<<” “<<a2<<” "<<sum<<endl;
}
i++;
}
cout<<sum<<endl;
}
return 0;
}
We can also do this to avoid the usage of excess variables.