We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int n,m;
scanf("%d",&n);
int i=0;
for(;i<n;i++)
{
int c ;
scanf("%d",&c);
scanf("%d",&m);
int data[m];
int j=0;
for(;j<m;j++)
{
scanf("%d",&data[j]);
//printf("%d ",data[j]);
}
int k=0;
for(j=0;j<m;j++)
{
for(k=j+1;k<m;k++)
{
if(data[j]+data[k]==c)
{
printf("%d %d\n",j+1,k+1);
goto flag;
}
}
}
flag:;
}
return 0;
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Ice Cream Parlor
You are viewing a single comment's thread. Return to all comments →
include
include
include
include
int main() {
}