Buggy python submission (verdict: Runtime Error):
import math
def gcd(n, m):
  while m % n != 0:
    m, n = n, m % n
  return m
def div(n):
  d = []
  for i in range(2, int(math.sqrt(n))+2):
    if n % i == 0:
      for j in d:
        if i % j == 0:
          break
      else:
        d.append(i)
  if len(d) == 0 and n > 1:
    return 1
  return len(d)

a, b = map(int, input().split())
if a > b:
  a, b = b, a
c = math.gcd(a,b)
print(div(c) + 1)


Fixed submission:
import math
def gcd(a, b):
  while b > 0:
    a, b = b, a % b
  return a
def div(a):
  r = []
  i = 2
  k = int(math.sqrt(a))
  while i <= k:
    if a % i == 0:
      r.append(i)
      while a % i == 0:
        a //= i
      k = math.sqrt(a)
    i += 1
  if a > 1:
    r.append(a)
  return r

a, b = map(int, input().split())
if a > b:
  a, b = b, a
c = gcd(a,b)
print(len(div(c))+1)

Buggy python submission (verdict: Runtime Error):
import math
def div(n):
  d = []
  for i in range(2, int(math.sqrt(n))+2):
    if n % i == 0:
      for j in d:
        if i % j == 0:
          break
      else:
        d.append(i)
  if len(d) == 0 and n > 1:
    return 1
  return len(d)

a, b = map(int, input().split())
if a > b:
  a, b = b, a
c = math.gcd(a,b)
print(div(c) + 1)


Fixed submission:
import math
def gcd(a, b):
  while b > 0:
    a, b = b, a % b
  return a
def div(a):
  r = []
  i = 2
  k = int(math.sqrt(a))
  while i <= k:
    if a % i == 0:
      r.append(i)
      while a % i == 0:
        a //= i
      k = math.sqrt(a)
    i += 1
  if a > 1:
    r.append(a)
  return r

a, b = map(int, input().split())
if a > b:
  a, b = b, a
c = gcd(a,b)
print(len(div(c))+1)

Buggy python submission (verdict: Time Limit Exceeded):
def div(n, m):
  if n > m:
    n = m
  d = []
  for i in range(2, n+1):
    if n % i == 0 and m % i == 0:
      for j in d:
        if i % j == 0:
          break
      else:
        d.append(i)
  if n != 1 and m % n == 0:
    d.append(n)
  return d

a, b = map(int, input().split())
lc = div(a,b)
print(len(lc) + 1)


Fixed submission:
import math
def gcd(a, b):
  while b > 0:
    a, b = b, a % b
  return a
def div(a):
  r = []
  i = 2
  k = int(math.sqrt(a))
  while i <= k:
    if a % i == 0:
      r.append(i)
      while a % i == 0:
        a //= i
      k = math.sqrt(a)
    i += 1
  if a > 1:
    r.append(a)
  return r

a, b = map(int, input().split())
if a > b:
  a, b = b, a
c = gcd(a,b)
print(len(div(c))+1)

Buggy python submission (verdict: Runtime Error):
import math
def div(n, m):
  if n > m:
    n = m
  d = []
  for i in range(2, int(math.sqrt(n))+1):
    if n % i == 0 and m % i == 0:
        d.append(i)
  if m % n == 0:
    d.append(i)
  return d

a, b = map(int, input().split())
lc = div(a,b)
print(len(lc) + 1)


Fixed submission:
import math
def gcd(a, b):
  while b > 0:
    a, b = b, a % b
  return a
def div(a):
  r = []
  i = 2
  k = int(math.sqrt(a))
  while i <= k:
    if a % i == 0:
      r.append(i)
      while a % i == 0:
        a //= i
      k = math.sqrt(a)
    i += 1
  if a > 1:
    r.append(a)
  return r

a, b = map(int, input().split())
if a > b:
  a, b = b, a
c = gcd(a,b)
print(len(div(c))+1)

Buggy python submission (verdict: Time Limit Exceeded):
def div(n, m):
  if n > m:
    n = m
  d = []
  for i in range(2, n+1):
    if n % i == 0 and m % i == 0:
      for j in d:
        if i % j == 0:
          break
      else:
        d.append(i)
  return d

a, b = map(int, input().split())
lc = div(a,b)
print(len(lc) + 1)


Fixed submission:
import math
def gcd(a, b):
  while b > 0:
    a, b = b, a % b
  return a
def div(a):
  r = []
  i = 2
  k = int(math.sqrt(a))
  while i <= k:
    if a % i == 0:
      r.append(i)
      while a % i == 0:
        a //= i
      k = math.sqrt(a)
    i += 1
  if a > 1:
    r.append(a)
  return r

a, b = map(int, input().split())
if a > b:
  a, b = b, a
c = gcd(a,b)
print(len(div(c))+1)

Buggy python submission (verdict: Time Limit Exceeded):
def div(n, m):
  if n > m:
    n = m
  d = []
  for i in range(1, n+1):
    if n % i == 0 and m % i == 0:
      d.append(i)
  return d

a, b = map(int, input().split())
lc = div(a,b)
la = []
for i in lc:
  if la:
    for j in la:
      if j != 1 and i % j == 0:
        break
    else:
      la.append(i)
  else:
    la.append(i)
print(len(la))


Fixed submission:
import math
def gcd(a, b):
  while b > 0:
    a, b = b, a % b
  return a
def div(a):
  r = []
  i = 2
  k = int(math.sqrt(a))
  while i <= k:
    if a % i == 0:
      r.append(i)
      while a % i == 0:
        a //= i
      k = math.sqrt(a)
    i += 1
  if a > 1:
    r.append(a)
  return r

a, b = map(int, input().split())
if a > b:
  a, b = b, a
c = gcd(a,b)
print(len(div(c))+1)

Buggy python submission (verdict: Time Limit Exceeded):
def div(n):
  d = set()
  for i in range(1, n+1):
    if n % i == 0:
      d.add(i)
  return d

a, b = map(int, input().split())
lc = list(div(a) & div(b))
lc.sort()
la = []
for i in lc:
  if la:
    for j in la:
      if j != 1 and i % j == 0:
        break
    else:
      la.append(i)
  else:
    la.append(i)
print(len(la))


Fixed submission:
import math
def gcd(a, b):
  while b > 0:
    a, b = b, a % b
  return a
def div(a):
  r = []
  i = 2
  k = int(math.sqrt(a))
  while i <= k:
    if a % i == 0:
      r.append(i)
      while a % i == 0:
        a //= i
      k = math.sqrt(a)
    i += 1
  if a > 1:
    r.append(a)
  return r

a, b = map(int, input().split())
if a > b:
  a, b = b, a
c = gcd(a,b)
print(len(div(c))+1)