Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

#F
from operator import mul
from functools import reduce

r1, c1, r2, c2 = [int(i) for i in input().split()]
mod = 10**9 + 7

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

def f(rr,cc):
    #(0,0)~(r,c)までのコンビネーションの累積和
    #print(rr+cc+2, cc+1)
    #print(combinations_count(rr+cc+2, cc+1))
    return combinations_count(rr+cc+2, cc+1) - 1

ans = f(r2, c2) - f(r2, c1-1) - f(r1-1, c2) + f(r1-1, c1-1)
print(ans % mod)

### FIXED CODE ###

#F
from operator import mul
from functools import reduce

r1, c1, r2, c2 = [int(i) for i in input().split()]
mod = 10**9 + 7

#pre-caluculation of the factorial
num = 10**6*2+3
fact=[0] * num
fact[0]=1
for i in range(1, num):
    fact[i] = (fact[i-1] * i) % mod

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

def f(rr,cc):
    #(0,0)~(r,c)までのコンビネーションの累積和
    #print(rr+cc+2, cc+1)
    #print(combinations_count(rr+cc+2, cc+1))
    #return combinations_count(rr+cc+2, cc+1) - 1
    return (fact[rr+cc+2]%mod * pow(fact[rr+1]*fact[cc+1], mod-2, mod)) % mod -1

ans = f(r2, c2) - f(r2, c1-1) - f(r1-1, c2) + f(r1-1, c1-1)
print(ans % mod)
### BUGGY CODE ###

N = int(input())
S = input().strip()
k = 0
D = {chr(i):[] for i in range(97,123)}
D[S[0]].append(0)
for i in range(1,N):
    a = S[i]
    if len(D[a])>0:
        if k==0:
            k += 1
        else:
            for j in D[a]:
                if j-k>=0 and S[j-k:j]==S[i-k:i] and i-j>=k+1:
                    k += 1
                    break
    D[a].append(i)
print(k)

### FIXED CODE ###

N = int(input())
S = input().strip()
cmax = 0
for k in range(1,N):
    X = S[:N-k]
    Y = S[k:]
    cur = 0
    cnt = 0
    for i in range(N-k):
        if X[i]!=Y[i]:
            cmax = max(cmax,min(cnt,k))
            cur = i
            cnt = 0
        else:
            cnt += 1
    cmax = max(cmax,min(cnt,k))
print(cmax)
### BUGGY CODE ###

H,N = map(int,input().split())
A = []
B = []
for i in range(N):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)
x = max(A)
dp = [10**9 for i in range(H+x+1)]
dp[0] = 0
for i in range(N):
    a = A[i]
    b = B[i]
    for j in range(H+x+1):
        if j < a:
            continue
        dp[j] = min(dp[j-a]+b,dp[j])
ans = 10**9
for i in range(H,H+x+1):
    ans = min(ans,dp[i])
print(ans)

### FIXED CODE ###

H,N = map(int,input().split())
A = []
B = []
for i in range(N):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)
x = max(A)
dp = [10**9 for i in range(H+x+1)]
dp[0] = 0
for i in range(N):
    a = A[i]
    b = B[i]
    for j in range(H+x+1):
        if j < a:
            continue
        dp[j] = min(dp[j-a]+b,dp[j])
ans = 10**9
for i in range(H,H+x+1):
    ans = min(ans,dp[i])
print(ans)
### BUGGY CODE ###

import copy
n = int(input())
l = [int(input()) for i in range(n)]
l1 = copy.deepcopy(l)
for i in range(len(l1)):
  l.remove(l[i])
  print(max(l))
  l = copy.copy(l1)



### FIXED CODE ###

n = int(input())
l = [int(input()) for i in range(n)]
a = max(l)
b = sorted(l)[-2]
for i in l:
  print(b if i == a else a)
### BUGGY CODE ###

N = int(input())
from math import sqrt
#N mod K = 0 or 1 となるk をさがす
#K = Nの約数　or N-1 の約数
def divisor(num):
    max_num = int(sqrt(num))
    divisor_list = []
    for i in range(1, max_num + 1):
        if num % i == 0:
            if i != 1:
                divisor_list.append(i)
            divisor_list.append(num//i)
    sorted_divisor_list = sorted(divisor_list)
    return sorted_divisor_list

K_1 = divisor(N-1)
K_2 = divisor(N)
Ks = set(K_1 + K_2)
count = 0
for k in Ks:
    temp = N
    while temp % k == 0:
        temp //= k
    if temp == 1 or temp % k == 1:
        count += 1

ans = count
print(ans)

### FIXED CODE ###

N = int(input())
from math import sqrt
#N mod K = 0 or 1 となるk をさがす
#K = Nの約数　or N-1 の約数
def divisor(num):
    max_num = int(sqrt(num))
    divisor_list = []
    for i in range(1, max_num + 1):
        if num % i == 0:
            if i != 1:
                divisor_list.append(i)
            if num // i != 1:
                divisor_list.append(num//i)
    #sorted_divisor_list = sorted(divisor_list)
    return divisor_list

K_1 = divisor(N-1)
K_2 = divisor(N)
K_3 = []
count = 0
for k in K_2:
    temp = N
    while temp % k == 0:
        temp //= k
    if temp == 1 or temp % k == 1:
        count += 1
        K_3.append(k)
kk = K_1 + K_3
ans = len(set(kk))
print(ans)
### BUGGY CODE ###

from copy import deepcopy

N, S = map(int, input().split())
A = [0] + list(map(int, input().split()))
mod = 998244353

dp = [0] * (S + 1)
dp2 = [0] * (S + 1)

"""
dp[i][j] = (i個までの数を使ってj点とる組み合わせ)
としたはいいが、f(L, R)をf(1,L)とf(1, R)に分解できずに爆死したのが敗因。

各(L, R)に対してdpするとTLEになるから手詰まりになると思ったわけだけど、
上のdpテーブルを各iに対して使い回しつつ、新たなdpテーブル[1, 0, 0, ...]を
作成して「元のdpテーブルに加算しておけば」dpテーブル一個で1番目スタート、2番目スタート、
..., L番目スタートのdpテーブル全てを考えられる！
（解説放送前半を参考）
"""

# i == 0の時
dp[0] = 1
ans = 0

# i >= 1の時
for i in range(1, N + 1):
    for j in range(S + 1):
        if j - A[i] < 0:
            dp2[j] = dp[j]
        else:
            dp2[j] = dp[j] + dp[j - A[i]]
    ans += dp2[S]
    ans %= mod

    dp = deepcopy(dp2)
    dp[0] += 1
    dp2 = [0] * (S + 1)

print(ans)


### FIXED CODE ###

N, S = map(int, input().split())
A = [0] + list(map(int, input().split()))
mod = 998244353

dp = [0] * (S + 1)
dp2 = [0] * (S + 1)

"""
dp[i][j] = (i個までの数を使ってj点とる組み合わせ)
としたはいいが、f(L, R)をf(1,L)とf(1, R)に分解できずに爆死したのが敗因。

各(L, R)に対してdpするとTLEになるから手詰まりになると思ったわけだけど、
上のdpテーブルを各iに対して使い回しつつ、新たなdpテーブル[1, 0, 0, ...]を
作成して「元のdpテーブルに加算しておけば」dpテーブル一個で1番目スタート、2番目スタート、
..., L番目スタートのdpテーブル全てを考えられる！
（解説放送前半を参考）
"""

# i == 0の時
dp[0] = 1
ans = 0

# i >= 1の時
for i in range(1, N + 1):
    for j in range(S + 1):
        if j - A[i] < 0:
            dp2[j] = dp[j]
        else:
            dp2[j] = dp[j] + dp[j - A[i]]
    ans += dp2[S]
    ans %= mod

    dp = dp2 # deepcopyしなくてもこれで十分なはずだし、ポインタ渡しなので高速？
    dp[0] += 1
    dp2 = [0] * (S + 1)

print(ans)
### BUGGY CODE ###

N = int(input())
s = str(input())
maxlen = N//2

def solve(tgt):
    for i in range(N-tgt*2+1):
        if s[i:i+tgt] in s[i+tgt:]:
            return True
    return False

ng = maxlen + 1
ok = 0
while ng-ok > 1:
    tgt = (ok+ng)//2
    if solve(tgt):
        ok = tgt
    else:
        ng = tgt
print(ok)


### FIXED CODE ###

from collections import defaultdict as dd
N = int(input())
s = str(input())
maxlen = N//2

def solve(tgt):
    dic = dd(int)
    st = s[tgt:2*tgt]
    dic[st] += 1
    ls = [st]
    for char in s[2*tgt:]:
        st = st[1:]+char
        dic[st] += 1
        ls.append(st)
    st = s[:tgt]
    if dic[st] > 0:
        return True
    dic[ls[0]] -= 1
    for i,char in enumerate(s[tgt:N-tgt]):
        st = st[1:]+char
        if dic[st] > 0:
            return True
        dic[ls[i+1]] -= 1
    return False

ng = maxlen + 1
ok = 0
while ng-ok > 1:
    tgt = (ok+ng)//2
    if solve(tgt):
        ok = tgt
    else:
        ng = tgt
print(ok)
### BUGGY CODE ###

mod=10**9+7
def num2bi(x, k):
  #10進数xを2進数k桁(string)で出力
  out=format(x, '0'+str(k)+'b')
  return out

N=int(input())
A=list(map(int, input().split()))
ma=max(A)
keta=1
while ma>=2**keta:
  keta+=1
  
onekazu=[0 for i in range(keta)]
k=str(keta)
for i in range(N):
  temp=format(A[i], '0'+str(k)+'b')
  onekazu=[onekazu[j]+int(temp[j]) for j in range(keta)]
    
out=0
out=sum([(onekazu[i]*(N-onekazu[i])%mod)*(2**(keta-1-i))%mod for i in range(keta)])
out%=mod  
print(out)

### FIXED CODE ###

mod=10**9+7
def num2bi(x, k):
  #10進数xを2進数k桁(string)で出力
  out=format(x, '0'+str(k)+'b')
  return out

N=int(input())
A=list(map(int, input().split()))
ma=max(A)
keta=1
while ma>=2**keta:
  keta+=1
  
onekazu=[0 for i in range(keta)]
k=str(keta)
for i in range(N):
  temp=format(A[i], '0'+str(k)+'b')
  onekazu=[onekazu[j]+1 if temp[j]=='1' else onekazu[j] for j in range(keta)]
    
out=0
out=sum([(onekazu[i]*(N-onekazu[i])%mod)*(2**(keta-1-i))%mod for i in range(keta)])
out%=mod  
print(out)
### BUGGY CODE ###

def examA():
    N = I()
    ans = 0
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    N, M = LI()
    A = LI()
    A.sort()
    l = 0; r = 10**6
    while(r-l>1):
        now = (l+r)//2
        cnt = 0
        for i in range(N):
            need = now-A[i]
            c = bisect.bisect_left(A,need)
            cnt += N-c
        if cnt>=M:
            l = now
        else:
            r = now
    base = l
    cnt = 0
    ans = 0
    for i in range(N):
        need = base - A[i]
        c = bisect.bisect_left(A, need+1)
        for j in range(c,N):
            ans += A[i]+A[j]
            cnt += 1
    if cnt<M:
        ans += base*(M-cnt)
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    examE()

"""

"""

### FIXED CODE ###

def examA():
    N = I()
    ans = 0
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    N, M = LI()
    A = LI()
    A.sort()
    ma = max(A)
    l = 0; r = ma*2+1
    while(r-l>1):
        now = (l+r)//2
        cnt = 0
        for a in A:
            need = now-a
            if need>ma:
                continue
            c = bisect.bisect_left(A,need)
            cnt += N-c
        if cnt>=M:
            l = now
        else:
            r = now
    base = l
    cnt = 0
    ans = 0
    S = [0]+A
    for i in range(N):
        S[i+1] += S[i]
    #print(S)
    for a in A:
        need = base - a
        c = bisect.bisect_left(A, need+1)
        ans += a*(N-c) + S[N]-S[c]
        cnt += (N-c)
    if cnt<M:
        ans += base*(M-cnt)
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    examE()

"""

"""
### BUGGY CODE ###

import bisect

n,m=[int(i) for i in input().split()]
a_list=[int(i) for i in input().split()]
a_list.sort()

for i in range(m):
    b,c=map(int,input().split())
    index=bisect.bisect_left(a_list,c)
    if index<=0:
        continue
    if index>b:
        index=b
    a_list=[c]*index+a_list[index:]
    a_list.sort()
    
print(sum(a_list))

### FIXED CODE ###

N,M = list(map(int,input().split()))
a_list = list(map(int,input().split()))
bc_list = []
for _ in range(M):
    b,c = list(map(int,input().split()))
    bc_list.append([b,c])

a_list = sorted(a_list)
bc_list = sorted(bc_list,key=lambda x: x[1],reverse=True)

tmp = 0
for i,a in enumerate(a_list):
    if tmp >= len(bc_list):
        break
    
    if a < bc_list[tmp][1]:
        bc_list[tmp][0] -= 1
        a_list[i] = bc_list[tmp][1]
    else:
        break

    if bc_list[tmp][0] == 0:
        tmp += 1
print(sum(a_list))
### BUGGY CODE ###

n=int(input())
a=[int(c) for c in input().split()]
for num in range(n):
    print(a.index(num+1)+1,end=" ")

### FIXED CODE ###

n=int(input())
a=[0]*n
l =list(map(int, input().split()))
for i in range(n):
    a[l[i]-1]=i+1
for i in range(n):
    print(a[i])
### BUGGY CODE ###

import copy
h,w = map(int,input().split())
s = [list(input()) for _ in range(h)]
l,r,u,d,S = [[0]*w for _ in range(h)],[[0]*w for _ in range(h)],[[0]*w for _ in range(h)],[[0]*w for _ in range(h)],[[0]*w for _ in range(h)]
for i in range(h):
  if s[i][0] == ".":
    l[i][0] = 1
  for j in range(1,w):
    if s[i][j] == ".":
      l[i][j] = l[i][j-1] + 1
#print(l)
for i in range(h):
  if s[i][w-1] == ".":
    r[i][w-1] = 1
  for j in range(w-2,-1,-1):
    if s[i][j] == ".":
      r[i][j] = r[i][j+1] + 1
#print(r)
for i in range(w):
  if s[0][i] == ".":
    u[0][i] = 1
  for j in range(1,h):
    if s[j][i] == ".":
      u[j][i] = u[j-1][i] + 1
#print(u)
for i in range(w):
  if s[h-1][i] == ".":
    d[h-1][i] = 1
  for j in range(h-2,-1,-1):
    if s[j][i] == ".":
      d[j][i] = d[j+1][i] + 1
m = 0
for i in range(h):
  for j in range(w):
    m = max(m,l[i][j]+r[i][j]+u[i][j]+d[i][j]-3)
print(m)

### FIXED CODE ###

import numpy as np
h,w = map(int,input().split())
s = np.array([[1 if i == "." else 0 for i in input()] for j in range(h)])
l,r,u,d = np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w))
for i in range(h):
  u[i] = (u[i-1]+1)*s[i]
  d[-i-1] = (d[-i]+1)*s[-i-1]
for i in range(w):
  l[:,i] = (l[:,i-1]+1)*s[:,i]
  r[:,-i-1] = (r[:,-i]+1)*s[:,-i-1]
print(int(np.max(l+r+u+d))-3)
### BUGGY CODE ###

#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = list(input())
n = len(s)
s = s[::-1]
dp = [[0]*13 for _ in range(n)]
if s[0] == '?':
    for i in range(10):
        dp[0][i] = 1
else:
    dp[0][int(s[0])] = 1
for i in range(1,n):
    x = (10**i) % 13
    if s[i] != '?':
        y = int(s[i])
        for j in range(13):
            dp[i][(j+(y*x) % 13) % 13] += dp[i-1][j]
            dp[i][(j+(y*x) % 13) % 13] %= mod
    else:
        for j in range(10):
            for k in range(13):
                dp[i][(k+(j*x) % 13) % 13] += dp[i-1][k]
                dp[i][(k+(j*x) % 13) % 13] %= mod
print(dp[n-1][5])


### FIXED CODE ###

#!/usr/bin/env python3
#ABC135 D

import sys
import math
import bisect
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
mod = 10**9 + 7

s = list(input())
s = s[::-1]
l = len(s)
#dp[i][j] := 先頭i文字として考えられるもののうち、13で割ったあまりがjであるもの
dp = [[0]*13 for _ in range(l)]
remain = 1
if s[0] == '?':
    for i in range(10):
        dp[0][i] = 1
else:
    dp[0][int(s[0])] = 1

for i in range(1,l):
    remain = (remain * 10) % 13
    if s[i] == '?':
        for k in range(10):
            for j in range(13):
                dp[i][(j + remain * k) % 13] += dp[i-1][j]
                dp[i][(j + remain * k) % 13] %= mod
    else:
        for j in range(13):
            dp[i][(j + remain * int(s[i])) % 13] += dp[i-1][j]
print(dp[-1][5])
### BUGGY CODE ###

import sys
from io import StringIO
import unittest


def resolve():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

    for i in range(M):
        m = max(A)
        m_index = A.index(m)
        A[m_index] //= 2

    print(int(sum(A)))


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """3 3
2 13 8"""
        output = """9"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """4 4
1 9 3 5"""
        output = """6"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """1 100000
1000000000"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """10 1
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000"""
        output = """9500000000"""
        self.assertIO(input, output)


if __name__ == "__main__":
    resolve()


### FIXED CODE ###

import sys
from io import StringIO
import unittest
import heapq


def resolve():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    A = list(map(lambda x: x*(-1), A))
    heapq.heapify(A)

    for i in range(M):
        m = -1 * heapq.heappop(A)
        heapq.heappush(A, -1 * (m//2))

    print(-1 * int(sum(A)))


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """3 3
2 13 8"""
        output = """9"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """4 4
1 9 3 5"""
        output = """6"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """1 100000
1000000000"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """10 1
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000"""
        output = """9500000000"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()
### BUGGY CODE ###

n,p=map(int,input().split())
if n==1:
  print(p)
else:
  for i in range(int(p**(1/n))+1):
    if p%(i+1)**n==0:
      ans=i+1
  print(ans)


### FIXED CODE ###

n,p=map(int,input().split())
ans=[]
if n==1:
  print(p)
elif n>=40:
  print(1)
else:
  for i in range(int(p**(1/n))+1):
    if p%(i+1)**n==0:
      ans.append((i+1))
  print(max(ans))
### BUGGY CODE ###

N = int(input())
ar = list(map(int, input().split()))

ansAr = []
for i in range(N):
    ansAr.append(ar.index(i+1)+1)

print(" ".join([str(n) for n in ansAr]))

### FIXED CODE ###

N = int(input())
ar = list(map(int, input().split()))
dic = {}
for i in range(len(ar)):
    dic[i] = ar[i]

arFast = sorted(dic.items(), key=lambda x: x[1], reverse=False)
for n in arFast:
    print(n[0]+1, end=" ")
### BUGGY CODE ###

n,k=map(int,raw_input().split())
a=map(int,raw_input().split())
aa=len(set(a))

div=max(0,int(aa)-k)
res = [(a.count(e),e) for e in set(a) if a.count(e) > 0]
resl=sorted(res,key=lambda x:x[0],reverse=True)
ans=0
while div>0:
    ans+=resl[-1][0]
    resl.pop()
    div=div-1

print ans


### FIXED CODE ###

import heapq

n,k=map(int,raw_input().split())
a=map(int,raw_input().split())



d={}
for i in a:
    if i in d:
        d[i]+=1
    else:
        d[i]=1
l=d.values()
div=max(0,len(l)-k)
if div==0:
    print 0
    exit()


heapq.heapify(l)

ans=0
while div>0:
    ans+=heapq.heappop(l)
    div-=1
print ans
### BUGGY CODE ###

row = list(map(int, input().split()))
Flag = False
for i in range(10000000):
    if row[0]*i % row[1] == row[2]:
        Flag = True
        break
if Flag:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

row = list(map(int, input().split()))
Flag = False
for i in range(1000000):
    if row[0]*i % row[1] == row[2]:
        Flag = True
        break
if Flag:
    print("YES")
else:
    print("NO")
### BUGGY CODE ###

# coding: utf-8
# Your code here!
H,W=map(int,input().split())


def dfs(h,w):
    A[h][w]="#"
    que=[]
    if h>0:
        if A[h-1][w]!="#":
            que.append([h-1,w])
            A[h-1][w]="#"
    if w>0:
        if A[h][w-1]!="#":
            que.append([h,w-1])
            A[h][w-1]="#"
    if h<H-1:
        if A[h+1][w]!="#":
            que.append([h+1,w])
            A[h+1][w]="#"
    if w<W-1:
        if A[h][w+1]!="#":
            que.append([h,w+1])
            A[h][w+1]="#"
    
    return que


A=[]
for _ in range(H):
    A.append(list(input()))

#print(A)

ans=0
lis=[]
for h in range(H):
    for w in range(W):
        if A[h][w]=="#":
            lis.append([h,w])
while True:
    if lis:
        N=len(lis)
        for i in range(N):
            item=lis.pop(0)
            lis+=dfs(item[0],item[1])
    if len(lis)==0:
        break
    ans+=1
    #print(lis)
    #print(A)
    
print(ans)

### FIXED CODE ###

# coding: utf-8
# Your code here!
H,W=map(int,input().split())


def dfs(h,w):
    A[h][w]="#"
    que=[]
    if h>0:
        if A[h-1][w]!="#":
            que.append([h-1,w])
            A[h-1][w]="#"
    if w>0:
        if A[h][w-1]!="#":
            que.append([h,w-1])
            A[h][w-1]="#"
    if h<H-1:
        if A[h+1][w]!="#":
            que.append([h+1,w])
            A[h+1][w]="#"
    if w<W-1:
        if A[h][w+1]!="#":
            que.append([h,w+1])
            A[h][w+1]="#"
    
    return que


A=[]
for _ in range(H):
    A.append(list(input()))

#print(A)

ans=0
lis=[]
for h in range(H):
    for w in range(W):
        if A[h][w]=="#":
            lis.append([h,w])
while True:
    pre=[]
    if lis:
        N=len(lis)
        lis=lis[::-1]
        for i in range(N):
            item=lis.pop(-1)
            pre+=dfs(item[0],item[1])
        lis=pre
    if len(lis)==0:
        break
    ans+=1
    #print(lis)
    #print(A)
    
print(ans)
### BUGGY CODE ###

n,k = list(map(int,input().split()))
m = 10**9+7
def c(x,y):
  t = 1
  for j in range(y):
    t *= x-j
    t //= j+1
  return t
for i in range(1,k+1):
  print( (c(k-1,i-1) * c(n-k+1,i)) % m )

### FIXED CODE ###

n,k = list(map(int,input().split()))
m = 10**9+7
a = 1
b = n-k+1
print(a*b%m)
for i in range(2,k+1):
  a *= k+1-i
  a //= i-1
  at = a%m
  b *= n-k+2-i
  b //= i
  bt = b%m
  print(at*bt%m)
### BUGGY CODE ###

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

def lcm(a, b):
    return a * b // gcd(a, b)

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

if N == 1:
    res = 1
else:
    l = lcm(A[0], A[1])
    for i in range(2, N):
        l = lcm(l, A[i])

    for i in range(N):
        res += l//A[i]

print(res % 1000000007)

### FIXED CODE ###

from fractions import gcd

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

l = A[0]
for i in range(1, N):
    l = l * A[i] // gcd(l, A[i])

for a in A:
    res += l//a

print(res % 1000000007)
### BUGGY CODE ###

L, R = map(int, input().split())
mi = 2019
for i in range(L,R+1):
    for j in range(i+1,R+1):
        mi = min(mi,(i*j)%2019)
        if mi == 0:
            break
print(mi)

### FIXED CODE ###

L, R = map(int, input().split())
target = R+1
if R - L > 10000:
    target = L + 10000
mi = 2019
for i in range(L,target):
    for j in range(i+1,target):
        mi = min(mi,(i*j)%2019)
print(mi)