Problem:
 Score: 100 points    Problem Statement  We held two competitions: Coding Contest and Robot Maneuver.  In each competition, the contestants taking the 3 -rd, 2 -nd, and 1 -st places receive 100000 , 200000 , and 300000 yen (the currency of Japan), respectively. Furthermore, a contestant taking the first place in both competitions receives an additional 400000 yen.  DISCO-Kun took the X -th place in Coding Contest and the Y -th place in Robot Maneuver.
Find the total amount of money he earned.      Constraints   1 \leq X \leq 205  1 \leq Y \leq 205  X and Y are integers.         Input  Input is given from Standard Input in the following format:  X  Y       Output  Print the amount of money DISCO-Kun earned, as an integer.        Sample Input 1 1 1      Sample Output 1 1000000  In this case, he earned 300000 yen in Coding Contest and another 300000 yen in Robot Maneuver. Furthermore, as he won both competitions, he got an additional 400000 yen.
In total, he made 300000 + 300000 + 400000 = 1000000 yen.       Sample Input 2 3 101      Sample Output 2 100000  In this case, he earned 100000 yen in Coding Contest.       Sample Input 3 4 4      Sample Output 3 0  In this case, unfortunately, he was the highest-ranked contestant without prize money in both competitions.

Solution (Python):
x,y = map(int,input().split())
if x==1 and y==1:
    print(1000000)
    exit()
if x==1:
    mx=300000
elif x==2:    
    mx=200000
elif x==3:    
    mx=100000    
else:
    mx=0
if y==1:
    my=300000
elif y==2:    
    my=200000
elif y==3:    
    my=100000    
else:
    my=0
print(mx+my)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    X, Y = map(int, input().split())

    if X == 1 and Y == 1:
        print(1000000)
        exit()

    if X == 1 and Y == 2:
        print(500000)
    elif X == 1 and Y == 3:
        print(400000)
    elif X == 1:
        print(300000)
    elif X == 2 and Y == 1:
        print(500000)
    elif X == 2 and Y == 2:
        print(400000)
    elif X == 2 and Y == 3:
        print(300000)
    elif X == 2:
        print(200000)
    elif X == 3 and Y == 1:
        print(400000)
    elif X == 3 and Y == 2:
        print(300000)
    elif X == 3 and Y == 3:
        print(200000)
    elif X == 3:
        print(100000)
    elif Y == 1:
        print(300000)
    elif Y == 2:
        print(200000)
    elif Y == 3:
        print(100000)
    else:
        print(0)


if __name__ == '__main__':
    main()

Solution (Python):
import sys,queue,copy
sys.setrecursionlimit(10**8)
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
INF = float('inf')

X,Y = inpl()
ans = 0
if X == 1 and Y == 1:
    ans += 400000

if X == 3 :
    ans +=100000
if X== 2:
    ans +=200000
if X == 1:
    ans +=300000
if Y == 3 :
    ans +=100000
if Y== 2:
    ans +=200000
if Y == 1:
    ans +=300000

print(ans)

Solution (Python):
x,y = map(int,input().split())
if x * y == 1:
    print(1000000)
elif x*y == 2:
    print(500000)
elif x == 2 and y == 2:
    print(400000)
elif x*y == 3:
    print(400000)
elif x == 1 or y == 1:
    print(300000)
elif x == 2 and y == 3:
    print(300000)
elif x == 3 and y == 2:
    print(300000)
elif x == 3 and y == 3:
    print(200000)
elif x ==2 or y == 2:
    print(200000)
    
elif x == 3 or y == 3:
    print(100000)
else:
    print(0)

Solution (Python):
x, y = list(map(int, input().split()))
ans = 0

if x==1 and y==1:
  ans += 400000

if x == 3:
  ans += 100000
elif x == 2:
  ans += 200000
elif x == 1:
  ans += 300000


if y == 3:
  ans += 100000
elif y == 2:
  ans += 200000
elif y == 1:
  ans += 300000

print(ans)

Solution (Python):
x, y = map(int, input().split())
if x == 1 and y == 1:
    print(300000*2 + 400000)
elif x == 1 and y == 2:
    print(300000+200000)
elif x == 1 and y == 3:
    print(300000+100000)
elif x == 2 and y == 1:
    print(300000 + 200000)
elif x == 2 and y == 2:
    print(200000+200000)
elif x == 2 and y == 3:
    print(200000+100000)
elif x == 3 and y == 1:
    print(100000+300000)
elif x == 3 and y == 2:
    print(100000+200000)
elif x == 3 and y == 3:
    print(100000+100000)
elif x == 1:
    print(300000)
elif x == 2:
    print(200000)
elif x == 3:
    print(100000)
elif y == 1:
    print(300000)
elif y == 2:
    print(200000)
elif y == 3:
    print(100000)
else:
    print(0)

Solution (Python):
X,Y=list(map(int,input().split()))
if X==1 and Y==1:
  print(1000000)
elif X==1 and Y==2:
  print(500000)
elif X==1 and Y==3:
  print(400000)
elif X==1 and Y>=4:
  print(300000)
elif X==2 and Y==1:
  print(500000)
elif X==3 and Y==1:
  print(400000)
elif X>=4 and Y==1:
  print(300000)
elif X==2 and Y==3:
  print(300000)
elif X==3 and Y==2:
  print(300000)
elif X==2 and Y==2:
  print(400000)
elif X==3 and Y==3:
  print(200000)
elif X==2 and Y>=4:
  print(200000)
elif X==3 and Y>=4:
  print(100000)
elif X>=4 and Y==2:
  print(200000)
elif X>=4 and Y==3:
  print(100000)
else:
  print(0)

Solution (Python):
x,y=map(int,input().split())
k=0
if x==1 and y==1:
    print("1000000")
else:
    if x==1:
       k+=300000
    else:
       if x==2:
          k+=200000
       else:
           if x==3:
               k+=100000
    if y==1:
        k+=300000
    else:
        if y==2:
            k+=200000
        else:
            if y==3:
                k+=100000
    print(k)

Solution (Python):
W = [int(x) for x in input().split()]
if W[0] ==1:
    if W[1] ==1:
        print(1000000)
    elif W[1] ==2:
        print(500000)
    elif W[1] ==3:
        print(400000)
    else:
        print(300000)
elif W[0] ==2:
    if W[1] ==1:
        print(500000)
    elif W[1] ==2:
        print(400000)
    elif W[1] ==3:
        print(300000)
    else:
        print(200000)
elif W[0] ==3:
    if W[1] ==1:
        print(400000)
    elif W[1] ==2:
        print(300000)
    elif W[1] ==3:
        print(200000)
    else:
        print(100000)
else:
    if W[1] ==1:
        print(300000)
    elif W[1] ==2:
        print(200000)
    elif W[1] ==3:
        print(100000)
    else:
        print(0)

Solution (Python):
X, Y = map(int, input().split())
a = 0
if X == 1:
  a += 300000
elif X == 2:
  a += 200000
elif X == 3:
  a += 100000

if Y == 1:
  a += 300000
elif Y == 2:
  a += 200000
elif Y == 3:
  a += 100000

if X == 1 and Y == 1:
  a += 400000
print(a)

Solution (Python):
X, Y = map(int, input().split())

ans = 0
if X < 4:
    ans += (4 - X) * 10**5

if Y < 4:
    ans += (4 - Y) * 10**5

if X == 1 and Y == 1:
    ans += 4 * 10**5

print(ans)

Solution (Python):
X,Y = map(int,input().split())
ans = 0
if X<=3:
  ans += 300000-100000*(X-1)
  
if Y<=3:
  ans += 300000-100000*(Y-1)
  
if (X==1)and(Y==1):
  ans += 400000
  
print(ans)

Solution (Python):
L = list(map(int,input().split()))
r = 0
if L.count(1) == 2 :
    r += 4

for a in L :
    if a > 3 :
        r+=0
    else :
        r+=[0,3,2,1][a]
r*=100000
print(r)

Solution (Python):
X, Y = map(int, input().split())
p = {1:300000, 2:200000, 3:100000}

if X == Y == 1:
  print(p[X] + p[Y] + 400000)
elif X <=3 and Y <= 3:
  print(p[X] + p[Y])
elif X <= 3 and not Y <= 3:
  print(p[X])
elif not X <= 3 and Y <= 3:
  print(p[Y])
else:
  print(0)

Solution (Python):
import collections
xy_list = list(map(int, input().split()))

score = 0

xy_count = collections.Counter(xy_list)
if xy_count.get(1):
  score += xy_count.get(1) * 300000
  if xy_count.get(1) == 2:
    score += 400000
if xy_count.get(2):
  score += xy_count.get(2) * 200000
if xy_count.get(3):
  score += xy_count.get(3) * 100000

print(score)

Solution (Python):
x,y=list(map(int, input().split()))
ret=0
if(x==3):ret+=100000
if(x==2):ret+=200000
if(x==1):ret+=300000
if(y==3):ret+=100000
if(y==2):ret+=200000
if(y==1):ret+=300000
if(x==1 and y==1):ret+=400000

print (ret)

Solution (Python):
X,Y = map(int,input().split())
p = 0
if X==1:
    p = 300000
elif X==2:
    p = 200000
elif X==3:
    p = 100000

q =0
if Y==1:
    q = 300000
elif Y==2:
    q = 200000
elif Y==3:
    q = 100000

t = 0
if X==1 and Y==1:
    t = 400000
    
print(p + q + t)

Solution (Python):
X,Y = map(int, input().split())
import sys

if X==1 and Y==1:
    print("1000000")
    sys.exit()

ans = 0
if X == 1:
    ans += 300000
if X == 2:
    ans += 200000
if X == 3:
    ans += 100000

if Y == 1:
    ans += 300000
if Y == 2:
    ans += 200000
if Y == 3:
    ans += 100000

print(ans)

Solution (Python):
A = list(map(int, input().split()))
x = A[0]
y = A[1]
mon = 0
if x < 4:
    if x == 3:
        mon += 100000
    elif x == 2:
        mon += 200000
    elif x == 1:
        mon += 300000
if y < 4:
    if y == 3:
        mon += 100000
    elif y == 2:
        mon += 200000
    elif y == 1:
        mon += 300000
if x == 1:
    if y == 1:
        mon += 400000
print(mon)

Solution (Python):
X,Y = map(int, input().split())

def getM(x):
    res = 0
    if x==1:
        res += 300000
    elif x==2:
        res += 200000
    elif x==3:
        res += 100000
    return res

ans = 0
ans = getM(X)+getM(Y)

if X==1 and Y==1:
    ans += 400000

print(ans)

Solution (Python):
X, Y = map(int, input().split())
if X == 1:
    x = 300000
elif X == 2:
    x = 200000
elif X == 3:
    x = 100000
else:
    x = 0

if Y == 1:
    y = 300000
elif Y == 2:
    y = 200000
elif Y == 3:
    y = 100000
else:
    y = 0


if X == 1 and Y == 1:
    print(1000000)
else:
    print(x+y)

Solution (Python):
X, Y = map(int, input().split())

ans = 0
for i in [X, Y]:
    if i == 3:
        ans += 100000
    if i == 2:
        ans += 200000
    if i == 1:
        ans += 300000

if [1, 1] == [X, Y]:
    ans += 400000

print(ans)

Solution (Python):
x, y = map(int, input().split())
get=0
if x==1:
    get+=300000
if y==1:
    get+=300000
if x==2:
    get+=200000
if y==2:
    get+=200000
if x==3:
    get+=100000
if y==3:
    get+=100000
if x==1 and y==1:
    get+=400000
print(get)

Solution (Python):
X, Y = map(int, input().split())

myans = 0

if X == 1:
    myans += 300000
if Y == 1:
    myans += 300000
if X == 2:
    myans += 200000
if Y == 2:
    myans += 200000
if X == 3:
    myans += 100000
if Y == 3:
    myans += 100000
if X == 1 and Y == 1:
    myans += 400000
    
print(myans)

Solution (Python):
X, Y = [int(x) for x in input().split()]
prices = {
  3: 100000,
  2: 200000,
  1: 300000
}
totals = 0
if X in prices.keys():
  totals = totals + prices[X]
if Y in prices.keys():
  totals = totals + prices[Y]
if X == 1 and Y == 1:
  totals = totals + 400000
print(totals)

Solution (Python):
x,y=map(int,input().split())
if x*y==1:
  print(1000000)
else:
  a=max(0,100000*(4-x))
  b=max(0,100000*(4-y))
  print(a+b)

Solution (Python):
x, y = map(int, input().split())
res = 0
if x <= 3:
    res += 400000 - (x*100000) 
if y <= 3:
    res += 400000 - (y*100000)
if x ==1 and y == 1:
    res += 400000

print(res)

Solution (Python):



def solve(*args: str) -> str:
    x, y = map(int, args[0].split())
    ret = 0
    if x == 1 and y == 1:
        ret += 400000

    if x == 1:
        ret += 300000
    elif x == 2:
        ret += 200000
    elif x == 3:
        ret += 100000

    if y == 1:
        ret += 300000
    elif y == 2:
        ret += 200000
    elif y == 3:
        ret += 100000

    return str(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Solution (Python):
x, y = map(int, input().split())

ans = 0

if (x == 1):
    ans += 300000

if (y == 1):
    ans += 300000

    
if (x == 2):
    ans += 200000
    
if (y == 2):
    ans += 200000
    
if (x == 3):
    ans += 100000
    
if (y == 3):
    ans += 100000
    
if (x == 1)and(y==1):
    ans +=  400000 

    
print(ans)

Solution (Python):
X, Y = map(int, input().split())
ans = 0
if X == 1:
    ans += 300000
elif X == 2:
        ans += 200000
elif X == 3:
        ans += 100000

if Y == 1:
    ans += 300000
elif Y == 2:
        ans += 200000
elif Y == 3:
        ans += 100000

if X == 1 and Y == 1:
    ans += 400000

print(ans)

Solution (Python):


import sys
import math
import collections

PRICES = [0, 300000, 200000, 100000]

X, Y = map(int, sys.stdin.readline().rstrip().split(" "))

price = 0
for x in [X, Y]:
    if x <= 3:
        price += PRICES[x]
if X == 1 and Y == 1:
    price += 400000
print(price)
exit(0)

Solution (Python):
N,M = map(int,input().split())
ans = 0
if N == 3:
  ans += 100000
if M == 3:
  ans += 100000
if N == 2:
  ans += 200000
if M == 2:
  ans += 200000
if N == 1:
  ans += 300000
if M == 1:
  ans += 300000
if N == 1 and M == 1:
  ans += 400000
print(ans)

Solution (Python):
X,Y = list(map(int,input().split()))

ans=0
if X==1 and Y==1:
    ans+=400000
if X==1:
    ans+=300000
elif X==2:
    ans+=200000
elif X==3:
    ans+=100000
if Y==1:
    ans+=300000
elif Y==2:
    ans+=200000
elif Y==3:
    ans+=100000
    
print(ans)

Solution (Python):
A ,B = map(int,(input().split()))
one = 300000
two = 200000
three = 100000
result = 0
if A == 1 and B == 1:
    print(one + one + 400000)
    exit(0)
if A == 3:
    result += three
if A == 2:
    result += two
if A == 1:
    result += one
if B == 3:
    result += three
if B == 2:
    result += two
if B == 1:
    result += one
print(result)

Solution (Python):
X, Y = map(int, input().split())
ans = 0
if X <= 3:
    ans += (4 - X) * 100000
if Y <= 3:
    ans += (4 - Y) * 100000
if X == 1 and Y == 1:
    ans += 400000

print(ans)

Solution (Python):
X, Y = map(int, input().split())
ranks = [X, Y]
ans = 0

for i in ranks:
    if i == 1:
        ans += 300000
    elif i == 2:
        ans += 200000
    elif i == 3:
        ans += 100000

if (X, Y) == (1, 1):
    ans = 1000000

print(ans)

Solution (Python):
a,b=map(int, input().split())

x=[300000,200000,100000]+[0]*300
y=[300000,200000,100000]+[0]*300

if a==1 and b==1:
    print(1000000)

else:
    print(x[a-1]+x[b-1])

Solution (Python):
X, Y = map(int, input().split())

p = [300000, 200000, 100000]
if X < 4:
    ans = p[X - 1]
else:
    ans = 0
if Y < 4:
    ans += p[Y - 1]
if X == 1 and Y == 1:
    ans += 400000

print(ans)

Solution (Python):
x, y = map(int, input().split())
if x + y == 2:
  print(1000000)
elif x + y == 3:
  print(500000)
elif x + y == 4:
  print(400000)
elif x + y == 5:
  print(300000)
elif x + y == 6:
  print(200000)
elif x == 1 or y == 1:
  print(300000)
elif x == 2 or y == 2:
  print(200000)
elif x == 3 or y == 3:
  print(100000)
else:
  print(0)

Solution (Python):
X, Y = map(int, input().split())

def money(m,Z):
  if Z == 1:
    m += 300000
  elif Z == 2:
    m += 200000
  elif Z == 3:
    m += 100000
  return m

result = money(0,X)
result = money(result,Y)

if result == 600000:
  result += 400000

print(result)

Solution (Python):
from sys import stdin
X,Y = [int(x) for x in stdin.readline().rstrip().split()]
if X == 1 and Y == 1:
    print(300000*2 + 400000)
elif X < 4 and Y < 4:
    ans = 0
    ans += (4 - X)*100000
    ans += (4 - Y)*100000
    print(ans)
    
elif X < 4:
    ans = 0
    ans += (4 - X)*100000
    print(ans)
elif Y < 4:
    ans = 0
    ans += (4 - Y)*100000
    print(ans)
else:
    print(0)

Solution (Python):
A, B = map(int, input().split())
money = 0
if A==1 and B ==1:
    print("1000000")
elif A<4 and B > 3:
    money = 100000 * (4-A)
    print(money)
elif A>3 and B < 4:
    money = 100000 * (4-B)
    print(money)
elif A <4 and B <4:
    money = 100000 * (4-A) + 100000 * (4-B)
    print(money)
else:
    print("0")

Solution (Python):
PRIZE = [300000, 200000, 100000]

code_rank,  device_rank = [int(s) - 1 for s in input().split(" ")]
code_prize = 0
device_prize = 0

if len(PRIZE) > code_rank:
  code_prize = PRIZE[code_rank]
  
if len(PRIZE) > device_rank:
  device_prize = PRIZE[device_rank]

prize = code_prize + device_prize

if code_rank + device_rank <= 0:
  prize += 400000
  
print(prize)

Solution (Python):
x, y = list(map(int, input().split()))
ans = max(0, 4 - x) * 100000 + max(0, 4 - y) * 100000
if x == 1 and y == 1:
    ans += 400000
print(ans)

Solution (Python):
X,Y=map(int,input().split())
ans=0
if X==3:
    ans+=100000
elif X==2:
    ans+=200000
elif X==1:
    ans+=300000
if Y==3:
    ans+=100000
elif Y==2:
    ans+=200000
elif Y==1:
    ans+=300000
if X==1 and Y==1:
    ans+=400000
print(ans)

Solution (Python):
input_xy = input().split()
input_xy = [int(i) for i in input_xy]

if input_xy[0] == 1 and input_xy[1] == 1:
    print(1000000)
    exit()

res = 0

if input_xy[0] == 1:
    res += 300000
elif input_xy[0] == 2:
    res += 200000
elif input_xy[0] == 3:
    res += 100000

if input_xy[1] == 1:
    res += 300000
elif input_xy[1] == 2:
    res += 200000
elif input_xy[1] == 3:
    res += 100000     

print(res)

Solution (Python):
x, y = map(int, input().split())
s = 0
if x == 3:
    s += 100000
if x == 2:
    s += 200000
if x == 1:
    s += 300000
if y == 3: 
    s += 100000
if y == 2:
    s += 200000
if y == 1:
    s += 300000
if x == 1 and y == 1:
    s += 400000
print(s)

Solution (Python):
X, Y=map(int, input().split())

ans = 0

if (X==1):
    ans += 300000
elif (X==2):
    ans += 200000
elif (X==3):
    ans += 100000


if (Y==1):
    ans += 300000
elif (Y==2):
    ans += 200000
elif (Y==3):
    ans += 100000

if (X==1) and (Y==1):
    ans += 400000

print(ans)

Solution (Python):
x,y=map(int,input().split())
ans=0
dic={1:300000,2:200000,3:100000}

def rank(a):
  if a<=3:
    return dic[a]
  else:
    return 0

ans+=rank(x)
ans+=rank(y)

if x==1 and y==1:
  ans+=400000
  
print(ans)

Solution (Python):
X, Y = map(int, input().split())
X = 4 if X > 3 else X
Y = 4 if Y > 3 else Y
print(100000 * (4 - X + 4 - Y + 4*(X == Y == 1)))

Solution (Python):
import math
x, y = input().strip().split(' ')
x, y = [int(x), int(y)]
get = 0
if x == 3:
    get = get + 100000
if y == 3:
    get = get + 100000
if x == 2:
    get = get + 200000
if y == 2:
    get = get + 200000
if x == 1:
    get = get + 300000
if y == 1:
    get = get + 300000
if x == 1 and y == 1:
    get = get + 400000

print(get)

Solution (Python):
x,y=map(int,input().split())
lis=[0,300000,  200000,  100000]
amt=0
if x <=3:
  amt+=lis[x]
if y<=3:
  amt+=lis[y]
if y==1 and x==1:
  amt+=  400000
print(amt)

Solution (Python):

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

if x+y == 2:
  prize = 1000000
else:
  prize = sum([100000 * (4-rank) if rank < 4 else 0 for rank in [x,y]])

print("{}".format(prize))

Solution (Python):
X, Y = map(int, input().split())
ANS = 0
if X == 1:
  ANS += 300000
elif X == 2:
  ANS += 200000
elif X == 3:
  ANS += 100000

if Y == 1:
  ANS += 300000
  if X == 1:
    ANS += 400000
elif Y == 2:
  ANS += 200000
elif Y == 3:
  ANS += 100000

print(ANS)

Solution (Python):
X,Y = map(int,input().split())

res = 0

if X == 1:
    res += 300000
elif X == 2:
    res += 200000
elif X == 3:
    res += 100000

if Y == 1:
    res += 300000
elif Y == 2:
    res += 200000
elif Y == 3:
    res += 100000

if (X == 1) & (Y == 1):
    res += 400000

print(res)

Solution (Python):
x, y = map(int, input().split())
c = [0]*210
c[1], c[2], c[3] = 3, 2, 1
reword = c[x]+c[y]
if x+y == 2:
    reword += 4

print(reword*100000)

Solution (Python):
x, y = map(int, input().split())
c = 0
if x <= 3:
    c += 100000 * (4 - x)
if y <= 3:
    c += 100000 * (4 - y)
if x == y == 1:
    c += 400000

print(c)

Solution (Python):
X, Y = map(int, input().split())
res = 0
if X == 1 and Y == 1:
    print(1000000)
    exit(0)
revenue = [300000,200000,100000,0]
res = revenue[min(X-1, 3)] + revenue[min(Y-1, 3)]
print(res)

Solution (Python):
x, y = map(int, input().split())
score1 = 300000
score2 = 200000
score3 = 100000
plus = 400000

ans1 = 0
ans2 = 0
if x == 1:
    ans1 = score1
elif x == 2:
    ans1 = score2
elif x == 3:
    ans1 = score3
else:
    ans1 = 0
if y == 1:
    ans2 = score1
elif y == 2:
    ans2 = score2
elif y == 3:
    ans2 = score3
else:
    ans2 = 0

if x == 1 and y == 1:
    print(ans1 + ans2 + plus)
else:
    print(ans1 + ans2)

Solution (Python):
x, y = map(int, input().split())

score = 0

for z in [x, y]:
  if z == 1:
    score += 300000
  elif z == 2:
    score += 200000
  elif z == 3:
    score += 100000

if (x == 1) and (y == 1):
  score += 400000
  
print(score)

Solution (Python):
x, y = map(int, input().split())
m = [300000, 200000, 100000, 0]
if x > 3:
    x = 4
if y > 3:
    y = 4
ans = m[x - 1] + m[y - 1]
if ans == 600000:
    print(ans + 400000)
else:
    print(ans)

Solution (Python):
input_line = input().split()
num_1 = int(input_line[0])
num_2 = int(input_line[1])
worse = 0
if num_1 == 1:
  worse += 300000
elif num_1 == 2:
  worse += 200000
elif num_1 == 3:
  worse += 100000
if num_2 == 1:
  worse += 300000
elif num_2 == 2:
  worse += 200000
elif num_2 == 3:
  worse += 100000
if num_1 == 1 and num_2 == 1:
  worse += 400000
print(worse)

Solution (Python):
x,y = map(int,input().split())

c=0

if x ==1:
  c+=300000
elif x ==2:
  c+=200000
elif x==3:
  c+=100000
if y==1:
  c+=300000
elif y==2:
  c+=200000
elif y==3:
  c+=100000

if c==600000:
  c+=400000

print(c)

Solution (Python):
X, Y = map(int, input().split())
if X == 1 and Y == 1:
  print(1000000)
  exit(0)
code_prize = 0
if X == 1:
  code_prize = 300000 
elif X == 2:
  code_prize = 200000
elif X == 3:
  code_prize = 100000
device_prize = 0
if Y == 1:
  device_prize = 300000
elif Y == 2:
  device_prize = 200000
elif Y == 3:
  device_prize = 100000
print(code_prize + device_prize)

Solution (Python):
data = input().split(' ')
result = 0
if int(data[0]) == 1:
    result += 300000
elif int(data[0]) == 2:
    result += 200000
elif int(data[0]) == 3:
    result += 100000
if int(data[1]) == 1:
    result +=300000
elif int(data[1]) == 2:
    result += 200000
elif int(data[1])== 3:
    result += 100000

if int(data[0])== 1 and int(data[1]) == 1:
    result += 400000

print(result)

Solution (Python):
x,y = map(int, input().split())

ans = 0

if x == 1: 
    if y == 1:
        ans = 1000000
    elif y == 2:
        ans = 500000
    elif y == 3:
        ans = 400000
    else:
        ans = 300000
elif x == 2: 
    if y == 1:
        ans = 500000
    elif y == 2:
        ans = 400000
    elif y == 3:
        ans = 300000
    else:
        ans = 200000
elif x == 3: 
    if y == 1:
        ans = 400000
    elif y == 2:
        ans = 300000
    elif y == 3:
        ans = 200000
    else:
        ans = 100000
else: 
    if y == 1:
        ans = 300000
    elif y == 2:
        ans = 200000
    elif y == 3:
        ans = 100000
    else:
        ans = 0
print(ans)

Solution (Python):
X,Y = map(int, input().split())

ls = [300000, 200000, 100000] + [0 for i in range(300)]

result = ls[X - 1] + ls[Y - 1]

if X == 1 and Y == 1:
    result += 400000

print(result)

Solution (Python):
X,Y = list(map(int,input().split()))

count = 0

if X == 1 and Y == 1:
    count = 400000
    
if X == 1:
    count += 300000
elif X == 2:
    count += 200000
elif X == 3:
    count += 100000
    
if Y == 1:
    count += 300000
elif Y == 2:
    count += 200000
elif Y == 3:
    count += 100000
    
print(count)

Solution (Python):
X, Y = map(int, input().split())

total = 0

if X == 1:
  total += 300000
elif X == 2:
  total += 200000
elif X == 3:
  total += 100000
  
if Y == 1:
  total += 300000
elif Y == 2:
  total += 200000
elif Y == 3:
  total += 100000

if X == 1 and Y == 1:
  total += 400000


print(total)

Solution (Python):
x, y = map(int, input().split())
sum = 0
if x == 1 and y == 1:
    sum += 400000
if x == 1:
    sum += 300000
elif x == 2:
    sum += 200000
elif x == 3:
    sum += 100000
if y == 1:
    sum += 300000
elif y == 2:
    sum += 200000
elif y == 3:
    sum += 100000

print(sum)

Solution (Python):
x,y = map(int,input().split())
ans = 0

if x == 1 :
    ans = 300000
elif x == 2:
    ans = 200000
elif x == 3:
    ans = 100000


if y == 1:
    ans += 300000
elif y == 2:
    ans += 200000
elif y == 3:
    ans += 100000


if x == 1 and y == 1:
    ans += 400000

print(ans)

Solution (Python):
x, y = map(int, input().split())
def f(n):
    if n == 1:
        return 300000
    elif n == 2:
        return 200000
    elif n == 3:
        return 100000
    return 0
result = f(x) + f(y) + (400000 if x == y == 1 else 0)
print(result)

Solution (Python):
X,Y = map(int,input().split())
total = 0

if X <= 3:
  total += (4 - X) * 100000
if Y <= 3:
  total += (4 - Y) * 100000
if X==1 and Y==1:
  total += 400000
  
print(total)

Solution (Python):
X,Y=map(int,input().split())
result=0
if X==1 :
  result+=300000
elif X==2:
  result+=200000
elif X==3:
  result+=100000
if Y==1 :
  result+=300000
elif Y==2:
  result+=200000
elif Y==3:
  result+=100000
if X==1 and Y==1:
  result+=400000
print(result)

Solution (Python):
x,y = map(int,input().split())
ans = 0
if x<4:
  ans+=abs(4-x)*100000
if y<4:
  ans+=abs(4-y)*100000
if x==y==1:
  ans +=400000 
print(ans)

Solution (Python):
x, y = map(int, input().split(" "))

amount = 0
if x == 1 and y == 1:
    amount += 400000
if x == 2:
    amount += 200000
elif x == 3:
    amount += 100000
elif x == 1:
    amount += 300000
if y == 2:
    amount += 200000
elif y == 3:
    amount += 100000
elif y == 1:
    amount += 300000

print(amount)

Solution (Python):
x,y = map(int, input().split())
base = 100000
if x == 1:
  c = 3
elif x == 2:
  c = 2
elif x == 3:
  c = 1
else:
  c = 0
if y == 1:
  m = 3
elif y == 2:
  m = 2
elif y == 3:
  m = 1
else:
  m = 0
ans = base * c + base * m
if x == 1 and y == 1:
  ans += 4 * base

print(ans)

Solution (Python):
X, Y = map(int, input().split())

shokin = [300000, 200000, 100000]

total = 0
if X <= 3:
  total += shokin[X-1]
if Y <= 3:
  total += shokin[Y-1]
if X == 1 and Y == 1:
  total += 400000

print(total)

Solution (Python):
x,y = map(int,input().split())
money = [0,300000,200000,100000]
if x ==1 and y ==1:
    print(1000000)
else:
    if x>3:
        x=0
    if y >3:
        y=0
    print(money[x]+money[y])

Solution (Python):
import sys
input = sys.stdin.readline

_x, _y = map(int, input().split())


def chker(x, y):
    x = x if x < 4 else 4
    y = y if y < 4 else 4
    syokin = {
        1: 300000,
        2: 200000,
        3: 100000,
        4: 0
    }

    if x == y == 1:
        print('1000000')
        return

    print(syokin[x] + syokin[y])


chker(_x, _y)

Solution (Python):


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

ans=0

if x==1 and y==1:
    ans+=400000

ans+=max(400000-x*100000,0)
ans+=max(400000-y*100000,0)

print(ans)

Solution (Python):
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    X, Y = map(int, input().split())

    money = (0, 300000, 200000, 100000)
    ans = 0
    if X < 4:
        ans = money[X]
    if Y < 4:
        ans += money[Y]
    if X == Y == 1:
        ans += 400000
    print(ans)


main()

Solution (Python):
x, y = list(map(int, input().split()))

if x * y == 1:
	print(1000 * 1000)
else:
	print(max(0, 400000 - 100000 * x) + max(0, 400000 - 100000 * y))

Solution (Python):

import sys
from itertools import product
from collections import Counter, defaultdict

def inpl(): return list(map(int, input().split()))

X, Y = inpl()
s = defaultdict(int)
s[1] = 300000
s[2] = 200000
s[3] = 100000
print(s[X] + s[Y] + 400000*(X==Y==1))

Solution (Python):
x,y = map(int,input().split())
ans = 0
if x <= 3:
    ans += 100000*(4-x)
if y <= 3:
    ans += 100000*(4-y)
if x==1 and y==1:
    ans += 400000
print(ans)

Solution (Python):
a,b,= map(int,input().split())
import math
c=[a,b]
sum=0

for i in range(0,2):
    if c[i]==3:
        sum+=100000
    elif c[i]==2:
        sum+=200000
    elif c[i]==1:
        sum+=300000

if c[0]==1 and c[1]==1:
    sum+=400000

print(int(sum))

Solution (Python):
x,y=map(int,input().split())
c=0
if x==1:
    c+=300000
elif x==2:
    c+=200000
elif x==3:
    c+=100000

if y==1:
    c+=300000
elif y==2:
    c+=200000
elif y==3:
    c+=100000

if x==1 and y==1:
    c+=400000
print(c)

Solution (Python):

X, Y = map(int, input().split())
ans = 0
pay = [0, 300000, 200000, 100000]
if X == 1 and Y == 1:
    print(1000000)
    exit()
if X < 4:
    ans += pay[X]
if Y < 4:
    ans += pay[Y]

print(ans)

Solution (Python):
x, y = map(int, input().split())
ans = 0
if x==1:
    if y==1:
        print(1000000)
        exit()
    else:
        ans += 300000
elif x==2:
    ans += 200000
elif x==3:
    ans += 100000
if y==1:
    ans+=300000
elif y==2:
    ans+=200000
elif y==3:
    ans+=100000
print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

def main():
    x,y=map(int,input().split())
    if x>3:x=0
    if y>3:y=0
    prize=[0,300000,200000,100000]
    ans=prize[x]+prize[y]
    if (x,y)==(1,1):
        ans+=400000
    print(ans)

main()

Solution (Python):
x, y = map(int, input().split())

prize_x = 0
prize_y = 0
prize_z = 0

if x == 3:
    prize_x = 100000
elif x == 2:
    prize_x = 200000
elif x == 1:
    prize_x = 300000

if y == 3:
    prize_y = 100000
elif y == 2:
    prize_y = 200000
elif y == 1:
    prize_y = 300000
    
if x == 1 and y == 1:
    prize_z = 400000

print(prize_x + prize_y + prize_z)

Solution (Python):
temp = list(map(int, input().split()))
X = temp[0]
Y = temp[1]

ans = 0

if(X==1):
  ans += 300000
if(Y==1):
  ans += 300000
if(X==2):
  ans += 200000
if(Y==2):
  ans += 200000
if(X==3):
  ans += 100000
if(Y==3):
  ans += 100000
if(X==1 and Y==1):
  ans += 400000
print(ans)

Solution (Python):
x,y=map(int,input().split())
if x==1:
  if y==1:
    print(1000000)
  elif y==2:
    print(500000)
  elif y==3:
    print(400000)
  else:
    print(300000)
elif x==2:
  if y==1:
    print(500000)
  elif y==2:
    print(400000)
  elif y==3:
    print(300000)
  else:
    print(200000)
elif x==3:
  if y==1:
    print(400000)
  elif y==2:
    print(300000)
  elif y==3:
    print(200000)
  else:
    print(100000)
else:
  if y==1:
    print(300000)
  elif y==2:
    print(200000)
  elif y==3:
    print(100000)
  else:
    print(0)

Solution (Python):
x, y = list(map(int, input().split()))
total = 0
if x == 1:
    total += 300000
elif x == 2:
    total += 200000
elif x == 3:
    total += 100000
else:
    total += 0

if y == 1:
    total += 300000
elif y == 2:
    total += 200000
elif y == 3:
    total += 100000
else:
    total += 0

if x == 1 and y == 1:
    total += 400000
else:
    total += 0

print(total)

Solution (Python):
A ,B = map(int, input().split())
G = 0
if A == 1:
  G += 300000
elif A == 2:
  G += 200000
elif A == 3:
  G += 100000
if B == 1:
  G += 300000
elif B == 2:
  G += 200000
elif B == 3:
  G += 100000
if A == 1 and B == 1:
  G += 400000
print(G)

Solution (Python):
x,y=map(int,input().split())
priseX=0
priseY=0
if x==1:
  priseX=300000
elif x==2:
  priseX=200000
elif x==3:
  priseX=100000
if y==1:
  priseY=300000
elif y==2:
  priseY=200000
elif y==3:
  priseY=100000
if x==1 and y==1:
  print(1000000)
else:
  print(priseX+priseY)

Solution (Python):
import sys

def solve(x, y):
    ans = 0
    prize = [300000, 200000, 100000]
    if x - 1 < 3:
        ans += prize[x-1]
    if y - 1 < 3:
        ans += prize[y-1]
    if x == 1 and y == 1:
        ans += 400000
    print(ans)

if __name__ == '__main__':
    x, y = map(int, sys.stdin.readline().strip().split())
    solve(x, y)

Solution (Python):
if __name__ == "__main__":
    x, y = map(int, input().split())

    if x == 1 and y == 1:
        print(1000000)
    else:
        xc = 400000 - x * 100000 if x <= 3 else 0
        yc = 400000 - y * 100000 if y <= 3 else 0
        print(xc + yc)

Solution (Python):
x, y = map(int, input().split())
val = [100000, 200000, 300000]

res = 0
if x == 1:
	res += 300000
elif x == 2:
	res += 200000
elif x == 3:
	res += 100000

if y == 1:
	res += 300000
elif y == 2:
	res += 200000
elif y == 3:
	res += 100000

if x == 1 and y == 1:
	res += 400000
	print(res)
else:
	print(res)

Solution (Python):
x, y = map(int, input().split())
ans = 0

if x == 1 and y == 1:
    ans += 400000

if x == 3:
    ans += 100000
elif x == 2:
    ans += 200000
elif x == 1:
    ans += 300000

if y == 3:
    ans += 100000
elif y == 2:
    ans += 200000
elif y == 1:
    ans += 300000

print(ans)