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())
count = 0
if X == 1:
    count += 300000
if X == 2:
    count += 200000
if X == 3:
    count += 100000
    
if Y == 1:
    count += 300000
if Y == 2:
    count += 200000
if Y == 3:
    count += 100000

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

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

ans = 0
money = [100000,200000,300000]
if X==1 and Y==1:
    ans += 400000

if X==1: ans += money[2]
elif X==2: ans += money[1]
elif X==3: ans += money[0]

if Y==1: ans += money[2]
elif Y==2: ans += money[1]
elif Y==3: ans += money[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 += 400000

print(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 == Y == 1:
    money += 400000

print(money)

Solution (Python):


import sys
import math
import collections




tmp = input().split()
x,y = list(map(lambda a: int(a), tmp))

total=0

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

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

x, y = map(int, input().split())
ans = money(x) + money(y)
if x == y == 1:
    ans += 400000
print(ans)

Solution (Python):
x,y=map(int,input().split())
if x==y==1:
    print(300000*2+400000)
    exit()
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
print(a)

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    X,Y = MI()
    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 ans == 600000:
        ans = 1000000
    print(ans)
if __name__ == '__main__':
    main()

Solution (Python):
from collections import defaultdict


def main():
    X, Y = map(int, input().split())
    award = defaultdict(int)
    award[1] = 300000
    award[2] = 200000
    award[3] = 100000
    ans = award[X] + award[Y]
    if X == Y == 1:
        ans += 400000
    print(ans)


if __name__ == "__main__":
    main()

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
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):
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):
A = list(map(int, input().split()))
A.sort()

if A[1] == 1:
    print(1000000)
else:
    ans = 0
    for a in A:
        if a == 1:
            ans += 300000
        elif a == 2:
            ans += 200000
        elif a == 3:
            ans += 100000
    print(ans)

Solution (Python):
X, Y = list(map(float, input().split()))
syo = {3:100000, 2:200000, 1:300000}
ans = 0
for one in [X,Y]:
    if one in syo:
        ans+=syo[one]
if X==1 and Y==1:
    ans+=400000
print(ans)

Solution (Python):
X, Y = map(int,input().split())
X -= 1; Y -= 1
money = [300000, 200000, 100000] + [0] * 300
ans = money[X] + money[Y]
if X == Y == 0:
    ans += 400000
print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [A, B] = string_to_int(inputs[0])
    s = 0
    if A == 1:
        s += 300000
    elif A == 2:
        s += 200000
    elif A == 3:
        s += 100000

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

    if A == 1 and B == 1:
        s += 400000
    return s


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

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

def solve(v):
    if v == 3:
        return 100000
    if v == 2:
        return 200000
    if v == 1:
        return 300000
    return 0

ans = solve(x) + solve(y)

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

print(ans)

Solution (Python):
X, Y = map(int, input().split())
rewords = [300000, 200000, 100000]
ans = 0
if X <= 3:
    ans += rewords[X-1]
if Y <= 3:
    ans += rewords[Y-1]
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):
x, y = map(int, input().split())

t = [1, 2, 3]
p = {1: 300000,
     2: 200000,
     3: 100000}

ans = 0
if x in t:
    ans += p[x]
if y in t:
    ans += p[y]

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

print(ans)

Solution (Python):



def rint():
    return int(input())


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


M = {
    1: 300000,
    2: 200000,
    3: 100000,
}
x, y = rints()
print(M.get(x, 0) + M.get(y, 0) + (400000 if x == y == 1 else 0))

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

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

l=[0,300000,200000,100000]
x,y=map(int,input().split())
ans=0
if x<4:
    ans+=l[x]
if y<4:
    ans+=l[y]
if x==1 and y==1:
    ans+=400000
print(ans)

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

def prize(a) :
    if a == 1 :
        return 300000
    elif a == 2 :
        return 200000
    elif a == 3 :
        return 100000
    else :
        return 0
        
ret = prize(X) + prize(Y)
if X == Y == 1 :
    ret += 400000
    
print(ret)

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
for z in [X, Y]:
    if z <= 3:
        ans += 100000*(4-z)

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

print(ans)

Solution (Python):
def score(x):
    if x == 1:
        return 300000
    if x == 2:
        return 200000
    if x == 3:
        return 100000
    return 0 

x, y = [int(x) for x in input().split(' ')]

s = score(x) + score(y)
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())
if x==y==1:
    print(1000000)
else:
    a=0
    if x==1:
        a+=300000
    if x==2:
        a+=200000
    if x==3:
        a+=100000
    if y==1:
        a+=300000
    if y==2:
        a+=200000
    if y==3:
        a+=100000
    print(a)

Solution (Python):
import math

def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]





a, b = list(map(int, input().split()))
hoge = 100000
ans = 0
if a == 1 and b == 1:
    ans = 1000000
else:
    if a <= 3:
        ans += (4-a) * hoge
    if b <= 3:
        ans += (4-b) * hoge


print(ans)

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

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

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

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

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):
def main():
    X, Y = (int(i) for i in input().split())
    ans = 0
    if X == 1 and Y == 1:
        ans += 400000
    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
    print(ans)


if __name__ == '__main__':
    main()

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*Y == 1:
    ans += 400000
print(ans)

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline






















def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	X,Y = inputMap()

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

	print(ans)


if __name__ == "__main__":
	main()

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

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]
inf=float("inf")
x,y=map(int,input().split())
li=[0,300000,200000,100000]
for i in range(210):
    li.append(0)
if x==1 and y==1:
    print(1000000)
else:
    print(li[x]+li[y])

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

X, Y = MAP()

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):
x,y = map(int,input().split())
l = [300000, 200000, 100000]
ans = 0

if x < 4:
    ans += l[x-1]
if y < 4:
    ans += l[y-1]
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):
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):
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
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):
x, y = map(int, input().split())

res = 0
if x == 1 and y == 1:
    res += 400000

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

print(res)

Solution (Python):
x,y = map(int,input().split())
c = 0
for i in x,y:
    if i < 4:
        c += (4-i)*10**5
if x==y==1:
    c += 4*10**5
print(c)

Solution (Python):
X, Y = map(int, input().split())
Z = [0, 300000, 200000, 100000, 0]

X = min(X, 4)
Y = min(Y, 4)
if (X == 1) and (Y == 1):
    print(1000000)

else:
    print(Z[X] + Z[Y])

Solution (Python):

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

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())
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 read_tokens():
    return input().strip().split(' ')

def read_ints():
    return [int(token) for token in read_tokens()]

def solve(b, n):
    ret = []
    while len(b) > 0:
        
        c = None
        for i in reversed(range(len(b))):
            if b[i] > i + 1:
                return [-1]
            if b[i] == i + 1:
                c = b[:i] + b[i+1:]
                ret.append(b[i])
                break
        if c is None:
            return [-1]
        b = c
    return list(reversed(ret))

x, y = read_ints()

def f(x):
    if x <= 3:
        return [300000, 200000, 100000][x-1]
    return 0

s = f(x) + f(y)
if x == 1 and y == 1:
    s += 400000

print(s)

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):
def main():
    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)

if __name__ == "__main__":
    main()

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

val = [0,300000,200000,100000]
if X>3:
    X = 0
if Y>3:
    Y = 0
ans = val[X]+val[Y]
if X==Y and X == 1:
    ans += 400000
print(ans)

Solution (Python):

import sys
input = sys.stdin.buffer.readline


from collections import defaultdict


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


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

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, raw_input().split())
if x == 1:
    s = 300000
elif x == 2:
    s = 200000
elif x == 3:
    s = 100000
else:
    s = 0
if y == 1:
    s += 300000
elif y == 2:
    s += 200000
elif y == 3:
    s += 100000
if (x, y) == (1, 1):
    s += 400000
print s

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    x, y = list(map(int, readline().split()))
    t = 0
    if x == 1 and y == 1:
        print(300000 * 2 + 400000)
    else:
        if x == 1:
            t += 300000
        elif x == 2:
            t += 200000
        elif x == 3:
            t += 100000

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


if __name__ == '__main__':
    solve()

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):
x, y = map(int, input().split())
ans = 0

score = {3:100000, 2:200000, 1:300000}
if x in score.keys():
  ans += score[x]
if y in score.keys():
  ans += score[y]
if x == 1 and y == 1:
  ans += 400000

print(ans)

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 == B == 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):
x,y = map(int, input().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

print(ret)

Solution (Python):
X,Y=[int(x) for x in input().split()]

dic={
    1:300000,
    2:200000,
    3:100000,
    0:0,
    }
if X>3:
    X=0
if Y>3:
    Y=0
if X==1 and Y==1:
    print(dic[1]+dic[1]+400000)
else:
    print(dic[X]+dic[Y])

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

M = [300000,200000,100000] + [0]*1000

if X==1 and Y==1:
    print(1000000)
else:
    print(M[X-1]+M[Y-1])

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

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

Solution (Python):

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

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):
X,Y = map(int,input().split())
s = 0
s += max(0,(4-X)*100000)
s += max(0,(4-Y)*100000)
s += 400000 if X == 1 and Y == 1 else 0

print(s)

Solution (Python):
import  collections
a, b = map(int, input().split(" "))
if a == 1 and b == 1:
    print(1000000)
else:
    di = collections.defaultdict(lambda :0)
    di[1] = 300000
    di[2] = 200000
    di[3] = 100000
    print(di[a] + di[b])

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(v):
    if v == 3:
        return 100000
    elif v == 2:
        return 200000
    elif v == 1:
        return 300000
    else:
        return 0

print(f(X)+f(Y)+400000*((X==1) and (Y == 1)))

Solution (Python):
X, Y = 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):
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


def solve(X: int, Y: int):
    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)
    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):

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

if x[0] == x[1] == 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 math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  x,y=LI()
  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
  return ans


print(main())

Solution (Python):
X,Y=map(int,input().split())
Xp=max((4-X),0)*100000
Yp=max((4-Y),0)*100000
print(Xp+Yp+((0,400000)[X*Y==1]))

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

P = {3: 100000, 2: 200000, 1: 300000}
ans = 0
if X in P:
    ans += P[X]
if Y in P:
    ans += P[Y]
if X == Y == 1:
    ans += 400000
print(ans)

Solution (Python):
from collections import Counter,defaultdict,deque
import sys
import bisect
import math
import itertools
import string
import queue
import copy


from itertools import permutations, combinations
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7

def inp(): 
    return int(input())
def inpm(): 
    return map(int,input().split())
def inpl(): 
    return list(map(int, input().split()))
def inpls(): 
    return list(input().split())
def inplm(n): 
    return list(int(input()) for _ in range(n))
def inpll(n): 
    return sorted([list(map(int, input().split())) for _ in range(n)])
    
def main():
    ans=0
    x,y=inpm()
    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__":
    main()

Solution (Python):
import queue
import math
import copy
"""
N = int(input())



A = []
for i in range(N):
	A.append(int(input()))

print(A)

"""
(N,M) = (int(i) for i in input().split(" "))
a = 0
if N <=3:
	a += 100000*(4-N)
if M <=3:
	a += 100000*(4-M)
if N==1 and M==1:
	a += 400000
print(a)

Solution (Python):
import collections
X, Y = [int(_) for _ in input().split()]
a = collections.defaultdict(int)
a[3] = 100000
a[2] = 200000
a[1] = 300000
ans = a[X] + a[Y]
if X == Y == 1:
    ans += 400000
print(ans)

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

a,b = m()

co = 0

if a == 1:
    co += 300000
if b == 1:
    co += 300000
if a == 2:
    co += 200000
if b == 2:
    co += 200000
if a == 3:
    co += 100000
if b == 3:
    co += 100000
if a == 1 and b == 1:
    co += 400000
print(co)

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

print(ans)

Solution (Python):
x, y = (int(i) for i in input().split())
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

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

print(point)

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

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

ans = score(X) + score(Y)
if X == Y == 1:
    ans += 400000
print(ans)

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline






















def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	X,Y = inputMap()

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

	print(ans)


if __name__ == "__main__":
	main()

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