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, y = input().split()
    answer = 0
    prize = {"1": 300000, "2": 200000, "3": 100000}
    if x in prize:
        answer += prize[x]
    if y in prize:
        answer += prize[y]
    if x == y == "1":
        answer += 400000
    print(answer)


if __name__ == '__main__':
    main()

Solution (Python):



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


cost_ans = 0

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

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

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

print(cost_ans)

Solution (Python):
import sys

input = sys.stdin.buffer.readline







def main():
	xy=list(map(int,input().split()))
	ans=0
	li=[0,3,2,1]

	for i in xy:
		if i<=3:
			ans+=li[i]

	if sum(xy)==2:
		ans+=4

	print(ans*100000)







if __name__ == "__main__":
	main()

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








def main():
	xy=list(map(int,input().split()))
	ans=0
	li=[0,3,2,1]

	for i in xy:
		if i<=3:
			ans+=li[i]

	if sum(xy)==2:
		ans+=4

	print(ans*100000)







if __name__ == "__main__":
	main()

Solution (Python):
def award(x):
    return max(0, 4*(10**5) - x*(10**5))

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

ans  = award(x)
ans += award(y)

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

print(ans)

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

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

Solution (Python):









import sys



ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    x, y = list(map(int,ipti().split()))
    prize = [300000, 200000, 100000, 0]

    if x == y == 1:
        print(1000000)
    else:
        x = 4 if x > 3 else x
        y = 4 if y > 3 else y
        print(prize[x-1]+prize[y-1])

if __name__ == '__main__':
    main()

Solution (Python):
xy = list(map(int,input().split()))
prise = 0

for i in xy:
  if i == 1:
    prise += 300000
  elif i == 2:
    prise += 200000
  elif i == 3:
    prise += 100000

if sum(xy) == 2:
  prise += 400000

print(prise)

Solution (Python):
def padd(x, ans):
    if x==1:
        ans += 300000
    elif x==2:
        ans += 200000
    elif x==3:
        ans += 100000
    return ans

def main():
    x, y = map(int, input().split())
    ans = 400000 if x==1 and y==1 else 0
    ans = padd(x, ans)
    ans = padd(y, ans)
    print(ans)

main()

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):
a,b = map(int, input().split())
sum = 0
if a == 1:
  sum = sum + 300000
elif a == 2:
  sum = sum + 200000
elif a == 3:
  sum = sum + 100000

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

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

print(sum)

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

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

prize = [0]*206
prize[1] = 300000
prize[2] = 200000
prize[3] = 100000

money = 0

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

print(money+prize[X]+prize[Y])

Solution (Python):
import math
from collections import deque
def main():
    t = [int(t)for t in input().split()]
    x,y = t[0],t[1]

    earned = 0

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

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

    print(earned)
if __name__ == "__main__":
    main()

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

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

Solution (Python):
from collections import defaultdict
X, Y = map(int, input().split())
d = defaultdict(int)
d[1] = 300000
d[2] = 200000
d[3] = 100000
ans = d[X]+d[Y]
if X==1 and Y==1:
  ans += 400000
print(ans)

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

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

ans = 0
if x <= 3:
    ans += prize[x]
if y <= 3:
    ans += prize[y]
if x == y == 1:
    ans += 400000
print(ans)

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

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

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

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

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

print(ans)

Solution (Python):


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

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

ans = 0
for i in [x, y]:
  if i <= 3:
    ans += 4 - i

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

print(ans * 100000)

Solution (Python):
X, Y = map(int, input().split())
li = [300000, 200000, 100000]
ans = 0
for i in range(3) :
    if i + 1 == X :
        ans += li[i]
        break

for i in range(3) :
    if i + 1 == Y :
        ans += li[i]
        break
if X == 1 and Y == 1:
    ans += 400000
print(ans)

Solution (Python):
money = [0, 300000, 200000, 100000]
a,b = map(int, input().split())

st = money[a if a < len(money) else 0] \
 + money[b if b < len(money) else 0]
if a == 1 and b == 1:
  st += 400000
print(st)

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

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

Solution (Python):








mod = int(1e9+7)

class Library():
    @staticmethod
    def Swap(a,b):
        return [b,a]

    @staticmethod
    def myRound(a,dig=0): 
        
        
        
        p = 10 ** dig
        return (a * p * 2 + 1) // 2 / p

    @staticmethod
    def Roundup(a): 
        if a < 0:
            return int(a)
        else:
            return int(a + 0.9)
    

    @staticmethod
    def Gcd(a,b): 
        if (a<b):
            a,b = Library.Swap(a,b)
        if (b==0):
            return a
        else:
            return Library.Gcd(b,a%b)

    @staticmethod
    def Lcm(a,b): 
        return a//Library.Gcd(a,b)*b

    @staticmethod
    def Divisors(a): 
        divisors = []
        for i in range(1,int(a**0.5)+1):
            if a%i==0:
                divisors.append(i)
                if i!=a//i:
                    divisors.append(a//i)
        divisors.sort()
        return divisors

class Prime():
    
    
    def __init__(self,num):
        self.num = num
        self.sieve = [0] * (self.num + 1)
        self.sieve[0] = -1
        self.sieve[1] = -1
        for i in range(2,self.num + 1):
            if not self.sieve[i]:
                self.sieve[i] = i
                for j in range(i * i,self.num + 1,i):
                    if self.sieve[j]:
                        self.sieve[j] = i
    
    
    def isPrime(self,num = None):
        if num is None:
            num = self.num
        if self.sieve[num] == num:
            return True
        else:
            return False
    
    
    def PrimeNum(self,num = None):
        if num is None:
            num = self.num
        prime = []
        for i in range(2,num):
            if self.sieve[i] == i:
                prime.append(i)
        return prime
    
    
    def PrimeFact(self,num = None):
        if num is None:
            num = self.num
        fact = []
        while self.sieve[num] != num:
            fact.append(self.sieve[num])
            num //= self.sieve[num]
        fact.append(num)
        return fact

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

if __name__=='__main__':
    main()

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

def main():
    X, Y = map(int, input().split())
    ans = 0
    t = [300000, 200000, 100000]

    if X <= 3:
        ans += t[X-1]
    if Y <= 3:
        ans += t[Y-1]
    if X == 1 and Y == 1:
        ans += 400000
    
    print(ans)

if __name__ == "__main__":
    main()

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

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):
from sys import stdin
X, Y = [int(_) for _ in stdin.readline().rstrip().split()]
ans = max(0, 4-X) + max(0, 4-Y)
if X == Y == 1:
    print((ans + 4) * 100000)
else:
    print(ans*100000)

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

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

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

Solution (Python):

def main():
    X, Y = map(int, input().split())
    prize_table = {1: 300000, 2: 200000, 3: 100000}
    prize = 0
    for rank in (X, Y):
        if rank in prize_table:
            prize += prize_table[rank]
    if X == Y and X == 1:
        prize += 400000
    print(prize)


if __name__ == "__main__":
    main()

Solution (Python):

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


if __name__ == "__main__":
    main()

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

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

print(x_cost + y_cost + 400000 if x_cost == y_cost == 300000 else x_cost + y_cost)

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

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

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

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

print(award)

Solution (Python):
x, y = map(int, input().split())
def a(n):
    if n == 1:
        return 100000 * 3
    if n == 2:
        return 100000 * 2
    if n == 3:
        return 100000
    return 0
res = a(x) + a(y)
if x == y == 1:
    res += 100000*4
print(res)

Solution (Python):
x,y = map(int,input().split())
s=[0,]
d={
  1:300000,
  2:200000,
  3:100000,
}

if x in d:
  s.append(d[x])

if y in d:
  s.append(d[y])

if x==1 and y==1:
  s.append(400000)
  
print(sum(s))

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

if(x == 1 and y == 1):
    print(1000000)
elif(1 <= x <= 3 and 1 <= y <= 3):
    print(z[x]+z[y])
elif(1 <= x <= 3):
    print(z[x])
elif(1 <= y <= 3):
    print(z[y])
else:
    print(0)

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

ans=0

ans+=max(4-x,0)*100000
ans+=max(4-y,0)*100000
if x==1 and y==1:
    ans+=400000
    
print(ans)

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

P = [300000, 200000, 100000, 0]

if X == 1 and Y == 1:
    print(1000000)
else:
    print(P[min(3, X - 1)] + P[min(3, Y - 1)])

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

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

Solution (Python):

 
import math
import itertools
import sys
import copy
 





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())
wins = [300000, 200000, 100000]
ans = 0
if x <= 3:
    ans += wins[x - 1]
if y <= 3:
    ans += wins[y - 1]

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

print(ans)

Solution (Python):

import sys
INF = float("inf")


def solve(X: int, Y: int):
    ans = 0
    for x in [X, Y]:
        if x == 3:
            ans += 100000
        elif x == 2:
            ans += 200000
        elif x == 1:
            ans += 300000
    if X == Y == 1:
        ans += 400000
    print(ans)
    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):
import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial, ceil
sys.setrecursionlimit(200000)
input = sys.stdin.readline









N, M, = map(int, input().split())

ans = 0
if N == 1 and M == 1:
    ans += 400000

if N <= 3:
    ans += (4 - N) * 100000

if M <= 3:
    ans += (4 - M) * 100000

print(ans)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
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 list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    x,y = LI()
    r = 0
    if x <= 3:
        r += 4 - x
    if y <= 3:
        r += 4 - y
    if x == 1 and y == 1:
        r += 4

    return r * 10**5


print(main())

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


prize_code = 0;
if X == 1:
    prize_code = 300000;
elif X == 2:
    prize_code = 200000;
elif X == 3:
    prize_code = 100000;


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


prize_both = 0
if X == 1 and Y == 1:
    prize_both = 400000


prize_total = prize_code + prize_device + prize_both
print(prize_total)

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

answer = 0

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

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

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

print(answer)

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

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

ans=money(x)+money(y)
if ans==600000:
    print(1000000)
else:
    print(ans)

Solution (Python):
x = list(map(int, input().split()))
ans = 0
for i in x:
    if i == 1:
        ans += 300000
    elif i == 2:
        ans += 200000
    elif i == 3:
        ans += 100000

if ans == 600000:
    print(1000000)
else:
    print(ans)

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

Solution (Python):
import sys
if sys.platform =='ios':
	sys.stdin=open('input.txt')
	
x,y = map(int,input().split())

if x==1 and y==1:
	print(1000000)
	exit()
	
ans = 0

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

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

print(ans)

Solution (Python):
X, Y = list(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):
x, y = map(int,input().split())
money = 0
def yy(money):
    if y == 1:
        money += 300000
    elif y ==2:
        money += 200000
    elif y==3:
        money += 100000
    else:
        money +=0
    print(money)

if x==1 and y==1:
    print(300000*2+400000)
else:
    if x == 1:
        money += 300000
        yy(money)
    elif x ==2:
        money += 200000
        yy(money)
    elif x ==3:
        money += 100000
        yy(money)
    else:
        money +=0
        yy(money)

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

if x == 1 and y == 1:
  print(1000000)
else:
  print(c+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):
XY= list(map(int,input().split()))
X=XY[0]
Y=XY[1]

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

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

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

print(syokinx+syokiny+syokinz)

Solution (Python):

XY=input().split()
X=int(XY[0])
Y=int(XY[1])
award=0
if X==1 and Y==1:
    award+=400000
for num in [X,Y]:
    if num==3:
        award+=100000
    if num==2:
        award+=200000
    if num==1:
        award+=300000
print(award)

Solution (Python):
import numpy as np


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


n, m = map(int, input().split())

ans = 0
ans += add(n) + add(m)
if n == 1 and m == 1:
    ans += 400000
print(ans)

Solution (Python):
import numpy as np


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


n, m = map(int, input().split())

ans = 0
ans += add(n) + add(m)
if n == 1 and m == 1:
    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())
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 = list(map(int, input().split()))
pX = [0 for _ in range(206)]
pX[1] = 300000
pX[2] = 200000
pX[3] = 100000

point = pX[X] + pX[Y]
if X == 1 and Y == 1:
    point += 400000

print(point)

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

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

if x == 1 and y == 1:
	print(a[x] + a[y] + 400000)
else:
	if x > 3 and y <= 3:
		print(a[y])
	elif x <= 3 and y > 3:
		print(a[x])
	elif x>3 and y >3:
		print(0)
	else:
		print(a[x] + a[y])

Solution (Python):
X,Y=map(int,input().split())
ans=0
if X==1:
    if Y==1:
        ans+=400000
    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())
def shokin(z):
  if z == 1:
    return 300000
  elif z == 2:
    return 200000
  elif z == 3:
    return 100000
  else:
    return 0
v = 0
if x == 1 and y == 1:
  v = 400000
  
print(shokin(x)+shokin(y)+v)

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

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

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

if x > 3:
    x = 0
if y > 3:
    y = 0
if x == 1 and y == 1:
    print(1000000)
else:
    print(100000 * (- x % 4) + 100000 * (- y % 4))

Solution (Python):
x, y = map(int, input().split())
from collections import defaultdict
dic = defaultdict(lambda: 0)
dic[1] = 300000
dic[2] = 200000
dic[3] = 100000
if x == 1 and y == 1:
    print(1000000)
else:
    print(dic[x]+dic[y])

Solution (Python):
def solve(x, y):
    res = 0
    res += max(0, (4-x) * 10**5)
    res += max(0, (4-y) * 10**5)
    res += 4 * 10**5 * int(x==1 and y==1)
    return res

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

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

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

trd = 100000
srd = 200000
onrd = 300000

if X == 3 and 3 < Y:
    print(trd)
elif X == 2 and 3 < Y:
    print(srd)
elif X == 1 and 3 < Y:
    print(onrd)
elif Y == 3 and 3 < X:
    print(trd)
elif Y == 2 and 3 < X:
    print(srd)  
elif Y == 1 and 3 < X:
    print(onrd)
elif X == 3 and Y == 3:
    print((trd)+(trd))
elif X == 3 and Y == 2:
    print((trd) +(srd))
elif X == 3 and Y == 1:
    print((trd)+(onrd))
elif X == 2 and Y == 3:
    print((srd)+(trd))
elif X == 2 and Y == 2:
    print((srd)+(srd))
elif X == 2 and Y == 1:
    print((srd)+(onrd))
elif X == 1 and Y == 3:
    print((onrd)+(trd))
elif X == 1 and Y == 2:
    print((onrd) + (srd))
elif X == 1 and Y == 1:
    print((onrd)+(onrd) + 400000)
else:
    print(0)

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
    else:
        pass

    if y == 1:
        ans += 300000
    elif y == 2:
        ans += 200000
    elif y == 3:
        ans += 100000
    else:
        pass
    
    if x==1 and y==1:
        ans += 400000
    
    print(ans)
    
if __name__ == "__main__":
    main()

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

ans = 0
V = [400000, 300000, 200000, 100000]
if X <= 3:
    ans += V[X]
if Y <= 3:
    ans += V[Y]
if X == Y == 1:
    ans += V[0]

print(ans)

Solution (Python):
rewards = 0

c, d = input().split(" ")

rewards += 300000 if c == "1" else 0
rewards += 200000 if c == "2" else 0
rewards += 100000 if c == "3" else 0

rewards += 300000 if d == "1" else 0
rewards += 200000 if d == "2" else 0
rewards += 100000 if d == "3" else 0

rewards += 400000 if c == "1" and d == "1" else 0
  
print(rewards)

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

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

Solution (Python):



def resolve():
    x,y=(int(i) for i in input().split())
    if x==1 and y==1:
        print(1000000)
        return
    c=0
    if x==1:
        c+=300000
    if x==2:
        c+=200000
    if x==3:
        c+=100000

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




if __name__ == "__main__":
    resolve()

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

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

Solution (Python):
X, Y = map(int, input().split())
ans = 0
for i in [X, Y]:
	if i < 4:
		ans += (4 - i) * 10**5
if ans == 6 * 10**5:
	ans = 10 * 10**5
print(ans)

Solution (Python):
codePlace, implePlace = map(int, input().split(" "))

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

totalPrice = priceDict[codePlace] if codePlace in priceDict.keys() else 0
totalPrice += priceDict[implePlace] if implePlace in priceDict.keys() else 0
totalPrice += 400000 if codePlace == 1 and implePlace == 1 else 0

print(totalPrice)

Solution (Python):
X, Y = map(int, input().split(" " ))
Z=[0,300000, 200000, 100000]
if (X>3): 
    X=0
if (Y>3):
    Y=0
sum = 0
if X==1 and Y==1:
    sum = 400000
print (Z[X]+ Z[Y]+sum)

Solution (Python):


import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def main():
    x, y = map(int, input().split())

    ans = 0
    for rank in [x, y]:
        if rank == 1:
            ans += 300000
        if rank == 2:
            ans += 200000
        if rank == 3:
            ans += 100000
    if x == 1 and y == 1:
        ans += 400000

    print(ans)

    
if __name__ == '__main__':
    main()

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

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

Solution (Python):
n,m = map(int,input().split())
lis = [0]*205
lis[0] = 300000
lis[1] = 200000
lis[2] = 100000
if n == m and n == 1:
  print(1000000)
else:
  print(lis[n-1]+lis[m-1])

Solution (Python):
x,y = map(int ,input().split())
dec = {1:300000, 2:200000, 3:100000}
ans = 0
if x in dec.keys():
	ans += dec[x]
if y in dec.keys():
	ans += dec[y]

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

print(ans)

Solution (Python):
a,b=map(int,input().split())
n=max(0,4-a)*10**5+max(0,4-b)*10**5
print(n+4*10**5 if a==b and a==1 else n)

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

dic = {1:300000, 2:200000, 3:100000}
if x in dic:
  ans = dic[x]
if y in dic:
  ans += dic[y]
  
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():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    x, y = list(map(int, readline().split()))
    if x == 1 and y == 1:
        print(300000 * 2 + 400000)
    else:
        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
        print(t)


if __name__ == '__main__':
    solve()

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

answer = 0

for a in [x, y]:
    if a == 3:
        answer += 100000
    elif a == 2:
        answer += 200000
    elif a == 1:
        answer += 300000
    else:
        pass
if x == 1 and y == 1:
    answer += 400000

print(answer)