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.



Sample input:
1 1


Sample output:
1000000

Submission status: Accepted

Solution code:
X, Y = map(int,input().split())
AnswerX = 0
AnswerY = 0
AnswerW = 0
if X*Y == 1:
  AnswerW = 400000
if X == 1:
  AnswerX= 300000
elif X==2:
  AnswerX = 200000
elif X==3:
  AnswerX = 100000
if Y == 1:
  AnswerY= 300000
elif Y==2:
  AnswerY = 200000
elif Y==3:
  AnswerY = 100000
  
Answer = AnswerX + AnswerY + AnswerW
print(Answer)

Submission status: Accepted

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

prize=0

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

print(prize)

Submission status: Accepted

Solution code:
from fractions import gcd
from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
import sys
from bisect import *
import itertools
import copy
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# assign prize of the 3 places
first = 300000
second = 200000
third = 100000
extra = 400000
no = 0
# get two integers as the competitions
X, Y = map(int, input().split())
# output
if X == 1 and Y == 1:
    {
        print(first + first + extra)
    }
elif X == 1 and Y == 2:
    {
        print(first + second)
    }
elif X == 1 and Y == 3:
    {
        print(first + third)
    }
elif X == 2 and Y == 1:
    {
        print(second + first)
    }
elif X == 2 and Y == 2:
    {
        print(second + second)
    }
elif X == 2 and Y == 3:
    {
        print(second + third)
    }
elif X == 3 and Y == 1:
    {
        print(third + first)
    }
elif X == 3 and Y == 2:
    {
        print(third + second)
    }
elif X == 3 and Y == 3:
    {
        print(third + third)
    }
elif X == 1 and Y > 3:
    {
        print(first + no)
    }
elif X == 2 and Y > 3:
    {
        print(second + no)
    }
elif X == 3 and Y > 3:
    {
        print(third + no)
    }
elif X > 3 and Y == 3:
    {
        print(no + third)
    }
elif X > 3 and Y == 2:
    {
        print(no + second)
    }
elif X > 3 and Y == 1:
    {
        print(no + first)
    }
else:
    {
        print(0 )
    }

Submission status: Accepted

Solution code:
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:
  print(1000000)
else:
  print(sum)

Submission status: Accepted

Solution code:
#A
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
x,y = map(int, stdin.readline().rstrip().split())

if x == 1 and y == 1:
    print(1000000)
    exit()
else:
    pass
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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
d = {
    4: 0,
    3: 100000,
    2: 200000,
    1: 300000
}
ans = d[min(x, 4)] + d[min(y, 4)]
if x * y == 1:
    ans += 400000
print(ans)

Submission status: Accepted

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

if y == 1:
    point += 300000
elif y == 2:
    point += 200000
elif y == 3:
    point += 100000
else:
    pass

print(point)

Submission status: Accepted

Solution code:
def A():
    temp = [int(i) for i in input().split()]
    ans = 0
    for n in temp:
        if n<4:
            ans += (4-n)*100000
    if temp[0] == 1 and temp[1] == 1:
        ans += 400000
    print(ans)

A()

Submission status: Accepted

Solution code:
def main():
    X,Y=map(int,input().split())
    if X==1 and Y==1:
        print('1000000')
    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):
        print('200000')
    elif (X==3 and Y>3) or (X>3 and Y==3):
        print('100000')
    else:
        print('0')
        

        
if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
list = [int(i) for i in input().split()]
money = 0

for i in range(len(list)):
    if list[i] == 1:
        money += 300000
    elif list[i] == 2:
        money += 200000
    elif list[i] == 3:
        money += 100000

if list[0] * list[1] == 1:
    money += 400000

print(money)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
first = 300000
second = 200000 
third = 100000
if ((X==1 and ((X<205 and X>=1) and (Y>=1 and Y<205)) and Y==1)):
    print(first+first+400000)
elif (X==2 and Y==2):
    print(second+second)
elif (X==3 and Y==3):
    print(third+third)
elif ((X==1 and Y==2) or(X==2 and Y==1)):
    print(first+second)
elif ((X==1 and Y==3) or(X==3 and Y==1) ):
     print(first+third)
elif ((X==2 and Y==3) or(X==3 and Y==2) ):
    print(second+third)
elif ((X==3 and Y>3) or(X>3and Y==3) ):
    print(third)
elif ((X==2 and Y>3) or(X>3 and Y==2) ):
    print(second)
elif ((X==1 and Y>3) or(X>3 and Y==1) ):
    print(first)
else:
    print(0)

Submission status: Accepted

Solution code:
s = input().split()
m = 0
n = 0
if s[0] == '1':
  m += 300000
  n += 1
elif s[0] == '2':
    m += 200000
elif s[0] == '3':
    m += 100000
if s[1] == '1':
  m += 300000
  n += 1
elif s[1] == '2':
    m += 200000
elif s[1] == '3':
    m += 100000
if n == 2:
  m += 400000
print(m)

Submission status: Accepted

Solution code:

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

    elif b == 1:
        money += 700000

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

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

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

print(money)

Submission status: Accepted

Solution code:
x , y = map(int,input().split())
n = max(x , y)
if x == y == 1:
    print(1000000)
elif min(x , y) == 1:
    if n == 2:
        print(500000)
    elif n == 3:
        print(400000)
    else:
        print(300000)
elif min(x , y) == 2:
    if n == 2:
        print(400000)
    elif n == 3:
        print(300000)
    else:
        print(200000)
elif min(x , y) == 3:
    if n == 3:
        print(200000)
    else:
        print(100000)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# assign prize of the 3 places
first = 300000
second = 200000
third = 100000
extra = 400000
no = 0
# get two integers as the competitions
X, Y = map(int, input().split())
# output
if X == 1 and Y == 1:
    {
        print(first + first + extra)
    }
elif X == 1 and Y == 2:
    {
        print(first + second)
    }
elif X == 1 and Y == 3:
    {
        print(first + third)
    }
elif X == 2 and Y == 1:
    {
        print(second + first)
    }
elif X == 2 and Y == 2:
    {
        print(second + second)
    }
elif X == 2 and Y == 3:
    {
        print(second + third)
    }
elif X == 3 and Y == 1:
    {
        print(third + first)
    }
elif X == 3 and Y == 2:
    {
        print(third + second)
    }
elif X == 3 and Y == 3:
    {
        print(third + third)
    }
elif X == 1 and Y > 3:
    {
        print(first + no)
    }
elif X == 2 and Y > 3:
    {
        print(second + no)
    }
elif X == 3 and Y > 3:
    {
        print(third + no)
    }
elif X > 3 and Y == 3:
    {
        print(no + third)
    }
elif X > 3 and Y == 2:
    {
        print(no + second)
    }
elif X > 3 and Y == 1:
    {
        print(no + first)
    }
else:
    {
        print(0 + no)
    }

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

answer = 0
for t in [x,y]:
    if t == 1:
        answer += 3
    elif t == 2:
        answer += 2
    elif t == 3:
        answer += 1
if x == y == 1:
    answer = 10

answer *= (10**5)
print(answer)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
X, Y = map(int, input().split())

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

ans = 0
ans += get_money(X)
ans += get_money(Y)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ranks = list(map(int,input().split()))
x, y = ranks[0], ranks[1]
total = 0

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

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

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

print(total)

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
Z = int(400000)

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 + Y == 2:
	print(A + B + Z)
else:
  	print(A + B)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
r = 0

if x == 1 or y == 1:
	r += 300000
if x == 2 or y == 2:
	r += 200000
if x == 3 or y == 3:
	r += 100000	
if x == 1 and y == 1:
	r = 1000000
if x == 2 and y == 2:
	r = 400000
if x == 3 and y == 3:
	r = 200000

print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y=(int(x) for x in input().split())
b = 0
if x == 1:
    b += 300000
elif x == 2:
    b += 200000
elif x == 3:
    b += 100000
else:
    b += 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:
    b += 400000

print(b)

Submission status: Accepted

Solution code:
X, Y = input().split()
X = int(X)
Y = int(Y)
if X >= 4 and Y >= 4:
    print(0)
elif X == 1 and Y == 1:
    print(1000000)
elif X <= 3:
    if Y >= 4:
        print(400000-X*100000)
    else:
        print((400000-X*100000)+(400000-Y*100000))
else:
    print(400000-Y*100000)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

result = 0

if X == 1:
    result = 300000
elif X == 2:
    result = 200000
elif X == 3:
    result = 100000

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

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

print(result)

Submission status: Accepted

Solution code:
# -*- Coding: utf-8 -*-
import itertools#これは色々使える組み込み関数みたいなやつ
import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
N = 1
x, y = [0]*N, [0]*N#N個の空のリストを作成
l = list(range(N))#範囲がNのリストを作成する
sum=0
#print(x[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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = raw_input().split()
[X, Y] = s
o = [0,0]
o[0] = int(X)
o[1] = int(Y)
#print A, B

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y=input().split()
X=int(X)
Y=int(Y)
prize = [0]*206
prize[1:4] = [300000,200000,100000]
#print(prize)
if X==1 and Y==1:
    ans=1000000
else:
    ans=prize[X]+prize[Y]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 順位を入力として、賞金を返す
def prize(r):
    return int(r<=3)*(4-r)*100000    

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

# もし両部門で1位の場合、40,0000円上乗せ
if X==1 and Y==1:
    print(prize(X)+prize(Y)+400000)
else: # それ以外の場合
    print(prize(X)+prize(Y))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
# A - DDCC Finals
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)