Harryxun/stf_run huggingface dataset:
import math
import numpy as np
from operator import mul

# 整数Nを桁ごとのリストにする
# l = [int(x) for x in list(str(N))]

# リストliから重複を削除したリストli_uniqを作成
#li_uniq = []
#for i in li:
#    if x not in li_uniq:
#        li_uniq.append(x)

# 複数行のinput - list版
#list = [list(map(int, input().split())) for i in range(N)]
# 複数行のinput - dictionary版
# key = a, value = b
#for i in range(N):
#    a, b = map(int, input().split())
#    dict[a] = b


N, H = map(int, input().split())

D = [list(map(int, input().split())) for i in range(N)]
B = [D[i][1] for i in range(N)] # bのリスト

a_max = 0 # 最大のa

for i in range(N):
    if D[i][0] >= a_max:
        a_max = D[i][0]

B_larger = [] # a_maxより大きいbのリスト

for i in range(N):
    if B[i] > a_max:
        B_larger.append(B[i])

B_larger.sort(reverse=True)

n = 0

while H > 0:
    H = H - B_larger[i]
    n += 1    

if H <= 0:
    print(n)
else
    n = math.ceil(H/a_max)
    print(n)


### FIXED CODE ###

import math
import numpy as np
from operator import mul

# 整数Nを桁ごとのリストにする
# l = [int(x) for x in list(str(N))]

# リストliから重複を削除したリストli_uniqを作成
#li_uniq = []
#for i in li:
#    if x not in li_uniq:
#        li_uniq.append(x)

# 複数行のinput - list版
#list = [list(map(int, input().split())) for i in range(N)]
# 複数行のinput - dictionary版
# key = a, value = b
#for i in range(N):
#    a, b = map(int, input().split())
#    dict[a] = b


N, H = map(int, input().split())

D = [list(map(int, input().split())) for i in range(N)]
B = [D[i][1] for i in range(N)] # bのリスト

a_max = 0 # 最大のa

for i in range(N):
    if D[i][0] >= a_max:
        a_max = D[i][0]

B_larger = [] # a_maxより大きいbのリスト

for i in range(N):
    if B[i] > a_max:
        B_larger.append(B[i])

B_larger.sort(reverse=True)

n = 0

for i in range(len(B_larger)):
    H = H - B_larger[i]
    n += 1    
    if H <= 0:
        print(n)
        break
    

if H > 0:
    n += math.ceil(H/a_max)
    print(n)
import sys
sys.setrecursionlimit(200000)

a, b, c = map(int, input().sprit())
num = 100 *a + 10*b + c
 
if num%4==0:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

a, b, c = map(int, input().split())
num = 100 *a + 10*b + c
 
if num%4==0:
    print("YES")
else:
    print("NO")
n = int(input())
v = list(map(int, input().split()))
even_list = [0] * (n + 1)
odd_list = [0] * (n + 1)

for i in range(n):
    if i % 2 == 0:
        even_list[v[i]] += 1

    else:
        odd_list[v[i]] += 1

if even_list.index(max(even_list)) == odd_list.index(max(odd_list)):
    even_sorted, odd_sorted = sorted(even_list), sorted(odd_list)
    print(min(n - even_sorted[-1] - odd_sorted[-2], n - even_sorted[-2] - odd_sorted[-1]))

else:
    print(n - max(even_list) - max(odd_list))


### FIXED CODE ###

n = int(input())
v = list(map(int, input().split()))
even_list = [0] * (100000 + 1)
odd_list = [0] * (100000 + 1)

for i in range(n):
    if i % 2 == 0:
        even_list[v[i]] += 1

    else:
        odd_list[v[i]] += 1

if even_list.index(max(even_list)) == odd_list.index(max(odd_list)):
    even_sorted, odd_sorted = sorted(even_list), sorted(odd_list)
    print(min(n - even_sorted[-1] - odd_sorted[-2], n - even_sorted[-2] - odd_sorted[-1]))

else:
    print(n - max(even_list) - max(odd_list))
n, k = map(int, input().split())
s = list(input().split())

print(join(s[k-1].swapcase()))

### FIXED CODE ###

n, k = map(int, input().split())
s = list(input())

s[k-1] = s[k-1].swapcase()
print("".join(s))
a, b, c, d, e, f = map(int, input().split())
x = set()
y = set()
for A in range(0, f + 1, 100 * a):
    for B in range(0, f + 1, 100 * b):
        if A + B:
            x.add(A + B)
for C in range(0, f + 1, c):
    for D in range(0, f + 1, d):
        y.add(C + D)
ans = 0
for X in x:
    for Y in y:
        if X + Y <= f and 100 * Y / X <= e:
                if ans < Y / (X + Y):
                    ans = Y / (X + Y)
                    w = X
                    s = Y
print(w + s, s)

### FIXED CODE ###

a, b, c, d, e, f = map(int, input().split())
x = set()
y = set()
for A in range(0, f + 1, 100 * a):
    for B in range(0, f + 1, 100 * b):
        if A + B > f:
            break
        if A + B:
            x.add(A + B)
for C in range(0, f + 1, c):
    for D in range(0, f + 1, d):
        if C + D > f:
            break
        y.add(C + D)
ans = 0
w = 100 * a
s = 0
for X in x:
    for Y in y:
        if X + Y <= f and 100 * Y / X <= e:
                if ans < Y / (X + Y):
                    ans = Y / (X + Y)
                    w = X
                    s = Y
print(w + s, s)
H, W = map(int, input().split())
S = ['.' * (W + 2)] + ['.' + input() + '.' for _ in range(H)] + ['.' * (W + 2)]
ans = [[] for _ in range(H)]
N = [(1, 1), (1, 0), (1, -1), (0, 1), (0, -1), (-1, 1), (-1, 0), (-1, -1)]
for h in range(H):
    for w in range(W):
        if S[h][w] == '#':
            ans[h - 1].append('#')
        else:
            ans[h - 1].append(sum([S[h + n[0]][w + n[1]] == '#' for n in N]))

for h in range(H):
    print(''.join(ans[h]))


### FIXED CODE ###

H, W = map(int, input().split())
S = ['.' * (W + 2)] + ['.' + input() + '.' for _ in range(H)] + ['.' * (W + 2)]

N = [(0, 1), (1, 0), (1, 1), (0, -1), (-1, 0), (1, -1), (-1, 1), (-1, -1)]
ans = [[] for _ in range(H)]
for h in range(1, H + 1):
    for w in range(1, W + 1):
        if S[h][w] == '.':
            ans[h - 1].append(sum([S[h + n[0]][w + n[1]] == '#' for n in N]))
        else:
            ans[h - 1].append('#')

for h in range(H):
    print(''.join(map(str, ans[h])))
def gcd(a, b):
    while b:
        a, b = b, a%b
    return a

n=int(input())
al=input().split()
al_i = [int(s) for s in al]

for x in range(n):
   if (x == 0):
       fg[0] = al_i[0]
       y = 1
   else:
      while y <= x:
         fg[y] = gcd(fg[y-1], al_i[y])
         y += 1
for x in range(n):
   if (x == 0):
      bg[0] = al_i[n-1]
      y = 1
   else:
      while y <= x:
         bg[y] = gcd(bg[y-1], al_i[n-1-y])
         y += 1

m = 0
gm = 0

for x in range(n):
   if (x == 0):
      g = bg[n-2]
   elif (x == n):
      g = fg[n-2]
   else:
      g = fg[x-1] + bg[n-2-x]
   if (g > gm):
      g = gm

print(gm)


### FIXED CODE ###

import sys

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

n=int(input())
al=input().split()
al_i = [int(s) for s in al]

if (n == 2):
   print(max(al_i[0],al_i[1]))
   sys.exit()

fg = [0] * n
bg = [0] * n

for x in range(n):
   if (x == 0):
       fg[0] = al_i[0]
       y = 1
   else:
      while y <= x:
         fg[y] = gcd(fg[y-1], al_i[y])
         y += 1

for x in range(n):
   if (x == 0):
      bg[0] = al_i[n-1]
      y = 1
   else:
      while y <= x:
         bg[y] = gcd(bg[y-1], al_i[n-1-y])
         y += 1

m = 0
gm = 0

for x in range(n):
   if (x == 0):
      g = bg[n-2]
   elif (x == n-1):
      g = fg[n-2]
   else:
      g = gcd(fg[x-1],bg[n-2-x])
   if (g > gm):
      gm = g

print(gm)
n, m = map(int,input().split())
lis = [0 for i in range(m)]
for i in range(m):
    lis[i] = list(map(int,input().split()))
    
seen = []
count = 0
def route(x=1):
    for i in range(m):
        if lis[i][0] == x and visited[i] == 0:
            visited[i] = 1
            route(lis[i][1])
            visited[i] = 0
        elif lis[i][1] == x and visited[i] == 0:
            visited[i] = 1
            route(lis[i][0])
            visited[i] = 0
        r = 0
        for j in visited:
            r += j
        if r == n-1:
            global count
            count += 1
            return
        
            
        
route(1)
print(count)

### FIXED CODE ###

n, m = map(int,input().split())
lis = [0 for i in range(m)]
for i in range(m):
    lis[i] = list(map(int,input().split()))
    
seen = []
count = 0
visited = [0 for i in range(n)]
def route(x=1):
    visited[x-1] = 1
    if [1]*n == visited:
        global count
        count +=1
        return
    for i in range(m):
        if lis[i][0] == x and visited[lis[i][1]-1] == 0:
            route(lis[i][1])
            visited[lis[i][1]-1] = 0
        elif lis[i][1] == x and visited[lis[i][0]-1] == 0:
            route(lis[i][0])
            visited[lis[i][0]-1] = 0
    return
            
        
route(1)
print(count)
import heapq
N, M =map(int, input().split())
A = [[] for i in range(10**5+1)]
 
for i in range(N):
    a, b = map(int,input().split())
    if a > m:
        continue
    A[a].append(-b)
 
work_cand = []
sum = 0
 
for i in range(M+1):
    add_jobs = A[i]
    if len(add_jobs) != 0:
        for j in add_jobs:
            heapq.heappush(work_cand, j)
    if len(work_cand) == 0:
        continue
    sum += heapq.heappop(work_cand)
ans = -(sum)
print(ans)

### FIXED CODE ###

import heapq
N, M =map(int, input().split())
A = [[] for i in range(10**5+1)]
 
for i in range(N):
    a, b = map(int,input().split())
    if a > M:
        continue
    A[a].append(-b)
 
work_cand = []
sum = 0
 
for i in range(M+1):
    add_jobs = A[i]
    if len(add_jobs) != 0:
        for j in add_jobs:
            heapq.heappush(work_cand, j)
    if len(work_cand) == 0:
        continue
    sum += heapq.heappop(work_cand)
ans = -(sum)
print(ans)
n = int(input())
sn = input()
sr = ''.join(list(reversed(sn)))
sint = int(sn, 2)
spop = sn.count('1')

def f(x):
    count = 0
    while x != 0:
        count += 1
        pop = bin(x).count('1')
        x %= pop
    return count



m1 = sint % (spop + 1)
m2 = 0 if spop <= 1 else sint % (spop - 1)

a = [0] * n
for i in range(n):
    if sr[i] == '0':
        d = pow(2, i, spop + 1)
        m = (m1 + d) % (spop + 1)
    else:
        d = pow(2, i, spop - 1)
        m = (m2 - d + spop - 1) % (spop - 1)
    a[i] = f(m) + 1

for ans in reversed(a):
    print(ans)


### FIXED CODE ###

n = int(input())
sn = input()
sr = ''.join(list(reversed(sn)))
sint = int(sn, 2)
spop = sn.count('1')

def f(x):
    count = 0
    while x != 0:
        count += 1
        pop = bin(x).count('1')
        x %= pop
    return count



m1 = sint % (spop + 1)
m2 = 0 if spop <= 1 else sint % (spop - 1)

a = [0] * n
for i in range(n):
    if sr[i] == '0':
        d = pow(2, i, spop + 1)
        m = (m1 + d) % (spop + 1)
        a[i] = f(m) + 1
    elif spop != 1:
        d = pow(2, i, spop - 1)
        m = (m2 - d + spop - 1) % (spop - 1)
        a[i] = f(m) + 1
    else:
        a[i] = 0

for ans in reversed(a):
    print(ans)
# problem C
N, x = map(int, input().split())
num_list = [int(x) for x in input().split()]
if x < num_list[0]:
    count = n - num_list[0]
    num_list[0] = x
else:
    count = 0


for i in range(N-1):
    n = num_list[i] + num_list[i+1]
    if x < n:
        num_list[i+1] = x - num_list[i]
        count += n - x
    else:
        pass
print(count)

### FIXED CODE ###

# problem C
N, x = map(int, input().split())
num_list = [int(x) for x in input().split()]
if x < num_list[0]:
    count = num_list[0] - x
    num_list[0] = x
else:
    count = 0

for i in range(N-1):
    n = num_list[i] + num_list[i+1]
    if x < n:
        num_list[i+1] = x - num_list[i]
        count += n - x
    else:
        pass
print(count)
a, b = int(input())
if a*b % 2 == 0
    print('No')
else:
    print('Yes')

### FIXED CODE ###

a, b = map(int, input().split(' '))
if a*b % 2 == 0:
    print('No')
else:
    print('Yes')
for e in sorted(map(int,input().split()))[::-1]:
    print e,
print

### FIXED CODE ###

x=sorted(map(int,raw_input().split()))[::-1]
for e in x: print e,
s = input()
t = input()
s.reverse()

if s==t :
  print("YES")
else:
  print("NO")

### FIXED CODE ###

s=input()
t=input()
t=t[::-1]
if s==t:
  print("YES")
else:
  print("NO")
n = int(input())
s = input()
if n%2==1:
  print("NO") 
elif s[0:n/2] == s[n/2:-1]:
  print("YES")
else:
  print("NO")


### FIXED CODE ###

n = int(input())
s = input()
if n%2==1:
    print("No") 
else:
    s1 = ""
    s2 = ""
    for i in range(0, n//2):
        s1+=s[i]
        s2+=s[n//2 + i]
    if(s1 == s2):
        print("Yes")
    else:
        print("No")
n, e, t = map(int, raw_input().split())
X = map(int, raw_input().split())

if n > 2001:
    exit(1)
ans = 0
bef = 0
bef_i = 0

d = [[0 for i in xrange(n)] for j in xrange(n)]
for i in xrange(n):
    el = d[i]
    xi = X[i]
    for j in xrange(i, n):
        el[j] = max(2*(X[j] - xi), t) + X[j] - xi
for i in xrange(n):
    for j in xrange(i):
        d[0][i] = min(d[0][j]+d[j+1][i]+(X[j+1]-X[j]), d[0][i])
print d[0][n-1]+ e - X[-1] + X[0]


### FIXED CODE ###

h, w = map(int, raw_input().split())
A = [list(raw_input()) for i in xrange(h)]

x = y = 0
A[0][0] = '.'
while 1:
    if y+1 < h and A[y+1][x] == '#':
        A[y+1][x] = '.'
        y += 1
    elif x+1 < w and A[y][x+1] == '#':
        A[y][x+1] = '.'
        x += 1
    else: break
if y == h-1 and x == w-1 and all(all(f is '.' for f in e) for e in A):
    print "Possible"
else:
    print "Impossible"
count= 0
#全探索は時計が切れる
for x in range(k+1):
    for y in range(k+1):
        if 0 <= s - (x +y) <= k:
            count += 1

print(count)

### FIXED CODE ###

k ,s = map(int, input().split())

count = 0
for x in range(min(k+1,s + 1)):
    for y in range(x,min(x+k+1,s +1)):
        if s - y <=k:
                
            count += 1
print(count)
import sys
from bisect import *

input = sys.stdin.readline

def f(n, q):
    xst = []
    for i in range(n):
        s, t, x = map(int, input().split())
        xst.append([x, s - x, t - x])
    xst.sort()

    ds = []
    for i in range(q):
        d = int(input())
        ds.append(d)

    ans = [-1] * q
    jump = [-1] * q

    for x, s, t in xst:
        i = bisect_left(ds, s)
        fi = bisect_left(ds, t)
        while i < fi:
            if jump[i] != -1:
                i = jump[i]
            ans[i] = x
            jump[i] = fi
            i += 1

    print(*ans, sep="\n")

n, q = map(int, input().split())
f(n, q)


### FIXED CODE ###

import sys
from bisect import *

input = sys.stdin.readline

def f(n, q):
    xst = []
    for i in range(n):
        s, t, x = map(int, input().split())
        xst.append([x, s - x, t - x])
    xst.sort()

    ds = []
    for i in range(q):
        d = int(input())
        ds.append(d)

    ans = [-1] * q
    jump = [-1] * q

    for x, s, t in xst:
        i = bisect_left(ds, s)
        fi = bisect_left(ds, t)
        while i < fi:
            if jump[i] != -1:
                i = jump[i]
            else:
                ans[i] = x
                jump[i] = fi
                i += 1

    print(*ans, sep="\n")

n, q = map(int, input().split())
f(n, q)
# -*- coding: utf-8 -*-
# 入力
N = int(input())
T = map(int, input().split())
M = int(input())
for i in range(0, M):
    p, x = map(int, input().split())
    Time = sum(T) - T[p - 1] + x
    print(Time)

### FIXED CODE ###

# -*- coding: utf-8 -*-
# 入力
N = int(input())
T = input().split()
for i in range(0, N):
    T[i] = int(T[i])
M = int(input())
for i in range(0, M):
    p, x = input().split()
    p = int(p)
    x = int(x)
    Time = sum(T) - T[p - 1] + x
    print(Time)
S=input()
a=S[::2]
b=S[1::2]
if 'L' not in a:
	if 'R' not in b:
		print('Yes')
    else:
    	print('No')
else:
	print('No')

### FIXED CODE ###

S=input()
a=S[::2]
b=S[1::2]
if 'L' not in a:
	if 'R' not in b:
		print('Yes')
	elif 'R' in b:
		print('No')
elif 'L' in a:
	print('No')
x = input()

print(x//500*1000 + (x%500)//5*5)

### FIXED CODE ###

x = int(input())
 
print(x//500*1000 + (x%500)//5*5)
n,m = map(int,input())
a = [int(x) for x in input().split()]
s = sum(a)
if n < s:
  print("-1")
else:
  print(n-s)

### FIXED CODE ###

n,m = map(int,input().split())
a = [int(x) for x in input().split()]
s = sum(a)
if n < s:
  print("-1")
else:
  print(n-s)
import math
def c(n, r):
    a = math.factorial(n)
    b = math.factorial(n-r)
    c = math.factorial(r)
    return (a // b * c) % (10**9+7)

N,K = [int(i) for i in input().split()]
for i in range(1,K+1):
    num1 = c(K-1,i-1) % (10**9+7)
    num2 = c(N-K+1,i) % (10**9+7)
    ans = (num1*num2) % (10**9+7)
    print(ans)

### FIXED CODE ###

def c(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

N,K = [int(i) for i in input().split()]
for i in range(1,K+1):
    num1 = c(K-1,i-1,mod)
    num2 = c(N-K+1,i,mod)
    ans = (num1*num2) % (10**9+7)
    print(ans)
# D Water_Bottle
import math
a,b,x = map(int,input().split(" "))
x /= a
if (x > a*b/2):
    #水筒の半分の容積より水の容積が大きかった場合
    ha = a/2
    print(90-math.degrees(math.atan(ha/(b-(x/a)))))
else:
    #水の容積が水筒の半分の容積以下だった場合
    c = 2*x/b
    print(90-math.degrees(math.atan(c/b)))



### FIXED CODE ###

# D Water_Bottle
import math
a,b,x = map(int,input().split(" "))
x /= a
if (x == a*b):
    #水筒が満タンの場合
    print(0)
elif (x > a*b/2):
    #水筒の半分の容積より水の容積が大きかった場合
    ha = a/2
    print(90-math.degrees(math.atan(ha/(b-(x/a)))))
else:
    #水の容積が水筒の半分の容積以下だった場合
    c = 2*x/b
    print(90-math.degrees(math.atan(c/b)))
BASE_PAIRS = [['A', 'T'], ['C', 'G']]
base_b = input()
paired_base_index = ValueError
result = ''

for i in range(len(BASE_PAIRS)):
    paired_base_index = BASE_PAIRS[i].index(base_b)
    if paired_base_index != ValueError:
        result = BASE_PAIRS[i][(paired_base_index+1) % 2]
        break

print(result)


### FIXED CODE ###

BASE_PAIRS = [['A', 'T'], ['C', 'G']]
base_b = input()
result = ''

for i in range(len(BASE_PAIRS)):
    if base_b in BASE_PAIRS[i]:
        paired_base_index = (BASE_PAIRS[i].index(base_b)+1) % 2
        result = BASE_PAIRS[i][paired_base_index]

print(result)
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())
a = list( map(int, input().split()))
b = list( map(int, input().split()))

sa = sum(a)
sb = sum(b)

al = sb-sa

if al<0:
    print('No')
    exit()

doub = 0
sing = 0

for i in range(n):
    diff = b[i]-a[i]
    if diff > 0:
        doub += diff//2
        sing += diff%2
    if diff < 0:
        sing += -diff

dnokori = al - doub
snokori = al - sing

if dnokori < 0 or snokori<0:
    print('No')
    exit()

if snokori/dnokori == 2:
    print('Yes')
else:
    print('No')



### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())
a = list( map(int, input().split()))
b = list( map(int, input().split()))

sa = sum(a)
sb = sum(b)

al = sb-sa

if al<0:
    print('No')
    exit()

doub = 0
sing = 0

for i in range(n):
    diff = b[i]-a[i]
    if diff > 0:
        doub += -(-diff//2)
        sing += diff%2
    if diff < 0:
        sing += -diff

dnokori = al - doub
snokori = al - sing

if dnokori < 0 or snokori<0:
    print('No')
    exit()

if dnokori==0 and snokori==0:
    print('Yes')
    exit()

if dnokori==0:
    print('No')
    exit()

if snokori/dnokori == 2:
    print('Yes')
else:
    print('No')
input = int(input().strip())

hour = input // 3600
min = (input - 3600*hour) // 60
sec = input - 3600 * hour - 60 * min 

print (":".join([hour, min, sec]))

### FIXED CODE ###

input = int(input().strip())

hour = input // 3600
min = (input - 3600*hour) // 60
sec = input - 3600 * hour - 60 * min 

print (":".join([str(hour), str(min), str(sec)]))
n=int(input())
a=list(map(int,input().split()))
ans=sum(a)
q=int(input())
dp=[0]*(10**5+1)
for i in range(1,10**5+1):
  dp[i]=a.count(i)

for j in range(3000):
  b,c=map(int,input().split())
  ans+=(c-b)*dp[b]
  dp[c]+=dp[b]
  dp[b]=0
  print(ans)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=sum(a)
q=int(input())
dp=[0]*(10**5+1)
for i in a:
  dp[i]+=1

for j in range(q):
  b,c=map(int,input().split())
  ans+=(c-b)*dp[b]
  dp[c]+=dp[b]
  dp[b]=0
  print(ans)
lst = list(map(int,input().split("")))
n = (list[1]-1)/list[0]
print("n")

### FIXED CODE ###

lst = list(map(int,input().split(" ")))
socket_n = 1
tap = 0
while socket_n < lst[1]:
  tap += 1
  socket_n = socket_n-1+lst[0]
print("%d" % tap)
def trial_division(n):
    a = []  
    while n % 2 == 0:
        a.append(2)
        n /= 2
    f = 3
    while f*f <= n:
        if n % f == 0:
            a.append(f)
            n /= f
        else:
            f += 2   
    if n != 1: a.append(n)
    return a
A,B = (lambda x: (min(x),max(x)))(list(map(int,input().split())))
print(len(set(trial_division(A),trial_division(B)))+1)

### FIXED CODE ###

def trial_division(n,b):
    a = []
    if n%2==0 and b%2==0:
        a.append(2)
    while n % 2 == 0:
        n /= 2
    f = 3
    while f*f <= n:
        if n % f == 0: 
            if b%f == 0:
                a.append(f)
            n /= f
        else:
            f += 2   
    if n != 1 and b%n==0: 
        a.append(n)
    return a
A,B = (lambda x: (min(x),max(x)))(list(map(int,input().split())))
print(len(set(trial_division(A,B)))+1)
N=int(input())
S=list(map(int,input().split()))
D={}
mod=((10**9)+7)
ans=1
for i in range(N):
    if S[i]==0:
        if 0 not in D:
            D[0]=1
            ans*=3
        elif D[0]==1:
            D[0]+=1
            ans*=2
        else:
            D[0]=3
    elif S[i] not in D:
        ans*=D[S[i]-1]
        ans%mod
        D[S[i]]=1
    else:
        if D[S[i]]==1:
            ans*=(D[S[i]-1]-1)
            D[S[i]]+=1
            ans%=mod
        elif D[S[i]]==2:
            ans*=(D[S[i]-1]-2)
            D[S[i]]+=1
            ans%=mod
    #print(ans)
print(ans%mod)
            

### FIXED CODE ###

N=int(input())
S=list(map(int,input().split()))
D={}
mod=((10**9)+7)
ans=1
for i in range(N):
    try:
        if S[i]==0:
            if 0 not in D:
                D[0]=1
                ans*=3
            elif D[0]==1:
                D[0]+=1
                ans*=2
            elif D[0]==2:
                D[0]=3
            else:
                ans=0
        elif S[i] not in D:
            ans*=D[S[i]-1]
            ans%mod
            D[S[i]]=1
        else:
            if D[S[i]]==1:
                ans*=(D[S[i]-1]-1)
                D[S[i]]+=1
                ans%=mod
            elif D[S[i]]==2:
                ans*=(D[S[i]-1]-2)
                D[S[i]]+=1
                ans%=mod
            else:
                ans=0
    except:
        ans=0
    #print(ans)
print(ans%mod)
N = int(input())
s = [input() for i in range(N)] #複数行の数値の入力を取得
c = collections.Counter(s)
print(len(c))

### FIXED CODE ###

from collections import Counter
N = int(input())
s = [input() for i in range(N)]
c = Counter(s)
print(len(c))
import numpy as np
import itertools

H, W = map(int, input().split())
A = [tuple(map(int, input().split())) for _ in range(H)]
B = [tuple(map(int, input().split())) for _ in range(H)]

D = [[abs(A[h][w] - B[h][w]) for w in range(W)] for h in range(H)]
table = np.zeros((H, W, 80 * (H + W)), dtype='bool')
table[0][0][D[0][0]] = True

it = itertools.product(range(H), range(W))
next(it)  # h=w=0 捨てる
for h, w in it:
    d = D[h][w]
    table[h][w][d:] += table[h - 1][w][:-d] + table[h][w - 1][:-d]
    table[h][w][:-d] += table[h - 1][w][d:] + table[h][w - 1][d:]
    table[h][w][d:0:-1] += table[h - 1][w][:d] + table[h][w - 1][:d]

print(np.amin(*np.where(table[H-1][W-1])))


### FIXED CODE ###

import numpy as np
import itertools

H, W = map(int, input().split())
A = [tuple(map(int, input().split())) for _ in range(H)]
B = [tuple(map(int, input().split())) for _ in range(H)]

D = [[abs(A[h][w] - B[h][w]) for w in range(W)] for h in range(H)]
max_num = 80 * (H + W)
table = np.zeros((H, W, max_num), dtype='bool')
table[0][0][D[0][0]] = True

it = itertools.product(range(H), range(W))
next(it)  # h=w=0 捨てる
for h, w in it:
    d = D[h][w]
    table[h][w][d:] += table[h - 1][w][:max_num - d] + table[h][w - 1][:max_num - d]
    table[h][w][:max_num - d] += table[h - 1][w][d:] + table[h][w - 1][d:]
    table[h][w][d:0:-1] += table[h - 1][w][:d] + table[h][w - 1][:d]

print(np.amin(*np.where(table[H - 1][W - 1])))
r=int(input())
a=3(rxr)


### FIXED CODE ###

r=int(input())
a=3*(r*r)
print(a)
import math
a, b, x =, ap(int, input().split())

ax = a // x
bx = math.ceil(b // x)

tar = ax - bx + 1
print(tar)


### FIXED CODE ###

import math
import sys
import numpy as np
from decimal import *
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# ----------------------------------------
a, b, x = map(int, readline().split())

ans = Decimal(b // x) - Decimal(a // x)
if (a % x == 0):
    ans += 1

print(int(ans))