My issue
The normal approach for this question exceed time limit I see people using gcd in why so?
My code
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner input = new Scanner(System.in);
int t = input.nextInt();
while(t-- > 0){
int x = input.nextInt();
int y = input.nextInt();
System.out.println(y);
}
}
}
Problem Link: Sub or Swp Practice Coding Problem