Sunday, May 1, 2016

Codeforces 664A - Complicated GCD

import java.lang.*;
import java.util.*;
import java.math.*;

public class bigGcd{
 public static void main(String[] args){
  Scanner sc= new Scanner(System.in);
  BigInteger a , b;
  while(sc.hasNext()){
   a=sc.nextBigInteger();
   b=sc.nextBigInteger();
   System.out.println(gcdFinder(a,b));
  }
 }
 public static BigInteger gcdFinder(BigInteger x , BigInteger y){
  int c;
  c = x.compareTo(y);
  if(c==0)
   return x;
  else
     return BigInteger.valueOf(1);
 }

}

No comments:

Post a Comment