import java.math.BigInteger;
import java.util.*;
class Main {
public static void main(String[] args){
Scanner in=new Scanner(System.in);
int t=in.nextInt();
while(t-->0){
BigInteger x=in.nextBigInteger();
char c=in.next().charAt(0);
BigInteger y=in.nextBigInteger();
BigInteger n=x.gcd(y);
System.out.println(x.divide(n)+" / "+y.divide(n));
}
}
}
import java.util.*;
class Main {
public static void main(String[] args){
Scanner in=new Scanner(System.in);
int t=in.nextInt();
while(t-->0){
BigInteger x=in.nextBigInteger();
char c=in.next().charAt(0);
BigInteger y=in.nextBigInteger();
BigInteger n=x.gcd(y);
System.out.println(x.divide(n)+" / "+y.divide(n));
}
}
}
Comments
Post a Comment