Harryxun/stf_run huggingface dataset:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N = int(input())

d = {}
zeros = 0

def gcd(a, b):
    while b != 0:
        a, b = b, a % b

    return a

MOD = int(1e9) + 7
p = [1] * (N + 1)
for i in range(N):
    p[i + 1] = p[i] * 2 % MOD
    a, b = map(int, input().split())
    if a == b == 0:
        zeros += 1
        continue
    a, b = a // gcd(a, b), b // gcd(a, b)

    if a == 0:
        f, s = d.get((a, abs(b)), (0, 0))
        d[(a, abs(b))] = (f + 1, s)

    if b == 0:
        f, s = d.get((b, abs(a)), (0, 0))
        d[(b, abs(a))] = (f, s + 1)

    if a < 0 or b < 0:
        if a < 0:
            a, b = -a, -b
        f, s = d.get((abs(b), a), (0, 0))
        d[(abs(b), a)] = (f, s + 1)
    else:
        f, s = d.get((abs(a), abs(b)), (0, 0))
        d[(abs(a), abs(b))] = (f + 1, s)

ans = 1
for _, (f, s) in d.items():
    cnt = p[f] - 1
    cnt += p[s] - 1
    cnt += 1
    cnt %= MOD
    ans *= cnt
    ans %= MOD

ans -= 1
ans += zeros
print(ans)


### FIXED CODE ###

import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N = int(input())

d = {}
zeros = 0

def gcd(a, b):
    while b != 0:
        a, b = b, a % b

    return a

MOD = int(1e9) + 7
p = [1] * (N + 1)
for i in range(N):
    p[i + 1] = p[i] * 2 % MOD
    a, b = map(int, input().split())
    if a == b == 0:
        zeros += 1
        continue
    a, b = a // abs(gcd(a, b)), b // abs(gcd(a, b))

    if a == 0:
        f, s = d.get((a, abs(b)), (0, 0))
        d[(a, abs(b))] = (f + 1, s)

    elif b == 0:
        f, s = d.get((b, abs(a)), (0, 0))
        d[(b, abs(a))] = (f, s + 1)

    elif (a < 0) ^ (b < 0):
        if a < 0:
            a, b = -a, -b
        f, s = d.get((abs(b), a), (0, 0))
        d[(abs(b), a)] = (f, s + 1)
    else:
        f, s = d.get((abs(a), abs(b)), (0, 0))
        d[(abs(a), abs(b))] = (f + 1, s)

ans = 1
for _, (f, s) in d.items():
    cnt = p[f] - 1
    cnt += p[s] - 1
    cnt += 1
    cnt %= MOD
    ans *= cnt
    ans %= MOD

ans -= 1
ans += MOD
ans += zeros
ans %= MOD
print(ans)
list = [int(input()) for i in range(5)]
min = 9
ans = 0
for i in range(5):
  amari = list[i] % 10
  if amari != 0:
    if amari < min:
      min = amari
      num_min = i
for i in range(5):
  if i != num_min:
    ans += int(round(list[i], -1))
  else:
    ans += list[i]
print(ans)

### FIXED CODE ###

list = [int(input()) for i in range(5)]
ans = 0
amari = []
for i in range(5):
  ans += (list[i] // 10) * 10
  amari.append(list[i] % 10)
amari = sorted(amari)
for i in range(5):
  if amari[i] != 0:
    ans += amari[i]
    ans += (5-(i+1)) * 10
    break
print(ans)
import sys
from collections import defaultdict
readline=sys.stdin.readline
read=sys.stdin.read

def main():
    n=int(readline())
    a=[list(map(int,sys.stdin.readline().split())) for _ in range(n)]
    wts=dict(((i,j),a[i][j]) for i in range(n) for j in range(n))
    cost=defaultdict(int)
    cost.update(wts)
    for k in range(n):
        cost.update([((i,j),min(cost[(i,j)],cost[(i,k)]+cost[(k,j)])) \
          for i in range(n) for j in range(n)])
    edges=[e for e in wts.keys() if e[0]<e[1]]
    edges.sort(key=wts.get,reverse=True)
    s=0
    for e in edges:
        if cost[e]<wts[e]:
            print(-1)
            return None
        detour=min([cost[(e[0],i)]+cost[(i,e[1])] for i in range(n) if i!=e[0] and i!=e[1]])
        if detour>cost[e]:
            s+=wts[e]
    print(s)

if __name__=='__main__':
    main()


### FIXED CODE ###

import sys
from copy import deepcopy
import numpy as np
readline=sys.stdin.readline
read=sys.stdin.read

def main():
    n=int(readline())
    a=np.array([list(map(int,l.split())) for l in read().splitlines()])
    cost=deepcopy(a)
    for k in range(n):
        arr=np.stack([cost,[cost[k]]+np.transpose([cost[k]])])
        cost=np.amin(arr,axis=0)
    cost2=deepcopy(a)
    f=np.sum(cost<a)
    if f:
        print(-1)
        return
    filt=np.sum([([cost[k]]+np.transpose([cost[k]]))==cost for k in range(n)],axis=0)==2
    print(np.sum(a[filt])//2)

if __name__=='__main__':
    main()
N,K = map(int,input().split())
A = list(map(int,input().split()))

ans = 'IMPOSSIBLE'
if max(A) >= K:
    from math import gcd
    from functools import reduce
    g = reduce(gcd,A)
    if K % g == 0: ans = 'POSSIBLE'

print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
A = list(map(int,input().split()))

ans = 'IMPOSSIBLE'
if max(A) >= K:
    # from math import gcd
    from fractions import gcd
    from functools import reduce
    g = reduce(gcd,A)
    # print(g)
    if K % g == 0: ans = 'POSSIBLE'

print(ans)
import os
import sys
from collections import defaultdict
from functools import lru_cache

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N = int(sys.stdin.readline())
A = [list(map(int, sys.stdin.readline().split())) for _ in range(N)]

# グラフつくる
nodes = set()
sources = set()
graph = defaultdict(list)
ins = defaultdict(int)
for i in range(N):
    for j in range(N - 2):
        a, b = i, A[i][j] - 1
        a, b = min(a, b), max(a, b)
        c, d = i, A[i][j + 1] - 1
        c, d = min(c, d), max(c, d)

        graph[a * N + b].append(c * N + d)
        ins[c * N + d] += 1
        sources.add(a * N + b)

        nodes.add(a * N + b)
        nodes.add(c * N + d)

assert False

# トポロジカルソート
S = []
for v in sources:
    if ins[v] == 0:
        S.append(v)
L = []
while S:
    v = S.pop()
    L.append(v)
    for u in graph[v]:
        ins[u] -= 1
        if ins[u] == 0:
            S.append(u)
if len(L) != len(nodes):
    print(-1)
    exit()

seen = []


@lru_cache(maxsize=None)
def dfs(v):
    ret = 0
    for u in graph[v]:
        ret = max(ret, dfs(u))
    return ret + 1


ans = 0
for v in sources:
    ans = max(ans, dfs(v))
print(ans)


### FIXED CODE ###

import os
import sys
from collections import defaultdict, deque
from functools import lru_cache

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N = int(sys.stdin.readline())
A = [list(map(int, sys.stdin.readline().split())) for _ in range(N)]

graph = [[] for _ in range(N ** 2)]
ins = [0] * (N ** 2)
for i in range(N):
    for j in range(N - 2):
        a, b = i, A[i][j] - 1
        c, d = i, A[i][j + 1] - 1

        if a > b:
            a, b = b, a
        if c > d:
            c, d = d, c

        graph[a * N + b].append(c * N + d)
        ins[c * N + d] += 1

zeros = []
seen = []
for v, cnt in enumerate(ins):
    if cnt == 0:
        zeros.append(v)
        seen.append(v)

ans = 0
while zeros:
    nz = []
    for v in zeros:
        for u in graph[v]:
            ins[u] -= 1
            if ins[u] == 0:
                nz.append(u)
                seen.append(u)
    zeros = nz
    ans += 1
if len(seen) == len(graph):
    print(ans)
else:
    print(-1)
r,c = [int(i) for i in input().split()]
a = [[0 for i in range(r+2)] for j in range(c)]
for i in range(r):
	a[i] = [int(j) for j in input().split()]
for i in range(r):
	rowSum = 0
	for j in range(c):
		rowSum += a[i][j]
	a[i].append(rowSum)
for i in range(c+1):
	columnSum = 0
	for j in range(r):
		columnSum += a[j][i]
	a[r][i] = columnSum
for i in range(r+1):
	for j in range(c):
		print(a[i][j],end=' ')
	print(a[i][c])

### FIXED CODE ###

r,c = [int(i) for i in input().split()]
a = [[0 for i in range(c+1)] for j in range(r+1)]
for i in range(r):
	a[i] = [int(j) for j in input().split()]
for i in range(r):
	rowSum = 0
	for j in range(c):
		rowSum += a[i][j]
	a[i].append(rowSum)
for i in range(c+1):
	columnSum = 0
	for j in range(r):
		columnSum += a[j][i]
	a[r][i] = columnSum
for i in range(r+1):
	for j in range(c):
		print(a[i][j],end=' ')
	print(a[i][c])
H,W=map(int,input().split())
board=[[True]*(W+2)]
for i in range(H):
    board.append([True]+[a=='#' for a in input()]+[True])
board.append([True]*(W+2))

q=[]
for i in range(1,H+1):
    for j in range(1,W+1):
        if board[i][j]:
            q.append([i,j])

cnt=0
while q:
    nq=[]
    for h,w in stack:
        if not board[h+1][w]:
            board[h+1][w]=True
            nq.append([h+1,w])
        if not board[h-1][w]:
            board[h-1][w]=True
            nq.append([h-1,w])
        if not board[h][w+1]:
            board[h][w+1]=True
            nq.append([h,w+1])
        if not board[h][w-1]:
            board[h][w-1]=True
            nq.append([h,w-1])

    q=nq
    cnt+=1

print(cnt-1)




### FIXED CODE ###

H,W=map(int,input().split())
board=[[True]*(W+2)]
for i in range(H):
    board.append([True]+[a=='#' for a in input()]+[True])
board.append([True]*(W+2))

q=[]
for h in range(1,H+1):
    for w in range(1,W+1):
        if board[h][w]:
            q.append((h,w))

cnt=0
while q:
    nq=[]
    for h,w in q:
        if not board[h+1][w]:
            board[h+1][w]=True
            nq.append((h+1,w))
        if not board[h-1][w]:
            board[h-1][w]=True
            nq.append((h-1,w))
        if not board[h][w+1]:
            board[h][w+1]=True
            nq.append((h,w+1))
        if not board[h][w-1]:
            board[h][w-1]=True
            nq.append((h,w-1))

    q=nq
    cnt+=1

print(cnt-1)
import copy
import fraction
import functools


def gcd(*numbers):
    return functools.reduce(fraction.gcd, numbers)


n = int(input())
a = list(map(int, input().split()))
nl = set(range(n))
gcd_list = [0]
for i in nl:
    tmp = copy.deepcopy(a)
    tmp.pop(i)
    tmp2 = gcd(*tmp)
    gcd_list.append(tmp2)
ans = max(gcd_list)
print(ans)

### FIXED CODE ###

import fractions


n = int(input())
a = list(map(int, input().split()))
nl = set(range(n))
l = [0]
r = [0]
m = []
for i in nl:
    l.append(fractions.gcd(l[i], a[i]))
    r.append(fractions.gcd(r[i], a[-i-1]))
r.reverse()
for i in nl:
    m.append(fractions.gcd(l[i], r[i+1]))
ans = max(m)
print(ans)
N, H = [int(_) for _ in input().split()]
katana = [[int(_) for _ in input().split()] for _ in range(N)]

katana.sort(key=lambda x:x[1], reverse=True)
a_max_katana = max(katana)

a_max = a_max_katana[0]
a_max_b = a_max_katana[1]
a_max_index = katana.index(a_max_katana)
katana.pop(a_max_index)

count = 0
j = 0

while H > a_max_b:
    katana_use = katana[j]
    if katana_use[1] < a_max or j == N - 2:
        count += max(0, (H - a_max_b) // a_max + bool((H - a_max_b) % a_max)) + 1
        break
    else:
        H -= katana_use[1]
        count += 1
        j += 1
else:
    count += 1

print(count)

### FIXED CODE ###

N, H = [int(_) for _ in input().split()]
katana = [[int(_) for _ in input().split()] for _ in range(N)]

katana.sort(key=lambda x:x[1], reverse=True)
a_max_katana = max(katana)

a_max = a_max_katana[0]
a_max_b = a_max_katana[1]
katana.pop(katana.index(a_max_katana))

count = 0

for katana_use in katana:
    if katana_use[1] > a_max:
        H -= katana_use[1]
        count += 1
        if H > a_max_b:
            continue
        else:
            count += 1
            break
    else:
        count += (H - a_max_b) // a_max + bool((H - a_max_b) % a_max) + 1
        break

else:
    count += (H - a_max_b) // a_max + bool((H - a_max_b) % a_max) + 1

print(count)
n=int(input())
b=list(map(int,input().split()))
x=sum(b)+b[0]
y=0
for i in range(0,n-1):
  if b[i]>b[i+1]:
    y+=b[i+1]-b[i]
print(int(x+y))


### FIXED CODE ###

n=int(input())
b=list(map(int,input().split()))
x=sum(b)+b[0]
y=0
for i in range(0,n-2):
  if b[i]>b[i+1]:
    y+=(b[i+1]-b[i])
print(x+y)
n = int(input())
print(a=n//1000)

### FIXED CODE ###

print((1000-(int(input())%1000))%1000)
import scipy.misc as scm

H, W, A, B = [int(input()) for _ in range(4)]
MOD = 10**9 + 7
f = [1]
a = [1]
for i in range(1, H+W-1):
    f.append((f[i-1] * i) % MOD)
    a.append(pow(f[i], MOD-2, MOD))
ans = 0
for i in range(B, W, 1):
    ans += (((f[(H-A-1)+i] * a[H-A-1] * a[i]) % MOD) * ((f[(A-1)+(W-1-i)] * a[A-1] * a[W-1-i]) % MOD))
    ans %= MOD
print(ans)

### FIXED CODE ###

import scipy.misc as scm

H, W, A, B = [int(i) for i in input().split()]
MOD = 10**9 + 7
f = [1]
a = [1]
for i in range(1, H+W-1):
    f.append((f[i-1] * i) % MOD)
    a.append(pow(f[i], MOD-2, MOD))
ans = 0
for i in range(B, W, 1):
    ans += (((f[(H-A-1)+i] * a[H-A-1] * a[i]) % MOD) * ((f[(A-1)+(W-1-i)] * a[A-1] * a[W-1-i]) % MOD))
    ans %= MOD
print(ans)
# -*- coding: utf-8 -*-

import itertools
import numpy as np

def main():

    N,M,X= map(int, input().split())
    matrix = [list(map(int, input().split())) for i in range(N)]

    l= []

    for i in range(N):
        for pair in itertools.combinations(matrix, i+1):
            row_sum = np.sum(pair, axis=0)
            for j in range(len(row_sum)):
                if j == 0:
                    continue
                if row_sum[j] < X:
                    break
                l.append(row_sum[0])


    if len(l) == 0:
        print('-1')
    else:
        print(min(l))
if __name__ == '__main__':
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-

import itertools
import numpy as np


def main():

    n, m, x= map(int, input().split())
    matrix = np.array([list(map(int, input().split())) for _ in range(n)], dtype=np.int32)

    out = 10**18
    for i in itertools.product([False,True], repeat=n):
        row_sum = np.sum(matrix[np.where(i)], axis=0)
        if m == np.count_nonzero(row_sum[1:] >= x):
            out = min(out, row_sum[0])

    if out == 10**18:
        print('-1')
    else:
        print(out)


if __name__ == '__main__':
    main()
ns, ds = input().split()
n, d = int(ns), int(ds)

if n % (2 * d + 1) == 0:
  ans = n / (2 * d + 1)
else:
  ans = floor(n / (2 * d + 1)) + 1

print(ans)

### FIXED CODE ###

import math
ns, ds = input().split()
n, d = int(ns), int(ds)

if n % (2 * d + 1) == 0:
  ans = n / (2 * d + 1)
else:
  ans = math.floor(n / (2 * d + 1)) + 1

print(int(ans))
W, H, N = map(int, input().split())
a_list =[] 
for i in range(N):
  a_list.append(list(map(int, input().split())))
a1_list = [i[0] for i in a_list if i[2] == 1 ]
a2_list = [i[0] for i in a_list if i[2] == 2 ]
a3_list = [i[1] for i in a_list if i[2] == 3 ]
a4_list = [i[1] for i in a_list if i[2] == 4 ]
if a1_list == []:
  a1_max = 0
else:
  a1_max = max(a1_list)
if a2_list == []:
  a2_min = W
else:
  a2_min = min(a2_list)
if a3_list ==[]:
  a3_max = 0
else:
  a3_max = max(a3_list)
if a4_list == []:
  a4_min = H
else:
  a4_min = min(a4_list)
S = (a2_min - a1_max)*(a4_min - a3_max)
if (a2_min - a1_max) >= 0 and (a4_min - a3_max) >= 0):
  print(S)
else:
  print(0)

### FIXED CODE ###

W, H, N = map(int, input().split())
a_list =[] 
for i in range(N):
  a_list.append(list(map(int, input().split())))
a1_list = [i[0] for i in a_list if i[2] == 1 ]
a2_list = [i[0] for i in a_list if i[2] == 2 ]
a3_list = [i[1] for i in a_list if i[2] == 3 ]
a4_list = [i[1] for i in a_list if i[2] == 4 ]
if a1_list == []:
  a1_max = 0
else:
  a1_max = max(a1_list)
if a2_list == []:
  a2_min = W
else:
  a2_min = min(a2_list)
if a3_list ==[]:
  a3_max = 0
else:
  a3_max = max(a3_list)
if a4_list == []:
  a4_min = H
else:
  a4_min = min(a4_list)
S = (a2_min - a1_max)*(a4_min - a3_max)
if (a2_min - a1_max) >= 0 and (a4_min - a3_max) >= 0:
  print(S)
else:
  print(0)
N, M = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
A.sort()
sumcost = 0
k = 0
t = 0
while M-k>0:
    buy = min(M-k, A[t][0])
    sumcost += A[t][1]*buy
    k += buy
    t += 1


print(sumcost)

### FIXED CODE ###

N, M = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
A.sort()
sumcost = 0
for i in range(M):
    sumcost += A[0][0]
    A[0][1] -= 1
    if A[0][1] < 1:
        A.pop(0)

print(sumcost)
a = input()
if a = "AAA" or a = "BBB":
  print("No")
else:
  print("Yes")

### FIXED CODE ###

a = input()
if a == "AAA" or a == "BBB":
  print("No")
else:
  print("Yes")
s=list(input())

K=int(input())

L=[]

for i in range (1,K+1):
    for j in range (0, len(s)-i+1):
        L.append("".join(s[j:j+1]))

L=sorted(set(L))

print(L[K-1])



### FIXED CODE ###

s=list(input())

K=int(input())

L=[]

for i in range (1,K+1):
    for j in range (0, len(s)-i+1):
        L.append("".join(s[j:j+i]))

L=sorted(set(L))

print(L[K-1])
A, B = map(int, input().split())
C = A//0.08
if(C*0.1 = B):
  print(C)
else:
  print(-1)

### FIXED CODE ###

A, B = map(int, input().split())
A1 = A/0.08
A2 = (A+1)/0.08
B1 = B/0.1
B2 = (B+1)/0.1
C = 0
for i in range(1001):
  if A1 <= i < A2 and B1 <= i < B2:
    print(i)
    C = 1
    break
if C == 0:
  print(-1)
n,m,q=map(int,input().split())
a=[]
b=[]
c=[]
d=[]
for j in range(q):
    a2,b2,c2,d2=map(int,input().split())
    a.append(a2)
    b.append(b2)
    c.append(c2)
    d.append(d2)

#dp[i][j] i番目までの数字でjまでつかってとれる最高得点
dp=[[0]*(m+1) for _ in range(n+1)]

for i in range(q):
    for k in range(m+1):
        if k+c>m:
            continue
        dp[b[i]][k+c]=dp[a[i]][k]+d[i]

ans = 0
for j in range(m):
    ans = max(ans,dp[n][j]) 
print(dp[n][m])











### FIXED CODE ###

n,m,q=map(int,input().split())
a=[]
for _ in range(q):
    a.append(list(map(int,input().split())))

ans=0
def search(l):
    global ans
    if len(l)==n+1:
        score=0
        for i in range(q):
            if l[a[i][1]]-l[a[i][0]]==a[i][2]:
                score+=a[i][3]
        ans=max(ans,score)
    
    else:
        for i in range(l[-1],m+1):
            search(l+[i])

search([1])

print(ans)
import sympy

n = int(input())
lis = list(map(int, input().split()))

t = [0]*(10**6)

for p in range(n):
    t[lis[p]] = 1

count =n
for p in range(n):
    for k in sympy.divisors(lis[p]):
        #print(str(p) +" " + str(k))
        if t[k] == 1:
            if lis[p] != k or lis.count(lis[p]) > 1:
                count -= 1
                break
print(count)

### FIXED CODE ###

n = int(input())
lis = list(map(int, input().split()))
maxL = max(lis)+1
t = [0] * maxL
lis.sort()
for k in lis:
    t[k] += 1
    if t[k] == 1:
        for p in range(k * 2, maxL, k):
            t[p] += 2
print(t.count(1))
H,W=map(int,input().split())
l=[]
for i in range(H):
  l.append(list(map(int,input().split())))
  
x,y=0,0
p=1
J=[]
ans=0
while y<H:
  if y%2==0:
    if x<W-1:
      nx=x+1
      ny=y
    else:
      nx=x
      ny=y+1
  else:
    if x>0:
      nx=x-1
      ny=y
    else:
      nx=x
      ny=y+1
  if l[y][x]%2==1:
    l[ny][nx]+=1
    ans+=1
    J.append((y+1,x+1,ny+1,nx+1))
  x,y=nx,ny
  if x==[0,W-1][H%2] and y==H-1:
    break

print(ans)
for a,b,c,d in J:
  print(a,b,c,d)

### FIXED CODE ###

H,W=map(int,input().split())
l=[]
for i in range(H):
  l.append(list(map(int,input().split())))
  
x,y=0,0
p=1
J=[]
ans=0
if(H,W)==(1,1):
  print(0)
else:
  while y<H:
    if y%2==0:
      if x<W-1:
        nx=x+1
        ny=y
      else:
        nx=x
        ny=y+1
    else:
      if x>0:
        nx=x-1
        ny=y
      else:
        nx=x
        ny=y+1
    if l[y][x]%2==1:
      l[ny][nx]+=1
      ans+=1
      J.append((y+1,x+1,ny+1,nx+1))
    x,y=nx,ny
    if x==[0,W-1][H%2] and y==H-1:
      break

  print(ans)
  for a,b,c,d in J:
    print(a,b,c,d)
import math
n, m, r = map(int, input().split())
a = r - n * m
if a < 0:
    print(0)
else:
    b = 1
    if n - 1 > a:
        for i in range(a):
            b *= a + n - 1 - i
        for i in range(1, a + 1):
            b = int(b / i)
    else:
        for i in range(n - 1):
            b *= a + n - 1 - i
        for i in range(1, n):
            b /= int(b / i)
    print(int(b))


### FIXED CODE ###

import math
n, m, r = map(int, input().split())
a = r - n * m
def combination(p, q):
    if q < 0 or p < q:
        return 0
    return math.factorial(p) // math.factorial(q) // math.factorial(p - q)
if a < 0:
    print(0)
else:
    print(int(combination(a + n - 1, a)))
n, X = map(int, input().split())
x = list(map(int, input().split()))

x.append(X)
x.sort()

diff_all = []
for i in range(len(x) - 1):
    diff_all.append(abs(x[i] - x[i+1]))

import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

print(gcd_list(diff_all))


### FIXED CODE ###

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

x.append(a)
x.sort()

diff_all = []
for i in range(len(x) - 1):
    diff_all.append(abs(x[i] - x[i+1]))

import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

print(gcd_list(diff_all))
n, d = map(int, input().split())
x = [list(map(int,input().split())) for i in range(n)]

ans = 0
for i,j in x:
    if (i**2)+(j**2)) <= d**2:
        ans += 1

print(ans)

### FIXED CODE ###

import math

n, d = map(int, input().split())
x = [list(map(int,input().split())) for i in range(n)]

ans = 0
for i,j in x:
    if math.sqrt((i*i)+(j*j)) <= d:
        ans += 1

print(ans)
N, M = map(int, input().split())

group = []

MOD = 1000000007

pre_a = int(input())
group.append(pre_a)

ok = True
for i in range(M-1):
    a = int(input())
    tmp = a - pre_a - 1
    pre_a = a
    if tmp == 1:
        ok = False
    else:
        group.append(tmp)
    if not ok:
        break
group.append(N - pre_a)

if not ok:
    print(0)
elif max(group) == 1:
    print(1)
else:
    fiv = [0 for i in range(max(group))]
    fiv[0] = 1
    fiv[1] = 1
    for i in range(2, len(fiv)):
        fiv[i] = (fiv[i-1] + fiv[i-2]) % MOD
    ans = 1
    for g in group:
        ans *= fiv[g-1]
    print(ans%MOD)


### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    N, M =map(int, input().split())
    a = [int(input()) for i in range(M)]

    sep = []
    pre = -1
    ok = True
    for t in a:
        tmp = t - pre - 1
        if tmp == 0:
            ok = False
            break
        sep.append(tmp)
        pre = t
    sep.append(N-pre)
    # print(sep)

    if not ok:
        print(0)
        return
    max_sep = max(sep)

    MOD = 1000000007
    fib = [1] * (max_sep)
    for i in range(2, max_sep):
        fib[i] = fib[i-2] + fib[i-1]
        fib[i] %= MOD
    
    ans = 1
    for s in sep:
        ans *= fib[s-1]
        ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()
import numpy as np

def calculate_length(int radius):
    return 2.0 * radius * np.pi

if __name__ == "__main__":
    radius = int(input())
    print(calculate_rength(radius))

### FIXED CODE ###

import numpy as np

def calculate_length(radius):
    return 2.0 * radius * np.pi

if __name__ == "__main__":
    radius = int(input())
    print(calculate_length(radius))
N,W = map(int, input().strip().split(" "))
oj = []
for i in range(N):
    tmp = list(map(int, input().strip().split(" ")))
    oj.append(tmp)

def chk(x):
    s = f"{x:b}"
    s = s[-1::-1]
    w = 0
    v = 0
    for i in range(len(s)):
        if s[i] == '1':
            w += oj[i][0]
            v += oj[i][1]
    return w,v

ans = 0
for i in range(0, 2**N):
    w,v = chk(i)
    if w <= W and v > ans:
        ans = v
print(ans)


### FIXED CODE ###

N,W = map(int, input().strip().split(" "))
oj = []
for i in range(N):
    tmp = list(map(int, input().strip().split(" ")))
    oj.append(tmp)

dp = [[0] * (W+1) for i in range(N)]
for i in range(W+1):
    dp[0][i] = oj[0][1] if oj[0][0] <= i else 0

for i in range(1,N):
    for j in range(W+1):
        if j < oj[i][0]:
            dp[i][j] = dp[i-1][j]
        else:
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-oj[i][0]] + oj[i][1])
print(max(dp[N-1]))
a,t=input().split()
a=int(a)
t=int(t)
x = a * t
i=int(i)
c=min(x,i)

### FIXED CODE ###

a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)
print(c)
a, b, c= map(int, input().split())
kawaiso = 0 
if a==b && a!=c:
    kawaiso = 1

if b==c && b!=a :
    kawaiso = 1
]
if c==a && c!=b :
    kawaiso = 1

if kawaiso == 1 :
    print ('yes')

else :
    print('No')


### FIXED CODE ###

a, b, c= map(int, input().split())
kawaiso = 0 
if a==b and a!=c:
    kawaiso = 1
 
elif  b==c and b!=a:
    kawaiso = 1
 
elif c==a and c!=b:
    kawaiso = 1
    
else:
    kawaiso = 0
  
 
if kawaiso == 1:
    print ("Yes")
    
else:
    print("No")