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):
def main(x: int, y: int):
    award = 0

    if x == y == 1:
        award += 400000

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

    print(award)


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

    main(x, y)

Solution (Python):
a,b=[int(x) for x in 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 ans==600000:
  ans+=400000
print(ans)

Solution (Python):
n = [int(i) for i in input().split()]
T=0
for i in range(2):
        if n[i] == 1: T+=3
        elif n[i] == 2: T+=2
        elif n[i] == 3: T+=1
if sum(n)==2: T+=4
print(T*100000)

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

if x == 1 and y == 1:
  print(10**6)
else:

  x = 0 if x >= 4 else 4 - x
  y = 0 if y >= 4 else 4 - y
  print(x*10**5 + y*10**5)

Solution (Python):
c1, c2 = map(int, input().split())

prizes = [300000, 200000, 100000]
total_prize = 0
if(c1 <= 3):
  total_prize += prizes[c1-1]
if(c2 <= 3):
  total_prize += prizes[c2-1]
if(c1==1 and c2==1):
  total_prize += 400000
print(total_prize)

Solution (Python):

import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(X: int, Y: int):
    ans = 0
    if X == 3:
        ans += 1
    elif X == 2:
        ans += 2
    elif X == 1:
        ans += 3
    
    if Y == 3:
        ans += 1
    elif Y == 2:
        ans += 2
    elif Y == 1:
        ans += 3
    
    if X == 1 and Y == 1:
        ans += 4
    
    print(ans*10**5)

    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
x=max(4-x,0)
y=max(4-y,0)
ans+=x*100000+y*100000
if x==3 and y==3:
  ans+=400000
print(ans)

Solution (Python):
x, y = input().split()
prizes = {'1': 300000, '2': 200000, '3': 100000}
ans = prizes.get(x, 0) + prizes.get(y, 0)
if x == y == '1':
    ans += 400000
print(ans)

Solution (Python):
x, y = input().split()
prizes = {'1': 300000, '2': 200000, '3': 100000}
ans = prizes.get(x, 0) + prizes.get(y, 0)
if x == y == '1':
    ans += 400000
print(ans)

Solution (Python):
X,Y = (int(i) for i in input().split())

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


x = get_money(X)
y = get_money(Y)

if X == 1 and Y == 1:
    z = 400000
else:
    z = 0
ans = x + y + z

print(ans)

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())
if(x==y==1):
  print(1000000)
else:
  ans=max(4-x,0)*100000+max(4-y,0)*100000
  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 == 5:
  print(300000)
elif x + y == 4:
  print(400000)
elif x + y == 6:
  print(200000)
elif x + y >=5 and min(x,y) == 1:
  print(300000)
elif x + y >=5 and min(x,y) == 2:
  print(200000)
elif x + y >=5 and min(x,y) == 3:
  print(100000)
else:
  print(0)

Solution (Python):

X, Y = map(int,input().split())
money = 0
moneyX = 400000 - X*100000
moneyY = 400000 - Y*100000
if moneyX > 0:
    money += moneyX
if moneyY > 0:
    money += moneyY
if money == 600000:
    money += 400000
print(money)

Solution (Python):
prize = {1:300000,2:200000,3:100000}

a,b = [int(i) for i in input().split()]

if a == b == 1:
    print(1000000)
elif a < 4 and b < 4:
    print(prize[a] + prize[b])
elif a >= 4 and b < 4:
    print(prize[b])
elif b >= 4 and a < 4:
    print(prize[a])
else:
    print(0)

Solution (Python):
X,Y=map(int,input().split())
X=4 if X>3 else X
Y=4 if Y>3 else Y

C=[300000,200000,100000,0]

print(C[X-1]+C[Y-1]+400000 if X==Y==1 else C[X-1]+C[Y-1])

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

Solution (Python):
num = input().split()
nums = []
for i in num:
  nums.append(int(i))

price = [300000, 200000, 100000]
result = []
 

for i in nums:
  if int(i) > 3:
    result.append(0)
  else:
    result.append(price[i-1])
value = result[0] + result[1]
if value == 600000:
  print("1000000")
else:
  print(value)

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

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

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

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

if x == 1 and y == 1:
    ans += 400000
    
li = [0,300000, 200000, 100000]

if x <= 3:
    ans += li[x]
if y <= 3:
    ans += li[y]

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())
prize = [0, 300000, 200000, 100000]
ans = 0

if x <= 3:
    ans += prize[x]
if y <= 3:
    ans += prize[y]

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

print(ans)

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

Solution (Python):
x,y=map(int,input().split())
k=[1,2,3]
l=[0,300000,200000,100000]
p=0
if x in k:
  p+=l[x]
if y in k:
  p+=l[y]
if x==1 and y==1:
  p+=400000
print(p)

Solution (Python):
x, y = map(int, input().split())
ans = 0
money = [0, 3, 2, 1]

if x <= 3:
    ans += money[x]
if y <= 3:
    ans += money[y]

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

print(ans*10**5)

Solution (Python):


def get_syokin(a):
    if a == 3:
        return 100000
    elif a == 2:
        return 200000
    elif a == 1:
        return 300000
    return 0

def solve():
    X, Y = map(int, input().split())
    ans = 0

    ans += get_syokin(X)
    ans += get_syokin(Y)

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

    print(ans)


if __name__ == "__main__":
    solve()

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

d = {1: 300000, 2: 200000, 3: 100000}
ans = 0
ans += d.get(X, 0)
ans += d.get(Y, 0)
if X == 1 and Y == 1:
    ans += 400000

print(ans)

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

def f(x):
  if x == 1:
    return 300000
  if x == 2:
    return 200000
  if x == 3:
    return 100000
  return 0

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

Solution (Python):
a,b=map(int,input().split())
ans=0
if a<=3:
    ans+=(4-a)*10**5
if b<=3:
    ans+=(4-b)*10**5
if a==b==1:
    ans+=4*10**5
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 == 1 and y == 1:
  money += 400000

print(money)

Solution (Python):
res = {1:300000, 2:200000, 3:100000}
a, b = map(int, input().split())
if a == b == 1:
	c = 400000
else:
	c = 0
try:
	a = res[a]
except:
	a = 0
try:
	b = res[b]
except:
	b = 0
print(c+a+b)

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

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

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

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

print(ans)

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

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

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

if ans == 600000:
    ans += 400000

print(ans)

Solution (Python):



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

Solution (Python):
x,y = map(int,input().split())
s = max(0,(4-x)*100000)+max(0,(4-y)*100000)
print(s if s!=600000 else s+400000)

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

total_money = 0

if x >= 4:
    total_money += 0
elif x == 3:
    total_money += 100000
elif x == 2:
    total_money += 200000
elif x == 1:
    total_money += 300000

if y >= 4:
    total_money += 0
elif y == 3:
    total_money += 100000
elif y == 2:
    total_money += 200000
elif y == 1:
    total_money += 300000

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

print(total_money)

Solution (Python):


from collections import deque, defaultdict
import itertools as ite
import sys
import math
import decimal

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7
X, Y = map(int, raw_input().split())
ans = max(4 - X, 0) * 100000 + max(4 - Y, 0) * 100000
if X * 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 (s==600000): s+=400000

print(s)

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

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

print(sum_)

Solution (Python):
num = input().split()
nums = []
for i in num:
  nums.append(int(i))

price = [300000, 200000, 100000]
result = []


for i in nums:
  if int(i) > 3:
    result.append(0)
  else:
    result.append(price[i-1])
value = result[0] + result[1]
if value == 600000:
  print("1000000")
else:
  print(value)

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
else:
    ans += 0

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

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

print(ans)

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

points = [-1, 300000, 200000, 100000, 0]
print(400000*(X==Y==1) + points[min(4, X)] + points[min(4, Y)])

Solution (Python):

x,y = map(int,input().split())
if x == 1 and y == 1:

    print(10**6)
else:
    print((max(0,4-x)+max(0,4-y))*(10**5))

Solution (Python):
X, Y =[int(x) for x in 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):
X , Y = 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 == 2 and Y == 3:
    print("300000")

elif X == 2 and Y == 2:
    print("400000")
   
elif X == 3 and Y == 3:
    print("200000")

elif X == 3 and Y == 2:
    print("300000")
    
elif X == 2 and Y == 1:
    print("500000")

elif X == 3 and Y == 1:
    print("400000")

elif X == 1 and Y >= 4:
    print("300000")

elif X == 2 and Y >= 4:
    print("200000")  

elif X == 3 and Y >= 4:
    print("100000")

elif X >= 4 and Y == 1:
    print("300000")

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())
a = max(0, 100000 * (4 - x))
b = max(0, 100000 * (4 - y))
c = 400000 if x == 1 and y == 1 else 0
print(a + b + c)

Solution (Python):
N,M=[int(i) for i in input().split()]
ans=0
for i in [N,M]:
  if i==1:
    ans += 3
  elif i==2:
    ans += 2
  elif i==3:
    ans+=1
if N==1 and M==1:
  ans+=4
print(ans*100000)

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

prise = {3: 100000, 2: 200000, 1: 300000}
ans = 0
if x in (1, 2, 3):
    ans += prise[x]
if y in (1, 2, 3):
    ans += prise[y]

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

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

prize = 0

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

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

Solution (Python):

import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

A=list(map(int,input().split()))
for ai in A:
    if ai==1:
        ans+=300000
    elif ai==2:
        ans+=200000
    elif ai==3:
         ans+=100000
if A[0]==1 and A[1]==1:
    ans+=400000
print(ans)

Solution (Python):
a, b = [int(x) for x in input().split()]
won = 0
if a in range(1, 4):
  won  += [0,300000,200000,100000][a]
if b in range(1, 4):
  won  += [0,300000,200000,100000][b]
if a == 1 and b == 1:won += 400000  
 
print(won)

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

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

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

print(T)

Solution (Python):

a = list(map(int, input().split()))

ans = 0
for i in a:
    if i == 1:
        ans += 300000
    elif i == 2:
        ans += 200000
    elif i == 3:
        ans += 100000
    
if a[0] == a[1] == 1:
    ans += 400000

print(ans)

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

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

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

X -= 1
Y -= 1

if X < 3:
    ans += price[X]
if Y < 3:
    ans += price[Y]

print(ans)

Solution (Python):
X, Y = [int(n) for n in input().split()]
V = {0: 400000, 1: 300000, 2: 200000, 3: 100000}
ans = 0
for i in [X, Y]:
    ans += V.setdefault(i, 0)
print(ans+V[0] if X==1==Y else ans)

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


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

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

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

print(prize)

Solution (Python):
x, y = (int(x) for x in input().split())
if x == y == 1: print(1000000)
else:
    ans = 0
    points = [300000, 200000, 100000]
    if x <= 3: ans += points[x-1]
    if y <= 3: ans += points[y-1]
    print(ans)

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

Solution (Python):
def a_ddcc_finals():
    X, Y = [int(i) for i in input().split()]
    prizes = {1: 300000, 2: 200000, 3: 100000}
    ans = 0
    for rank in (X, Y):
        if rank in prizes.keys():
            ans += prizes[rank]
    ans += 400000 if X == 1 and Y == 1 else 0
    return ans

print(a_ddcc_finals())

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

prize=[0,300000,200000,100000]

ans=0
for c in [X,Y]:
    if c<=3:
        ans+=prize[c]

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

print(ans)

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

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

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

Solution (Python):
x,y=[max(4-int(i),0)for i in input().split()];print((x+y+4*(x>2<y))*10**5)

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 ans == 600000:
    ans += 400000

print(ans)

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

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

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

Solution (Python):
X, Y = map(int, input().split())
S = 0
R = [300000, 200000, 100000]
for i in range(max(X, Y)):
  R.append(0)

if X == 1 and Y == 1:
  print(R[X-1] + R[X-1] + 400000)
else:
  print(R[X-1] + R[Y-1])

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

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
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)]

sys.setrecursionlimit(1000000)
mod = 1000000007
flush = sys.stdin.flush()

def solve():
    x,y = LI()
    ans = 0
    f = [300000,200000,100000,0]
    if x == 1 and y == 1:
        print(1000000)
    else:
        ans = f[min(3,x-1)]+f[min(3,y-1)]
        print(ans)
    return


if __name__ == "__main__":
    solve()

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

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

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

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

ans = 0

if x < 4:
  ans += (4-x)* 100000
  
if y < 4:
  ans += (4-y)* 100000
  
if x + y == 2:
  ans += 400000
  
print(ans)

Solution (Python):
X,Y=map(int,input().split());print(max((4-X)*10**5,0)+max((4-Y)*10**5,0)+(400000 if (X,Y)==(1,1) else 0))

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

x1 = rewards[x] if (x <= 3) else 0
y1 = rewards[y] if (y <= 3) else 0
 
if (x == 1 and y ==  1):
  total += 400000
if (x1 != None):
  total += x1
if (y1 != None):
  total += y1
 
print(total)

Solution (Python):
X,Y = map(int,input().split())
if X*Y == 1:
    print(10**6)
else:
  print(10**5*(max(0,4-X)+max(0,4-Y)))

Solution (Python):
from collections import Counter

a = map(int, input().split())
c = Counter(a)
d = {1: 300000, 2: 200000, 3: 100000}

ret = sum(c[rank] * d[rank] for rank in range(1, 3 + 1))
if c[1] == 2:
    ret += 400000
print(ret)

Solution (Python):
X,Y=map(int,input().split());print((max((4-X),0)+max((4-Y),0)+4*(X*Y<2))*10**5)

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

Solution (Python):
x,y=[max(4-int(i),0)for i in input().split()];print((x+y+4*(x>2<y))*10**5)

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):
a, b = input().split(" ")
x = int(a)
y = int(b)

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

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

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

print (amt)

Solution (Python):
X,Y=map(int,input().split());print((max((4-X),0)+max((4-Y),0)+4*(X*Y<2))*10**5)

Solution (Python):
x,y=[int(s) for s in input().split()]
ans=0
if x<4:
  ans+=100000
if x<3:
  ans+=100000
if x<2:
  ans+=100000
if y<4:
  ans+=100000
if y<3:
  ans+=100000
if y<2:
  ans+=100000
if x*y==1:
  ans+=400000
print(ans)

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

Solution (Python):
x = [int(i) for i in input().split()]
ans = 0
f = [False,False]
for i in range(2):
    if x[i] == 1:
        ans += 300000
        f[i] = True
    elif x[i] == 2:
        ans += 200000
    elif x[i] == 3:
        ans += 100000

if f[0] and f[1]:
    ans += 400000

print(ans)

Solution (Python):
X,Y=map(int,input().split());print((max((4-X),0)+max((4-Y),0)+(0,4)[X*Y<2])*10**5)

Solution (Python):



import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))


x,y = LI()
if x == 3 and y == 3:
    print(200000)
elif x == 2 and y == 2:
    print(400000)
elif (x == 1 and y == 2) or (x == 2 and y == 1):
    print(500000)
elif (x == 3 and y == 2) or (x == 2 and y == 3):
    print(300000)
elif (x == 3 and y == 1) or (x == 1 and y == 3):
    print(400000)
elif x == 1 and y == 1:
    print(600000+400000)
elif x == 3 or y == 3:
    print(100000)
elif x == 2 or y == 2:
    print(200000)
elif x == 1 or y == 1:
    print(300000)
else:
    print(0)

Solution (Python):
X,Y=map(int,input().split());print((max((4-X),0)+max((4-Y),0)+((0,4)[X*Y<2]))*10**5)

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

Solution (Python):
X,Y=map(int,input().split());print((max((4-X),0)+max((4-Y),0)+((0,4)[X*Y==1]))*10**5)

Solution (Python):

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

Solution (Python):
x,y = map(int,input().split())
ans = 0
if x == 1 and y == 1:
    ans += 400000

def q(x,ans):
    if x == 1:
        ans += 300000
    elif x == 2:
        ans += 200000
    elif x == 3:
        ans += 100000
    return ans
ans = q(x,ans)
ans = q(y,ans)
print(ans)

Solution (Python):
X,Y = [int(x) for x in input().split()]
li = [300000, 200000, 100000]
if(X==Y==1):
    print(1000000)
else:
    ans = 0
    if(X<=3):
        ans += li[X-1]
    if(Y<=3):
        ans += li[Y-1]
    print(ans)

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

Solution (Python):
def fun(x):
    if x==1:
        return 300000
    elif x==2:
        return 200000
    elif x==3:
        return 100000
    else:
        return 0
s=input()
s=s.split()
a=eval(s[0])
b=eval(s[1])
su=0
if a==b==1:
    su+=400000
su+=fun(a)
su+=fun(b)
print(su)

Solution (Python):


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



sum = 0

if(X == 1):
  
  sum += 300000
  if(Y == 1):
    sum += 300000
    sum += 400000
  elif(Y == 2):
    sum += 200000
  elif(Y == 3):
    sum += 100000
  else:
    pass
elif( X == 2):
  
  sum += 200000
  if(Y == 1):
    sum += 300000
    
  elif(Y == 2):
    sum += 200000
  elif(Y == 3):
    sum += 100000
  else:
    pass
elif( X == 3):
  
  sum += 100000
  if(Y == 1):
    sum += 300000
    
  elif(Y == 2):
    sum += 200000
  elif(Y == 3):
    sum += 100000
  else:
    pass
else:
  if(Y == 1):
    sum += 300000
    
  elif(Y == 2):
    sum += 200000
  elif(Y == 3):
    sum += 100000
  else:
    pass

print(sum)

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

Solution (Python):
X,Y = map(int,raw_input().split())
if((X >= 1)and(X <= 205))and((Y >= 1)and(Y <= 205)):
    if(X == 1)and(Y == 1): print("1000000")
    elif((X == 1)and(Y == 2))or((Y == 1)and(X == 2)): print("500000")
    elif((X == 1)and(Y == 3))or((Y == 1)and(X == 3))or((X == 2)and(Y == 2)): print("400000")
    elif((X == 2)and(Y == 3))or((X == 1)and(Y > 3))or((Y == 1)and(X > 3))or((X == 3)and(Y == 2)): print("300000")
    elif((X == 3)and(Y == 3))or((X == 2)and(Y > 3))or((Y == 2)and(X > 3)): print("200000")
    elif((X == 3)and(Y > 3))or((Y == 3)and(X > 3)): print("100000")
    elif(X > 3)and(Y > 3): print("0")

Solution (Python):
rank3 = 100000
rank2 = 200000
rank1 = 300000







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

reward = 0

if x == 1:
    reward += rank1
elif x == 2:
    reward += rank2
elif x == 3:
    reward += rank3

if y == 1:
    reward += rank1
elif y == 2:
    reward += rank2
elif y == 3:
    reward += rank3

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

print(reward)

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

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

Solution (Python):
import sys
input = sys.stdin.readline
def print_ans(A, B):
    """Test Case
    >>> print_ans(1, 1)
    1000000
    >>> print_ans(3, 101)
    100000
    >>> print_ans(4, 4)
    0
    """
    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)

if __name__ == '__main__':
    A, B = map(int, input().rstrip().split())
    print_ans(A, B)

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

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

Solution (Python):
a, b = input().split(" ")
x = int(a)
y = int(b)
amt = 0
if x == 3:
    amt += 100000
elif x == 2:
    amt += 200000
elif x == 1: 
    amt += 300000

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

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

print (amt)

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

Solution (Python):
a,b=map(int, input().split())
s=0
t=400000-100000*a
if t>0:
  s=t
u=400000-100000*b
if u>0:
  s+=u
if a+b==2:
  s+=400000
print(s)

Solution (Python):
x,y=map(int,input().split())
m=10**5
print(max(0,m*(4-x))+max(0,m*(4-y))+4*m*(x<2>y))