Stack-Repo
/
data
/train
/rghvgrv
/Simple-Programs
/Data-Structure-and-Algorithms
/Java
/DynamicP
/Main.java
import java.util.*; | |
public class Main{ | |
public static void main(String[] args){ | |
Scanner sc = new Scanner(System.in); | |
int t= sc.nextInt(); | |
while(t-->0){ | |
Set<Integer> s =new HashSet<Integer>(); | |
long n = sc.nextInt(); | |
int k,l; | |
int j; | |
for(int i = 1; i <n; i++){ | |
for(j = 1; j<n; j++){ | |
if(i!=j){ | |
System.out.println(i+" "+j); | |
} | |
} | |
System.out.println(); | |
} | |
} | |
} | |
} | |