Questions asked
analysis
It is said that this question is this question of an upgraded version → ...... P1014 problem solution to a problem
Place upgrade is actually divided about after multiplying.
About points need to solve the greatest common divisor, gcd () is not it ......
But I am here but why bother to write gcd, wanted to use the Java API how to do? Hey, do not look for it, in java.math.BigInteger in!
public BigInteger gcd(BigInteger val)
It is this stuff, and finally back to finish up opinions on the matter ......
Moreover, this question, not even seek to identify the location, but the horizontal and vertical coordinates ...... do ...... Obviously this is not
the denominator is divided about the line, the molecule is the column.
So ...... upgraded version? ? Rather tease me? ?
Upgrading from red rose orange title theme from the lower ha ha ha ...... a ...... xswl ......
AC Code (Java description language)
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String[] array_1 = scanner.nextLine().split("/");
String[] array_2 = scanner.nextLine().split("/");
BigInteger a = new BigInteger(Integer.toString(Integer.parseInt(array_1[0])*Integer.parseInt(array_2[0])));
BigInteger b = new BigInteger(Integer.toString(Integer.parseInt(array_1[1])*Integer.parseInt(array_2[1])));
int gcd = a.gcd(b).intValue();
System.out.println((b.intValue()/gcd) + " " + (a.intValue()/gcd));
scanner.close();
}
}