Harryxun/stf_run huggingface dataset:
from operator import mul
from functools import reduce

N,A,B = map(int,input().split())
V = sorted(list(map(int,input().split())),reverse = True)

a = A - 1
top = V[0]
ans = 0

if top == V[a]:
  d = 1
  for i in range(a,N):
    if V[i] != top:
      b = i
      break
  if A == B:
    n = reduce(mul,[t for t in range(A,b + 1)])
    d = reduce(mul,[k for k in range(1,A + 1)])
    ans = n / d
  else:
    for i in range(1,b + 1):
      n = 1
      d *= i
      if i < A:
        continue
      for j in range(b,b - i,-1):
        n *= j
        print(n,d)
      n /= d
      ans += n
  print(float(top))
  print(int(ans))
else:
  sect = V[:A]
  ave = sum(sect) / A
  print(ave)
  con = V.count(V[a])
  ind = V.index(V[a])
  i = a - ind + 1
  if a == ind:
    print(con)
  else:
    n = reduce(mul,[t for t in range(con - i + 1,con + 1)]) 
    d = reduce(mul,[k for k in range(1,i + 1)])
    print(int(n/d))



### FIXED CODE ###

import collections
from operator import mul
from functools import reduce

N,A,B = map(int, input().split())
V = list(map(int, input().split()))
VV = sorted(V,reverse = True)
ave = 0
ml = []

for i in range(A,B + 1):
  avet = sum(VV[:i]) / i
  if avet >= ave:
    ml.append(i)
    ave = max(ave,avet)
  else:
    break

dic = collections.Counter(V)
#print(dic,ml)

def cmb(n,r):
  r = min(n - r,r)
  if r == 0:
    return 1
  over = reduce(mul,range(n, n - r, -1))
  under = reduce(mul,range(1,r + 1))
  return over // under

res = 0

for j in ml:
  r = dic[VV[j - 1]]
  rr = VV.index(VV[j - 1])
  res += cmb(r,j - rr)

print(ave)
print(res)
l, r = map(int, input().split())
l, r = l%2019, r%2019
mi = 9999
if r*(r-1)<2019:
    print(l*(l+1))
elif r==0 or l==0:
    print(0)
else:
    for i in range(l, r-1):
        for j in range(i+1, r):
            if (i/3).is_integer() and (j/673).is_integer():
                mi = (i/3)*((i/3)+1)
            elif (i/673).is_integer() and (j/3).is_integer():
                mi = (i/673)*((i/673)+1)
            else:
                mi = min(mi, (i*j)%2019)
    print(mi)

### FIXED CODE ###

n, a, b = map(int, input().split())
print(min(a*n, b))
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

min_i =	0
min_temp = abs(T - H[0] * 0.006 - A)

for i in range(1, N):
    if abs(T-H[i]*0.006-A) < min_temp:
	min_temp = abs(T-H[i]*0.006-A)
        min_i =	i

print(min_i+1)


### FIXED CODE ###

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

N = int(input())
T, A = map(int, input().split())

import numpy as	np

ans = (T-A) / 0.006

h = np.abs(np.array(list(map(int, input().split()))) - ans)

print(np.argmin(h) + 1)
n = input()
arr = input().split(' ')
arr = [int(a) for a in arr]
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a
def lcm(a, b):
    return a *b//gcd(a, b)
tmp = arr[0]
for i in range(len(arr)-1):
    tmp = lcm(tmp,arr[i+1])
ans = sum([int(tmp/a) for a in arr])
ans = int(ans % (1e+9+7))
print(ans)


### FIXED CODE ###

import sys
from fractions import gcd
input = sys.stdin.readline

n = input()
arr = list(map(int, input().split()))
tmp = arr[0]
for i in arr:
    tmp = tmp*i//gcd(tmp,i)
print(sum(tmp//a for a in arr) % (10**9+7))
import sys

n, m = map(int, input().split())

a = []
for i in range(n):
    a.append(list(input()))

b = []
for i in range(m):
    b.append(list(input()))

for i in range(n-m+1):
    for j in range(n-m+1):
        for k in range(m):
            if k <= m-2:
                if a[i+k][j:j+m] == b[k]:
                    continue
                else:
                    break
            else:
                if a[i+k][j:j+m] == b[k]:
                    print("Yes")
                    sys.exit()
                else:
                    break

print("No")


    

### FIXED CODE ###

a, b = map(int, input().split())
l = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1]

if l.index(a) > l.index(b):
    print("Alice")
elif l.index(a) == l.index(b):
    print("Draw")
else:
    print("Bob")
S = input()
ans = 0
tmp = 0
preR = 0
if S == "SSS":
    print(0)
elif S == 'RSS' or S == 'SRS' or S == 'SSR' or S ==  'RSR'):
    print(1)
elif S == 'RRS' or S == 'SRR':
    print(2)
elif S == 'RRR':
    print(3)

### FIXED CODE ###

S = input()
ans = 0
tmp = 0
preR = 0
if S == "SSS":
    print(0)
elif S == 'RSS' or S == 'SRS' or S == 'SSR' or S ==  'RSR':
    print(1)
elif S == 'RRS' or S == 'SRR':
    print(2)
elif S == 'RRR':
    print(3)
from collections import defaultdict
MOD = 10**9+7
N, K = map(int, input().split())
E = defaultdict(list)

for i in range(N-1):
  a, b = map(int, input().split())
  E[a-1] += [b-1]
  E[b-1] += [a-1]
  
def dfs(K, es, now, par):
  if par==-1:
    can_use = K-1
  else:
    can_use = K-2
  if K<len(es[now]):
    return 0
  else:
    case_num = 1
    for e in es[now]:
      if e==par:
        continue
      case_num *= can_use
      can_use -= 1
      case_num %= MOD
    for e in es[now]:
      if e==par:
        continue
      case_num *= dfs(K, es, e, now)
      case_num %= MOD
    return case_num

ans = K*dfs(K, E, 0,-1)
ans %= MOD
print(ans)

### FIXED CODE ###

from collections import defaultdict, deque
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    return g1[n] * g2[r] % mod

mod = 10**9+7 #出力の制限
N = 10**6
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 = map(int, input().split())
dic = defaultdict(list)
for i in range(N-1):
  a, b = map(int, input().split())
  dic[a-1] += [b-1]
  dic[b-1] += [a-1]

log = [float('inf')]*N
log[0] = 0
q = deque([0])
ans = K
while q:
  p = q.popleft()
  if log[p]<1:
    ans *= cmb(K-1,K-1-len(dic[p]),mod)
  else:
    ans *= cmb(K-2,K-1-len(dic[p]),mod)
  ans %= mod
  for e in dic[p]:
    if log[e]>log[p]+1:
      q += [e]
      log[e] = log[p]+1
print(ans)
# 169a
# A*Bを整数として出力せよ

# ①入力をプログラムでとらえるように受け取る
a, b = map(int, input(),split())
# print(a, b)

# ②受け取った入力値を適切に出力
answer = a * b

# ③結果出力
print(answer)

### FIXED CODE ###

# 169a
# A*Bを整数として出力せよ

# ①入力をプログラムでとらえるように受け取る
a, b = map(int, input().split())
# print(a, b)

# ②受け取った入力値を適切に出力
answer = a * b

# ③結果出力
print(answer)
N,i=map(int,input.split())
print((N-i)+1)

### FIXED CODE ###

N,i=map(int,input().split())
print(N+1-i)
mod = 10 ** 9 + 7
s = input()
dp =[[0 for _ in range(13)] for _ in range(l+1)]
dp[0][0] =1
for i in range(l):
    obj =s[l - i - 1]
    if obj == "?":
        for j in range(10):
            for k in range(13):
                dp[i + 1][(j * (10 ** i) + k) % 13] +=dp[i][k] % mod
    else:
        for k in range(13):
            dp[i + 1][(int(obj) * (10 ** i) + k) % 13] +=dp[i][k] % mod
print(dp[-1][5] % mod)

### FIXED CODE ###

mod = 10 ** 9 + 7
s = input()
n = len(s)
dp = [[0 for _ in range(13)] for _ in range(n + 1)]
dp[0][0]=1
for i in range(n):
    if s[i] == '?': 
        for j in range(10):
            for k in range(13):
                dp[i + 1][(k * 10 + j) % 13]+=dp[i][k] % mod
    else:
        for k in range(13): 
            dp[i + 1][(k * 10+ int(s[i])) % 13]+=dp[i][k] % mod
print(dp[-1][5] % mod)
H,W = map(int,input().rsplit().split())
h,w = map(int,input().rsplit().split())
print(H * W - h * w)

### FIXED CODE ###

H,W = map(int,input().rstrip().split())
h,w = map(int,input().rstrip().split())
print(H * W - h * W - (H - h) * w)
def checkWhichToRead(A, B, K, count):
    if K < 0:
        return count - 1
    ACount = count
    BCount = count
    if len(A) > 0:
        ACount = checkWhichToRead(A[1:], B, K - A[0], count + 1)
    if len(B) > 0:
        BCount = checkWhichToRead(A, B[1:], K - B[0], count + 1)
    if ACount > BCount:
        return ACount
    else:
        return BCount


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

print(checkWhichToRead(A, B, K, 0))



### FIXED CODE ###

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

totalA = [0]
totalB = [0]
sumA = 0
for i in range(N):
    sumA += A[i]
    totalA.append(sumA)
sumB = 0
for i in range(M):
    sumB += B[i]
    totalB.append(sumB)

iB = M
countMax = 0
for iA in range(N+1):
  if totalA[iA]>K:
    break
  else:
    while totalA[iA] + totalB[iB] > K:
      iB -= 1
  countMax = max(countMax,iA+iB)

print(countMax)
import bisect
import numpy as np
N,K=[int(_) for _ in input().split()]
if N==4:
    raise
A = np.array([int(_) for _ in input().split()],dtype=int)
A.sort()
#A=sorted([int(_) for _ in input().split()])

#target以下の積がK個以上ある最小のtarget

def check(target):
    cnt=0
    for i, a in enumerate(A):
        if a < 0:
            #il = bisect.bisect_left(A,  target / a)
            il = np.searchsorted(A,target/a,side='left')
            #ilからiまで、ただしilがiを超えたら0
            d = max(i - il, 0)
        elif a > 0:
            #ir = bisect.bisect_right(A, target / a)
            ir = np.searchsorted(A,target/a,side='right')
            #0からirまで、ただしirがiを超えたらi
            d = min(ir, i)
        else:
            d = i if target >= 0 else 0
        #print(target,a,d)
        cnt+=d
    return cnt>=K

lb = -10**18-1
rb = 10 ** 18 + 1
# Min x for check(x) == True
while rb - lb > 1:
    mid = (rb + lb) // 2
    if check(mid):
        rb = mid
    else:
        lb = mid
print(rb)



### FIXED CODE ###

import numpy as np
from numba import njit
N,K=[int(_) for _ in input().split()]
A = np.array([int(_) for _ in input().split()],dtype=int)
A.sort()


@njit
def main(N,K,A):
    lb = -10**18-1
    rb = 10 ** 18 + 1
    while rb - lb > 1:
        target = (rb + lb) // 2
        if 1:
            cnt=0
            for i, a in enumerate(A):
                if a==0:
                    d = i if target >= 0 else 0
                elif a < 0:
                    il = np.searchsorted(A,0- (-target)//a,side='left')
                    d = max(i - il, 0)
                else:
                    ir = np.searchsorted(A,target//a,side='right')
                    d = min(ir, i)
                cnt+=d
        if cnt>=K:
            rb = target
        else:
            lb = target
    return rb

print(main(N,K,A))
S = list(input())
F = ["A", "C", "G", "T"]
count = 0
max = 0
for i in S:
    for j in F:
        if j == i:
            count += 1
    if max < count:

        max = count
    else:
        count = 0
        f = max
        max = 0
print(max if max > f else f)

### FIXED CODE ###

S = list(input())
F = ["A", "C", "G", "T"]
count = 0
max = 0
f = 0
for i in S:
    for j in F:
        if j == i:
            count += 1
    if max < count:

        max = count
    else:
        count = 0
        if max != 0:
            f = max
        max = 0
    
print(max if max > f else f)
a, b = input().split()
c = (a + b) % 24
print(c)

### FIXED CODE ###

a, b = map(int, input().split())
c = (a + b) % 24
print(c)
def linearSearch(key, list, N):
    list[N] = key
    i = 0
    while l[i] != key:
        i += 1
    return int(i != N)


N1 = int(input())
arr1 = [int(n) for n in input().split()] + [0]
N2 = int(input())
arr2 = [int(n) for n in input().split()]

print(sum([linearSearch(key, arr1, N1) for key in arr2]))



### FIXED CODE ###

def linearSearch(key, list):
    for e in list:
        if key == e:
            return 1
    return 0


N1 = int(input())
arr1 = [int(n) for n in input().split()]
N2 = int(input())
arr2 = [int(n) for n in input().split()]

print(sum([linearSearch(key, arr1) for key in arr2]))
a,b=map (int,input ().split ())
print (max [a+b,a-b,a*b])

### FIXED CODE ###

a,b=map (int,input ().split ())
print (max([a+b,a-b,a*b]))
fantastic!!

### FIXED CODE ###

h,w = map(int,input().split())
lis = [list(map(int,input().split())) for i in range(10)]
li = [list(map(int,input().split())) for i in range(h)]

for k in range(10):
    for i in range(10):
        for j in range(10):
            if lis[i][j] > lis[i][k] + lis[k][j]:
                lis[i][j] = lis[i][k] + lis[k][j]
ans = 0
for i in range(h):
    for num in li[i]:
        if num >= 0:
            ans += lis[num][1]
print(ans)
import string
alphabets = string.ascii_lowercase

S = input()

if len(S) < 26:
    for i in range(26):
        if alphabets[i] not in S:
            char_idx = i
            break
    print(S + alphabets[char_idx])
elif S == 'zyxwvutsrqponmlkjihgfedcba':
    print(-1)
else:
    cont_flag = False
    for i in range(26-1):
        if S[i] > S[i+1]:
            if cont_flag == False:
                idx = i
                cont_flag = True
        else:
            cont_flag = False
            
    if idx == 0:
        for i in range(26):
            if alphabets[i] > S[idx]:
                char_idx = i
                break
        print(alphabets[char_idx])
    else:
        st = S[:idx]
        char = S[idx-1]
        len_st = len(st)
        for i in range(26):
            if alphabets[i] not in st and alphabets[i] > char:
                char_idx = i
                break
        print(st[:len_st-1] + alphabets[char_idx])

### FIXED CODE ###

S = input()
alpha = 'abcdefghijklmnopqrstuvwxyz'
if S == alpha[::-1]:
    print(-1)
else:
    rest = sorted(list(set(alpha) - set(S)))
    if rest:
        print(S + rest[0])
    else:
        for i in range(len(S)-1, 0, -1):
            if S[i-1] < S[i]:
                break
        rest = sorted([s for s in S[i:] if s > S[i-1]])
        print(S[:i-1] + rest[0])
S = list(map(str, input()))
N = len(S)+1
List = [0]*N
rightcount = 0
leftcount = 0

if S[0] == "<":
    leftcount+=1
else:
    rightcount+=1

for i in range(1, N-1):
    if S[i] == "<":
        leftcount+=1
        if S[i-1] == ">":
            for j in range(rightcount):
                List[i-j] = j
            if List[i-rightcount]<List[i-rightcount+1]:
                List[i-rightcount] = List[i-rightcount+1] + 1
            rightcount = 0


    if S[i] == ">":
        rightcount+=1
        if S[i-1] =="<":
            for j in range(leftcount+1):
                List[i-j] = leftcount - j
            leftcount = 0

if S[N-2] == "<":
    List[N-1] = 1
else:
    for j in range(rightcount):
        List[N-j] = j
    if List[N-rightcount]<List[N-rightcount+1]:
        List[N-rightcount] = List[N-rightcount+1] + 1

print(sum(List))

### FIXED CODE ###

S = list(map(str, input()))
N = len(S)+1
List = [0]*N
rightcount = 0
leftcount = 0

if S[0] == "<":
    leftcount+=1
else:
    rightcount+=1

for i in range(1, N-1):
    if S[i] == "<":
        leftcount+=1
        if S[i-1] == "<":
            List[i] = List[i-1]+1
        elif S[i-1] == ">":
            for j in range(rightcount):
                List[i-j] = j
            if List[i-rightcount]<=List[i-rightcount+1]:
                List[i-rightcount] = List[i-rightcount+1] + 1
            rightcount = 0


    if S[i] == ">":
        rightcount+=1
        if S[i-1] =="<":
            for j in range(leftcount+1):
                List[i-j] = leftcount - j
            leftcount = 0

if S[N-2] == "<":
    List[N-1] = List[N-2] + 1
else:
    for j in range(rightcount):
        List[N-1-j] = j
    if List[N-1-rightcount]<=List[N-1-rightcount+1]:
        List[N-1-rightcount] = List[N-1-rightcount+1] + 1

print(sum(List))
n = int(input())

if type(n / 9) == int:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = input()
t = sum(list(map(int, list(n))))


if int(t / 9) == t / 9:
    print("Yes")
else:
    print("No")
def calc_ch(cx, cy, i):
    x, y, h = xyh[i][0], xyh[i][1], xyh[i][2]
    ch = max(abs(cx-x) + abs(cy-y) + h, 0)
    if h == 0 or ch == 0:
        if i == n-1:
            ch, i = -1, -1
        else:
            ch, i = calc_ch(cx, cy, i+1)
    return ch, i


n = int(input())
xyh = [list(map(int,input().split())) for i in range(n)]
# xyh = sorted(xyh, key=lambda x:(x[2]))

for cx in range(101):
    for cy in range(101):
        flg = False
        ch0, s = calc_ch(cx, cy, 0)
        # print(cx, cy, ch0)
        if ch0 == -1:
            continue
        for i in range(s,n):
            x, y, h = xyh[i][0], xyh[i][1], xyh[i][2]
            if h == 0:
                continue
            ch = max(abs(cx-x) + abs(cy-y) + h, 0)
            if ch != ch0:
                break
            if i == n-1:
                flg = True
        if flg:
            anscx, anscy = cx, cy
            ansh = ch0
            break
    if flg:
        break
# print(cx, cy)
print(anscx, anscy, ch0)

### FIXED CODE ###

n = int(input())
xyh = [list(map(int,input().split())) for i in range(n)]
xyh = sorted(xyh, key=lambda x:(x[2]), reverse=True)

ans = -1, -1, -1
for cx in range(101):
    for cy in range(101):
        flg = True
        x, y, h = xyh[0][0], xyh[0][1], xyh[0][2]
        ch = abs(cx-x) + abs(cy-y) + h
        for i in range(1,n):
            x, y, h = xyh[i][0], xyh[i][1], xyh[i][2]
            tmph = max(ch - abs(cx-x) - abs(cy-y), 0)
            if h != tmph:
                flg = False
                break
        if flg:
            ans = cx, cy, ch
print(*ans)
X,Y = list(map(int,input().split()))

def pairs (xs):
    if 2 > len(xs):
        return []
    else:
        return [xs[0:2]] + pairs(xs[1:])

def pascal (n):
    def compute (prev):
        return [1] + [x + y for (x,y) in pairs(prev)] + [1]
    def aux (m, prev):
        if (m > n):
            return []
        else:
            return [prev] + aux(m + 1, compute(prev))
    return aux(1, [1])
  
import math
a = 10**9+7

if (X+Y) % 3 != 0:
    print(0)
else:
    if abs(X-Y) > (X+Y)/3:
        print(0)
    else:
        line = pascal(int((X+Y)/3)+1)
        bangou = int(min(X,Y) - (X+Y)/3)
        print( line[int((X+Y)/3)][bangou]%a )
        
  

### FIXED CODE ###

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

class ModComb:
    def __init__(self, MAX, mod=10 ** 9 + 7):
        fac = [1, 1]
        finv = [1, 1]
        inv = [0, 1]
        for i in range(2, MAX):
            fac.append(fac[i - 1] * i % mod)
            inv.append(mod - inv[mod % i] * (mod // i) % mod)
            finv.append(finv[i - 1] * inv[i] % mod)
        self.fac, self.finv, self.mod = fac, finv, mod
 
    def nCk(self, n, k):
        if n < k or n < 0 or k < 0:
            return 0
        fac, finv, mod = self.fac, self.finv, self.mod
        return fac[n] * (finv[k] * finv[n - k] % mod) % mod

if (x+y)%3!=0:
    print(0)
else:
    a = (2*x - y) // 3
    b = (2*y - x) // 3

    mod = 10 ** 9 + 7
    mc = ModComb(1000000, mod=mod) 

    print(mc.nCk(a + b, a) % mod)
import itertools
import sys
sys.setrecursionlimit(2000)
h, w = map(int, input().split())
s_list = []
for i in range(h):
  s_list.append(list(input()))
res = 0
check_list = set()

def rec_create_area(point, tmp_area, current_str):
  new_point_list = []
  new_point_list.append((point[0] + 1, point[1]))
  new_point_list.append((point[0], point[1] + 1))
  new_point_list.append((point[0] - 1, point[1]))
  new_point_list.append((point[0], point[1] - 1))
  for new_point in new_point_list:
    if new_point[0] >= h or new_point[1] >= w or new_point[0] < 0 or new_point[1]  < 0:
      continue
    if new_point in check_list:
      continue
    new_str = s_list[new_point[0]][new_point[1]]
    if new_str == current_str:
      continue
    if new_str == "#":
      tmp_area[0] += 1
    else:
      tmp_area[1] += 1
    check_list.add(new_point)
    rec_create_area(new_point, tmp_area, new_str)
  
for a, b in itertools.product(range(h), range(w)):
  check_point = (a, b)
  if check_point in check_list:
    continue
  check_list.add(check_point)
  current_str = s_list[check_point[0]][check_point[1]]
  if current_str == "#":
    tmp_area = [1, 0]
  else:
    tmp_area = [0, 1]
  rec_create_area(check_point, tmp_area, current_str)
  res += tmp_area[0] * tmp_area[1]
  
print(res)

### FIXED CODE ###

import itertools
import sys
sys.setrecursionlimit(1000000)
h, w = map(int, input().split())
s_list = []
for i in range(h):
  s_list.append(list(input()))
res = 0
check_list = set()

def rec_create_area(point, tmp_area, current_str):
  new_point_list = []
  new_point_list.append((point[0] + 1, point[1]))
  new_point_list.append((point[0], point[1] + 1))
  new_point_list.append((point[0] - 1, point[1]))
  new_point_list.append((point[0], point[1] - 1))
  for new_point in new_point_list:
    if new_point[0] >= h or new_point[1] >= w or new_point[0] < 0 or new_point[1]  < 0:
      continue
    if new_point in check_list:
      continue
    new_str = s_list[new_point[0]][new_point[1]]
    if new_str == current_str:
      continue
    if new_str == "#":
      tmp_area[0] += 1
    else:
      tmp_area[1] += 1
    check_list.add(new_point)
    rec_create_area(new_point, tmp_area, new_str)
  
for a, b in itertools.product(range(h), range(w)):
  check_point = (a, b)
  if check_point in check_list:
    continue
  check_list.add(check_point)
  current_str = s_list[check_point[0]][check_point[1]]
  if current_str == "#":
    tmp_area = [1, 0]
  else:
    tmp_area = [0, 1]
  rec_create_area(check_point, tmp_area, current_str)
  res += tmp_area[0] * tmp_area[1]
  
print(res)
a,b = int(input())
s = input()
l = [str(i) for i in range(10)]
for i in range(a):
    if not s[i] in l:
        print('No')
        exit()
for i in range(b):
    if not s[a+i] in l:
        print('No')
        exit()
if not s[a]=='-':
    print('No')
    exit()
print('Yes')

### FIXED CODE ###

a,b = map(int,input().split())
s = input()
l = [str(i) for i in range(10)]
for i in range(a):
    if not s[i] in l:
        print('No')
        exit()
for i in range(b):
    if not s[a+i+1] in l:
        print('No')
        exit()
if not s[a]=='-':
    print('No')
    exit()
print('Yes')
n = int(input())
s = list(input())

a = 0

for i in range(n):
  if s[i]=='R':
    for j in range(n):
      if s[j]=='G':
        for k in range(n):
          if s[k]=='B':
            if i<j<k:
              if (j-i)!=(k-j):
                a = a + 1
            elif i<k<j:
              if (k-i)!=(j-k):
                a = a + 1
            elif j<i<k:
              if (i-j)!=(k-i):
                a = a + 1
            elif j<k<i:
              if (k-j)!=(i-k):
                a = a + 1
            elif k<i<j:
              if (i-k)!=(j-i):
                a = a + 1
            elif k<j<i:
              if (j-k)!=(i-j):
                a = a + 1
          
print(a)	

### FIXED CODE ###

n = int(input())

a = list(map(int, list(str(n))))

if a[0]==7 or a[1]==7 or a[2]==7:
  print('Yes')
else:
  print('No')
N, M = map(int,input().split())

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

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

count = 0

dic = {}

for i in range(1, N):
  dic[i] = set()

for hen in V:
  dic[hen[0]].add(hen[1])
  dic[hen[1]].add(hen[0])

print(sum(all([H[i] > hs for hs in dic[i]]) for i in N))

### FIXED CODE ###

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

H = list(map(int, input().split()))
H.insert(0, 0)

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

count = 0

dic = {}

for i in range(1, N+1):
  dic[i] = set()

for hen in V:
  dic[hen[0]].add(hen[1])
  dic[hen[1]].add(hen[0])

print(sum(all([H[i] > H[hs] for hs in dic[i]]) for i in range(1, N+1)))
num=[]
for i in range(3):
  nums.append(list(map(int,input().split())))
subd=[]
for i in range(3):
  subd.append([nums[i][0]-nums[i][1],nums[i][1]-nums[i][2]])
for i in range(3):
  subd.append([nums[0][i]-nums[1][i],nums[1][i]-nums[2][i]])
if subd[0]==subd[1] and subd[1]==subd[2] and subd[3]==subd[4] and subd[4]==subd[5]:
  print("Yes")
else:
  print("No")



### FIXED CODE ###

nums=[]
for i in range(3):
  nums.append(list(map(int,input().split())))
subd=[]
for i in range(3):
  subd.append([nums[i][0]-nums[i][1],nums[i][1]-nums[i][2]])
for i in range(3):
  subd.append([nums[0][i]-nums[1][i],nums[1][i]-nums[2][i]])
if subd[0]==subd[1] and subd[1]==subd[2] and subd[3]==subd[4] and subd[4]==subd[5]:
  print("Yes")
else:
  print("No")
L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)
list = []
else :
    for i in range(L, R+1):
        for j in range(i+1, R+1) :
            list.append((i*j) % 2019)
print(min(list))

### FIXED CODE ###

L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)

else :
    t = []
    for i in range(L, R):
        for j in range(i + 1, R + 1) :
            t.append((i * j) % 2019)
    print(min(t))