This is Discussion thread about Solve questions
Discussion About Solve questions
why my all cases failed
#include
using namespace std;
int main()
{
int t;
cin>>t;
while(t–)
{
int n,m;
cin>>n>>m;
int arr1[n];
int arr2[m];
for(int i=0;i<n;i++)
{
cin>>arr1[i];
}
for(int i=0;i<m;i++)
{
cin>>arr2[i];
}
int sum=0;
int sum1=0;
for(int i=0;i<n;i++)
{
sum+=arr1[i];
}
for(int i=0;i<m;i++)
{
sum1+=arr2[i];
}
if(sum<sum1)
{
cout<<n<<" Deepak";
}
else if(sum>sum1)
{
cout<<m<<" Gautam";
}
else{
cout<<m<<" Deepak";
}
}
return 0;
}