BigInteger b1 = new BigInteger(next()); BigInteger b2 = new BigInteger(next()); out.println(b2.gcd(b1.mod(b2)));
相关推荐