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())

def ctr(n):
    if n == 1:
        return 300000
    elif n == 2:
        return 200000
    elif n == 3:
        return 100000
    else:
        return 0

ans = ctr(X) + ctr(Y)
ans += 400000 if X == Y == 1 else 0
print(ans)

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 = 1000000

print(ans)

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())
ans = 0
if x == 1:
    ans += 300000
    if y == 1:
        ans += 400000
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):
x, y = map(int, input().split())
out = 0
if x == 1:
  out += 300000
elif x == 2:
  out += 200000
elif x == 3:
  out += 100000

if y == 1:
  out += 300000
elif y == 2:
  out += 200000
elif y == 3:
  out += 100000
if x ==1 and y == 1:
  out += 400000  
print(out)

Solution (Python):

si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
x,y = nm()
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):

xy = input().split()
x = int(xy[0])
y = int(xy[1])

result = 0

if x == 1:
    result =result+ 300000
if y == 1:
    result =result+ 300000

if x == 2:
    result =result+ 200000
if y == 2:
    result =result+ 200000

if x == 3:
    result =result+ 100000
if y == 3:
    result =result+ 100000

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

print(result)

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

if b == 1:
    sum_price += 300000
elif b == 2:
    sum_price += 200000
elif b == 3:
    sum_price += 100000

if a == 1 and b == 1:
    sum_price += 400000

print(sum_price)

Solution (Python):
m,n=map(int,input().split())
ans=0
if m==1:
  ans+=300000
if m==2:
  ans+=200000
if m==3:
  ans+=100000
if n==1:
  ans+=300000
  if ans==600000:
    ans=1000000
if n==2:
  ans+=200000
if n==3:
  ans+=100000
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 == y == 1:
    ans += 400000

print(ans)

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(X, Y):
    def f(x):
        if x == 3:
            return 100000
        elif x == 2:
            return 200000
        elif x == 1:
            return 300000
        return 0

    b = 400000 if X == 1 and Y == 1 else 0
    return f(X) + f(Y) + b


def main():
    X, Y = read_int_n()
    print(slv(X, Y))


if __name__ == '__main__':
    main()

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

a = [300000, 200000, 100000]

cnt = 0
if 1 <= x <= 3:
    cnt += a[x - 1]
if 1 <= y <= 3:
    cnt += a[y - 1]
if x == 1 and y == 1:
    cnt += 400000
print(cnt)

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

Solution (Python):
inpl = lambda: list(map(int,input().split()))
X = inpl()
ans = 0
for i in range(2):
    if X[i] <= 3:
        ans += (4-X[i])*100000
if X[0]==X[1]==1:
    ans += 400000
print(ans)

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

ans = 0
if x==1 and y==1:
    print(1000000)
    sys.exit()
if x<=3:
    ans += a[x-1]
if y<=3:
    ans += a[y-1]

print(ans)

Solution (Python):
X, Y = map(int, input().split())
ret = 0
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
if X == 1 and Y == 1:
    ret += 400000
print(ret)

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

Solution (Python):
def examA():
    AB = LI(); AB.sort()
    ans = 0
    if AB[1]==1:
        ans += 400000
    for i in range(2):
        if AB[i]==1:
            ans +=300000
        elif AB[i]==2:
            ans +=200000
        elif AB[i]==3:
            ans +=100000
    print(ans)


def examB():
    return

def examC():
    return

def examD():
    return

def examE():
    return

import sys,copy,bisect,itertools
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

Solution (Python):
X, Y = map(int, input().split())
p = [300000, 200000, 100000] + [0] * max(X, Y)
num = p[X - 1] + p[Y - 1]
if X == 1 and Y == 1:
    num += 400000
print(num)

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())

ans = 0
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
if X ==1 and Y == 1:
    ans += 400000

print(ans)

Solution (Python):
from math import *
from collections import *
import sys
sys.setrecursionlimit(10**9)
n,m = map(int,input().split())
a = [0,300000,200000,100000]
ans = 0
if(n <= 3):
	ans = a[n]
if(m <= 3):
	ans += a[m]
if(ans == 600000): 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):
x, y = map(int, input().split())
s = 0
if x == 1:
    s += 300000
    if y == 1:
        s += 400000
elif x == 2:
    s += 200000
elif x == 3:
    s += 100000
else:
    pass

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

print(s)

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

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())

mon = [0, 300000, 200000, 100000]
add = 400000
s = 0
if x == y == 1:
    s += add


def f(x):
    if x <= 3:
        return mon[x]
    return 0


s += f(x) + f(y)
print(s)

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

result = 0
if (x == 3):
    result += 100000
elif (x == 2):
    result += 200000
elif (x == 1):
    result += 300000


if (y == 3):
    result += 100000
elif (y == 2):
    result += 200000
elif (y == 1):
    result += 300000

if(result == 600000):
    result += 400000

print(result)

Solution (Python):
def solve():
    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)



if __name__ == '__main__':
    solve()

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

result = 0
if x == 1:
  result += 300000
if x == 2:
  result += 200000
if x == 3:
  result += 100000
if y == 1:
  result += 300000
if y == 2:
  result += 200000
if y == 3:
  result += 100000
if x == 1 and y == 1:
  result += 400000
print(result)

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

Solution (Python):
x,y=map(int,input().split())
m={1:300000,2:200000,3:100000}
ans=0
if x<=3:
   ans=m[x]
if y<=3:
    ans+=m[y]
if x==y 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):
x,y = map(int,input().split())
s = 0
if x == 1 and y == 1:
  s += 400000
for i in [x,y]:
  if i == 1:
    s += 300000
  elif i == 2:
    s += 200000
  elif i == 3:
    s += 100000
print(s)

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

cnt = 0
if x == 1:
    cnt += 300000
elif x == 2:
    cnt += 200000
elif x == 3:
    cnt += 100000 
    
if y == 1:
    cnt += 300000
elif y == 2:
    cnt += 200000
elif y == 3:
    cnt += 100000 
    
if x == 1 and y == 1:
    cnt += 400000
    
print(cnt)

Solution (Python):
X, Y = [int(s) for s in input().split()]
money = 0
if X == 1:
  money += 300000
elif X == 2:
  money += 200000
elif X == 3:
  money += 100000
if Y == 1:
  money += 300000
elif Y == 2:
  money += 200000
elif Y == 3:
  money += 100000
if X == 1 and Y == 1:
  money += 400000
  
print(money)

Solution (Python):
x,y=map(int,input().split())
ans=0
if x==1:
  ans+=3*(10**5)
elif x==2:
  ans+=2*(10**5)
elif x==3:
  ans+=1*(10**5)

if y==1:
  ans+=3*(10**5)
elif y==2:
  ans+=2*(10**5)
elif y==3:
  ans+=1*(10**5)

if x==1 and y==1:
  ans+=4*(10**5)
print(ans)

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

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

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

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

print(sum)

Solution (Python):
a,s=map(int,input().split())
if a==s and a==1:print(1000000)
else:
  l=[300000,200000,100000,0]
  if a>=4:a=4
  if s>=4:s=4
  print(l[a-1]+l[s-1])

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

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


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

ans=0

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

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

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

s = 0

if x == 1:
    s += 300000
if y == 1:
    s += 300000

if x == 2:
    s += 200000
if y == 2:
    s += 200000

if x == 3:
    s += 100000
if y == 3:
    s += 100000

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

print(s)

Solution (Python):

import sys


def solve(X: int, Y: int):
    prise=0
    if X<=3:
        prise+=100000*(4-X)
    if Y<=3:
        prise+=100000*(4-Y)
    if X==1 and Y==1:
        prise+=400000
    print(prise)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    Y = int(next(tokens))  
    solve(X, Y)

if __name__ == '__main__':
    main()

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

def prize(x):
    if x == 1:
        return 300000
    elif x == 2:
        return 200000
    elif x == 3:
        return 100000
    else:
        return 0


ans = prize(a) + prize(b)

if a==b==1:
    ans += 400000
    
print(ans)

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

X, Y = map(int, input().split())

s = [3*10**5, 2*10**5, 1*10**5]

if X == 1 and Y == 1:
    print(s[X-1] + s[Y-1] + 4*10**5)
elif X <= 3 and Y <= 3:
    print(s[X-1] + s[Y-1])
elif X <= 3 or Y <= 3:
    if X <= 3:
        print(s[X-1])
    else:
        print(s[Y-1])
else:
    print(0)

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

Solution (Python):
from collections import defaultdict
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

A, B = map(int, input().split())

D = defaultdict(int)
D["1"] = 3*10**5
D["2"] = 2*10**5
D["3"] = 1*10**5
ans = 0
if A == 1 and B == 1:
    ans += 4*10**5
print(ans+D[str(A)]+D[str(B)])

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

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

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

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

print (S)

Solution (Python):
MONEY = (300000, 200000, 100000)

x, y = map(int, input().split())
ret = 0
if x <= 3:
    ret += MONEY[x - 1]
if y <= 3:
    ret += MONEY[y - 1]
if x == y == 1:
    ret += 400000
print(ret)

Solution (Python):
[x,y]=list(map(int,input().split()))
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
if x==1 and y==1:
	ans+=400000
print(ans)

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

if x == 1 and y == 1:
    out = 3 * 2 + 4
else:
    out = 0
    if x == 1:
        out += 3
    elif x == 2:
        out += 2
    elif x == 3:
        out += 1

    if y == 1:
        out += 3
    elif y == 2:
        out += 2
    elif y == 3:
        out += 1

out *= 100000
print(out)

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

prise = [300000, 200000, 100000]


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

if X <= 3:
        ans += prise[X-1]
if Y <= 3:
        ans += prise[Y-1]

print(ans)

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

def f(n):
  if n == 3:
    return 100000
  elif n == 2:
    return 200000
  elif n == 1:
    return 300000
  else:
    return 0

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

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

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

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

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

if a == 1 and b == 1:
    ans+= 400000
print(ans)

Solution (Python):
a,b=map(int,input().split())
l=[300000,200000,100000]
total=0
if a<=3:
    total+=l[a-1]
if b<=3:
    total+=l[b-1]
if a==1 and b==1:
    total+=400000
print(total)

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):
def main():
    X, Y = map(int, input().split())

    ans = 0
    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

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

    print(ans)

if __name__ == "__main__":
    main()

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

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

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

if c == 600000:
    c += 400000

print(c)

Solution (Python):
x, y = [int(i) for i in input().split()]
s = 0
if x == 1:
  s += 300000
elif x == 2:
  s += 200000
elif x == 3:
  s += 100000
if y == 1:
  s += 300000
elif y == 2:
  s += 200000
elif y == 3:
  s += 100000
if x == 1 and y == 1:
  s += 400000
print(s)

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

Solution (Python):
a, b = [ int(v) for v in input().split() ]
if a == 1 and b == 1:
    print(1000000)
else:
    ans = 0
    if a < 4:
        ans += 100000 * (4-a)
    if b < 4:
        ans += 100000 * (4-b)
    print(ans)

Solution (Python):
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
import queue


Mod = 1000000007
import sys

sys.setrecursionlimit(100000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

def factorial(i):
    if i == 1:
        return 1
    else:
        return i*factorial(i-1)
 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)




def main(): 
    X,Y = map(int,input().split())
    A = [300000,200000,100000]
    B = [0]*(300)
    A += B
    if X == 1 and Y == 1:
        print(A[X-1]+A[Y-1]+400000)
    else:
        print(A[X-1]+A[Y-1])
if __name__ == "__main__":
    main()

Solution (Python):
import numpy as np

def main():
    X,Y = map(int, input().split())
    res = 0
    if(X in [1,2,3]):
        if(X==1):
            res += 300000
        elif(X==2):
            res += 200000
        else:
            res += 100000
    if(Y in[1,2,3]):
        if(Y==1):
            res += 300000
        elif(Y==2):
            res += 200000
        else:
            res += 100000
    if(X==1 and Y==1):
        res += 400000
    print(res)


if __name__ == "__main__":
    main()

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):
a=[]
n=0
for x in input().split(" "):
    a.append(int(x))
if a[0]==3:
    n+=100000
elif a[0]==2:
    n+=200000
elif a[0]==1:
    n+=300000
if a[1]==3:
    n+=100000
elif a[1]==2:
    n+=200000
elif a[1]==1:
    n+=300000
if a[0]==1 and a[1]==1:
    n+=400000
print(n)

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

d = [300000, 200000, 100000]

if x == y == 0:
    print(d[x] + d[y] + 400000)
else:
    s = 0

    if x < 3:
        s += d[x]
    if y < 3:
        s += d[y]

    print(s)

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

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

if __name__ == '__main__':
    solve()

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

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

result = 0

if X < 2:
    result += 300000
elif X < 3:
    result += 200000
elif X < 4:
    result += 100000

if Y < 2:
    result += 300000
elif Y < 3:
    result += 200000
elif Y < 4:
    result += 100000

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


print(result)

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

x = int(x)

y = int(y)

money = 0

if x == 1:
    money += 300000
if x == 2:
    money += 200000
if x == 3:
    money += 100000

if y == 1:
    money += 300000
if y == 2:
    money += 200000
if y == 3:
    money += 100000

if money == 600000:
    money = 1000000

print(money)

Solution (Python):
juni=[int(thing) for thing in input().split(" ")]
shokin=0
for x in juni:
    if x==1:
        shokin=shokin+300000
    elif x==2:
        shokin=shokin+200000
    elif x==3:
        shokin=shokin+100000
if juni[0]==juni[1] and juni[0]==1:
    shokin=shokin+400000
print(shokin)

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

Solution (Python):
x, y = map(int, input().split())
ans = 0
if x == 1 and y == 1:
  print(1000000)
else:
  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):
X, Y = map(int, input().split())

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

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


x, y = LI()
ret = 0
for i in (x, y):
    if i == 1:
        ret += 300000
    elif i == 2:
        ret += 200000
    elif i == 3:
        ret += 100000


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



print(ret)

Solution (Python):
a, b = map(int, input().split())
print((max(4 - a, 0) + max(4 - b, 0) + [0, 4][set([a, b]) == {1}]) * 100000)

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


def main():
    X, Y = list(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)


if __name__ == '__main__':
    main()

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())
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 + y == 2:
    ans += 400000

print(ans)

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

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

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

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

sum=0
if a==1 and b == 1:
  sum += 400000
if a == 1:
  sum += 300000
elif a==2:
  sum += 200000
elif a==3:
  sum += 100000

if b == 1:
  sum += 300000
elif b==2:
  sum += 200000
elif b==3:
  sum += 100000

print(sum)

Solution (Python):



PRIZES = {3: 100000, 2: 200000, 1: 300000}


def solve(x, y):
    res = PRIZES.get(x, 0)
    res += PRIZES.get(y, 0)
    if x == y == 1:
        res += 400000
    return res


def main():
    x, y = (int(z) for z in input().split())
    res = solve(x, y)
    print(res)


if __name__ == "__main__":
    main()

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

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

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

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

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

Solution (Python):
x, y = map(int, input().split())
print(max(0, (4-x) * 100000) + max(0, (4-y) * 100000) if (x-1)**2 + (y-1)**2 != 0 else 10 ** 6)

Solution (Python):
X,Y=map(int, raw_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):
tmp = input().split()
X = int(tmp[0])
Y = int(tmp[1])

ans = 0

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

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):
X, Y = map(int, input().split())

d = {1:300000, 2:200000, 3:100000}

ans = 0
if X in d:
    ans += d[X]
if Y in d:
    ans += d[Y]
if X == Y == 1:
    ans += 400000

print(ans)

Solution (Python):
l = [int(x) for x in input().split()]
ans = 0
for i in range(2):
  if l[i] == 1:
    ans += 300000
  elif l[i] == 2:
    ans += 200000
  elif l[i] == 3:
    ans += 100000
if l[0] == 1 and l[1] == 1:
  ans += 400000
print(ans)

Solution (Python):
X, Y = 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):
X , Y = map(int,input().split())
if X == Y == 1:
    print("1000000")
    exit()
point = 0
if X == 1:
    point += 300000
elif X == 2:
    point += 200000
elif X == 3:
    point += 100000

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

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

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

r = 0

if X == 1:
    r = r + 300000
elif X == 2:
    r = r + 200000
elif X == 3:
    r = r + 100000
else:
    pass


if Y == 1:
    r = r + 300000
elif Y == 2:
    r = r + 200000
elif Y == 3:
    r = r + 100000
else:
    pass

if X == 1 and Y == 1:
    r = r + 400000
else:
    pass

print(r)