Problem:


Score : 300 points

Problem Statement

You are given two non-negative integers L and R.
We will choose two integers i and j such that L \leq i < j \leq R.
Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Constraints

All values in input are integers.

0 \leq L < R \leq 2 \times 10^9

Input

Input is given from Standard Input in the following format:

L R

Output

Print the minimum possible value of (i \times j) \mbox{ mod } 2019 when i and j are chosen under the given condition.

Sample Input 1

2020 2040

Sample Output 1

2

When (i, j) = (2020, 2021), (i \times j) \mbox{ mod } 2019  = 2.

Sample Input 2

4 5

Sample Output 2

20

We have only one choice: (i, j) = (4, 5).



Sample input:
2020 2040


Sample output:
2

Submission status: Wrong Answer

Solution code:
l,r = input().split()
l = int(l)
r = int(r)
N = int(2019)
flag = False
  
ans = N - 1
count = 0
for i in range(l,r):
  for j in range(l+1,r+1):
    if(count >= (N - 1)):
      flag = True
      break
    if(ans > (i * j) % N):
      ans = (i * j) % N
    count += 1
  if flag:
    break
    
print(ans)

Submission status: Wrong Answer

Solution code:
l,r = input().split()
l = int(l)
r = int(r)
N = int(2019)
flag = False
  
ans = (l * (l + 1)) % N
count = 0
for i in range(l,r+1):
  for j in range(l+1,r+1):
    if(count >= (N - 1)):
      flag = True
      break
    if(ans > (i * j) % N):
      ans = (i * j) % N
    count += 1
  if flag:
    break
    
print(ans)

Submission status: Wrong Answer

Solution code:
l,r = input().split()
l = int(l)
r = int(r)
N = int(2019)
flag = False
  
ans = (l * (l + 1)) % N
count = 0
for i in range(l,r):
  for j in range(l+1,r+1):
    if(count >= 2*N):
      flag = True
      break
    if(ans > (i * j) % N):
      ans = (i * j) % N
    count += 1
  if flag:
    break
    
print(ans)

Submission status: Wrong Answer

Solution code:
l,r = input().split()
l = int(l)
r = int(r)
N = int(2019)
flag = False
  
ans = (l * (l + 1)) % N
count = 0
for i in range(l,r):
  for j in range(l+1,r+1):
    if(count >= (N - 1)):
      flag = True
      break
    if(ans > (i * j) % N):
      ans = (i * j) % N
    count += 1
  if flag:
    break
    
print(ans)

Submission status: Wrong Answer

Solution code:
l,r = input().split()
l = int(l)
r = int(r)
N = 2019
  
ans = (l * (l + 1)) % N
count = 0
for i in range(l,r-1):
  if(count >= (N - 1)):
    break
  for j in range(l+1,r):
    if(count >= (N - 1)):
      break
    if(ans > (i * j) % N):
      ans = (i * j) % N
    count += 1
    
print(ans)

Submission status: Wrong Answer

Solution code:
l, r = map(int, raw_input().split(" "))

ans = 0
if r - l >= 2019 or (l % 2019) - (r % 2019) > 0:
    ans = 0
else:
    ans = (l * (l + 1)) % 2019

print(ans)

Submission status: Wrong Answer

Solution code:
l, r = map(int, raw_input().split(" "))

ans = 0
if r - l > 2018 or (l % 2019) - (r % 2019) > 0:
    ans = 0
else:
    ans = ((l % 2019) * ((l + 1) % 2019)) % 2019

print(ans)

Submission status: Wrong Answer

Solution code:
l, r = map(int, raw_input().split(" "))

ans = 0
if r - l > 2018 or (r % 2019) - (l % 2019) < 0:
    ans = 0
else:
    ans = (l % 2019) * ((l + 1) % 2019)

print(ans)

Submission status: Wrong Answer

Solution code:
l,r=[int(i) for i in input().split()]
l2,r2=l%2019,r%2019
if l//2019<r//2019:
  print(0)
else:
  k=2019*2019
  for i in range(l,r):
    for j in range(i+1,r+1):
      k=min(k,i*j%2019)

Submission status: Wrong Answer

Solution code:
l,r=[int(i) for i in input().split()]
l2,r2=l%2019,r%2019
if l2>=r2:
  print(0)
elif r-l>=2019:
  print(0)
else:
  print(l2*(l2+1))

Submission status: Wrong Answer

Solution code:
l,r=[int(i) for i in input().split()]
l2,r2=l%2019,r%2019
if l2>r2:
  print(0)
elif r-l>=2019:
  print(0)
else:
  print(l*(l+1))

Submission status: Wrong Answer

Solution code:
L,R = map(int, input().split())
rec = 2019
for i in range (R - L):
    for j in range(R - L):
        if i >= j:
            continue
        elif (((L+i)*(L+j)) % 2019) < rec:
            rec = ((L+i)*(L+j)) % 2019
print(rec)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
if n-m>=2018:
  print(0)
  exit()
a=n%2019
b=m%2019
if a>=b:
  print(0)
  exit()
ans=1145141919
for i in range(a,b+1):
  for j in range(a,i):
    ans=min(ans,(i*j)%2019)
    if ans==0:
      print(0)
      exit()
print(int(ans))

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=n%2019
b=m%2019
if a>=b:
  print(0)
  exit()
ans=1145141919
for i in range(a,b+1):
  for j in range(a,i):
    ans=min(ans,abs((i*j)%2019))
    if ans==0:
      print(0)
      exit()
print(abs(ans))

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=n%2019
b=m%2019
if a>=b:
  print(0)
  exit()
ans=1145141919
for i in range(a,b+1):
  for j in range(a,i):
    ans=min(ans,(i*j)%2019)
    if ans==0:
      print(0)
      exit()
print(int(ans))

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=n%2019
b=m%2019
if a>=b:
  print(0)
  exit()
ans=1145141919
for i in range(a,b+1):
  for j in range(a,i):
    ans=min(ans,i*j%2019)
    if ans==0:
      print(0)
      exit()
print(ans)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=n%2019
b=m%2019
if a>=b:
  print(0)
  exit()
ans=1145141919
for i in range(a,b+1):
  for j in range(a,i):
    ans=min(ans,i*j%2019)
print(ans)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=n%2019
b=m%2019
if a>=b:
  print(0)
  exit()
ans=1145141919
for i in range(a,b):
  for j in range(a,i):
    ans=min(ans,i*j%2019)
print(ans)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=n%2019
b=m%2019
if a>=b:
  print(0)
  exit()
print(a*(a+1))

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())
remainder = []
for i in range(L, R+1):
  remainder.append(i%2019)

sorted_remainder = sorted(remainder)
print(sorted_remainder[0]*sorted_remainder[1])

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())

div_l = L//2019
div_r = R//2019

ans = 0
if div_l == div_r:
    mod_l = L%2019
    mod_r = R%2019
    if ((mod_l <= 673 and mod_r >= 673) and R-L >= 2) or ((mod_l <= 1346 and mod_r >= 1346) and R-L >= 2):
        ans = 0
    else:
        ans = mod_l * (mod_l+1)
print(ans)

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())

ans = 2019
for i in range(r - l):
    a = l * r
    if a % 2019 < ans:
        ans = a % 2019

print(ans)

Submission status: Wrong Answer

Solution code:
list = input().split()
l = int(list[0])
r = int(list[1])
# print(l, r)


if l//2019 ==r//2019:
  print((l%2019)*((l+1)%2019))
else: 
  print(0)

Submission status: Wrong Answer

Solution code:
list = input().split()
l = int(list[0])
r = int(list[1])
# print(l, r)


if l//2019 ==r//2019:
  print((l*(l+1))%2019)
else: 
  print(0)

Submission status: Wrong Answer

Solution code:
list = input().split()
l = int(list[0])
r = int(list[1])
# print(l, r)

mod=[]
for i in range(l,r+1):
  mod.append(i%2019)
mod.sort()
#print(mod[0],mod[1])
print((mod[0]*mod[1])%2019)

Submission status: Wrong Answer

Solution code:
list = input().split()
l = int(list[0])
r = int(list[1])
# print(l, r)

mod=[]
for i in range(l,r+1):
  mod.append(i%2019)
mod.sort()
print(mod[0]*mod[1]%2019)

Submission status: Wrong Answer

Solution code:
list = input().split()
l = int(list[0])
r = int(list[1])

max = (l*(l+1))%2019
for i in range(l,r):
  for j in range(i+1,r+1):
    k = (i*j)%2019
    if k > max:
      max = k
print(max)

Submission status: Wrong Answer

Solution code:
l, r = map(int,input().split())

a = []
for i in range(l, r+1):
  a.append(i%2019)
a.sort()
ans = (a[0]*a[1])%2019
 
print(ans)

Submission status: Wrong Answer

Solution code:
l, r = map(int,input().split())

a = []
for i in range(l, r+1):
  a.append(i%2019)
a.sort()

print(a[0]*a[1])

Submission status: Wrong Answer

Solution code:
L,R=map(int,raw_input().split())
I=114514
II=114514
for i in range(L,R):
    if i%2019<I:
        I=i%2019
        II=i
    if I==0:break
J=114514
for j in range(II+1,R+1):
    J=min(J,j%2019)
    if J==0:break
print((I*J)%2019)

Submission status: Wrong Answer

Solution code:
def solve(string):
    l, r = map(int, string.split())
    if r - l >= 100000:
        return "0"
    m = sorted([i % 2019 for i in range(l, r + 1)])
    return str(m[0] * m[1] % 2019)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())
x, y = L % 2019, R % 2019
print(x,y)
if (R-L) > 2017 or x>=y:
    print(0)
else:
    m = 2019
    for i in range(x, y + 1):
        for j in range(i + 1, y + 1):
           x = (i * j) % 2019
           m = min(m, x)
           if m == 0:
               break
        if m == 0:
            break
    print(m)

Submission status: Wrong Answer

Solution code:
def solve(string):
    l, r = map(int, string.split())
    if r - l > 2019:
        return "0"
    m = [i % 2019 for i in range(l, r + 1)]
    m.sort()
    return str((m[0] * m[1]) % 2019)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
def solve(string):
    l, r = map(int, string.split())
    if r - l >= 2019:
        return 0
    m = [i % 2019 for i in range(l, r + 1)]
    m.sort()
    return str(m[0] * m[1] % 2019)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
def solve(string):
    l, r = map(int, string.split())
    if r - l >= 2019:
        return 0
    m = [i % 2019 for i in range(l, r + 1)]
    m.sort()
    return str(m[0] * m[1])


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())
x, y = L % 2019, R % 2019
print(x,y)
if (R-L) > 2017 or x>=y:
    print(0)
else:
    m = 2019
    for i in range(x, y + 1):
        for j in range(i + 1, y + 1):
           x = (i * j) % 2019
           m = min(m, x)
    print(m)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=(a[0]*(a[0]+1))%2019
if (a[1]//2019)-(a[0]//2019) != 0:
  print(0)
else:
  for i in range(a[0],a[1]-1):
    for j in range(i+1,a[1]):
      if b>(i*j)%2019:
        b=(i*j)%2019
    if b==0:
      break
  print(b)

Submission status: Wrong Answer

Solution code:
def main():
    N, M = map(int, input().split())
    ans = -1
    if M >= 2019:
        ans = 0
    else:
        for n in range(M)[N:]:
            for i in range(M + 1)[n + 1:]:
                mod = n * i % 2019
                if ans < 0 or mod < ans:
                    ans = mod
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
l,r=map(int, input().split())
if r > 2019:
    r %= 2019
if l > 2019:
    l %=2019
if(r-l >= 2019) or (r%2019<l%2019):
    print(0)
else:
    rem = 2018
    for i in range(l%2019,r%2019):
        for j in range(l%2019+1,r%2019+1):
             if rem<(i*j)%2019:
                continue
             else:
                rem = (i*j)%2019
    print(rem)

Submission status: Wrong Answer

Solution code:
l,r=map(int, input().split())
if r > 2019:
    r %= 2019
if l > 2019:
    l %=2019
if(r-l >= 2019) or (r%2019<l%2019):
    print(0)
rem = 2018
for i in range(l%2019,r%2019):
    for j in range(l%2019+1,r%2019+1):
         if rem<(i*j)%2019:
            continue
         else:
            rem = (i*j)%2019

print(rem)

Submission status: Wrong Answer

Solution code:
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(rem)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
l, r = [int(s) for s in input().split()]

mod_l = l % 2019
mod_r = r % 2019

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

print(min)

Submission status: Wrong Answer

Solution code:
l, r = [int(s) for s in input().split()]

mod_l = l % 2019
mod_r = r % 2019

if (mod_l >= mod_r):
  print('0')
else:
  min = 2018
  for i in range(mod_l, mod_r):
    for j in range(i+1, mod_r+1):
      mod = (i * j) % 2019
      if mod < min:
        min = mod

print(min)

Submission status: Wrong Answer

Solution code:
l, r = [int(s) for s in input().split()]

mod_l = l % 2019
mod_r = r % 2019

min = 2018
for i in range(mod_l, mod_r):
  for j in range(i+1, mod_r+1):
    mod = (i * j) % 2019
    if mod < min:
      min = mod

print(min)

Submission status: Wrong Answer

Solution code:
l, r = [int(s) for s in input().split()]

mod_l = l % 2019
mod_r = r % 2019

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

print(min)

Submission status: Wrong Answer

Solution code:
l, r = map(int, raw_input().split())

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

Submission status: Wrong Answer

Solution code:
l, r = map(int, raw_input().split())

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

Submission status: Wrong Answer

Solution code:
L, R = [int(_) for _ in input().split()]

def solve(L, R):
    if L // 2019 != R // 2019:
        return 0
    l, r = L % 2019, R % 2019
    if l == 0 or r == 0:
        return 0
    result = min(
        i * j
        for i in range(l, r)
        for j in range(i + 1, r + 1)
    )
    return result

print(solve(L, R))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


def main():
    l, r = map(int, input().split())
    mod = 2019
    l %= mod
    r %= mod
    ans = 2018

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

    if l > r:
        l, r = r, l

    for i in range(l, r + 1):
        for j in range(i + 1, r + 1):
            candidate = i * j
            candidate %= mod
            ans = min(ans, candidate)

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
p=m=2019;a,b=[int(x)for x in input().split()]
for i in range(a,b+1):
    for j in range(i%p+1,b+1):
        m=min(m,i*j%p)
print(m)

Submission status: Wrong Answer

Solution code:
p=m=2019;a,b=[int(x)for x in input().split()];a=a%p;b=b%p if b//p>1 else b
for i in range(a,b):
    for j in range(i+1,b):
        m=min(m,i*j%p)
print(m)

Submission status: Wrong Answer

Solution code:
p=m=2019;a,b=[int(x)%p for x in input().split()]
for i in range(a,b):
    for j in range(i+1,b):
        m=min(m,i*j%p)
print(m)

Submission status: Wrong Answer

Solution code:
L,R = [int(i) for i in input().split()]
 
length = min(2019, R-L)
 
m = (L * R) % 2019
for i in range(L-1, L+length) :
    for k in range(i,L+length) :
        # tmp = (i*k) % 2019

        # print(i,k)
 
        l = i % 2019
        r = k % 2019
        tmp = (l*r) % 2019
        if (tmp == 0) :
            m = 0
            break
        
        if (tmp < m) :
            m = tmp 
 
print(m)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


def main():
    l, r = map(int, input().split())
    mod = 2019
    l %= mod
    r %= mod
    ans = float('inf')

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

    if l > r:
        l, r = r, l

    for i in range(l, r + 1):
        for j in range(i + 1, r + 1):
            candidate = i * j
            candidate %= mod
            ans = min(ans, candidate)

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
p=m=2019;A=[[0]*p]*p;a,b=[int(x)for x in input().split()]
for i in range(a,b+1):
    for j in range(i+1,b+1):
        k,l=i%p,j%p
        if k>l and not A[k][l]:A[k][l]=1;m=min(m,k*l%p)
        elif not A[l][k]:A[k][l]=1;m=min(m,k*l%p)
print(m)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


def main():
    l, r = map(int, input().split())
    mod = 2019
    l %= mod
    r %= mod
    ans = float('inf')

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

    if l > r:
        l, r = r, l

    for i in range(l, r):
        for j in range(i + 1, r + 1):
            candidate = i * j
            candidate %= mod
            ans = min(ans, candidate)

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())
div_number = 2019
if l >= div_number:
    l = l%div_number
if r >= div_number:
    r = r%div_number
 
min_value = div_number
for i in range(r-l):
    for j in range(r-l-i):
        hoge = ((l + i) * (r - j)) % div_number
        if hoge != 0 and min_value > hoge:
            min_value = hoge
print(min_value)

Submission status: Wrong Answer

Solution code:
L,R = map( int, input().split() )

L = L % 2019
R = R % 2019

min = 2019

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



print(min)

Submission status: Wrong Answer

Solution code:
L,R = map( int, input().split() )

L = L % 2019
R = R % 2019

min = 2019

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



print(min)

Submission status: Wrong Answer

Solution code:
import sys

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

yy = 2019

d = 2019

for i in range(L,R):
    im = i % yy
    for j in range(i+1, R+1):
        jm = j % yy

        if im * jm < d:
            d = im*jm

print(d)

Submission status: Wrong Answer

Solution code:
L,R = map( int, input().split() )

L = L % 2019
R = R % 2019

min = 2019

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

print(min)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
YEAR = 2019
ans_list = []

def main():
    l,r = map(int, input().split(" "))
    
    if l is 0:
        return l
    
    for i in range(l,r-1):
        for j in range(i+1, r):
            # if i >= YEAR:
            _i = i % YEAR
            _j = j % YEAR
            # elif j >= YEAR:
            #     _i = i
            #     _j = j % YEAR
            # else:
            #     _i = i
            #     _j = j
            if ((_i * _j) % YEAR) is 0:
                return 0
            ans_list.append((_i * _j) % YEAR)
    
    if ans_list:
        return min(ans_list)
    else:
        return (r * l) % YEAR
    
if __name__ == "__main__":
    print(main())

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
YEAR = 2019
ans_list = []

def main():
    l,r = map(int, input().split(" "))
    
    if l is 0:
        return l
    
    for i in range(l,r-1):
        for j in range(i+1, r):
            # if i >= YEAR:
            _i = i % YEAR
            _j = j % YEAR
            # elif j >= YEAR:
            #     _i = i
            #     _j = j % YEAR
            # else:
            #     _i = i
            #     _j = j
            if (_i * _j) % YEAR is 0:
                return 0
            ans_list.append((_i * _j) % YEAR)
    
    if ans_list:
        return min(ans_list)
    else:
        return (r * l) % YEAR
    
if __name__ == "__main__":
    print(main())

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
YEAR = 2019
ans_list = []

def main():
    l,r = map(int, input().split(" "))
    
    if l is 0:
        return l
    
    for i in range(l,r):
        for j in range(i+1, r):
            # if i >= YEAR:
            _i = i % YEAR
            _j = j % YEAR
            # elif j >= YEAR:
            #     _i = i
            #     _j = j % YEAR
            # else:
            #     _i = i
            #     _j = j
            if (_i * _j) % YEAR is 0:
                return 0
            ans_list.append((_i * _j) % YEAR)
    
    if ans_list:
        return min(ans_list)
    else:
        return (r * l) % YEAR
    
if __name__ == "__main__":
    print(main())

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
YEAR = 2019
ans_list = []

def main():
    l,r = map(int, input().split(" "))
    
    if l is 0:
        return l
    
    for i in range(l,r):
        for j in range(i+1, r):
            if i >= YEAR:
                _i = i % YEAR
                _j = j % YEAR
            elif j >= YEAR:
                _i = i
                _j = j % YEAR
            else:
                _i = i
                _j = j
            if (_i * _j) % YEAR is 0:
                return 0
            ans_list.append((_i * _j) % YEAR)
    
    if ans_list:
        return min(ans_list)
    else:
        return (r * l) % YEAR
    
if __name__ == "__main__":
    print(main())

Submission status: Wrong Answer

Solution code:
L,R = map( int, input().split() )

L = L % 2019
R = R % 2019
min = 2019

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

print(min)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
YEAR = 2019
ans_list = []

def main():
    l,r = map(int, input().split(" "))
    
    if l is 0:
        return l
    
    for i in range(l,r):
        for j in range(i+1, r):
            if i >= YEAR:
                _i = i % YEAR
                _j = j % YEAR
            elif j >= YEAR:
                _j = j % YEAR
            else:
                _i = i
                _j = j
            if (_i * _j) is 0:
                return 0
            ans_list.append((_i * _j) % YEAR)
    
    if ans_list:
        return min(ans_list)
    else:
        return (r * l) % YEAR
    
if __name__ == "__main__":
    print(main())

Submission status: Wrong Answer

Solution code:
L,R = map( int, input().split() )

L = L % 2019
R = R % 2019
min = 2019

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

print(min)

Submission status: Wrong Answer

Solution code:
L,R = map( int, input().split() )

L = L % 2019
R = R % 2019
min = 2019

for i in range(R-L):
    if (L+i)%2019 < min:
        min = L+i

print(min)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
YEAR = 2019
ans_list = []

def main():
    l,r = map(int, input().split(" "))
    
    if l is 0:
        return l
    
    for i in range(l,r):
        for j in range(i+1, r):
            if i >= YEAR:
                _i = i % YEAR
                _j = j % YEAR
            elif j >= YEAR:
                _j = j % YEAR
            if (_i * _j) is 0:
                return 0
            ans_list.append((_i * _j) % YEAR)
    
    if ans_list:
        return min(ans_list)
    else:
        return (r * l) % YEAR
    
if __name__ == "__main__":
    print(main())

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
YEAR = 2019
ans_list = []

def main():
    l,r = map(int, input().split(" "))
    
    if l is 0:
        return l
    
    for i in range(l,r):
        for j in range(i+1, r):
            if i >= YEAR:
                _i = i % YEAR
                _j = j % YEAR
            elif j >= YEAR:
                _j = j % YEAR
            if (_i * _j) is 0:
                return 0
            ans_list.append((_i * _j) % YEAR)
    
    if ans_list:
        return min(ans_list)
    else:
        return r * l
    
if __name__ == "__main__":
    print(main())

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())

if(L%2019==0 or R%2019==0 or R-L>=2019 or (L<2019 and 2019<R)):
	print(0)
else:
	print((L*(L+1)%2019))

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())

if(L%2019==0 or R%2019==0 or R-L>=2019):
	print(0)
else:
	print((L*(L+1)%2019))

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())

if(L%2019==0 or R%2019==0 or (L<2019 and 2019<R)):
	print(0)
elif(L>2019):
	count = 2
	while(2019*count<R):
		count+=1
		if(2019*count>L):
			print(0)
			break
	else:
		print((L*(L+1)%2019))
else:
	print((L*(L+1)%2019))

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())

if(L%2019==0 or R%2019==0 or (L<2019 and 2019<R)):
	print(0)
elif(L>2019):
	count = 2
	while(2019*count<R and 2019*count>L):
		count+=1
		if(count!=2):
			print(0)
			break
	else:
		print((L*(L+1)%2019))
else:
	print((L*(L+1)%2019))

Submission status: Wrong Answer

Solution code:
mod=[]
answer = 2018
count = 0
sub=0
mod = [int(i) for i in input().split()]
if(mod[0]+1==mod[1]):
    answer = (mod[0]*mod[1])%2019

for i in range(mod[0],mod[1]+1):
    for j in range(i+1,mod[1]+1):
        sub = (i*j)%2019
        if sub<answer:
            answer = sub
            print(answer)
    if count == 2018:
        break
    count = count + 1
print(answer)

Submission status: Wrong Answer

Solution code:
mod=[]
answer = 2018
count = 0
sub=0
mod = [int(i) for i in input().split()]
for i in range(mod[0],mod[1]):
    for j in range(i+1,mod[1]):
        sub = i%2019*j%2019
        if sub<answer:
            answer = sub
    if count ==2018:
        break
    count = count + 1
print(answer)

Submission status: Wrong Answer

Solution code:
mod=[]
answer = 2018
count = 0
sub=0
mod = [int(i) for i in input().split()]
for i in range(mod[0],mod[1]):
    for j in range(i+1,mod[1]):
        sub = i*j%2019
        if sub<answer:
            answer = sub
    if count ==2018:
        break
    count = count + 1
print(answer)

Submission status: Wrong Answer

Solution code:
mod=[]
answer = 2018
count = 0
mod = [int(i) for i in input().split()]
for i in range(mod[0],mod[1]):
    for j in range(i+1,mod[1]):
        if i*j%2019<answer:
            answer = i*j%2019
    if count ==2018:
        break
    count = count + 1
print(answer)

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())

r_min = min(l+2019,r)
inf = float('inf')
ans = inf

for i in (l,r_min):
    for j in (i+1,r_min):
        modu = i*j
        if modu%2019 <= ans:
            ans = modu%2019

print(ans)

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())

r_min = min(l+2019,r)
inf = float('inf')
ans = inf

for i in (l,r_min):
    for j in (i+1,r_min):
        modu = i*j
        if modu%2019 <= ans:
            print(modu)
            ans = modu%2019

print(ans)

Submission status: Wrong Answer

Solution code:
N, D = map(int, input().rstrip().split())
X = []
for i in range(N,D+1):
  X.append(i%2019)
a=0
a=min(X)*(min(X)+1)
print(a)

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())

r_min = min(l+2019,r)
inf = float('inf')
ans = inf

for i in (l,r_min+1):
    for j in (i+1,r_min+1):
        modu = i*j
        if modu%2019 <= ans:
            ans = modu%2019

print(ans)

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())

min = (2 * (10 ** 9)) ** 2 + 1
for i in range(L, R):
    for j in range(i + 1, R):
        mod = (i * j) % 2019
        if (min > mod) :
            min = mod
            if (min == 0):
                break
    if (min == 0):
        break

if (min == (2 * (10 ** 9)) ** 2 + 1):
    print(L * R)
else:
    print(min)

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())

min = (2 * (10 ** 9)) ** 2 + 1
for i in range(L, R):
    for j in range(L + 1, R):
        mod = (i * j) % 2019
        if (min > mod) :
            min = mod
            if (min == 0):
                break
    if (min == 0):
        break

if (min == (2 * (10 ** 9)) ** 2 + 1):
    print(L * R)
else:
    print(min)

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())

if (L <= 2019 and 2019 <= R) :
    print(0)
else :
    min = (2 * (10 ** 9)) ** 2 + 1
    for i in range(L, R):
        for j in range(L + 1, R):
            mod = i * j % 2019
            if (min > mod) :
                min = mod
                if (min == 0):
                    break
        if (min == 0):
            break

    if (min == (2 * (10 ** 9)) ** 2 + 1):
        print(L * R)
    else:
        print(min)

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())

if (L <= 2019 and 2019 <= R) :
    print(0)
else :
    min = (2 * (10 ** 9)) ** 2 + 1
    for i in range(L, R):
        for j in range(L + 1, R):
            print(i, j, i * j % 2019)
            mod = i * j % 2019
            if (min > mod) :
                min = mod
                if (min == 0):
                    break
        if (min == 0):
            break

    if (min == (2 * (10 ** 9)) ** 2 + 1):
        print(L * R)
    else:
        print(min)

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())

if (2019 in range(L, R)) :
    print(0)
else :
    min = (2 * (10 ** 9)) ** 2 + 1
    for i in range(L, R):
        for j in range(L + 1, R):
            print(i, j, i * j % 2019)
            mod = i * j % 2019
            if (min > mod) :
                min = mod
                if (min == 0):
                    break
        if (min == 0):
            break

    if (min == (2 * (10 ** 9)) ** 2 + 1):
        print(L * R)
    else:
        print(min)

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())
print(L * (L + 1) % 2019)

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())
min = (2 * (10 ** 9)) ** 2 + 1
for i in range(L, R):
    for j in range(L + 1, R):
        mod = i * j % 2019
        if (min > mod) :
            min = mod
            if (min == 0):
                break
    if (min == 0):
        break

if (min == (2 * (10 ** 9)) ** 2 + 1):
    print(L * R)
else:
    print(min)

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())
min = (2 * (10 ** 9)) ** 2 + 1
for i in range(L, R):
    for j in range(L + 1, R):
        mod = i * j % 2019
        if (min > mod) :
            min = mod
            if (min == 0):
                break
    if (min == 0):
            break

if (min == (2 * (10 ** 9)) ** 2 + 1):
    print(L * R)
else:
    print(min)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())
min = L * R
for i in range(L, R):
    mod = i * (i + 1) % 2019
    if (min > mod) :
        min = mod
print(min)