ZhenlongDai/ACPR huggingface dataset:
Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = 2019
L,R =map(int,input().split())
l = L%n
N =min(2019,R-L+1)
ans = 2019
for i in range(N):
    i += l
    for j in range(i):
        j += l
        if ans > (i*j)%n:
            ans = (i*j)%n
print(ans)

Failing test case input:
1 78

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):

n = 2019
L,R =map(int,input().split())
l = L%n
N =min(2019,R-L+1)
ans = 2019
for i in range(N):
    for j in range(i):
        foo = (i+l)*(j+l)%n
        if ans > foo:
            ans = foo
print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = map(int, input().split())
if R - L >= 2019:
    print(0)
else:
    minmod = L % 2019
    maxmod = R % 2019
    if minmod > maxmod:
        print(0)
    else:
        print(minmod * (minmod + 1))

Failing test case input:
1 176

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
L, R = map(int, input().split())
if R - L >= 2019:
    print(0)
else:
    ans = 2019
    for i in range(L, R):
        for j in range(i+1, R+1):
            ans = min([ans, (i*j)%2019])
    print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = (int(i) for i in input().split())

if (R - L) <= 2019:
    temp1 = float("inf")
    for i in range(R - L):
        if (R-i-1) < L:
            break
        temp2 = (R * (R - i - 1)) % 2019
        if temp2 < temp1:
            temp1 = temp2
    print(temp1)
else:
    temp1 = float("inf")
    for i in range(2019):
        if (R-i-1) < L:
            break
        temp2 = (R * (R - i - 1)) % 2019
        if temp2 < temp1:
            temp1 = temp2
    print(temp1)

Failing test case input:
1 78

Expected output:
2


Actual output:
9


Fixed submission (verdict: Accepted):
L, R = (int(i) for i in input().split())

if (R - L) <= 2019:
    temp1 = float("inf")
    for i in range(R - L):
        for j in range(R - L):
            temp2 = ((R-i) * (R - 1 -j)) % 2019
            if temp2 < temp1:
                temp1 = temp2
    print(temp1)
else:
    temp1 = float("inf")
    for i in range(2019):
        if (R-i-1) < L:
            break
        for j in range(2019):
            temp2 = ((R - i) * (R - 1 - j)) % 2019
            if temp2 < temp1:
                temp1 = temp2
    print(temp1)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L,R=map(int, input().split())
n=R-L
ans=[]
if n == 1:
    print((L*R)%2019)
elif n < 2019:
    for i in range(n+1):
        l=L+i
        ans.append(l % 2019)
    a=sorted(ans)
    print(a[0]*a[1])
else:
    print(0)



Failing test case input:
2845 3053

Expected output:
1


Actual output:
683102


Fixed submission (verdict: Accepted):
L,R=map(int, input().split())
n=R-L
ans=[]
if n == 1:
    print((L*R)%2019)
elif n < 2019:
    for i in range(n+1):
        for j in range(1,n+1):
            l=L+i
            r=l+j
            if r > R:
                break
            ans.append((l*r) % 2019)
    print(min(ans))
else:
    print(0)
Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L,R = [int(x) for x in input().split()]
 


 
min_ans = 10**18
for i in range(L+1,R+1):
  ans = (L*i)%2019
  if ans < min_ans:
    min_ans = ans
  if min_ans == 0:
    break

print(min_ans)


Failing test case input:
2845 3053

Expected output:
1


Actual output:
38


Fixed submission (verdict: Accepted):
L,R = [int(x) for x in input().split()]
 
min_ans = 10**18

if R-L>=2019:
  min_ans=0
else:
  for i in range(L,R):
      for j in range(i+1,R+1):
          ans = (i*j)%2019

          if ans < min_ans:
              min_ans = ans
          if min_ans == 0:
              break
print(min_ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


L, R = map(int, input().split())








if R - L >= 2019:
    print(0)
elif L <= 2019 and R >= 2019:
    print(0)
else:
    ans = float("inf")
    for i in range(L, R):
        ans = min(i * (i + 1) % 2019, ans)
    print(ans)


Failing test case input:
2845 3053

Expected output:
1


Actual output:
3


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


else:
    ans = float("inf")
    for i in range(L, R):
        for j in range(i + 1, R + 1):
            ans = min(((i % 2019) * (j % 2019)) % 2019, ans)
    print(ans)

Problem: p02983
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
L,R=map(int,input().split())
A=[]
if R-L>=2019:
    print(0)
else:
    for i in range(L,R+1):
        A.append(i%2019)
    A=sorted(A)
    print(A[0]*A[1])   
    

Failing test case input:
2845 3053

Expected output:
1


Actual output:
683102


Fixed submission (verdict: Accepted):
L,R=map(int,input().split())
A=[]
if R-L>=2019:
    print(0)
else:
    d=2019
    for i in range(L,R):
        for j in range(i+1,R+1):
            d=min(i*j%2019,d)
    print(d)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
sys.setrecursionlimit(100000000)
input=lambda : sys.stdin.readline().rstrip()

l,r=map(int,input().split())

x=l%2019
y=r%2019

if x>=y or l-r>=2019 or x==0:
    print(0)
else:
    ans=99999
    for i in range(x,y+1):
        for j in range(x+1,y+1):
            ans=min(ans,i*j)
    print(ans)


Failing test case input:
2845 3053

Expected output:
1


Actual output:
99999


Fixed submission (verdict: Accepted):
import sys
sys.setrecursionlimit(100000000)
input=lambda : sys.stdin.readline().rstrip()

l,r=map(int,input().split())

x=l%2019
y=r%2019

if x>=y or r-l>=2019 or x==0:
    print(0)
else:
    ans=99999
    for i in range(x,y+1):
        for j in range(x+1,y+1):
            if i==j:
                break
            ans=min(ans,i*j%2019)
    print(ans)
Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = map(int, input().split())
if R-L>=2019:
    print(0)
else:
    modMin = 2019
    for _ in range(L, R):
        mod2019 = _%2019
        if mod2019 < modMin:
            modMin = mod2019
        if mod2019 == 2018:
            modMin = 0
    print(modMin*(modMin+1))

Failing test case input:
1 176

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
L, R = map(int, input().split())
if R-L >= 2019:
    print(0)
else:
    ans = 2018**2
    for i in range(L, R):
        for j in range(i+1, R+1):
            mod2019 = i*j%2019
            if mod2019 < ans:
                ans = mod2019
    print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

l,r = map(int,input().split())
m = (l*(l+1))%2019
for i in range(l,r):
    if m == 0:
        print(m)
        exit(0)
    for j in range(l+i,r+1):
        if (i*j)%2019 < m:
            m = (i*j)%2019
print(m)

Failing test case input:
2020 3053

Expected output:
0


Actual output:
2


Fixed submission (verdict: Accepted):

l,r = map(int,input().split())
if r-l > 2019:
    print(0)
    exit(0)
m = 2019
for i in range(l,r):
    for j in range(l,r+1):
        if i != j and (i*j)%2019 < m:
            m = (i*j)%2019
print(m)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = map(int, input().split())
ans = 10**20

for i in range(L, min(L+2019, R)+1):
    n = i % 2019
    for j in range(L+1, min(L+2019, R)+1):
        ans = min(ans, n * (j % 2019))
    if not ans:
        break
print(ans)

Failing test case input:
1 176

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
L, R = map(int, input().split())
ans = 10**20

if R-L < 2019:
    ans = 10**20

    for i in range(L, R):
        n = i % 2019
        for j in range(i+1, R+1):
            ans = min(ans, n * j % 2019)
else:
    ans = 0
print(ans)
Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = map(int, input().split())

ans = 2019
for i in range(L, R):
    f = False
    for j in range(i, R):
        if  ((i*j) % 2019) == 0:
            print(0)
            break
        ans = min(ans, (i*j)%2019)
    if f:
        break
print(ans)

Failing test case input:
998 2650

Expected output:
0


Actual output:
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1


Fixed submission (verdict: Accepted):
L, R = map(int, input().split())

ans = 2018
R = min(R, L+2020)
for i in range(L, R+1):
    f = False
    for j in range(i+1, R+1):
        m = (i*j)%2019
        if  m  == 0:
            ans = m
            f = True
            break     
        ans = min(ans, m)
    if f:
        break
print(ans)
Problem: p02983
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
l,r = map(int,input().split())
l=l%2019
r=r%2019
if l>r:
  print(0)
  sys.exit()

ans=2018
for i in range(l,r):
  if ans == 0:
    break
  for j in range(i+1,r+1):
    ans = min(ans,i*j%2019)
    if ans == 0:
      break
print(ans)

Failing test case input:
1022 3053

Expected output:
0


Actual output:
22


Fixed submission (verdict: Accepted):
import sys
l,r = map(int,input().split())
if l+2019<=r:
  print(0)
  sys.exit()
l=l%2019
r=r%2019
if l>=r:
  print(0)
  sys.exit()

ans=2018
for i in range(l,r):
  if ans == 0:
    break
  for j in range(i+1,r+1):
    ans = min(ans,i*j%2019)
    if ans == 0:
      break
print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import math
sys.setrecursionlimit(1000000)
 
l,r = map(int,input().split())

mod = 673

if r-l >= mod-1:
    print(0)
    exit()
    
l_s = l % mod
r_s = r % mod


ans = 673

if r_s > l_s:
    for i in range(abs(l_s - r_s)):
        for j in range(1,abs(l_s - r_s)+2):
            if l_s+i+j > r_s:
                break
            tmp = (l_s+i)*(l_s+i+j) % mod
            if ans > tmp:
                ans = tmp
    print(ans)
    exit()
else:
    print(0)
    exit()

Failing test case input:
1 97

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
import sys
sys.setrecursionlimit(1000000)
 
l,r = map(int,input().split())

mod = 673

if r-l >= mod-1:
    print(0)
    exit()

MOD = 2019

l_s = l % MOD
r_s = r % MOD


ans = 2019

if r_s > l_s:
    for i in range(abs(l_s - r_s)+1):
        for j in range(1,abs(l_s - r_s)+2):
            if l_s+i+j > r_s:
                break
            tmp = (l_s+i)*(l_s+i+j) % MOD
            if ans > tmp:
                
                ans = tmp
    print(ans)
    exit()
else:
    print(0)
    exit()

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
from heapq import heappush, heappop


def main():
    l,r=map(int,input().split())
    if r-l>=2019:
        print(0)
    else:
        ans=[]
        for i in range(l,r+1):
            ans.append(i%2019)
        ans.sort()
        print((ans[0]*ans[1])%2019)

if __name__ == '__main__':
    main()

Failing test case input:
2020 3053

Expected output:
0


Actual output:
2


Fixed submission (verdict: Accepted):
import sys
from heapq import heappush, heappop


def main():
    l,r=map(int,input().split())
    if r-l>=2019:
        print(0)
    else:
        ans=[]
        for i in range(l,r):
            for j in range(i+1,r+1):
                ans.append((i*j)%2019)
        ans.sort()
        print(ans[0])

if __name__ == '__main__':
    main()
Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l,r=map(int,input().split())
x=[]
if r-l>=2018:
    print(0)
else:
    for i in range(l,r+1):
        x.append(i%2019)
    x.sort()
    print((x[0]*x[1])%2019)

Failing test case input:
2845 3053

Expected output:
1


Actual output:
680


Fixed submission (verdict: Accepted):
l,r=map(int,input().split())
x=[]
if r-l>=2018:
    print(0)
else:
    ans=2018
    for i in range(l,r):
        for j in range(i+1,r+1):
            k=(i*j)%2019
            ans=min(k,ans)
    print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = map(int, input().split())

res = 1000000007

if R - L + 1 > 2019:
    print(0)
else:
    for i in range(L, R + 1):
        a = i % 2019
        for j in range(i + 1, R + 1):
            b = j % 2019
            res = min(res, a * b % 2019)

print(res)

Failing test case input:
1022 4340

Expected output:
0


Actual output:
0
1000000007


Fixed submission (verdict: Accepted):
L, R = map(int, input().split())

res = 1000000007

if R - L + 1 > 2019:
    print(0)
else:
    amari = [i % 2019 for i in range(L, R + 1)]
    l = len(amari)
    for i in range(l):
        a = amari[i]
        for j in range(i + 1, l):
            b = amari[j]
            res = min(res, a * b % 2019)

    print(res)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin

def main():
    L, R = map(int, input().split())

    modl = L % 2019
    modr = R % 2019
    min_ = min(modl, modr)
    print(min_ * (min_ + 1))

input = lambda: stdin.readline()
main()


Failing test case input:
998 2650

Expected output:
0


Actual output:
398792


Fixed submission (verdict: Accepted):
from sys import stdin

def main():
    L, R = map(int, input().split())

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

input = stdin.readline
main()

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = map(int, input().split(' '))

N = 2019

if R - L == 1:
    print((R * L) % N)
    exit(0)

q = L 
L_min = L % N
R_min = min(2019, R % N)


ans = 2019

for i in range(L_min, R_min):
    for j in range(i + 1, R_min + 1):
        mod = (i * j) % N
        if ans > mod:
            ans = mod

print(ans)

Failing test case input:
-1 125

Expected output:
0


Actual output:
2019


Fixed submission (verdict: Accepted):
L, R = map(int, input().split(' '))

N = 2019


ans = 2019

for i in range(L, R):
    for j in range(i + 1, R + 1):
        mod = (i * j) % N
        if ans > mod:
            ans = mod
        if ans == 0:
            print(ans)
            exit(0)

print(ans)
Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    l, r = map(int, input().split())
    
    a = l % 2019
    b = r % 2019
    if a >= b or r - l + 1 >= 2018:
        print(0)
    else:
        c = []
        for i in range(l, r+1):
            c.append(i % 2019)
        if 0 in c or (3 in c and 673 in c):
            print(0)
        else:
            print(c[0] * c[1])
        
    
if __name__ == '__main__':
    main()

Failing test case input:
1 176

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
def main():
    ans = 10**19
    l, r = map(int, input().split())
    for i in range(l, r + 1):
        for j in range(i + 1, r + 1):
            ans = min(ans, (i * j) % 2019)
            if ans == 0:
                print(0)
                return
    print(ans)              
        
    
if __name__ == '__main__':
    main()

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l,r = map(int,input().split())
ans = 0
if r-l >= 2018:
    print(ans)
else:
    cand = []
    for i in range(l,r+1):
        cand.append(i%2019)
    cand = sorted(cand)
    print(cand[0]*cand[1]%2019)

Failing test case input:
2845 3053

Expected output:
1


Actual output:
680


Fixed submission (verdict: Accepted):
l,r = map(int,input().split())

if r-l >= 2018:
    print(0)
else:
    cand = []
    ans = float("inf")
    for i in range(l,r+1):
        cand.append(i%2019)
    cand = sorted(cand)
    for i in range(len(cand)):
        for j in range(i+1,len(cand)):
            ans = min(ans,cand[i]*cand[j]%2019)
    print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l, r = map(int, input().split())
mod = 2019
mod_min = 2100

s = l % mod
e = r % mod

if s >= e:
    e = s + mod - 1



for i in range(s,e):
    for j in range(i+1,e+1):

        
        m = (i * j) % mod
        

        if m < mod_min:
            mod_min = m

print(mod_min)


Failing test case input:
1022 3053

Expected output:
0


Actual output:
22


Fixed submission (verdict: Accepted):
l, r = map(int, input().split())
mod = 2019
mod_min = 2019


for i in range(l,r):
    for j in range(i+1,r+1):
        m = (i * j) % mod
        if m < mod_min:
            mod_min = m
        if mod_min == 0:
            break
    if mod_min == 0:
        break

print(mod_min)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l, r = map(int, input().split())
mod = 2019
mod_min = 2100

s = l % mod
e = r % mod

if s > e:
    e = s + mod - 1



for i in range(s,e):
    for j in range(i+1,e+1):

        
        m = (i * j) % mod
        

        if m < mod_min:
            mod_min = m

print(mod_min)


Failing test case input:
1022 3053

Expected output:
0


Actual output:
22


Fixed submission (verdict: Accepted):
l, r = map(int, input().split())
mod = 2019
mod_min = 2019


for i in range(l,r):
    for j in range(i+1,r+1):
        m = (i * j) % mod
        if m < mod_min:
            mod_min = m
        if mod_min == 0:
            break
    if mod_min == 0:
        break

print(mod_min)
Problem: p02983
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
l, r = map(int, input().split())
min1 = 2019
min2 = 2020
for i in range(l, min(r+1, l+2019+1)):
    candidate = i % 2019
    if min1 > candidate:
        min1 = candidate
    elif min2 > candidate:
        min2 = candidate
print ((min1 * min2) % 2019)

Failing test case input:
2845 3053

Expected output:
1


Actual output:
680


Fixed submission (verdict: Accepted):
l,r = map(int, input().split())
min1 = 2019
for i in range(l, min(r+1, l+2020)):
    for j in range(i+1, min(r+1, l+2020)):
        candidate = ((i%2019)*(j%2019))%2019
        if candidate < min1:
            min1 = candidate
print (min1)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L,R=map(int,input().split())
d=R-L
ans=2019
if d>=2019:print(0)
else:
    for i in range(L,R+1):
        for j in range(L,R+1):
            if i != j:
                a = (i*j)%2019
                if a < ans:ans=a
print(ans)



Failing test case input:
543 3053

Expected output:
0


Actual output:
0
2019


Fixed submission (verdict: Accepted):
L,R=map(int,input().split())
ans=2019
if R-L>=2018:ans=0
else:
    for i in range(L,R):
        for j in range(i+1,R+1):
            a = (i*j)%2019
            if a < ans:ans=a
print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l,r=map(int, input().split())
if r > 2019:
    r %= 2019

if l > 2019:
    l %=2019
    l ,r = min(l, r), max(l, r)
rem = 2019
for i in range(l,r+1):
    for j in range(l+1,r+1):
         if rem<(i*j)%2019:
            continue
         else:
            rem = (i*j)%2019
print(l, r)
print(rem)

Failing test case input:
-2 113

Expected output:
0


Actual output:
-2 113
0


Fixed submission (verdict: Accepted):
l,r=map(int, input().split())

mod_l = l % 2019
mod_r = r % 2019

if (r - l >= 2019) or (mod_r < mod_l):
  print('0')
else:
  rem = 2018
  for i in range(mod_l, mod_r):
    for j in range(i+1, mod_r+1):
      if rem < (i*j)%2019:
        continue
      else:
          rem = (i*j)%2019

  print(rem)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l,r = map(int,input().split())

if r-l >= 2019:
    print("0")
else:
    min = 2019
    for i in range(l,r):
        if min > i * (i+1)% 2019:
            min = i * (i+1)% 2019
        elif min == 0:
            print(min)
            exit()
print(min)

Failing test case input:
2845 5763

Expected output:
0


Actual output:
0
<built-in function min>


Fixed submission (verdict: Accepted):
l,r = map(int,input().split())

if r-l >= 2019:
    print("0")
    exit()
else:
    min = 2019
    for i in range(l,r):
        if min == 0:
            break
        else:
            for j in range(i+1,r+1):
                if i*j%2019 < min:
                    min = i*j%2019
                if min == 0:
                    break
print(min)
Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


l, r = map(int, input().split())

l, r = l % 2019, r % 2019

mod = 2018

for i in range(l, r):
    for j in range(i+1, r+1):
        tmp = i * j % 2019
        if tmp < mod:
            mod = tmp
            if mod == 0:
                break
print(mod)

Failing test case input:
-2 43

Expected output:
0


Actual output:
2018


Fixed submission (verdict: Accepted):
l, r = map(int, input().split())

mod = 2018

if r - l >= 2019:
    print(0)
else:
    for i in range(l, r):
        for j in range(i+1, r+1):
            tmp = i * j % 2019
            if tmp < mod:
                mod = tmp
    print(mod)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

l,r=map(int,input().split())
c=(r-l)
d=2018
if c>=2018:
    print(0)
else:
    for i in range(l,r-1):
        for k in range(l+1,r):
            
            if (i*k)%2019<d:
                d=(i*k)&2019
            
    print(d)



Failing test case input:
2020 2040

Expected output:
2

Actual output:
162


Fixed submission (verdict: Accepted):

l,r=map(int,input().split())
c=(r-l)
d=2018
if c>=2018:
    print(0)
else:
    for i in range(l,r):
        for k in range(l+1,r+1):
            
            if (i*k)%2019<d:
                d=(i*k)%2019
    print(d)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = map(int, input().split())

res = 1000000007

if R - L > 2019:
    print(0)
else:
    for i in range(L, R + 1):
        a = i % 2019
        for j in range(i + 1, R + 1):
            b = j % 2019
            res = min(res, a * b % 2019)

print(res)

Failing test case input:
543 3053

Expected output:
0


Actual output:
0
1000000007


Fixed submission (verdict: Accepted):
L, R = map(int, input().split())

res = 1000000007

if R - L + 1 > 2019:
    print(0)
else:
    amari = [i % 2019 for i in range(L, R + 1)]
    l = len(amari)
    for i in range(l):
        a = amari[i]
        for j in range(i + 1, l):
            b = amari[j]
            res = min(res, a * b % 2019)

    print(res)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = map(int, input().split())
L %= 2019
R %= 2019
if L >= R:
    print(0)
else:
    L = int(L)
    R = int(R)
    val = 2019
    for i in range(L, R):
        for j in range(i + 1, R + 1):
            tmp = (i * (j % 2019)) % 2019
            val = tmp if val > tmp else val

    print(val)


Failing test case input:
1022 3053

Expected output:
0


Actual output:
22


Fixed submission (verdict: Accepted):
L, R = map(int, input().split())
if R - L >= 2019:
    print(0)
else:
    val = 2019
    for i in range(L, R):
        for j in range(i + 1, R + 1):
            tmp = ((i % 2019) * (j % 2019)) % 2019
            val = tmp if val > tmp else val
            if val == 0:
                print(val)
                exit()

    print(val)
Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L,R=map(int,input().split())
min=2019
for i in range(L,R+1):
    for k in range(i+1,R+1):
        mod=(i*k)%2019
        if mod<min:
            min=mod
        if mod==0:
            min=0
            break
        else:
            continue
    break
print(min)


Failing test case input:
1 176

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
L,R=map(int,input().split())
min=2019
for i in range(L,R+1):
    for k in range(i+1,R+1):
        mod=(i*k)%2019
        if mod<min:
            min=mod
        if mod==0:
            min=0
            break
    else:
        continue
    break
print(min)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l, r = map(int, input().split())
ans = 10e10
if r -l > 2019:
  print('0')
else:
  for i in range(l,r+1):
    for j in range(i+1,r+1):
      if (i*j)%2019 < ans:
        ans = (i*j)%2019
print(ans)

Failing test case input:
468 3053

Expected output:
0


Actual output:
0
100000000000.0


Fixed submission (verdict: Accepted):
l, r = map(int, input().split())
ans = 100000000000000000
if r -l > 2019:
  print('0')
else:
  for i in range(l,r+1):
    for j in range(i+1,r+1):
      if (i*j)%2019 <= ans:
        ans = (i*j)%2019
  print(ans)

Problem: p02983
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
l, r = map(int, input().split())

ans = float('inf')
for i in range(l, r):
    for j in range(i + 1, r + 1):
        x = i * j % 2019
        if x == 0:
            break
        ans = min(ans, x)
        
print(ans)

Failing test case input:
1022 3053

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
l, r = map(int, input().split())

ans = float('inf')
for i in range(l, min(r, l + 2019)):
    for j in range(i + 1, min(r + 1, l + 2019 + 1)):
        x = i * j % 2019
        ans = min(ans, x)
        
print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = map(int, input().split())
  

ans = 2018
for i in range(L, R):
    for j in range(i, R+1):
        ans = min(ans, (i * j) % 2019)
        if ans == 0:
            print(ans)
            exit()

print(ans)

Failing test case input:
1 97

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
L, R = map(int, input().split())
  

ans = 2018
for i in range(L, R):
    for j in range(i+1, R+1):
        ans = min(ans, (i * j) % 2019)
        if ans == 0:
            print(ans)
            exit()

print(ans)
Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def solve():
  l,r = (int(i) for i in input().split())
  mod = 2019
  l %= mod
  r %= mod
  ans = 10**15
  if l >= r :
    print(0)
    exit()
  elif l == 0 or r == 0:
    print(0)
    exit()
  else:
    for i in range(l,r):
      for j in range(i+1,r+1):
         ans = min(ans,(i*j)%mod)
  print(ans%mod)

solve()


Failing test case input:
1022 3053

Expected output:
0


Actual output:
22


Fixed submission (verdict: Accepted):
def solve():
  l,r = (int(i) for i in input().split())
  mod = 2019
  if r-l >= 2019:
   print(0)
   exit()
  l %= mod
  r %= mod
  ans = 10**15
  if l >= r :
    print(0)
    exit()
  elif l == 0 or r == 0:
    print(0)
    exit()
  else:
    for i in range(l,r):
      for j in range(i+1,r+1):
         ans = min(ans,(i*j)%mod)
  print(ans%mod)

solve()

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L,R = list(map(int, input().split()))

if R-L > 2019:
    print(0)
else:
    i_mod = 2019
    j_mod = 2019
    for k in range(L,R+1):
        mod = k%2019
        if mod < i_mod:
            j_mod = i_mod
            i_mod = mod
        elif mod < j_mod:
            j_mod = mod
    print((i_mod*j_mod)%2019)

Failing test case input:
2845 3053

Expected output:
1


Actual output:
680


Fixed submission (verdict: Accepted):
L,R = list(map(int, input().split()))
 
if R-L > 673:
    print(0)
else:
    min_mod = 2019
    for i in range(L,R):
        i_mod = i%2019
        for j in range(i+1,R+1):
            j_mod = j%2019
            mod = (i_mod*j_mod)%2019
            if mod < min_mod:
                min_mod = mod
        
    print(min_mod)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
L, R = [int(x) % 2019 for x in input().strip().split()]

if L < R:
  print(min([i * j for i in range(L, R) for j in range(i+1, R+1)]))
else:
  print(0)

Failing test case input:
2845 3053

Expected output:
1


Actual output:
683102


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
L, R = [int(x) for x in input().strip().split()]
MODL, MODR = L % 2019, R % 2019
if R - L >= 2019 or MODL > MODR:
  print(0)
else:
  print(min([(i * j) % 2019 for i in range(L, R) for j in range(i+1, R+1)]))

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

L,R = map(int,input().split())
if R-L>673:
    print(0)
else:
    A =[]
    for i in range(R-L+1):
        n = (L+i)
        if n % 673 == 0 and (R-L+1) >= 3:
            print(0)
            sys.exit()
        else:
            A.append(n%2019)
    A.sort()
    print((A[0]*A[1])%2019)


Failing test case input:
2845 3053

Expected output:
1


Actual output:
680


Fixed submission (verdict: Accepted):
import sys

L,R = map(int,input().split())
if R-L>673:
    print(0)
else:
    ans =2019
    for i in range(R-L+1):
        for j in range(R-(L+i)):
            m = L+i
            n = L+j+i+1
            ans = min(ans, m*n%2019)
            if ans == 0:
                print(ans)
                sys.exit()
    print(ans)
Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L,R=map(int,input().split())
ans=0
if R-L>=673:
  print(0)
  exit()
if R*(R-1)<=2018:
  print(L*(L+1))
  exit()
for i in range(R-L):
  for j in range(R-L):
    if ans>i*j%2019:
      ans=i*j%2019
print(ans)

Failing test case input:
1 89

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
L,R=map(int,input().split())
ans=2018
if R-L>=673:
    print(0)
    exit()
for i in range(R-L):
    for j in range(i+1,R-L+1):
        if ans>((L+i)*(L+j))%2019:
            ans=((L+i)*(L+j))%2019
print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = map(int, input().split())

reg = 10**9
if R-L >= 2019:
    print(0)
else:
    for l in range(L, R):
        for r in range(l+1, R+1):
            tmp = (l * r) % 2019
            reg = min(reg, tmp)
print(reg)

Failing test case input:
543 3053

Expected output:
0


Actual output:
0
1000000000


Fixed submission (verdict: Accepted):
L, R = map(int, input().split())

reg = 2018
if R-L >= 3000:
    print(0)
else:
    for l in range(L, R):
        for r in range(l+1, R+1):
            tmp = (l * r) % 2019
            reg = min(reg, tmp)
    print(reg)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = map(int, input().split())

p, q = L%2019, R%2019
z = R - L

if (p == 0) or (q == 0) or (z > 2019) or (p >= q):
    print(0)
else:
    answer = []
    for i in range(z):
        for j in range(z-i):
            i = p + i
            j = j + i + 1
            X = i * j % 2019
            answer.append(X)
    A = min(answer, key=int)
    print(A)

Failing test case input:
2845 3053

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
L, R = map(int, input().split())

p, q = L%2019, R%2019
z = R - L

if (p == 0) or (q == 0) or (z > 2019) or (p >= q):
    print(0)
else:
    answer = []
    for i in range(z):
        for j in range(z-i):
            k1 = p + i
            k2 = j + k1 + 1
            X = k1 * k2 % 2019
            answer.append(X)
    A = min(answer, key=int)
    print(A)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L,R=map(int,input().split())
li=[]
for i in range(L,R):
  for j in range(i+1,R+1):
    mod=(i*j)%2019
    if mod==0:
      break
    li.append(mod)
print(min(li))


Failing test case input:
1022 3053

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
L,R=map(int,input().split())
R=min(R, L+2019)
li=[]
for i in range(L,R):
  for j in range(i+1,R+1):
      mod=(i*j)%2019
      li.append(mod)
      if mod==0:
        break
print(min(li))
Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L,R = map(int,input().split())
if(L<=R-2018)or(L==0):
  print(0)
else:
  ans = 2020
  l = L%2019
  r = R%2019
  for i in range(l,r):
    for j in range(i+1,r):
      min(ans,(i*j)%2019)
  print(ans)
    

Failing test case input:
-1 88

Expected output:
0


Actual output:
2020


Fixed submission (verdict: Accepted):
L,R = map(int,input().split())
ans = 3000
for i in range(L,R+1):
  if(i%2019==0):
    ans = 0
    break
if ans>0:
  for i in range(L,R+1):
    for j in range(i+1,R+1):
      k = (i*j)%2019
      ans = min(ans,k)
print(ans)

Problem: p02983
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
l,r = map(int,input().split())
ans = 2019

for i in range(l,r+1):
    if ans == 0:
        break
    ans = min(ans,i%2019)

print(ans*(ans+1))

Failing test case input:
2845 3053

Expected output:
1


Actual output:
683102


Fixed submission (verdict: Accepted):
l,r = map(int,input().split())
ans = 2019

for i in range(l,min(r+1,l+2020)):
    for j in range(i+1,min(r+1,l+2020)):
        if ans == 0:
            break
        ans = min(ans,i*j%2019)

print(ans)

Problem: p02983
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
l, r = map(int, input().split())
x = 2018
for i in range(l, r+1):
    a = i%2019
    if a == 0:
        print(0)
        exit()
    x = min(a, x)
    y = a*(a+1)%2019
    
print(min(x*(x+1), y))

Failing test case input:
2845 3053

Expected output:
1


Actual output:
120


Fixed submission (verdict: Accepted):
l, r = map(int, input().split())
if r-l >=2020:
    print(0)
    exit()
ans = 2018
for i in range(l, r+1):
    for j in range(l, r+1):
        if i != j:
            a = i*j%2019
            ans = min(ans, a)
print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L,R=map(int,input().split())
L%=2019
R%=2019
ans=2019
for i in range(L,R):
	for j in range(i+1, R+1):
		ans=min(ans,(i*j)%2019)
print(ans)


Failing test case input:
-5 15

Expected output:
0


Actual output:
2019


Fixed submission (verdict: Accepted):
L,R=map(int,input().split())
ans=2019
for i in range(L,R):
	for j in range(i+1, R+1):
		if j%2019==0:
			print(0)
			exit()
		ans=min(ans,(i*j)%2019)
print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l,r=map(int,input().split())
a=[]
if r-l>=2018:
  print(0)
else:
  for i in range(0,r-l+1):
    a.append((l+i)%2019)
  
  a=sorted(a)
  print((a[0]*a[1])%2019)
    


Failing test case input:
2020 3053

Expected output:
0


Actual output:
2


Fixed submission (verdict: Accepted):
l,r=map(int,input().split())
a=[]
b=[]
if r-l>=2018:
  print(0)
else:
  for i in range(0,r-l+1):
    a.append((l+i)%2019)
  
  for j in range(0,r-l):
    for k in range(j+1,r-l+1):
      b.append((a[j]*a[k])%2019)
      
  print(min(b))
Problem: p02983
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

def solve():
    i = L
    ans = 0
    while L <= 2019*i <= R:
        i += 1

    if i >= 1:
        print(ans)
    else:
        ans = 2019
        for n in range(L,R):
            for m in range(n+1, R+1):
                ans = min(ans, ((n*m)%2019))
        print(ans)


if __name__ == "__main__":
    L,R = list(map(int, input().split()))
    solve()


Failing test case input:
1 97

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):

def solve():
    i = (L
    ans = 0
    if L <= 2019*i <= R:
        print(ans)
    else:
        ans = 2020
        for n in range(L,R):
            for m in range(n+1,R+1):
                ans = min(ans, (n*m)%2019)
            if ans == 0:
                break
        print(ans)

if __name__ == "__main__":
    L,R = list(map(int, input().split()))
    solve()

Problem: p02983
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
L,R = map(int,input().split())

ans = 2018

for i in range(L,R+1):
    for j in range(L,i):
        if (i*j) % 2019 < ans:
            ans = (i*j) % 2019
            if ans == 0:
                print(0)
                break

print(ans)

Failing test case input:
920 4340

Expected output:
0


Actual output:
0
0


Fixed submission (verdict: Accepted):
L,R = map(int,input().split())

ans = 2018

for i in range(L,min(R,L+2100)):
    for j in range(i+1,min(R+1,i+2100)):
        if (i*j) % 2019 <= ans:
            ans = (i*j) % 2019

print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = map(int, input().split())
min_mod = 10**9
for i in range(L, R):
    for j in range(i + 1, R + 1):
        min_mod = min(min_mod, i * j)
print(min_mod % 2019)


Failing test case input:
-7 7

Expected output:
0


Actual output:
1970


Fixed submission (verdict: Accepted):
L, R = map(int, input().split())
min_mod = 10**9
for i in range(L, min(L + 2019, R + 1)):
    for j in range(i + 1, min(L + 2019, R + 1)):
        min_mod = min(min_mod, (i * j) % 2019)
print(min_mod)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = map(int, input().split())

ans = 2019
R = min(R, L+4038)
for i in range(L, R):
    f = False
    for j in range(i+1, R+1):
        m = (i*j)%2019
        if  m  == 0:
            print(0)
            f = True
            break     
        ans = min(ans, m)
    if f:
        break
print(ans)

Failing test case input:
2845 5763

Expected output:
0


Actual output:
0
38


Fixed submission (verdict: Accepted):
L, R = map(int, input().split())

ans = 2018
R = min(R, L+2020)
for i in range(L, R+1):
    f = False
    for j in range(i+1, R+1):
        m = (i*j)%2019
        if  m  == 0:
            ans = m
            f = True
            break     
        ans = min(ans, m)
    if f:
        break
print(ans)
Problem: p02983
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
l,r = map(int,input().split())
l=l%2019
r=r%2019
if l>=r:
  print(0)
  sys.exit()

ans=2018
for i in range(l,r):
  if ans == 0:
    break
  for j in range(i+1,r+1):
    ans = min(ans,i*j%2019)
    if ans == 0:
      break
print(ans)

Failing test case input:
1022 3053

Expected output:
0


Actual output:
22


Fixed submission (verdict: Accepted):
import sys
l,r = map(int,input().split())
if l+2019<=r:
  print(0)
  sys.exit()
l=l%2019
r=r%2019
if l>=r:
  print(0)
  sys.exit()

ans=2018
for i in range(l,r):
  if ans == 0:
    break
  for j in range(i+1,r+1):
    ans = min(ans,i*j%2019)
    if ans == 0:
      break
print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l,r = map(int,input().split())
l%=2019
r%=2019
if r <l:
  r+=2019
ans = 20000
for i in range(l,r+1):
  for j in range(i+1,r+1):
    ans = min(i*j%2019,ans)
print(ans)

Failing test case input:
1022 3053

Expected output:
0


Actual output:
22


Fixed submission (verdict: Accepted):
l,r = map(int,input().split())
r2 = r+0
l2 = l+0
l%=2019
r%=2019
ans = 20000
if r2-l2 >= 2019 or r<=l:
  r += 2019
for i in range(l,r+1):
  for j in range(i+1,r+1):
    ans = min(i*j%2019,ans)
if ans == 20000:
  ans = 0
print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l,r = map(int, input().split())
L = l % 2019
R = r % 2019
ans = []

if R - L > 0:
  for i in range(L, R):
    for j in range(i+1, R+1):
      ans.append(i * j % 2019)
  print(min(ans))
elif R == L:
  print(L * L % 2019)
else:
  print(0)

Failing test case input:
1022 3053

Expected output:
0


Actual output:
22


Fixed submission (verdict: Accepted):
l,r = map(int, input().split())
L = l % 2019
R = r % 2019
ans = []

if r - l > 2019:
  print(0)
elif R - L > 0:
  for i in range(L, R):
    for j in range(i+1, R+1):
      ans.append(i * j % 2019)
  print(min(ans))
else:
  print(0)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline

L, R = map(int, input().split())
if R - L > 2018:
    print(0)
else:
    tmp = []
    for i in range(L, R+1):
        tmp.append(i%2019)
    m = tmp[0]*tmp[1]
    for i in range(2, R-L):
        m = min(m, (tmp[i]*tmp[i-1])%2019)
    print(m)


Failing test case input:
1 176

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline

L, R = map(int, input().split())
if R - L > 2018:
    print(0)
else:
    tmp = []
    for i in range(L, R+1):
        tmp.append(i%2019)
    m = 2019
    for i in range(R-L+1):
        for j in range(i+1, R-L+1):
            m = min(m, (tmp[i]*tmp[j])%2019)
    print(m)
Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    L, R = map(int, input().split())

    ans = L * R % 2019
    if R - L >= 2019:
        ans = 0
    else:
        l = L % 2019
        r = R % 2019
        if l == r:
            ans = 2*l
        else:
            ans = min(l*(l+1), l*r)

    print(ans)


if __name__ == '__main__':
    main()


Failing test case input:
-1 113

Expected output:
0


Actual output:
228034


Fixed submission (verdict: Accepted):
def main():
    L, R = map(int, input().split())

    ans = L * R % 2019
    if R - L >= 2019:
        ans = 0
    else:
        for i in range(L, R+1):
            for j in range(i+1, R+1):
                ans = min(ans, i*j % 2019)
    print(ans)


if __name__ == '__main__':
    main()

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l, r = map(int, input().split())

l = l%2019
r = r%2019

if l == 0 or r == 0 :
    print(0)
    exit()

if l > r:
    r += 2019



list_score = []
for i in range(l+1, r+1):
    for j in range(l, i):
        
        list_score.append(i*j%2019)

print(int(min(list_score)))

Failing test case input:
1022 3053

Expected output:
0


Actual output:
22


Fixed submission (verdict: Accepted):
l, r = map(int, input().split())

if r-l>=2019 :
    print(0)
    exit()

l = l%2019
r = r%2019

if l == 0 or r == 0 :
    print(0)
    exit()

if l > r:
    r += 2019



list_score = []
for i in range(l+1, r+1):
    for j in range(l, i):
        
        list_score.append(i*j%2019)

print(int(min(list_score)))

Problem: p02983
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
l, r = map(int, input().split())

l %= 2019
r %= 2019

if l >= r:
    print(0)
else:
    m = 2019
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            m = min(m, (i * j) % 2019)
    print(m)


Failing test case input:
1022 3053

Expected output:
0


Actual output:
22


Fixed submission (verdict: Accepted):
l, r = map(int, input().split())

ll = l % 2019
rr = r % 2019

if r - l >= 2019 or ll >= rr:
    print(0)
else:
    m = 2019
    for i in range(ll, rr):
        for j in range(i + 1, rr + 1):
            m = min(m, (i * j) % 2019)
    print(m)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L, R = map(int, input().split())
MOD = 2019
l = L % MOD
r = R % MOD
ans = 2019

if l >= r:
    l = 0
    r = 2018

for i in range(l, r):
    for j in range(l, r + 1):
        if j <= i:
            continue
        else:
            ans = min(ans, i * j % MOD)

print(ans)


Failing test case input:
1022 3053

Expected output:
0


Actual output:
22


Fixed submission (verdict: Accepted):
L, R = map(int, input().split())
MOD = 2019
l = L % MOD
r = R % MOD
ans = 2019

if l >= r or l == 0 or r == 0 or (R - L) >= 2019:
    ans = 0
else:
    for i in range(l, r):
        for j in range(l + 1, r + 1):
            if j <= i:
                continue
            else:
                ans = min(ans, i * j % MOD)

print(ans)
Problem: p02983
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
L,R= map(int,input().split())

bool = True
l = L % 2019
r = R % 2019
if l == 0 or r == 0:
    ans = 0
elif R == L +1:
    ans = L*R%2019
else:
    if l > r:
        r+=2019
    if l == r:
        l = L
        r = R
    for i in range(l,r):
        for j in range(i+1,r+1):
            temp = (i * j) % 2019
            if bool:
                min = temp
                ans = min
                bool = False
            elif min > temp:
                min = temp
                ans = min
print(ans)

Failing test case input:
1022 3053

Expected output:
0


Actual output:
22


Fixed submission (verdict: Accepted):
L,R= map(int,input().split())

bool = True
flag = False
for i in range(L,R):
    for j in range(i+1,R+1):
        temp = (i * j) % 2019
        if bool:
            min = temp
            ans = min
            bool = False
        elif min > temp:
            min = temp
            ans = min
        if min == 0:
            flag = True
            break
    if flag:
        break
print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L,R = map(int,input().split())
ans = 3000
for i in range(L,R+1):
  if(i%2019==0):
    ans = 0
    break
if ans>0:
  r = R%2019
  l = L%2019
  for i in range(r,l+1):
    for j in range(i+1,l+1):
      k = (i*j)%2019
      ans = min(ans,k)
print(ans)


Failing test case input:
2845 3053

Expected output:
1


Actual output:
3000


Fixed submission (verdict: Accepted):
L,R = map(int,input().split())
ans = 3000
for i in range(L,R+1):
  if(i%2019==0):
    ans = 0
    break
if ans>0:
  for i in range(L,R+1):
    for j in range(i+1,R+1):
      k = (i*j)%2019
      ans = min(ans,k)
print(ans)

Problem: p02983
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
MOD=2019

l,r=map(int,input().split()) 
res=[2020]

l=l%MOD
r=r%MOD
l,r=min(l,r),max(l,r)

for i in range(l,r+1):
  for j in range(i+1,r+1):
    res += [(i*j)%MOD]
print(min(res))




Failing test case input:
1022 3053

Expected output:
0


Actual output:
22


Fixed submission (verdict: Accepted):
MOD=2019
l,r=map(int,input().split()) 
res=[]

if r - l > 2019:
  print(0)
  
else:
  l=l%MOD
  r=r%MOD
  l,r=min(l,r),max(l,r)

  for i in range(l,r):
    for j in range(i+1,r+1):
      res += [(i*j)%MOD]

  print(min(res))