question-https://practice.geeksforgeeks.org/problems/subarray-with-given-sum/0
import java.util.Scanner;
public class SUB_ARRAY {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int T=input.nextInt();
while(T>0) {
int i,j,sum=0,k=0;
int size=input.nextInt();
int total=input.nextInt();
int data[]=new int[size+1];
for(i=1;i<=size;i++) {
data[i]=input.nextInt();
}
for(i=1;i<=size;i++) {
System.out.println(data[i]);
}
for(i=1;i<size;i++) {
sum=sum+data[i];
for(j=i+1;j<=size;j++) {
sum=sum+data[j];
if(sum==total) {
System.out.println(i+" "+j);
k=1;
break;
}
else if(sum>total) {
sum=0;
break;
}
}
if(k==1) {
break;
}
}
if(k==0){
System.out.println("-1");
}
}
}
}