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

import itertools
import math
N = 1
x, y = [0]*N, [0]*N
l = list(range(N))
sum=0


for i in range(N):
  x[i], y[i] = map(int, input().split())

if x[0] <= 3:
   sum=sum+100000*(4-x[0])
else:
    pass

if y[0]<= 3:
   sum=sum+100000*(4-y[0])
else:
    pass

if x[0]==1 and y[0]==1:
    sum=sum+400000

else:
    pass

print(sum)

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

if x>3 and y>3:
    print(0)
elif x<=3 and y<=3:
    if x+y == 2:
        print(1000000)
    elif x+y == 3:
        print(500000)
    elif x+y == 4:
        print(400000)
    elif x+y == 5:
        print(300000)
    else:
        print(200000)
else:
    z = min(x,y)
    if z == 1:
        print(300000)
    elif z == 2:
        print(200000)
    else:
        print(100000)

Solution (Python):
price = {
    '1': 300000,
    '2': 200000,
    '3': 100000
}
ranks = input().split(' ')

money = 0
for r in ranks:
    money += price.get(r, 0)
if ranks == ['1', '1']:
    money += 400000
print(money)

Solution (Python):
a,b = list(map(int, input().split()))
r=[300000, 200000, 100000]
ra=0
if a+b==2:
  print('1000000')
else:
    if a<4:
      ra += r[a-1]
    if b<4:
      ra += r[b-1]
    print(ra)

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

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

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

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

if x == y == 1:
    print("1000000")
else:
    print(str(score(x) + score(y)))

Solution (Python):
sum = 0
for i in map(int, input().split()):
    if i == 1:
        sum+=300000
    elif i ==2 :
        sum+= 200000
    elif i ==3 :
        sum+= 100000
if sum== 600000:
    sum = 1000000
print(sum)

Solution (Python):
s = 0
for i in map(int, input().split()):
    if i == 1:
        s+=300000
    elif i ==2 :
        s+= 200000
    elif i ==3 :
        s+= 100000
if s== 600000:
    s = 1000000
print(s)

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

rank1 = input_data[0]
rank2 = input_data[1]

my_sum = 0

if(rank1 == 1):
  my_sum = my_sum + 300000
elif(rank1 == 2):
  my_sum = my_sum + 200000
elif(rank1 == 3):
  my_sum = my_sum + 100000

  
if(rank2 == 1):
  my_sum = my_sum + 300000
elif(rank2 == 2):
  my_sum = my_sum + 200000
elif(rank2 == 3):
  my_sum = my_sum + 100000

if(rank1 == 1 and rank2 == 1):
  my_sum = my_sum + 400000
  
print(my_sum)

Solution (Python):
x,y = list(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):
a, b = map(int, input().split())
def kansu(a):
    if a == 1:
        return 300000
    if a == 2:
        return 200000
    if a == 3:
        return 100000
    else:
        return 0
    
if a == 1 and b == 1:
    print(1000000)
    
else:
    print(kansu(a)+kansu(b))

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

shokin = 0
if X == 1:
    shokin += 3*10**5
elif X == 2:
    shokin += 2*10**5
elif X == 3:
    shokin += 1*10**5

if Y == 1:
    shokin += 3*10**5
elif Y == 2:
    shokin += 2*10**5
elif Y == 3:
    shokin += 1*10**5

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

print(shokin)

Solution (Python):
total_reward = 0
for i in map(int, input().split()):
    if i == 1:
        total_reward+=300000
    elif i ==2 :
        total_reward+= 200000
    elif i ==3 :
        total_reward+= 100000
if total_reward== 600000:
    total_reward = total_reward + 400000
print(total_reward)

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

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

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

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

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

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

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):
s=0
t=0
m=list(map(int,input().split()))
if(m[0]==1):
  s=s+300000
  t=t+1
if(m[1]==1):
  s=s+300000
  t=t+1
if(m[0]==2):
  s=s+200000
if(m[1]==2):
  s=s+200000
if(m[0]==3):
  s=s+100000
if(m[1]==3):
  s=s+100000
if(t==2):
  s=s+400000
print(s)

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

if x * y == 1:
    print(300000 * 2 + 400000)
else:
    print(reward(x) + reward(y))

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

prize=0

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

if X in kingaku:
    prize +=  kingaku[X]

if Y in kingaku:
    prize +=  kingaku[Y]
    
if X == 1 and Y == 1:
    prize += 400000
print(prize)

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

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

if x == 1 and y == 1:
    print(300000*2 + 400000)
else:
    print(ls[x]+ls[y])

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

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

if x + y == 2:
    print(1000000)
else:
    if x <= 3:
        sum += (4-x)*100000
    if y <= 3:
        sum += (4-y)*100000
    print(sum)

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

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

if X == 1 and Y == 1:
    print(1000000)
elif X > 3 and Y > 3:
    print(0)
elif (X == 1 and Y == 2) or (X == 2 and Y == 1):
    print(500000)
elif (X == 1 and Y == 3) or (X == 3 and Y == 1):
    print(400000)
elif (X == 1 and Y > 3) or (X > 3 and Y == 1):
    print(300000)
elif (X == 2 and Y == 2):
    print(400000)
elif (X == 2 and Y == 3) or (X == 3 and Y == 2):
    print(300000)
elif (X == 2 and Y > 3) or (X > 3 and Y == 2):
    print(200000)
elif (X == 3 and Y == 3) or (X == 3 and Y == 3):
    print(200000)
elif (X == 3 and Y > 3) or (X > 3 and Y == 3):
    print(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
    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())
sum = 0
if x == 1 and y == 1:
    print(1000000)
else:
    if x == 1:
        sum += 300000
    elif x == 2:
        sum += 200000
    elif x == 3:
        sum += 100000
    if y == 1:
        sum += 300000
    elif y == 2:
        sum += 200000
    elif y == 3:
        sum += 100000
    print(sum)

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

sum_money=0
for i in DISCO:
    if i==1:
        sum_money+=300000
    elif i==2:
        sum_money+=200000
    elif i==3:
        sum_money+=100000
if sum(DISCO)==len(DISCO):
    sum_money+=400000
print(sum_money)

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

bonus = [0, 300000, 200000, 100000]
result = 0
if (x<=3):
	result += bonus[x]
if (y<=3):
	result += bonus[y]
if ((x==1) and (y==1)):
	result += 400000

print(result)

Solution (Python):
s = raw_input().split()
[X, Y] = s
o = [0,0]
o[0] = int(X)
o[1] = int(Y)


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

if o[0] == 1 and o[1] == 1:
    p += 400000

print p

Solution (Python):
input_ints = input().split()
x = int(input_ints[0])
y = int(input_ints[1])

if y <= 3:
    result_y = (4 - y) * 100000
else:
    result_y = 0
    
if x <= 3:
    result_x = (4 - x) * 100000
else:
    result_x = 0

result = result_y + result_x

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

print(result)

Solution (Python):
X,Y=input().split()
X=int(X)
Y=int(Y)
prize = [0]*206
prize[1:4] = [300000,200000,100000]

if X==1 and Y==1:
    ans=1000000
else:
    ans=prize[X]+prize[Y]

print(ans)

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

a = 4-x if x < 4 else 0
b = 4-y if y < 4 else 0
c = 4 if x == y == 1 else 0

print((a+b+c)*100000)

Solution (Python):
mylist=[]
mylist=input().split()
mylist_int=[]
mylist_int=[int(s) for s in mylist]
result=0

if mylist_int[0]>3:
    if mylist_int[1]==3:
        result+=100000
    elif mylist_int[1]==2:
        result+=200000
    elif mylist_int[1]==1:
        result+=300000
    

if mylist_int[0]==3:
    result+=100000
    if mylist_int[1]==3:
        result+=100000
    elif mylist_int[1]==2:
        result+=200000
    elif mylist_int[1]==1:
        result+=300000
        
elif mylist_int[0]==2:
    result+=200000
    if mylist_int[1]==3:
        result+=100000
    elif mylist_int[1]==2:
        result+=200000
    elif mylist_int[1]==1:
        result+=300000
        
elif mylist_int[0]==1:
    result+=300000
    if mylist_int[1]==3:
        result+=100000
    elif mylist_int[1]==2:
        result+=200000
    elif mylist_int[1]==1:
        result+=300000+400000
        
        
print(result)

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

Solution (Python):
m = {3:100000, 2:200000, 1:300000}
def f(a):
    if a <= 3:
        return m[a]
    return 0
def g(a, b):
    return 400000 if (a == 1 and a == b) else 0
x, y = map(int, input().split())
print(f(x) + f(y) + g(x, y))

Solution (Python):

def prize(r):
    return int(r<=3)*(4-r)*100000    

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


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

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

prize = [300000, 200000, 100000]
sump = 0

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

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

Solution (Python):
def main():
    x,y = map(int,input().split())
    prices = [300000,200000,100000]
    ans = 0
    if x <= 3:
        ans += prices[x-1]

    if y <= 3:
        ans += prices[y-1]

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

    print(ans)


main()

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

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

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

l = [[300000,200000,100000],[300000,200000,100000]]
x = 0
y = 0


if X == 1 and Y == 1:
    print(1000000)
else:
    if 1<= X <= 3:
        x = l[0][X-1]
    if  1 <= Y <= 3:
        y=l[1][Y-1]
    print(x+y)

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())
d = {1:300000, 2:200000, 3:100000}
if x == y == 1:
  print(1000000)
  exit()
a = 0
b = 0
if 1 <= x <= 3:
  a = d[x]
if 1 <= y <= 3:
  b = d[y]

print(a+b)

Solution (Python):
n, m = map(int, raw_input().split())
if n == m == 1:
    print 1000000
else:
    c = 0
    if n <= 3:
        c += (4 - n) * 100000
    if m <= 3:
        c += (4 - m) * 100000
    print c

Solution (Python):

x,y = map(int, input().split())
X = 0
Y = 0


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

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

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

Solution (Python):
import math
import random
from operator import itemgetter
import re
import sys
from itertools import accumulate
from collections import defaultdict
from collections import deque
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
X,Y = map(int,input().split())
if X+Y == 2:
    print(1000000)
elif X+Y == 3:
    print(500000)
elif X+Y == 4:
    print(400000)
elif X == 3 or Y == 3:
    if X == 2 or Y == 2:
        print(300000)
    elif X == 3 and Y == 3:
        print(200000)
    else:
        print(100000)
elif X == 2 or Y ==2:
    print(200000)
elif X == 1 or Y == 1:
    print(300000)
else:
    print(0)

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

G = 0

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

if X == 1:
    G += 300000

if X == 2:
    G += 200000

if X == 3:
    G += 100000

if Y == 1:
    G += 300000

if Y == 2:
    G += 200000

if Y == 3:
    G += 100000

print(G)

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

if (x==y==1):
  output=1000000
elif (x*y==2):
  output=500000
elif (x*y==3):
  output=400000

elif (x==y==2):
  output=400000
elif (x*y==6):
  output=300000
elif (x*y==9):
  output=200000
  

elif (x==1 or y==1):
  output=300000
elif (x==2 or y==2):
  output=200000
elif (x==3 or y==3):
  output=100000
else:
  output=0
print(output)

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

if Y == 1:
    ans += first
elif Y == 2:
    ans += second
elif Y == 3:
    ans += third
else:
    ans += 0

print(ans)

Solution (Python):




def main():
  x, y = map(int, input().split())
  x = x - 1
  y = y - 1
  p = (300000, 200000, 100000, 0)
  v = 0

  v += p[min(x, len(p) - 1)]
  v += p[min(y, len(p) - 1)]

  if x + y == 0:
    v += 400000

  print(v)


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

if X == 1 and Y == 1:
    print(300000 * 2 + 400000)
else:
    print(max(0, 4 - X) * 100000 + max(0, 4 - Y) * 100000)

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

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

prize_list = [300000, 200000, 100000]

ans = 0
if X <= 3:
    ans += prize_list[X-1]
if Y <= 3:
    ans += prize_list[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:
  print(1000000)
else:
  print(ans)

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

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):
en = list(map(int,input().split()))
sum = 0
for i in range(2):
	if en[i] == 1:
		sum += 300000;
	elif en[i] == 2:
		sum += 200000;
	elif en[i] == 3:
		sum +=100000;
if en[0] ==1 and en[1] == 1:
	sum += 400000
print(sum)

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

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

prize = 0
cn = disco[0]
sn = disco[1]

if (cn * sn == 1):
    print(1000000)
    exit()

if (cn < 4):
    prize += 400000 - 100000 * cn

if (sn < 4):
    prize += 400000 - 100000 * sn

print(prize)

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

n=0
if (x,y)==(1,1):
  print(1000000)
  exit()

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

print(n)

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

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())
l=[300000,200000,100000,0]
if x>=4:
    x=4
if y>=4:
    y=4

if x==1 and y==1:
    print(1000000)
else:
    print(l[x-1]+l[y-1])

Solution (Python):


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

sum = 0
if(X == 1):
  sum = 300000
elif(X == 2):
  sum = 200000
elif(X == 3):
  sum = 100000

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

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

print(sum)

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

if X == 1 and Y == 1:
  c = 400000
else:
  c = 0

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


print(a + b +c)

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

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

Solution (Python):
x,y=map(int,input().split())
if x*y==1:
  print(1000000)
elif x*y==2:
  print(200000+300000)
elif x*y==3:
  print(300000+100000)
elif (x==1 and y!=1) or (x!=1 and y==1):
  print(300000)
elif (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==2 and y==3) or (y==2 and x==3):
  print(300000)
elif (x==3 and y==3):
  print(200000)
elif (x==y==2):
  print(400000)
else:
  print(0)

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

if a+b==2:
  print(1000000)
else:
  ans =0
  if a<=3:
    ans+= (4-a)*100000
  if b<=3:
    ans+= (4-b)*100000
  print(ans)

Solution (Python):
a,b= map(int, input().split())
n=0
if a<4:
    n=n+300000-(a-1)*100000
if b<4:
    n=n+300000-(b-1)*100000
if (a==1)&(b==1):
    n=n+400000
print(int(n))

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

Solution (Python):
x,y = map(int,input().split())
if x == 1 and y == 1:print(int(10e5))
elif 1<=x<=3 and 1<=y<=3:
    print(int((8-x-y)*1e5))
elif 1<=x<=3:print(int((4-x)*1e5))
elif 1<=y<=3:print(int((4-y)*1e5))
else:print(0)

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

print(S)

Solution (Python):
import sys

line = sys.stdin.readlines()[0]
X, Y = map(int,line.split(' '))

ret = 0

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

for p in [X,Y]:
    if p == 1:
        ret += 300000
    if p == 2:
        ret += 200000
    if p == 3:
        ret += 100000

print(ret)

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

if __name__ == "__main__":
    main()

Solution (Python):
X = list(map(int,input().split()))
c=100000
b=200000
a=300000
X.sort()
ans=0
cnt=0
for i in X:
    if i==1:
        ans+=a
        cnt+=1
    elif i==2:
        ans+=b
    elif i==3:
        ans+=c
if cnt==2:
    ans += 400000
print(ans)

Solution (Python):
s = 0
for i in map(int, raw_input().split()):
    if i == 1:
        s+=300000
    elif i ==2 :
        s+= 200000
    elif i ==3 :
        s+= 100000
if s== 600000:
    s = 1000000
print(s)

Solution (Python):
x, y = list(map(int, input().split()))
xy = [x, y]
result = 0
for n in [x, y]:
    if n == 3:
        result += 100000
    if n == 2:
        result += 200000
    if n == 1:
        result += 300000
if x == 1 and y == 1:
    result += 400000

print(result)

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

ans = 0

if X == 1 and Y == 1:
    ans = 700000

if X == 2 and Y == 2:
    print(400000)
    exit()

if X == 3 and Y == 3:
    print(200000)
    exit()

if X == 1 or Y == 1:
    ans += 300000

if X == 2 or Y == 2:
    ans += 200000

if X == 3 or Y == 3:
    ans += 100000
print(ans)

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

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

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

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())
p = {1: 300000, 2: 200000, 3: 100000}
sum = 0
if X == 1 and Y == 1:
  sum += 400000
if X <= 3:
  sum += p[X]
if Y <= 3:
  sum += p[Y]
print(sum)

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

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

Solution (Python):
t = tuple(map(int, input().split()))
r = sum(max(4 - x, 0) * 100000 for x in t) + (sum(t) == 2 and 400000)
print(r)

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

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

Solution (Python):
x,y=map(int,input().split())
list=[300000,200000,100000,0]
if x>4:
    x=4
if y>4:
    y=4
if x==1 and y==1:
    print(2*300000+400000)
else:
    print(list[x-1]+list[y-1])

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

points = 0

if x <= 3:
    points += (-x + 4)*100000
if y <= 3:
    points += (-y + 4)*100000
if x == 1 and y == 1:
    points += 400000

print(points)

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

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

rwd_x = rwd_dict.get(x, 0)
rwd_y = rwd_dict.get(y, 0)
rwd_1 = 0
if x == 1 and y == 1:
    rwd_1 = 400000

rwd = rwd_x + rwd_y + rwd_1

print(rwd)

Solution (Python):

import sys

f = sys.stdin
x, y = map(int, f.readline().split(' '))

moneyx = (x==1) * 300000 + (x==2) * 200000 + (x==3) * 100000
moneyy = (y==1) * 300000 + (y==2) * 200000 + (y==3) * 100000
moneyz = (x==1 and y==1) * 400000
moneyall = moneyx + moneyy + moneyz
print(moneyall)

Solution (Python):

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

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

if(X==Y and X==1):
    print(1000000)
    
else:
    if(X>=4):
        X = 0
    if(Y>=4):
        Y = 0

    if(X==1):
        X = 3
    elif(X==3):
        X = 1

    if(Y==1):
        Y = 3
    elif(Y==3):
        Y = 1
        
    print((X+Y)*100000)

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

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

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

X_aaa=0
Y_aaa=0

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

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

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

print(X_aaa+Y_aaa)

Solution (Python):
a = raw_input().split(" ")
b = int(a[1])
a = int(a[0])
total = 0

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

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

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

result = 0
if X == 1:
    if Y == 1:
        result = 300000*2 + 400000
    elif Y == 2:
        result = 300000 + 200000
    elif Y == 3:
        result = 300000 + 100000
    else:
        result = 300000
elif X == 2:
    if Y == 1:
        result = 200000 + 300000
    elif Y == 2:
        result = 200000 + 200000
    elif Y == 3:
        result = 200000 + 100000
    else:
        result = 200000
elif X == 3:
    if Y == 1:
        result = 100000 + 300000
    elif Y == 2:
        result = 100000 + 200000
    elif Y == 3:
        result = 100000 + 100000
    else:
        result = 100000
else:
    if Y == 1:
        result = 300000
    elif Y == 2:
        result = 200000
    elif Y == 3:
        result = 100000
print(result)