THIS IS THE LINK FOR QUESTION:https://practice.geeksforgeeks.org/problems/subarray-with-given-sum/0
#include <iostream>
using namespace std;
int main() {
long long int s,n,a[10000000000],e,d,l,flag=0,t;
cin>>t;
while(t--)
{ cin>>n>>s;
e=0;
flag=0;
for(long long int i=0;i<n;i++)
{ cin>>a[i];
}
for(long long int j=0;j<n;j++)
{ e=a[j];
for(long long int h=j+1;h<n;h++)
{ e+=a[h];
if(e==s)
{ l=j;
d=h;
flag=1;
break;
}
else if(e>s)
{ flag=2;
break;
}
}
if(flag==1 || flag==2)
break;
}
if(flag==1)
cout<<l+1<<" "<<d+1;
else
cout<<-1;
cout<<endl;
}
return 0;
}