Harryxun/stf_run huggingface dataset:
l, r = (int(_) for _ in input().split())

if abs(l - r) == 1:
    print(l * r % 2019)
else:
    lower = l // 2019
    upper = r // 2019
    start = l % 2019
    stop = r % 2019
    if 2019 * (lower + 1) < r:
        print(0)
    else:
        if start == 0:
            print(0)
        elif stop == 0:
            print(0)
        elif stop < start:
            print(0)
        elif stop > start:
            while stop > start:
                total = stop * start % 2019
                if total < ans:
                    ans = total
                start += 1
            print(ans)
                



### FIXED CODE ###

l, r = (int(_) for _ in input().split())

if abs(l - r) == 1:
    print(l * r % 2019)
else:
    lower = l // 2019
    upper = r // 2019
    start = l % 2019
    stop = r % 2019
    if 2019 * (lower + 1) < r:
        print(0)
    else:
        ans = 1000000
        if start == 0:
            print(0)
        elif stop == 0:
            print(0)
        elif stop < start:
            print(0)
        elif stop > start:
            for i in range(start, stop + 1):
                for j in range(i+1, stop + 1):
                    if i * j % 2019 < ans:
                        ans = i * j % 2019
            print(ans)
list=input().split("\n")
number=int(list[0])
list_2=list[1].split(" ")
t=int(list_2[0])
a=int(list_2[1])
list_3=list[2].spilit(" ")
index=1
min=abs(a-(t-int(list_3[0])))
target_index=1
for height in list_3:
    temp=t-int(height)*0.006
    diff=abs(a-temp)
    if diff < min :
        min = diff
        target_index = index
    index += 1    
print(target_index)

### FIXED CODE ###

number=input().split(" ")
x=int(number[0])
y=int(number[1])
z=x+y/2
print(int(z))
a, b, c, d, e, f = map(int, input().split())

s = set()
t = set()
for i in range(f):
    for j in range(f):
        if f >= 100 * (a * i + b * j):
            s.add(100 * (a * i + b * j))
        if f >= (c * i + d * j):
            t.add(c * i + d * j)

m = 0            
ans = [0, 0]
for k in s:
    for l in t:
        if k != 0 and l != 0:
            if k + l <= f and m <= (100*l) / (k + l) and l <= (k//100) * e :
                m = (100 * l) / (k + l)
                ans = [str(k + l), str(l)]
print(" ".join(ans))


### FIXED CODE ###

A,B,C,D,E,F = map(int,input().split())
W=set()
for a in range(0,F+1,100*A):
    for b in range(0,F+1-a,100*B):
        W.add(a+b)
S=set()
for c in range(0,F+1,C):
    for d in range(0,F+1,D):
        S.add(c+d)
rate = -1
for w in W:
    for s in S:
        if 0 < w+s <= F and s <= w*E//100:
            if s/(w+s) > rate:
                rate = s/(w+s)
                ans = w+s, s
print(ans[0],ans[1])
A, B, C = int(input().split())
if A <= C and C <= B:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

A, B, C = map(int, input().split())
if A <= C and C <= B:
    print("Yes")
else:
    print("No")
def calc_dist(b,h,dist,E,D,ne):
	D[dist] += 1
	for nxt in E[h]:
		if nxt == b or nxt == ne:
			continue
		calc_dist(h,nxt,dist+1,E,D,ne) 

def solve():
	N,K = map(int,raw_input().split())
	pairs = []
	E = [[] for i in xrange(N)]
	for i in xrange(N-1):
		a,b = map(lambda x:int(x)-1,raw_input().split())
		E[a].append(b)
		E[b].append(a)
		pairs.append((a,b))
	ans = N
	rad = K/2
	if K % 2 == 0:
		for i in xrange(N):
			D = [0]*N
			calc_dist(-1,i,0,E,D,-1)
			for j in xrange(rad):
				D[rad-j-1] += D[rad-j]
			ans = min(N-D[0],ans)
	else:
		for a,b in pairs:
			D1 = [0]*N
			D2 = [0]*N
			calc_dist(-1,a,0,E,D1,b)
			calc_dist(-1,b,0,E,D2,a)
			for j in xrange(rad):
				D1[rad-j-1] += D1[rad-j]
				D2[rad-j-1] += D2[rad-j]
			ans = min(N-D1[0]-D2[0],ans)
	print ans

solve()

### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(1000000)
def calc_dist(b,h,dist,E,D,ne):
	D[dist] += 1
	for nxt in E[h]:
		if nxt == b or nxt == ne:
			continue
		calc_dist(h,nxt,dist+1,E,D,ne) 

def solve():
	N,K = map(int,raw_input().split())
	pairs = []
	E = [[] for i in xrange(N)]
	for i in xrange(N-1):
		a,b = map(lambda x:int(x)-1,raw_input().split())
		E[a].append(b)
		E[b].append(a)
		pairs.append((a,b))
	ans = N
	rad = K/2
	if K % 2 == 0:
		for i in xrange(N):
			D = [0]*N
			calc_dist(-1,i,0,E,D,-1)
			for j in xrange(rad):
				D[rad-j-1] += D[rad-j]
			ans = min(N-D[0],ans)
	else:
		for a,b in pairs:
			D1 = [0]*N
			D2 = [0]*N
			calc_dist(-1,a,0,E,D1,b)
			calc_dist(-1,b,0,E,D2,a)
			for j in xrange(rad):
				D1[rad-j-1] += D1[rad-j]
				D2[rad-j-1] += D2[rad-j]
			ans = min(N-D1[0]-D2[0],ans)
	print ans

solve()
from collections import deque
n = int(input())
a = deque([int(i) for i in input().split()])
count = 1
while a:
    try:
        index = a.index(count)
        count += 1
        a = a[index:]
    except ValueError:
        if count == 1:
            ans = -1
        else:
            ans = n - (count - 1)
        a = []
print(ans)

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
count = 0
for i in range(n):
    if a[i] == count + 1:
        count += 1
if count:
    print(n - count)
else:
    print(-1)
#問題2
#https://qiita.com/drken/items/a5e6fe22863b7992efdb
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DPL_1_B&lang=jp
n, w = map(int,input().split())
value = []
weight = []

for i in range(n):
    val,wei = map(int,input().split())
    value.append(val)
    weight.append(wei)
    
#dp i <= 110, w <= 1010
dp = []
for i in range(110):
    o = [0 for i in range(1010)]
    dp.append(o)

#i = 0 何も入れない状態を初期化する

for ww in range(w):
    dp[0][ww] = 0

for i in range(0,n):
    for ww in range(w+1):
        #dp[i+1]に最終状態が格納される
        if ww >= weight[i] :
            dp[i+1][ww] = max(dp[i][ww-weight[i]] + value[i], dp[i][ww])
        else:
            dp[i+1][ww] = dp[i][ww]
print(dp[n][w])


### FIXED CODE ###

#問題2
#https://qiita.com/drken/items/a5e6fe22863b7992efdb
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DPL_1_B&lang=jp
n, w = map(int,input().split())
value = []
weight = []

for i in range(n):
    val,wei = map(int,input().split())
    value.append(val)
    weight.append(wei)
    
#dp i <= 110, w <= 1010
dp = []
for i in range(110):
    o = [0 for i in range(10010)]
    dp.append(o)

#i = 0 何も入れない状態を初期化する

for ww in range(w):
    dp[0][ww] = 0

for i in range(0,n):
    for ww in range(w+1):
        #dp[i+1]に最終状態が格納される
        if ww >= weight[i] :
            dp[i+1][ww] = max(dp[i][ww-weight[i]] + value[i], dp[i][ww])
        else:
            dp[i+1][ww] = dp[i][ww]
print(dp[n][w])
s = input()
go = []
back = []
start = 0
end = len(s)-1
res = 0
while start<=end:
    gox = 0
    backx = 0
    while s[start] == 'x' and start<=end:
        start+=1
        gox += 1
    while s[end] == 'x'and start<=end:
        end -= 1
        backx +=1
    if start == end and s[start] == 'x':
        break
    if s[start] == s[end]:
        start += 1
        end -=1
        res += abs(gox-backx)
        gox = 0
        backx = 0
    else:
        res = -1
        break

print(res)


### FIXED CODE ###

s = input()
go = []
back = []
start = 0
end = len(s)-1
res = 0
while start<=end:
    gox = 0
    backx = 0
    while s[end] == 'x' or s[start] == 'x':
        if s[start] == 'x' and start<end:
            start+=1
            gox += 1
        if s[end] == 'x'and start<end:
            end -= 1
            backx +=1
        if start == end:break
    if start == end and s[start] == 'x':
        break
    if s[start] == s[end]:
        start += 1
        end -=1
        res += abs(gox-backx)
        gox = 0
        backx = 0
    else:
        res = -1
        break

print(res)
n=int(input())
t=list(map(int,input().split()))
m=int(input())
for i in range(m):
    p,x=map(int,input().split())
    t[p+1]=x
print(sum(t))


### FIXED CODE ###

n=int(input())
t=list(map(int,input().split()))
m=int(input())
ans=[]
for i in range(m):
    p,x=map(int,input().split())
    ans.append(sum(t)-(t[p-1]-x))
for i in range(m):
    print(ans[i])
import sys
input=sys.stdin.readline

S=input()
n=len(S)
R=[0]*13 #剰余テーブル
cnt=[0]*13
Pow=[[] for i in range(6)] #10の累乗の剰余テーブル
mod=10**9+7

for i in range(6):
    c=10**i
    for j in range(10):
        Pow[i].append(c*j%13)
print(Pow)
ans=0
flag=0
for i in range(n):
    if S[n-i-1]=="?":
        P=Pow[i%6] #当該の剰余テーブル
        if flag==0:
            for p in P:
                R[p]=1
                flag=1
        else:
            for j in range(10):
                for k in range(13):
                    cnt[(k+P[j])%13]+=R[k]%mod
            R=cnt
            cnt=[0]*13
    else:
        x=int(S[n-i-1])
        ans+=Pow[i%6][x]
        print(x,ans)
    print(R,i)
    print(sum(R))
ans%=13
print(R[(18-ans)%13]%mod)

### FIXED CODE ###

S=input()
n=len(S)
R=[0]*13
cnt=[0]*13
Pow=[[] for i in range(6)]
mod=10**9+7

for i in range(6):
    c=10**i
    for j in range(10):
        Pow[i].append(c*j%13)
ans=0
flag=0
for i in range(n):
    if S[n-i-1]=="?":
        P=Pow[i%6]
        if flag==0:
            for p in P:
                R[p]=1
                flag=1
        else:
            for j in range(10):
                for k in range(13):
                    cnt[(k+P[j])%13]+=R[k]%mod
            R=cnt
            cnt=[0]*13
    else:
        x=int(S[n-i-1])
        ans+=Pow[i%6][x]
ans%=13
if flag==0:
    if ans==5:
        print(1)
    else:
        print(0)
else:
    print(R[(18-ans)%13]%mod)
N = int(input())
A = list(map(int, input().split()))
ans = 1000
i = 0
while(len(A) - i > 1):
    s = [s for s in A[i + 1:] if s > A[i]]
    if len(s) == 0:
        break
    si = A.index(s[0])
    b = min(A[i:si])
    stock = ans // b
    ans %= b
    ans += (stock * s[0])
    i = si + 1
    
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
ans = 1000
for i in range(len(A) - 1):
    stocks = 0
    if A[i] < A[i + 1]:
        stocks = ans // A[i]
        ans += (A[i + 1] - A[i]) * stocks
print(ans)
x,y = map(int,input().split())
if x>y:
    swap(x,y)

if y-x>1:
    print("Alice")
elif:
    print("Brown")

### FIXED CODE ###

x,y = map(int,input().split())
if x>y:
    x,y = y,x

if y-x>1:
    print("Alice")
else:
    print("Brown")
H,N=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(N)]
dp=[0]*(H+1)
for i in range (1,H+1):
    dp[i]=min(dp[i-a]+b for a,b in ab)
print(dp[H])

### FIXED CODE ###

H,N=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(N)]
x=max(a for a,b in ab)
dp=[0]*(H+x)
for i in range (1,H+x):
    dp[i]=min(dp[i-a]+b for a,b in ab)
print(dp[H])
n=int(input())
mod=10**9+7

s1=input()
s2=input()

if n==1:
    print(3)
    exit(0)

if s1[0]==s1[1]:
    l=1
    ans=6
    i=2
else:
    l=0
    ans=3
    i=1

while True:
    if i==n-1:
        if l==0:
            ans*=2
            ans%=mod
        break

    if s1[i+1]==s1[i]:
        c=1
        i+=2
    else:
        c=0
        i+=1
    
    if l==0:
        ans*=2
    if l==1 and c==1:
        ans*=3
    
    ans%=mod
    
    l=c
    
print(ans)


### FIXED CODE ###

n=int(input())
mod=10**9+7

s1=input()
s2=input()

if n==1:
    print(3)
    exit(0)

if s1[0]==s1[1]:
    l=1
    ans=6
    i=2
else:
    l=0
    ans=3
    i=1

while i<n:
    if i==n-1:
        if l==0:
            ans*=2
            ans%=mod
        break

    if s1[i+1]==s1[i]:
        c=1
        i+=2
    else:
        c=0
        i+=1
    
    if l==0:
        ans*=2
    if l==1 and c==1:
        ans*=3
    
    ans%=mod
    
    l=c
    
print(ans)
N, M = map(int, input().split())
A = []
for _ in range(M):
    A.append(tuple(map(int, input().split())))
P = tuple(map(int, input().split()))
import itertools
def hantei(A, RETU, P):
    for i in range(len(A)):
        count = 0
        for k in RETU:
            if k in A[i][1:]:
                count += 1
        if not count % 2 == P[i]:
            return False
    return True
ans = 0
for i in range(1, N + 1):
    for k in itertools.combinations(range(1, N + 1), i):
        if hantei(A, k, P):
            ans += 1
if hantei(A, 0, P):
    ans += 1
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
A = []
for _ in range(M):
    A.append(tuple(map(int, input().split())))
P = tuple(map(int, input().split()))
import itertools
def hantei(A, RETU, P):
    for i in range(len(A)):
        count = 0
        for k in RETU:
            if k in A[i][1:]:
                count += 1
        if not count % 2 == P[i]:
            return False
    return True
ans = 0
for i in range(1, N + 1):
    for k in itertools.combinations(range(1, N + 1), i):
        if hantei(A, k, P):
            ans += 1
if hantei(A, [0], P):
    ans += 1
print(ans)
n, m = map(int, input().split())
ls = [int(input()) for _ in range(m)]

dp = [0] * (n + 1)
dp[0] = 1

if ls[0] == 1:
	dp[1] = 0
	del ls[0]
else:
	dp[1] = 1

ls.append(0)

for i in range(2, n + 1):
	if i == ls[0]:
		dp[i] == 0
		del ls[0]
	else:
		dp[i] = dp[i - 1] + dp[i - 2]
		
print(dp[n] % 1000000007)

### FIXED CODE ###

n, m = map(int, input().split())
ls = [int(input()) for _ in range(m)]

dp = [0] * (n + 1)
dp[0] = 1

ls.append(0)

if ls[0] == 1:
	dp[1] = 0
	del ls[0]
else:
	dp[1] = 1

for i in range(2, n + 1):
	if i == ls[0]:
		dp[i] == 0
		del ls[0]
	else:
		dp[i] = dp[i - 1] + dp[i - 2]

print(dp[n] % 1000000007)
x = map(int,raw_input().split())
i = 0
while x[i] <> 0:
  print "Case %d: %d" %d(i,x[i])
  i++

### FIXED CODE ###

i = 0
while 1:
    x = input()
    i += 1
    if x == '0':
        break
    print ('Case %s: %s' % (i,x))
dic = {}
dic['A'] = 'T'
dic['T'] = 'A'
dic['C'] = 'G'
dic['G'] = 'C'

def a(b):
	return dic[b]

a=input()
print(a(a))

### FIXED CODE ###

dic = {}
dic['A'] = 'T'
dic['T'] = 'A'
dic['C'] = 'G'
dic['G'] = 'C'

def C(b):
    return dic[b]

a=input()
print(C(a))
numbers = list(map(int, input().split()))
n = numbers[0]

v = []

for i in range(n):
    numbers = list(map(int, input().split()))
    a = numbers[0]
    
    w = []
    
    for j in range(a):
        z = list(map(int, input().split()))
        w.append(z)
        
    v.append(w)
    
rezultat = 0

max_steps = 2 ** n

for i in range(max_steps):
    w = [-1] * n
    
    for j in range(n):
        if i >> j & 1:
            w[j] = 1
        else:
            w[j] = 0
    
    ok = 1
    
    for j in range(n):
        if ok == 0:
            break
        for a, b in v[j]:
            if w[j] == 1:
                a = a - 1
            if w[a] != b:
                ok = 0
                break
                
    if ok:
        rezultat = rezultat if rezultat > sum(w) else sum(w)
        
print(rezultat)


### FIXED CODE ###

numbers = list(map(int, input().split()))
n = numbers[0]

v = []

for i in range(n):
    numbers = list(map(int, input().split()))
    a = numbers[0]
    
    w = []
    
    for j in range(a):
        z = list(map(int, input().split()))
        w.append(z)
        
    v.append(w)
    
rezultat = 0

max_steps = 2 ** n

for i in range(max_steps):
    w = [-1] * n
    
    for j in range(n):
        if i >> j & 1:
            w[j] = 1
        else:
            w[j] = 0
    
    ok = 1
    
    for j in range(n):
        if ok == 0:
            break
        for a, b in v[j]:
            if w[j] == 1:
                a = a - 1
                if w[a] != b:
                    ok = 0
                    break
                
    if ok:
        rezultat = rezultat if rezultat > sum(w) else sum(w)
        
print(rezultat)
N = int(input())
A = list(map(int, input().split()))

ans = 0
A_test = sorted(list(set(A)))

if N % 2 == 1:
    judge = [i for i in range(0,N,2)]
    if A_test == judge:
        ans = 2**(N//2)
else:
    judge = [i for i in range(1,N,2)]
    if A_test == judge:
        ans = 2**(N//2)]

ans = ans % (10**9 + 7)
print(ans)


### FIXED CODE ###

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

ans = 0
A_test = sorted(list(set(A)))

if N % 2 == 1:
    judge = [i for i in range(0,N,2)]
    if (A_test == judge) and (A.count(0) == 1):
        ans = 2**(N//2)
else:
    judge = [i for i in range(1,N,2)]
    if A_test == judge:
        ans = 2**(N//2)

ans = ans % (10**9 + 7)
print(ans)
#coding:UTF-8
def QQ():
 for i in range(1,10):
  for j in range(1,10):
   print(str(i)+"x"+str(j)+"="str(i*j))
 
if __name__=="__main__":
 QQ()

### FIXED CODE ###

#coding:UTF-8
def QQ():
    for i in range(1,10):
        for j in range(1,10):
            print(str(i)+"x"+str(j)+"="+str(i*j))
 
if __name__=="__main__":
    QQ()
a=int(input())
b=int(input())

area=a*b
print(area)

longht=2*a+2*b
print(longht)


### FIXED CODE ###

a, b = map(int, input().split())
print(str(a * b) + " " + str(2 * a + 2 * b))
k = int(input())
t = 7
kou = 1

if k % 2 != 0:
  if k % 5 != 0:
    while True:
      kou += 1
      t = 10 * t + 7
    
    if t % k == 0:
    print(kou)
    break

print(-1)


### FIXED CODE ###

K = int(input())

if K % 2 == 0 or K % 5 == 0:
    print(-1)
    exit()

i = 0
ai = 0
while True:
    ai = (ai * 10 + 7) % K
    i += 1
    if ai == 0:
        break
print(i)
m,k=map(int,input().split())

if k==0:
    x=[[i]*2 for i in range(2**m)]
    for i in x:
        print(*i,end=" ")
elif m==1:
    print(-1)
elif 2**m<=k:
    print(-1)
else:
    a=sorted(set(range(m))-set(k))
    b=a+[k]+a[::-1]+[k]
    print(*b)

### FIXED CODE ###

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

if k==0:
    x=[[i]*2 for i in range(2**m)]
    for i in x:
        print(*i,end=" ")
elif m==1:
    print(-1)
elif 2**m<=k:
    print(-1)
else:
    for i in reversed(range(2**m)):
        if i!=k:
            print(i,end=" ")
    print(k,end=" ")
    for i in range(2**m):
        if i!=k:
            print(i,end=" ")
    print(k)
da = list(map(int,input().split()))

k = [[0 for i in range(2)]for j in range(10001)]

i = 0

su = 0

j = 0

while da[0] != 0 and da[1] != 0:

	i = 0
	su = 0
	j = 0
	for i in range(da[0]):
		k[i][0],k[i][1] = list(map(int,input().split()))
		su += k[i][0] * k[i][1]


	sorted(k,key = lambda x: x[1],reverse = True)
	while da[1] != 0 or j != i + 1:
		if da[1] >= k[j][0]:
			su -= k[j][0] * k[j][1]
			da[1] -= k[j][0]
			j += 1

		elif da[1] < k[j][0]:
			su -= da[1] * k[j][1]
			da[1] = 0

	print(su)

	da = list(map(int,input().split()))
	if da[0] == 0 and da[1] == 0:
		break
	k = [[0 for i in range(2)]for j in range(10001)]


### FIXED CODE ###

da = list(map(int,input().split()))

k = [[0 for i in range(2)]for j in range(10001)]
i = 0
su = 0
j = 0

while da[0] + da[1] != 0:
	i = 0
	su = 0
	j = 0
	for i in range(da[0]):
		k[i][0],k[i][1] = map(int,input().split())


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

	while j != i + 1:
		if da[1] > k[j][0]:
			da[1] -= k[j][0]
			j += 1
		elif da[1] <= k[j][0] and da[1] > 0:
			su += (k[j][0] - da[1]) * k[j][1]
			da[1] = 0
			j += 1
		else:
			su += k[j][0] * k[j][1]
			j += 1

	print(su)

	da = list(map(int,input().split()))

	k = [[0 for i in range(2)]for j in range(10001)]
from heapq import heapify,heappush,heappop

def main():
    N,M = map(int,input()split())
    A = [-x for x in map(int,input().split())]
    heapify(A)
    for i in range(M):
        tmp = heappop(A)
        tmp2 = tmp//2
        heappush(A,tmp2)
    ans = 0
    for i in range(N):
        ans += A[i]

    ans = abs(ans)
    return ans

print(main())    


### FIXED CODE ###

from heapq import heapify,heappush,heappop

def main():
    N,M = map(int,input().split())
    A = [ -x for x in map(int,input().split()) ]
    heapify(A)

    for i in range(M):
        #print(A)
        tmp = -heappop(A)
        #print(tmp)
        tmp = tmp//2
        #print(tmp)
        heappush(A,-tmp)


    ans = 0
    for i in range(N):
        ans += A[i]

    ans = abs(ans)
    return ans

print(main())
import math
def prime(x):
  p = {}
  cnt = 2
  Flag = True
  while Flag:
    last = math.ceil(x ** 0.5) 
    if cnt > last:
      break
    for i in range(cnt, last + 1):
      if x % i == 0:
        x //= i
        p[i] = 1
        cnt = i + 2
        while x % i == 0:
          x //= i
          p[i] += 1
        cnt = i + 1
        break
      if i == last:
        Flag = False
  if x != 1:
    p[x] = 1
  return p

def lcm(x, y):
  return (x * y) // math.gcd(x,y)


N, M = list(map(int, input().split()))
S = list(input())
T = list(input())

L = lcm(N, M)

x = L // N
y = L // M
for i in range(N):
  if (i * x) % y == 0:
    if S[i] != T[(i * x) // y]:
      L = -1
      break

print(L)


### FIXED CODE ###

def gcd(x, y):
  n = min(x, y)
  for i in range(n, 0, -1):
    if x % i == 0 and y % i == 0:
      return i

def lcm(x, y):
  return (x * y) // gcd(x,y)


N, M = list(map(int, input().split()))
S = list(input())
T = list(input())

L = lcm(N, M)

x = L // N
y = L // M
for i in range(N):
  if (i * x) % y == 0:
    if S[i] != T[(i * x) // y]:
      L = -1
      break

print(L)
head = input().split(" ")
while head != "0 0 0":
    num = int(head[0])
    mini = int(head[1])
    maxi = int(head[2]) 

    scores = []

    gaps = []

    for _ in range(int(head[0]) + 1):
        scores.append(int(input()))
    
    for i in range(mini, maxi + 1):
        oks = scores[:i]
        ngs = scores[i:]
        gap = oks[-1] - ngs[0]
        gaps.append((i,gap))

    filtered = list(filter(lambda x: x[1] == max(map(lambda x: x[1], gaps)), gaps))
    sorted(filtered,key=lambda x: x[0])
    print(filtered[-1][0])


### FIXED CODE ###

while True:
    num, mini, maxi = map(int, input().split())
    if num == 0: break
    scores = [ int(input()) for i in range(num) ]
    gap = 0
    ans = 0
    for i in range(mini, maxi + 1):
        gap = scores[i-1] - scores[i] if scores[i-1] - scores[i] >= gap else gap
        ans = i if scores[i - 1] - scores[i] >= gap else ans

    print(ans)
N = int(input())
A = list(map(int,input().split())
i = 0        
for i in range(N):
         A.pop(i)
         A.insert(0,0)
         print(sum(abs(A[i+1]-A[i]))
         i+=1

### FIXED CODE ###

n = int(input())
a = [0] + list(map(int, input().split())) + [0]
A = [abs(a[i] - a[i + 1]) for i in range(n + 1)]
total = sum(A)

for i in range(n):
    print(total + abs(a[i + 2] - a[i]) - A[i] - A[i + 1])
l = input().strip().split()
print(l[0] + l[1]/2)


### FIXED CODE ###

x, y = map(int, input().split())
print(x + y//2)
# input
N, M = map(int, input().split())
R = [list(map(int, input().split())) for _ in range(M)]

for i in range(N):
    ans = 0
    for j in range(1, M + 1):
        if i in R[j]:
            ans += 1
    print(ans)



### FIXED CODE ###

# input
N, M = map(int, input().split())
R = [list(map(int, input().split())) for _ in range(M)]

for i in range(1, N + 1):
    ans = 0
    for j in range(M):
        if i in R[j]:
            ans += 1
    print(ans)
a, b = input(), input()
print a*b,
print 2*a+2*b

### FIXED CODE ###

a, b = map(int, raw_input().split())
print a*b,
print 2*a + 2*b
def main():
    N = int(input())
    A = list(map(int, input().split()))
    a = A.count(1)
    b = A.count(2)
    c = A.count(3)]
    floatN = N*1.0
    dp = [[[0]*(N+1) for i in range(N+1)] for j in range(N+1)]

    for k in range(A[3]+1):
        for j in range(A[2]+A[3] + 1 - k):
            for i in range(N + 1 - k - j):
                if i + j+k == 0:
                    continue
                dp[i][j][k] = floatN
                if i > 0:
                    dp[i][j][k] += dp[i-1][j][k] * i
                if j > 0:
                    dp[i][j][k] += dp[i+1][j-1][k] * j
                if k > 0:
                    dp[i][j][k] += dp[i][j+1][k-1] * k
                dp[i][j][k] /= (i+j+k)

    print(dp[a][b][c])
main()


### FIXED CODE ###

def main():
    N = int(input())
    A = list(map(int, input().split()))
    a = A.count(1)
    b = A.count(2)
    c = A.count(3)
    floatN = N*1.0
    dp = [[[.0]*(N+1) for i in range(N+1)] for j in range(N+1)]

    for k in range(c+1):
        for j in range(b+c + 1 - k):
            for i in range(N + 1 - k - j):
                if i + j+k == 0:
                    continue
                dp[i][j][k] = floatN
                if i > 0:
                    dp[i][j][k] += dp[i-1][j][k] * i
                if j > 0:
                    dp[i][j][k] += dp[i+1][j-1][k] * j
                if k > 0:
                    dp[i][j][k] += dp[i][j+1][k-1] * k
                dp[i][j][k] /= (i+j+k)
    print(dp[a][b][c])


main()