Problem:


Greatest Common Divisor

Write a program which finds the greatest common divisor of two natural numbers a and b

Input

a and b are given in a line sparated by a single space.

Output

Output the greatest common divisor of a and b.

Constrants

1 ≤ a, b ≤ 109

Hint

You can use the following observation:

For integers x and y, if x ≥ y, then gcd(x, y) = gcd(y, x%y)

Sample Input 1

54 20

Sample Output 1

2

Sample Input 2

147 105

Sample Output 2

21



Sample input:
54 20


Sample output:
2

Submission status: Runtime Error

Solution code:
import java.util.scanner;
public class Main{

public static void main(String[] args){

Scanner scan = new Scanner(System.in);
int a = scan.nextInt(scan);
System.out.println(a);
}
}

Submission status: Runtime Error

Solution code:
import java.util.Scanner;
public class Main{

public static void main(String[] args){

Scanner scan = new Scanner(System.in);
int a = scan.nextInt(scan);
System.out.println(a);
}
}

Submission status: Runtime Error

Solution code:
import java.util.Scanner;
public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.close();
        System.out.println(helper(a,b));
    }
    public int helper(int a, int b){
       if(a ==0){
         return b;     
       } else {
         return  helper(b % a, a);
       }
    }
}

Submission status: Runtime Error

Solution code:
import java.util.Scanner;
public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.close();
        System.out.println(helper(a,b));
    }
    public static int helper(int a, int b){
       if(a ==0){
         return b;     
       } else {
         return  helper(b % a, a);
       }
    }
}

Submission status: Runtime Error

Solution code:
import java.util.Scanner;
# gcd(x, y) = gcd(y, x%y)
public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.close();
        System.out.println(helper(a,b));
    }
    public static int helper(int a, int b){
       if(b == 0){
         return a;     
       } else {
         return  helper(b, b % a);
       }
    }
}

Submission status: Runtime Error

Solution code:
import java.util.Scanner;
//gcd(x, y) = gcd(y, x%y)
public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.close();
        System.out.println(helper(a,b));
    }
    public static int helper(int a, int b){
       if(b == 0){
         return a;     
       } else {
         return  helper(b, b % a);
       }
    }
}

Submission status: Runtime Error

Solution code:
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int x = input.nextInt();
int y = input.nextInt();
int out = helper(x,y);
System.out.println(out);
}

public static int helper(int x, int y){
if(y == 0){
return x;
} else if(x >= y){
return helper(y, x%y);
}
}

}

Submission status: Runtime Error

Solution code:
x, y = map(int, input.()split())
if x < y:
    swap(x, y)
while y > 0:
    r = x % y
    x = y
    y = r
print(y)

Submission status: Runtime Error

Solution code:
x = int(input())
print(x**3)

Submission status: Runtime Error

Solution code:
def calc_gcd(a,b):
    if a < b:
        a,b=b,a
    if b == a:
        return a
    return calc_gcd(b,a%b)

x,y=map(int,input().split())
print("%d"%(calc_(x,y)))

Submission status: Runtime Error

Solution code:
def calc_gcd(a,b):
    if a < b:
        a,b=b,a
    if b == a:
        return a
    return calc_gcd(b,a%b)

x,y=map(int,input().split())
print("%d"%(calc_gcd(x,y)))

Submission status: Runtime Error

Solution code:
data = list(map(int,input().split()))
if(data[0] < data[1]): data[0],data[1] = data[1],data[0]
z = data[0] % data[1]
gcd = 0
for i in range(1,z):
    if(z%i == 0 and y%i == 0 and gcd < i): gcd = i
print(gcd)

Submission status: Runtime Error

Solution code:
data = list(map(int,input().split()))
if(data[0] < data[1]): data[0],data[1] = data[1],data[0]
z = data[0] % data[1]

def gcd(x,y):
    return x if y == 0 else gcd(y,x%y)

else: print(gcd)

Submission status: Runtime Error

Solution code:
data = list(map(int,input().split()))
if(data[0] < data[1]): data[0],data[1] = data[1],data[0]

def gcd(x,y):
    return x if y == 0 else gcd(y,x%y)

else: print(gcd(data[0],data[1]))

Submission status: Runtime Error

Solution code:
x, y = (int(s) for s in input().split())
while y > 0
    x, y = y, x % y
print(x)

Submission status: Runtime Error

Solution code:
a,b = map(int,raw_input().split(' '))
x = max(a,b)
n = min(a,b)
f = False
for i in range(n,0,-1):
	if x%i == 0 and n %i==0:
		print i
		break

Submission status: Runtime Error

Solution code:
def gcd(x, y):
	n = min(x, y)
	array = range(1, n + 1)
	array.reverse()
	for d in array:
		if x % d == 0 and y % d == 0:
			return d

a, b = map(int, raw_input().split(' '))

print gcd(a, b)

Submission status: Runtime Error

Solution code:
from fractions import gcd
x, y = int(input().split())
print(gcd(x, y))

Submission status: Runtime Error

Solution code:
x, y = [int(i) for i in input().split()]
if x < y:
    buff = x
    x = y
    y = buff

r = x % y

for i in range(1, r):
    if y % i == 0 and r % i == 0:
        gcd = i

print(gcd)

Submission status: Runtime Error

Solution code:
# GCD
x, y = [int(i) for i in input().split()]

if x < y:
    buff = x
    x = y
    y = buff

r = x % y
for i in range(1, r+1):
    if y % i == 0 and r % i == 0:
        d = i

print(d)

Submission status: Runtime Error

Solution code:
import sys
import math

x = sys.stdin.readline()

a, b = x.split(" ")

a = int(a)
b = int(b)
y = 1

if a > b:
  a,b = b,a

for i in range(2, a):
  if a % i == 0 and b % i == 0:
    y *= i
    a = a / i
    b = b / i
    i--

print y

Submission status: Runtime Error

Solution code:
import sys
import math

for line in sys.stdin.readlines():
     x, y = line.split(" ")

x = int(x)
y = int(y)

divide = 1

if x > y:
    x, y = y, x

for i in range(2, sort(x) + 1):
    if x % i == 0 and y % i == 0:
        divide *= i
        x /= i
        y /= i
        i -= 1

print divide

Submission status: Runtime Error

Solution code:
import sys
import math

for line in sys.stdin.readlines():
     x, y = line.split(" ")

x = int(x)
y = int(y)

divide = 1

if x > y:
    x, y = y, x

for i in range(2, sqrt(x) + 1):
    if x % i == 0 and y % i == 0:
        divide *= i
        x /= i
        y /= i
        i -= 1

print divide

Submission status: Runtime Error

Solution code:
import sys
import math

for line in sys.stdin.readlines():
     x, y = line.split(" ")

x = int(x)
y = int(y)

divide = 1

if x > y:
    x, y = y, x

for i in range(2, int(sqrt(x)) + 1):
    if x % i == 0 and y % i == 0:
        divide *= i
        x /= i
        y /= i
        i -= 1

print divide

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin.readlines():
     x, y = line.split(" ")

x = int(x)
y = int(y)

divide = 1

if x > y:
    x, y = y, x

for i in range(2, x + 1):
    if x % i == 0 and y % i == 0:
        divide *= i
        x /= i
        y /= i
        i -= 1

print divide

Submission status: Runtime Error

Solution code:
import sys

line = sys.stdin.readline():
     x, y = line.split(" ")

x = int(x)
y = int(y)

divide = 1

if x > y:
    x, y = y, x

for i in range(2, x + 1):
    if x % i == 0 and y % i == 0:
        divide *= i
        x /= i
        y /= i
        i -= 1

print divide

Submission status: Runtime Error

Solution code:
import sys

line = sys.stdin.readline():
     x, y = line.split(" ")

x = int(x)
y = int(y)

divide = 1

if x > y:
    x, y = y, x

for i in range(2, x + 1):
    if x % i == 0 and y % i == 0:
        divide *= i
        x = x / i
        y = y / i
        i -= 1

print divide

Submission status: Runtime Error

Solution code:
import sys

line = sys.stdin.readline():
     x, y = line.split(" ")

x = int(x)
y = int(y)

divide = 1

if x > y:
    x, y = y, x

for i in range(2, x + 1):
    if x % i == 0 and y % i == 0:
        divide = divide * i
        x = x / i
        y = y / i
        i -= 1

print divide

Submission status: Runtime Error

Solution code:
import sys

line = sys.stdin.readline()
     x, y = line.split(" ")

x = int(x)
y = int(y)

divide = 1

if x > y:
    x, y = y, x

for i in range(2, x + 1):
    if x % i == 0 and y % i == 0:
        divide = divide * i
        x = x / i
        y = y / i
        i -= 1

print divide

Submission status: Runtime Error

Solution code:
s = input()
x,y = map(int,s)

while(x != y or x!=1 or y != 1)
    if(x < y):
        tmp = x
        x = y
        y = tmp

    x %= y
print(x)

Submission status: Runtime Error

Solution code:
import sys

line = sys.stdin.readline()
x, y = line.split(" ")

x = int(x)
y = int(y)

divide = 1

if x > y:
    x, y = y, x

while(1):
    flag = 0
    for i in range(2, x + 1):
        if x % i == 0 and y % i == 0:
            divide = divide * i
            x = x / i
            y = y / i
            flag = 1
            break
    if flag == 0:
        print divide
        exit()

Submission status: Runtime Error

Solution code:
import sys

for i in sys.stdin:
    lst = i.split(' ')
    n = 1
    while n <= lst[0]:
        lst = map(int, lst)
        if lst[0]%n == 0 and lst[1]%(lst[0]/n) == 0:
            print lst[0]/n
            break
        n = n+1
    else:
        print 1

Submission status: Runtime Error

Solution code:
# -*- coding: euc-jp -*-                                 
import sys
# ?????????                                                 
for i in sys.stdin:
    # ????????§???????????????2????????°?????????????????????????????????      
    lst = i.split(' ')
    lst = map(int, lst)
    lst.sort()

    # 1????????????????°???????????????°???/2?????§??°?????????            
    n = 1
    while n <= lst[0]/2:
        # ???????????????????????°???????????????????????????             
        if lst[0]%n == 0 and lst[1]%(lst[0]/n) == 0:
           print lst[0]/n
           break
        n = n+1
    else:
        print 1
    sys.exit(0)

Submission status: Runtime Error

Solution code:
def gcd(x, y):
    a_x = list()
    a_y = list()

    for i in range(1, x+1):
        if x % i == 0:
            a_x.append(i)

    for i in range(1, y+1):
        if y % i == 0:
            a_y.append(i)

    a_cd = list(set(a_x).intersection(set(a_y)))

    return max(a_cd)

if __name__ == "__main__":
    x, y = map(int, input().split())
    if x > y:
        tmp = x
        x = y
        y = tmp
    print(gcd(x, y%x))

Submission status: Runtime Error

Solution code:
a=map(int,raw_input().split())
a.sort()
while a[1]%a[0]!=0:
 a,b=b%a,a
return a

Submission status: Runtime Error

Solution code:
a=map(int,raw_input().split())
a.sort()
while a[1]%a[0]!=0:
 a[0],a[1]=a[1]%a[0],a[0]
return a[0]

Submission status: Runtime Error

Solution code:
import math

(a, b) = tuple([int(s) for s in input().split()])

if a==b:
    print(a)
    return

min = a if a < b else b
divisor = 1

i = 2
while i < math.sqrt(min):
    if a % i == 0 and b % i == 0:
        a = a / i
        b = b / i
        divisor = divisor * i
    else:
        i = i + 1

print(divisor)

Submission status: Runtime Error

Solution code:
while x > 0:
    z = x
    x = y % x
    y = z
print(y)

Submission status: Runtime Error

Solution code:
x,y = map(int,raw_input().split())
cd = 1

while True:
    a = x
    for i in range(2,int(min(x,y)) + 1):
        if x%i == 0:
            if y%i == 0:
                x /= i
                y /= i
                cd *= i
                break
    if a == x:
        break
print(cd)

Submission status: Runtime Error

Solution code:
import time

x,y = map(int,input().split())
b = int(min(x,y))
a = int(max(x,y))

def gcd(a,b):
    if a % b != 0:
        r = a % b
        return gcd(b,r)
    else:
        print(b)

gcd(a,b)

Submission status: Runtime Error

Solution code:
from fractions import gcd
print gcd(*map(int, raw_input().split())

Submission status: Runtime Error

Solution code:
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_B&lang=jp
#??????????????????????????????
#?????§??¬?´???°???????????????????????????????????¨????????¨?¨????????????????
def gcd(x,y):
    tmp = y
    
    if y > x:
        y = x
        x = tmp

    while not y == 0:
        y = x % y
        x = tmp
        tmp = y

    return x
def main():
    target = [int(a) for a in input().split()]
    print(gcd(a[0], a[1]))
    
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
def calc_gcd(a, b):
    from math import gcd
    return gcd(a, b)


if __name__ == '__main__':
    # ??????????????¬?????¨
    # start_time = datetime.now()
    # print('>>> {0}'.format(start_time))

    # ???????????\???
    data = [int(x) for x in input().split(' ')]

    # ?¨?????????????
    result = calc_gcd(data[0], data[1])

    # ???????????¨???
    print('{0}'.format(result))

Submission status: Runtime Error

Solution code:
def calc_gcd(a, b):
    import math
    return math.gcd(a, b)


if __name__ == '__main__':
    # ??????????????¬?????¨
    # start_time = datetime.now()
    # print('>>> {0}'.format(start_time))

    # ???????????\???
    data = [int(x) for x in input().split(' ')]

    # ?¨?????????????
    result = calc_gcd(data[0], data[1])

    # ???????????¨???
    print('{0}'.format(result))

Submission status: Runtime Error

Solution code:
import math


def calc_gcd(a, b):
    return math.gcd(a, b)


if __name__ == '__main__':
    # ??????????????¬?????¨
    # start_time = datetime.now()
    # print('>>> {0}'.format(start_time))

    # ???????????\???
    data = [int(x) for x in input().split(' ')]

    # ?¨?????????????
    result = calc_gcd(data[0], data[1])

    # ???????????¨???
    print('{0}'.format(result))

Submission status: Runtime Error

Solution code:
def calc_gcd(a, b):
    from math import gcd
    return gcd(a, b)


if __name__ == '__main__':
    data = [int(x) for x in input().split(' ')]
    result = calc_gcd(data[0], data[1])
    print('{0}'.format(result))

Submission status: Runtime Error

Solution code:
import math
a,b = map(int,input().split())
print(math.gcd(a,b))

Submission status: Runtime Error

Solution code:
from math import gcd
x, y = map(int, input().split())
print(gcd(x, y))

Submission status: Runtime Error

Solution code:
a=int(input("a:"))
b=int(input("b:"))


# a=max(a, b)
# b=min(a, b)?????¨??????????????????????????????
# ???????????????????????????a1=30, b1=100??????a2=b1=100, b2=r1=30??¨???????????§?°???\???????????????


while True:
    r=a%b
    if r==0:
        break
    else:
        a=b
        b=r
print(b)

Submission status: Runtime Error

Solution code:
x, y = [int(i) for i in input().split()]

if x < y:
    a = x
    x = y
    y = a

for i in range(int(x%y/2)):
    if (x%y)% (i+1) == 0 and y%(i+1) == 0:
        kouyakusu = i+1

print(kouyakusu)

Submission status: Runtime Error

Solution code:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

x,y=input().split()
gcd(x,y)

Submission status: Runtime Error

Solution code:
x, y = map(int,input().split())
while True 
  if x >= y:
    x %= y
  else
    y %= x
  if x == y:
    print(x)
    break

Submission status: Runtime Error

Solution code:
import math

x,y = map(int,input().split())
print(math.gcd(x,y))

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Here your code !
def mcg(a,b):
    while a%b !=0:
        x = a%b
        a = b
        b = x
    return x

num =sorted(list(map(int,input().split(" "))))
print(mcg(num[0],num[1]))

Submission status: Runtime Error

Solution code:
from math import gcd
a, b = [int(tem) for tem in input().split()]
print(gcd(a, b))

Submission status: Runtime Error

Solution code:
from math import gcd
a, b = [int(tem) for tem in input().split()]
print(str(gcd(a, b)))

Submission status: Runtime Error

Solution code:
from math import gcd
a, b = [int(tem) for tem in input().split()]
A = str(gcd(a, b))
print(A.strip(''))

Submission status: Runtime Error

Solution code:
import math
x, y = map(int, input().split())
print(math.gcd(x, y))

Submission status: Runtime Error

Solution code:
def lcd(a,b): ##return least common multiple of a and b
    if a > b:
        return lcd(a-b,b)
    elif a < b:
        return lcd(b-a,a)
    elif a == b:
        return a

a,b = input().split()
print(lcd(a,b))

Submission status: Runtime Error

Solution code:
x, y = [int(i) for i in input().split(" ")]

num = []
if x > y:
    z = x % y
    for zzz in range(z + 1):
        if z % zzz == 0 and x % zzz == 0:
            num.append(zzz)
            print(max(num))
elif y > x:
    z = y % x
    for zzz in range(z + 1):
        if z % zzz == 0 and y % zzz == 0:
            num.append(zzz) 
            print(max(num))
else:
    print(x)

Submission status: Runtime Error

Solution code:
x, y = [int(i) for i in input().split(" ")]
num = []
if x > y:
    z = x % y
    for zzz in range(z + 1):
        if z % zzz == 0 and x % zzz == 0:
            num.append(zzz)
        print(max(num))
elif y > x:
    z = y % x
    for zzz in range(z + 1):
        if z % zzz == 0 and y % zzz == 0:
            num.append(zzz) 
        print(max(num))
else:
    print(x)

Submission status: Runtime Error

Solution code:
x, y = [int(i) for i in input().split(" ")]
num = []
if x > y:
    z = x % y
    for zzz in range(z + 1):
        if z % zzz == 0 and x % zzz == 0:
            num.append(zzz)
    print(max(num))
elif y > x:
    z = y % x
    for zzz in range(z + 1):
        if z % zzz == 0 and y % zzz == 0:
            num.append(zzz) 
    print(max(num))
else:
    print(x)

Submission status: Runtime Error

Solution code:
x, y = [int(i) for i in input().split(" ")]
num = []
if x >= y:
    z = x % y
    for zzz in range(z + 1):
        if z % zzz == 0 and x % zzz == 0:
            num.append(zzz)
    print(max(num))
elif y > x:
    z = y % x
    for zzz in range(z + 1):
        if z % zzz == 0 and y % zzz == 0:
            num.append(zzz) 
    print(max(num))

Submission status: Runtime Error

Solution code:
def gdc(x, y):
    if x % y == 0:
        return y
    else:
        return gdc(x, x%y)


if __name__ == "__main__":
    x, y = [int(i) for i in input().split(" ")]
    print(gcd(x, y))

Submission status: Runtime Error

Solution code:
def gdc(x, y):
    if x % y == 0:
        return y
    else:
        return gdc(x, x%y)


if __name__ == '__main__':
    x, y = [int(i) for i in input().split(" ")]
    print(gcd(x, y))

Submission status: Runtime Error

Solution code:
def gcd(x, y):
  r = 1
  for i in range(min(x, y)):
    if x % i == 0 and y % i == 0:
      r = i
  return r

x, y = map(int, re.split(' ', raw_input()))
print(gcd(x, y))

Submission status: Runtime Error

Solution code:
def gcd(x, y):
    r = 1
    for i in range(min(x, y)):
        if x % i == 0 and y % i == 0:
            r = i
    return r

x, y = map(int, re.split(' ', raw_input()))
print(gcd(x, y))

Submission status: Runtime Error

Solution code:
def gcd(x, y):
    r = 1
    for i in range(1, min(x, y)):
        if x % i == 0 and y % i == 0:
            r = i
    return r

x, y = map(int, re.split(' ', raw_input()))
print(gcd(x, y))

Submission status: Runtime Error

Solution code:
def gcd(x, y):
    r = 1
    for i in range(1, min(x, y)):
        if x % i == 0 and y % i == 0:
            r = i
    return r

x, y = map(int, re.split(' ', raw_input()))
print('%d %d' % (x, y ))
#print(gcd(x, y))

Submission status: Runtime Error

Solution code:

x, y = map(int, re.split(' ', raw_input()))
print('%d %d' % (x, y ))
#print(gcd(x, y))

Submission status: Runtime Error

Solution code:
inputlist = map(int, re.split(' ', raw_input()))
print inputlist
#print(gcd(x, y))

Submission status: Runtime Error

Solution code:
def gcd(x, y):
    if x == y:
        return x
    if x < y and y % x:
        return x
    if x > y and x % y:
        return y

    r = 1
    for i in range(1, int(min(x, y) / 2) + 1):
        if x % i == 0 and y % i == 0:
            r = i
    return r
 
x, y = map(int, re.split(' ', raw_input()))
print(gcd(x, y))

Submission status: Runtime Error

Solution code:
from fractions import gcd
print(gcd(*set(map(int, input().split(" ")))))

Submission status: Runtime Error

Solution code:
import sys

def gcd(a,b):
	temp = a
	if a<b:
		a=b
		b=a
	if b==0:
		return a
	c = a%b
	return gcd(b,c)


line = sys.stdin.readline().strip().split(" ")
A = int(line[0])
B = int(line[1])

print(gcd(A,B))
return

Submission status: Runtime Error

Solution code:
XY=list(map(int,input().split()))

x=max(XY)
y=min(XY)
x_dy=x%y

ans=0

if x==y:
    ans=x

for d in range(1,(y+1)//2):
    if y%d==0 and x_dy%d==0:
        ans=d

print(and)

Submission status: Runtime Error

Solution code:
import math

XY=list(map(int,input().split()))

x=max(XY)
y=min(XY)
x_dy=x%y

ans=math.gcb(x,x_dy)

print(ans)

Submission status: Runtime Error

Solution code:
import math

XY=list(map(int,input().split()))

x=max(XY)
y=min(XY)
x_dy=x%y

ans=math.gcd(x,x_dy)

print(ans)

Submission status: Runtime Error

Solution code:
import math
x, y = map(int,input().split())
print(math.gcd(x, y))

Submission status: Runtime Error

Solution code:
def gcd(a, b):
    if a % b == 0:
        return b
    else:
        return gcd(b, a % b)


N = input().split()
print(gcd(N[0], N[1]))

Submission status: Runtime Error

Solution code:
z=list(map(int,input().split()))
z.sort()
a=0

while True:
    a=z[1]-z[0]
    if z[0]%a==0:
        z[1] = z[0]
        z[0] = a
        z.sort()
        break
    z[1]=z[0]
    z[0]=a
    z.sort()

print(z[0])

Submission status: Runtime Error

Solution code:
def gcd(x, y):
    if x < y:
        x, y = y, x
    while y > 0:
        x, y = y, x % y
    return x

x, y = map(int, input().split())
print(gcd(x, y)

Submission status: Runtime Error

Solution code:
import math
a = list(map(int,input().split()))
print(math.gcd(a[0],a[1])

Submission status: Runtime Error

Solution code:
import math
a = list(map(int,input().split()))
print(math.gcd(a[0],a[1]))

Submission status: Runtime Error

Solution code:
num = input().split()
if int(num[0])<int(num[1]):
    x = int(num[1])
    y = int(num[0])
else:
    x = int(num[0])
    y = int(num[1])

end = 0
    
z = x % y
while True:
    z1 = y % z
    y1 = z
    if z1 == 0:
        print(z)
        break 
    z = z1
    y = y1

Submission status: Runtime Error

Solution code:
def gcd(x, y):
    if x<y:
        return gcd(y, x)
    while x%y!=0:
        r = x%y
        x, y = y, r
    return r

iinfo = map(int, input().split())
print(gcd[info0], info[1]))

Submission status: Runtime Error

Solution code:
def gcd(x, y):
    if x<y:
        return gcd(y, x)
    while x%y!=0:
        r = x%y
        x, y = y, r
    return r

info = map(int, input().split())
print(gcd[info0], info[1]))

Submission status: Runtime Error

Solution code:
def gcd(x, y):
    if x<y:
        return gcd(y, x)
    while x%y!=0:
        r = x%y
        x, y = y, r
    return r

info = map(int, input().split())
print(gcd(info[0], info[1]))

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
print(math.gcd(a, b))

Submission status: Runtime Error

Solution code:
a, b = map(int, iput().split())
print(gcd(a, b))

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
if a, b != 0:
    print(math.gcd(a, b))

Submission status: Runtime Error

Solution code:
x, y = map(int, input().split())
print(gcd(x, y))

Submission status: Runtime Error

Solution code:
x, y = map(int, input().split())
while x > 0 :
    x, y = y, x % y
print(x)

Submission status: Runtime Error

Solution code:
x, y = map(int, input().split())
while True:
  if x >= y:
    x = x % y
  else:
    y = y % x
  if x % y == 0:
    print(x)
    break
  elif y % x == 0:
    print(y)

Submission status: Runtime Error

Solution code:
x, y = map(int, raw_input().split())
if x < y:
    x, y = y, x

while y != 0
    x, y = y, x%y
print x

Submission status: Runtime Error

Solution code:
def main ()
    x, y =[int(i) for i in input().split().sort(reverse = True )]
    
    while  x%y != 0 :
        x, y =[x%y x.sort(reverse = True)] 

    print(y)

if __name__=='__main__':
    def main()

Submission status: Runtime Error

Solution code:
def main ()
    x, y =[int(i) for i in input().split().sort(reverse = True )]
    
    while  y != 0 :
        x, y = y, x%y
    print(x)

if __name__=='__main__':
    def main()

Submission status: Runtime Error

Solution code:
def main()
    x, y =[int(i) for i in input().split()]

    while y != 0 :
        x, y = y, x%y
    print(x)

if __name__ == '__main__':
    def main()

Submission status: Runtime Error

Solution code:
def main()
    x, y =[int(i) for i in input().split()]
    while y != 0 :
        x, y = y, x%y
    print(x)

if __name__ == '__main__':
    def main()

Submission status: Runtime Error

Solution code:
def main()
    x, y =[int(i) for i in input().split()]

    while y != 0 :
        x, y = y, x%y
    print(x)
    
    if __name__ == '__main__':
    def main()

Submission status: Runtime Error

Solution code:
def main()
    x, y =[int(i) for i in input().split()]

    while y != 0 :
        x, y = y, x%y
    print(x)
    
    if __name__ == '__main__':
        def main()

Submission status: Runtime Error

Solution code:
def main()
    x, y =[int(i) for i in input().split()]
    while y != 0 :
        x, y = y, x%y
    print(x)
    
    if __name__ == '__main__':
        def main()

Submission status: Runtime Error

Solution code:
def main()
    x, y =[int(i) for i in input().split()]
    while y != 0 :
        x, y = y, x%y
    print(x)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def main()
    x, y =[int(i) for i in input().split()]
    while y != 0 :
        x, y = y, x%y
        
    print(x)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a,b=[int(x) for x in input().split()]

x = max(a,b)
y = min(a,b)

while x % y >0:
    res = x % y
    x = y
    y = res
print(res)

Submission status: Runtime Error

Solution code:
a,b=[int(x) for x in input().split()]

x = max(a,b)
y = min(a,b)

while x%y>0:
    res = x%y
    x = y
    y = res

print(res)

Submission status: Runtime Error

Solution code:
a,b=[int(x) for x in input().split()]

x = max(a,b)
y = min(a,b)

while x%y>0:
    x = y
    y = x%y

print(y)

Submission status: Runtime Error

Solution code:
# coding:utf-8
def gcd(x,y):
    a = x % y
    y_ans = []
    two_ans = []
    for i in range(1,y + 1):
        if y % i == 0:
            y_ans.append(i)
    for i in range(1,a + 1):
        if a % i == 0:
            two_ans.append(i)
    yset = set(y_ans)
    twoset = set(two_ans)
    matched = list(yset & twoset)
    print max(matched) 

n = map(int, raw_input().split())
gcd(n[0],n[1])

Submission status: Runtime Error

Solution code:
# coding:utf-8
def gcd(x,y):
    if x == y:
        print x
        return
    else if x < y:
        t = x
        x = y
        y = t
    a = x % y
    y_ans = []
    two_ans = []
    for i in range(1,y + 1):
        if y % i == 0:
            y_ans.append(i)
    for i in range(1,a + 1):
        if a % i == 0:
            two_ans.append(i)
    yset = set(y_ans)
    twoset = set(two_ans)
    matched = list(yset & twoset)
    print max(matched) 

n = map(int, raw_input().split())
gcd(n[0],n[1])

Submission status: Runtime Error

Solution code:
# naive

x, y = map(int, input().split())

s = min(x,y)
l = max(x,y)
for i in list(range(s+1)[::-1]):
    if s % i == 0:
        if l % i == 0:
            print(i)
            break

Submission status: Runtime Error

Solution code:
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while(b != 0):
        a, b = b, a%b
        print(a, b)


import sys
for line in sys.stdin:
    a, b = map(int, input().split())
    print(a, b)
    gcd(a, b)

Submission status: Runtime Error

Solution code:
data = [int(n) for n in input()];

def gcd(m, n):
    m = m % n;
    if m == 0:
        return n;
    return gcd(n, m);

print(gcd(max(data), min(data));

Submission status: Runtime Error

Solution code:
data = [int(n) for n in input().split(" ")];

def gcd(m, n):
    m = m % n;
    if m == 0:
        return n;
    return gcd(n, m);

print(gcd(max(data), min(data));

Submission status: Runtime Error

Solution code:
# coding: UTF-8
def common_divisor(x,y):
    if x >= y:
        x = x % y
        for i in range(1,x):
            if y % i == 0 and x % i == 0:
                divisor = i
        return divisor
    else:
        for i in range(1,x):
            if y % i == 0 and x % i == 0:
                divisor = i
        return divisor

num1,num2 = raw_input().split()
maximam = common_divisor(int(num1), int(num2))
print(maximam)

Submission status: Runtime Error

Solution code:
# coding: UTF-8
def common_div(x,y):
    divisor = 0
    x_mul = 0
    if x > y:
        x = x % y
        for i in range(1,x+1):
            if y % i == 0 and x % i == 0:
                divisor = i
        return divisor
    elif x == y:
        divisor = x
        return divisor
    else:
        for i in [2,3,5,7]:
            if x % i == 0:
                x_mul = i
        if x_mul != 0:
            for j in  x_mul * range(1,x+1):
                if y % j == 0 and x % j == 0:
                    divisor = j
            if x <= j:
                break
            return divisor
        else:
            for k in range(1,x+1):
                if y % i == 0 and x % i == 0:
                    divisor = i
            return divisor


num1,num2 = raw_input().split()
maximam = common_div(int(num1), int(num2))
print(maximam)

Submission status: Runtime Error

Solution code:
in = input().split()
A = int(in[0])
B = int(in[1])

if A < B:
  v = B
  B = A
  A = v

R = A % B
while R !=0:
  R = A % B
  A = B
  B = R
return A

Submission status: Runtime Error

Solution code:
def gcd(x, y):
    if x < y:
        x = tmp
        x = y
        y = tmp
    while y > 0:
        r = x % y
        x = y
        y = r
    return x

if __name__ == '__main__':
    a, b = [int(x) for x in input().split()]
    print (gcd(a, b))

Submission status: Runtime Error

Solution code:
def isprime(n):
    if n < 2: return 0
    elif n == 2: return 1

    if n % 2 == 0: return 0

    for i in range(3, n, 2):
        if i >= n/i: return 1
        if n % i == 0 : return 0

    return 1

N = int(input())
n = [int(input()) for i in range(N)]

a = [i for i in n if isprime(i)]

print(len(a))

Submission status: Runtime Error

Solution code:
n = input().split()

x = n[0]
y = n[1]

if x < y:
    x, y = y, x
while y > 0:
    r = x % y
    x = y
    y = r

print(x)

Submission status: Runtime Error

Solution code:
a = input(),split()
t , u = int(a[0]),int(b[0])
def c(x,y):
  if x % y:
    return c(y,x%y)
  else:
    return y
print(c(t,u))

Submission status: Runtime Error

Solution code:
a = input().split()
t , u = int(a[0]),int(b[0])
def c(x,y):
  if x % y:
    return c(y,x%y)
  else:
    return y
print(c(t,u))

Submission status: Runtime Error

Solution code:
a = input().split()
t , u = int(a[0]),int(b[0])

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))

Submission status: Runtime Error

Solution code:
a = list(map(int, input().split()))
t , u = int(a[0]),int(b[0])

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))