philschmid/DMath huggingface dataset:
Category: Correspondence

Question (EN): There are four different numbers A, B, C, and D. Find D from the four-digit addition formula ABCD+ABCD=5472.
Question (KO): 서로 다른 네 수 A, B, C, D가 있습니다. 네 자리 수끼리의 덧셈식 ABCD+ABCD=5472에서 D를 구하시오.

Answer: 6

Solution (Python):
var_a = 'ABCD+ABCD=5472'
var_b = 'D'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
    if v in variable_candi:
        ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
    temp = var_a
    for i, (k, _) in enumerate(ans_dict.items()):
        temp = temp.replace(k, str(c[i]))
    term_list = []
    op_list = []
    temp_c = ''
    for tc in temp:
        if tc not in '+-*/=><().':
            temp_c += tc
        else:
            op_list.append(tc)
            term_list.append(temp_c)
            temp_c = ''
    term_list.append(temp_c)
    new_eq = ''
    for i in range(len(op_list)):
        new_eq += str(int(term_list[i]))+op_list[i]
    new_eq += str(int(term_list[-1]))
    if len(new_eq) == len(var_a):
        new_eq=new_eq.replace('=', '==')
        new_eq=new_eq.replace('>==', '>=')
        new_eq=new_eq.replace('<==', '<=')
        eval_result = False
        try:
            eval_result = eval(new_eq)
        except:
            pass
        if eval_result:
            for i, (k, _) in enumerate(ans_dict.items()):
                ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c))
Category: Correspondence

Question (EN): When 3A+B82=216, what number should go in A?
Question (KO): 3A+B82=216일 때, A에 들어가야 하는 숫자는 무엇인가요?

Answer: 4

Solution (Python):
var_a = '3A+B82=216'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
    if v in variable_candi:
        ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
    temp = var_a
    for i, (k, _) in enumerate(ans_dict.items()):
        temp = temp.replace(k, str(c[i]))
    term_list = []
    op_list = []
    temp_c = ''
    for tc in temp:
        if tc not in '+-*/=><().':
            temp_c += tc
        else:
            op_list.append(tc)
            term_list.append(temp_c)
            temp_c = ''
    term_list.append(temp_c)
    new_eq = ''
    for i in range(len(op_list)):
        new_eq += str(int(term_list[i]))+op_list[i]
    new_eq += str(int(term_list[-1]))
    if len(new_eq) == len(var_a):
        new_eq=new_eq.replace('=', '==')
        new_eq=new_eq.replace('>==', '>=')
        new_eq=new_eq.replace('<==', '<=')
        eval_result = False
        try:
            eval_result = eval(new_eq)
        except:
            pass
        if eval_result:
            for i, (k, _) in enumerate(ans_dict.items()):
                ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c))
Category: Arithmetic calculation

Question (EN): Yujun's group of 8 students took the KTX from Seoul Station to Busan Station, but there were only 5 seats left, so they decided to buy standing tickets and sit in the remaining seats by turns. If the time taken on the KTX is 2 hours and 32 minutes, how many minutes does one person sit on average?
Question (KO): 유준이네 모둠 학생 8명이 KTX를 타고 서울역에서 부산역까지 가는 데 남은 좌석이 5개밖에 없어서 나머지를 입석표로 끊고 돌아가면서 자리에 않기로 하였습니다. KTX를 탄 시간이 2시간 32분이라면, 한 사람이 평균 몇 분씩 앉은 셈입니까?

Answer: 95

Solution (Python):
var_a = 2
var_b = 60
var_c = var_a * var_b
var_d = 32
var_e = var_c + var_d
var_f = 8
var_g = var_e / var_f
var_h = 5
var_i = var_g * var_h
print(int(var_i))
Category: Correspondence

Question (EN): 77 is a number that you need to subtract 35 from a number, but you accidentally added it. How much is it when you calculate correctly?
Question (KO): 77은 어떤 수에서 35를 빼야하는데 실수로 더해서 나온 숫자입니다. 바르게 계산하면 얼마입니까?

Answer: 7

Solution (Python):
var_a = 77
var_b = 35
var_c = var_a - var_b
var_d = 35
var_e = var_c - var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): There are four numbers 10, 11, 12, and 13. What is the largest number divided by the smallest number?
Question (KO): 4개의 수 10, 11, 12, 13이 있습니다. 그 중에서 가장 큰 수를 가장 작은 수로 나눈 값은 얼마입니까?

Answer: 1.3

Solution (Python):
var_a = 10
var_b = 11
var_c = 12
var_d = 13
list_a= []
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 1
list_b=list_a.copy()
list_b.sort()
var_f = list_b[-var_e]
var_g = 1
list_c=list_a.copy()
list_c.sort()
var_h = list_c[var_g-1]
var_i = var_f / var_h
print('{:.2f}'.format(round(var_i+1e-10,2)))
Category: Correspondence

Question (EN): An eight-digit number 757AB384 is said to be divisible by 357. Find the value that can be B.
Question (KO): 한 자리 수 A, B로 여덟 자리 수 757AB384를 만들었을 때 이 수는 357로 나누어 떨어진다고 합니다. B가 될 수 있는 값을 구하시오.

Answer: 5

Solution (Python):
var_a = '757AB384'
ans_dict = dict()
var_a = str(var_a)
list_a = []
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
    if v in variable_candi:
        ans_dict[v] = 0
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
    temp = var_a
    for i, (k, _) in enumerate(ans_dict.items()):
        temp = temp.replace(k, str(c[i]))
    if len(var_a) == len(str(int(temp))):
        new_elem = int(temp)
        list_a.append(new_elem)
var_b = 357
list_b = []
var_b = int(var_b)
for i in list_a:
    i = int(i)
    if i % var_b == 0:
        list_b.append(i)
var_c = '757AB384'
var_d = 'B'
var_c = str(var_c)
var_d = str(var_d)
unk_idx = var_c.index(var_d)
var_e = 0
for elem in list_b:
    elem = str(elem)
    var_e = int(elem[unk_idx])
print(int(var_e))
Category: Arithmetic calculation

Question (EN): There were 32 people on the bus. At the bus stop, 19 people got on and 13 people got off. Find how many people are on the bus right now.
Question (KO): 버스에 32명이 타고 있었습니다. 정류장에서 19명이 타고 13명이 내렸습니다. 지금 버스에 타고 있는 사람은 몇 명인지 구하시오.

Answer: 38

Solution (Python):
var_a = 32
var_b = 19
var_c = var_a + var_b
var_d = 13
var_e = var_c - var_d
print(int(var_e))
Category: Comparison

Question (EN): There are 28 identical cartons of eggs in the supermarket. Each egg carton contains the same number of eggs. If you select an egg that is at 14 from the front, 20 from the back, 3 from the left, and 2 from the right on the carton, count the number of eggs on cartons at that market.
Question (KO): 슈퍼마켓에는 28개의 동일한 계란 상자가 있습니다. 각 계란 상자에는 동일한 수의 계란이 있습니다. 달걀판에서 앞에서 14번째, 뒤에서 20개, 왼쪽에서 3번째, 오른쪽에서 두 번째를 선택했다면, 그 시장의 달걀판에 있는 달걀의 개수를 구하세요.

Answer: 3696

Solution (Python):
var_a = 14
var_b = 20
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 3
var_g = 2
var_h = var_f + var_g
var_i = 1
var_j = var_h - var_i
var_k = var_e * var_j
var_l = 28
var_m = var_k * var_l
print(int(var_m))
Category: Correspondence

Question (EN): The two-digit number 3A is a multiple of 8. What number can be A?
Question (KO): 두 자리 수 3A는 8의 배수이다. A는 몇인가?

Answer: 2

Solution (Python):
var_a = '3A'
ans_dict = dict()
var_a = str(var_a)
list_a = []
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
    if v in variable_candi:
        ans_dict[v] = 0
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
    temp = var_a
    for i, (k, _) in enumerate(ans_dict.items()):
        temp = temp.replace(k, str(c[i]))
    if len(var_a) == len(str(int(temp))):
        new_elem = int(temp)
        list_a.append(new_elem)
var_b = 8
list_b = []
var_b = int(var_b)
for i in list_a:
    i = int(i)
    if i % var_b == 0:
        list_b.append(i)
var_c = '3A'
var_d = 'A'
var_c = str(var_c)
var_d = str(var_d)
unk_idx = var_c.index(var_d)
var_e = 0
for elem in list_b:
    elem = str(elem)
    var_e = int(elem[unk_idx])
print(int(var_e))
Category: Possibility

Question (EN): Using the four numbers 1, 5, 6, and 9 once, find the largest two-digit number with 1 in the ones place.
Question (KO): 4개의 숫자 1, 5, 6, 9를 한 번씩 사용하여 일의 자리 숫자가 1인 가장 큰 두 자리 수를 구하시오.

Answer: 91

Solution (Python):
var_a = 1
var_b = 5
var_c = 6
var_d = 9
list_a= []
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 2
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_e))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_f = 1
var_g = 1
list_c = [] 
var_f = int(var_f)
var_g = int(var_g)
for i in list_b:
    i = int(i)
    if (i//var_f)%10 == var_g:
        list_c.append(i)
var_h = 1
list_d=list_c.copy()
list_d.sort()
var_i = list_d[-var_h]
print(int(var_i))
Category: Arithmetic calculation

Question (EN): 8 boxes of 25 balls each costing 2750 won are loaded on one truck. When there are 18 trucks like this, how much money can you make selling the balls?
Question (KO): 하나에 2750원인 공이 25개씩 8박스가 1 트럭에 실려있다. 이와 같은 트럭이 18대가 있을 때, 공을 팔아서 얻을 수 있는 돈은 얼마입니까?

Answer: 9900000

Solution (Python):
var_a = 18
var_b = 8
var_c = var_a * var_b
var_d = 25
var_e = var_c * var_d
var_f = 2750
var_g = var_e * var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): Yoojung gave 7 candies to her older sister and 6 to her younger sister, and there were 15 left over. How many candies did Yoojung have at first?
Question (KO): 유정이는 가지고 있던 사탕 중에서 언니에게 7개를 주고 동생에게 6개를 주었더니 15개가 남았습니다. 처음에 유정이가 가지고 있던 사탕은 몇 개입니까?

Answer: 28

Solution (Python):
var_a = 15
var_b = 7
var_c = var_a + var_b
var_d = 6
var_e = var_c + var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): When Jian drinks 1/3 liter (L) of water for 5 days and Joowon drinks 1/5 liter (L) for 2 days, find the number of days it takes for them to drink 1 liter (l) of water together.
Question (KO): 지안이는 5일동안 1/3리터(L)의 물을 마시고 주원이는 2일동안 1/5리터(L)의 물을 마십니다. 지안이와 주원이가 함께 1리터(L)를 다 마시는데 며칠이 걸리나요?

Answer: 6

Solution (Python):
var_a = 1
var_b = 0.3333333333333333
var_c = 5
var_d = var_b / var_c
var_e = 0.2
var_f = 2
var_g = var_e / var_f
var_h = var_d + var_g
var_i = var_a / var_h
print(int(eval('{:.2f}'.format(round(var_i+1e-10,2)))))
Category: Arithmetic calculation

Question (EN): A club has 12 more first-year students than non-first-year students. If there are 128 people in the club, how many first-year students are in this club?
Question (KO): 어떤 동아리에 1학년인 학생이 1학년이 아닌 학생보다 12명이 더 많다. 동아리의 인원이 128명일 때, 이 동아리의 1학년은 몇 명인지 구하시오.

Answer: 70

Solution (Python):
var_a = 128
var_b = 12
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
var_f = 12
var_g = var_e + var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): Seungju read 3/10 of the novel yesterday, and 4/10 of it today. If the number of pages of the novel he read yesterday and today is 140, how many pages are there in the novel Seungju read?
Question (KO): 승주가 소설책을 어제는 전체의 3/10을 읽었고, 오늘은 전체의 4/10를 읽었습니다. 어제와 오늘 읽은 소설책의 쪽수가 140쪽이라면 승주가 읽은 소설책의 전체 쪽수는 몇 쪽인지 구해 보시오.

Answer: 200

Solution (Python):
var_a = 140
var_b = 0.3
var_c = 0.4
var_d = var_b + var_c
var_e = var_a / var_d
print(int(var_e))
Category: Geometry

Question (EN): Find the maximum number of diagonals that can be drawn in a rectangle.
Question (KO): 사각형에서 그을 수 있는 대각선 개수의 최대값을 구하시오.

Answer: 2

Solution (Python):
var_a = 4
var_b = 4
var_c = 3
var_d = var_b - var_c
var_e = var_a * var_d
var_f = 2
var_g = var_e / var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): I was trying to install street lights at 32 meters (m) intervals around a circle-shaped park with a circumference of 2 kilometers (km) and 400 meters (m) but installed them at 48 meters (m) intervals. How many fewer streetlights did I install compare to installing them at 32 meters (m) apart?
Question (KO): 둘레가 2 킬로미터(㎞) 400 미터(m)인 원 모양의 공원 둘레에 32 미터(m) 간격으로 가로등을 설치하려다가 48 미터(m) 간격으로 설치하였습니다. 가로등을 32 미터(m) 간격으로 설치하려 할 때보다 몇 개 더 적게 설치하였습니까?

Answer: 25

Solution (Python):
var_a = 2
var_b = 1000
var_c = var_a * var_b
var_d = 400
var_e = var_c + var_d
var_f = 32
var_g = var_e / var_f
var_h = 2
var_i = 1000
var_j = var_h * var_i
var_k = 400
var_l = var_j + var_k
var_m = 48
var_n = var_l / var_m
var_o = var_g - var_n
print(int(var_o))
Category: Arithmetic calculation

Question (EN): You are planning to plant flowers at intervals of 30 meters (m) along a promenade with a perimeter of 1 kilometer (km) and 500 meters (m). If each flower costs 5,000 won, how much does it cost to buy the flowers you need?
Question (KO): 둘레가 1킬로미터(㎞) 500미터(m)인 산책로를 따라 꽃을 30미터(m) 간격으로 심으려고 합니다. 꽃 한 송이의 값이 5000원일 때, 필요한 꽃을 사는 데 드는 비용은 얼마입니까?

Answer: 250000

Solution (Python):
var_a = 1
var_b = 1000
var_c = var_a * var_b
var_d = 500
var_e = var_c + var_d
var_f = 30
var_g = var_e / var_f
var_h = 5000
var_i = var_g * var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): What is the sum of the numbers 72.52, 12.23, and 5.21?
Question (KO): 숫자 72.52, 12.23, 5.21에 대한 총합은 얼마인가요?

Answer: 89.96

Solution (Python):
var_a = 72.52
var_b = 12.23
var_c = var_a + var_b
var_d = 5.21
var_e = var_c + var_d
print('{:.2f}'.format(round(var_e+1e-10,2)))
Category: Geometry

Question (EN): A rectangle has a length of 13 centimeters (cm) and a perimeter of 50 centimeters (cm). Find the horizontal length.
Question (KO): 세로의 길이가 13센티미터(㎝)이고 둘레가 50센티미터(㎝)인 직사각형이 있습니다. 가로의 길이를 구하시오.

Answer: 12

Solution (Python):
var_a = 50
var_b = 2
var_c = var_a / var_b
var_d = 13
var_e = var_c - var_d
print(int(var_e))
Category: Correspondence

Question (EN): You get 58 when 74 is subtracted by a number, and then multiplies it by 15, divides by 5, and adds 16. Find what the number is.
Question (KO): 어떤 수에서 74를 뺀 뒤 15를 곱하여 5로 나눈 뒤 16을 더한 수가 58입니다. 어떤 수를 구하시오.

Answer: 88

Solution (Python):
var_a = 58
var_b = 16
var_c = var_a - var_b
var_d = 5
var_e = var_c * var_d
var_f = 15
var_g = var_e / var_f
var_h = 74
var_i = var_g + var_h
print(int(var_i))
Category: Possibility

Question (EN): How many different two-digit numbers can be formed by using the two numbers 3 and 5 only once?
Question (KO): 두 숫자 3, 5를 한 번씩만 사용하여 만들 수 있는 서로 다른 두 자리 수는 모두 몇 개입니까?

Answer: 2

Solution (Python):
var_a = 3
var_b = 5
list_a= []
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 2
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_c))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_d = len(list_b)
print(int(var_d))
Category: Geometry

Question (EN): A triangle with a base of 7.2 meters (m) and a height of 7 meters (m) and a rectangle with a width of 4 meters (m). If both shapes have the same area, how many meters (m) is the length of the rectangle?
Question (KO): 밑변이 7.2미터(m), 높이가 7미터(m)인 삼각형과 가로가 4미터(m)인 직사각형이 있습니다. 두 도형의 넓이가 같다면 직사각형의 세로는 몇 미터(m)입니까?

Answer: 6.3

Solution (Python):
var_a = 7.2
var_b = 7
var_c = var_a * var_b
var_d = 2
var_e = var_c / var_d
var_f = 4
var_g = var_e / var_f
print('{:.2f}'.format(round(var_g+1e-10,2)))
Category: Geometry

Question (EN): How many diagonal lines can be drawn at a vertex of a figure with 10 sides?
Question (KO): 10개의 변으로 이루어진 도형의 한 꼭짓점에서 그을 수 있는 대각선의 개수는 몇 개입니까?

Answer: 7

Solution (Python):
var_a = 10
var_b = 3
var_c = var_a - var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): Minyoung drank 4/9 liters (L) of milk, and Yuna drank 2/3 liters (L). Find how many times the amount of milk that Minyoung drank was the amount of what Yuna drank.
Question (KO): 민영이가 우유를 4/9리터(L) 마시고, 유나는 2/3리터(L) 마셨습니다. 민영이가 마신 우유의 양은 유나가 마신 우유의 양의 몇 배인지 구하시오.

Answer: 0.67

Solution (Python):
var_a = 0.4444444444444444
var_b = 0.6666666666666666
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2)))
Category: Comparison

Question (EN): Choose the smallest number among 5, 9, 10, 3, and 6.
Question (KO): 5, 9, 10, 3, 6중에서 가장 작은 숫자를 선택하십시오.

Answer: 3

Solution (Python):
var_a = 5
var_b = 9
var_c = 10
var_d = 3
var_e = 6
list_a= []
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 1
list_b=list_a.copy()
list_b.sort()
var_g = list_b[var_f-1]
print(int(var_g))
Category: Correspondence

Question (EN): If A is the number that is -5 less than -3 and B is the number that is -2 greater than +2, find the value of A-B.
Question (KO): -3보다 -5만큼 작은 수를 A, +2보다 -2만큼 큰 수를 B라 할 때, A-B의 값을 구하시오.

Answer: 2

Solution (Python):
var_a = -3
var_b = -5
var_c = var_a - var_b
var_d = 2
var_e = -2
var_f = var_d + var_e
var_g = var_c - var_f
print(int(var_g))
Category: Correspondence

Question (EN): When you mistakenly multiply a number by 8, instead of dividing a number by 8 and adding 7, you get 56. If you calculated correctly, indicate the number to two decimal places.
Question (KO): 어떤 수를 8로 나누고 7을 더해야하는데 잘못하여 8을 곱했더니 56이 되었습니다. 바르게 계산하면 얼마인지 소수점 둘째 자리까지 나타내시오.

Answer: 7.88

Solution (Python):
var_a = 56
var_b = 8
var_c = var_a / var_b
var_d = 8
var_e = var_c / var_d
var_f = 7
var_g = var_e + var_f
print('{:.2f}'.format(round(var_g+1e-10,2)))
Category: Geometry

Question (EN): Find the circumference of a sphere of radius 4 centimeters (cm) in pi.
Question (KO): 반지름 4인 구의 둘레는 몇 파이인지 구하시오.

Answer: 8

Solution (Python):
var_a = 4
var_b = 2
var_c = var_a * var_b
print(int(var_c))
Category: Comparison

Question (EN): It is said that Jihoon is taller than Hyeonseo and Hyeonseo is taller than Hyeonsoo. Who is the tallest of the three?
Question (KO): 지훈이의 키는 현서보다 크고 현서의 키는 현수보다 크다고 한다. 세 명중 가장 키가 큰 사람은 누구인가?

Answer: Jihoon

Solution (Python):
var_a = 'Jihoon'
var_b = 'Hyeonseo'
var_c = 'Hyeonsoo'
list_a= []
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 'Jihoon'
var_e = 'Hyeonseo'
var_f = '>'
var_g = 'Hyeonseo'
var_h = 'Hyeonsoo'
var_i = '>'
list_b= []
if "/" in str(var_i):
    var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_b.append(var_e)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
    if cond_ in ("<", ">", "="):
        operand_right = temp_stack.pop()
        operand_left = temp_stack.pop()
        if cond_ == "=":
            cond_ = "=="
        conditions.append(f"{operand_left} {cond_} {operand_right}")
    else:
        if not cond_.isdigit():
            cond_ = "{" + cond_ + "}"
        temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
    item_name_index_dict = dict(zip(items_name_list, perm))
    formatted_conditions = \
        [condition.format_map(item_name_index_dict) for condition in conditions]
    if all(map(eval, formatted_conditions)):
        break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_j = 1
var_k = list_c[var_j-1]
print(var_k)
Category: Comparison

Question (EN): When I weighed the bag, Jimin's bag weighed 1.2 kilograms (kg) and Seokjin's bag weighed 1350 grams (g). Whose bag is heavier?
Question (KO): 가방의 무게를 재어 보니 지민이 가방은 1.2kg이고, 석진이 가방은 1350g이었습니다. 누구의 가방이 더 무겁습니까?

Answer: Seokjin

Solution (Python):
var_a = 'Jimin'
var_b = 'Seokjin'
list_a= []
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 1.2
var_d = 1000
var_e = var_c * var_d
var_f = 1350
list_b= []
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j)
Category: Possibility

Question (EN): What is the difference between the second largest and the second smallest of all different four-digit numbers where each digit is 0 or a natural number?
Question (KO): 각 자리의 숫자가 0 또는 자연수인 모두 다른 네 자리 수 중 두 번째 큰 수와 두 번째로 작은 수의 차는 얼마입니까?

Answer: 8851

Solution (Python):
var_a = 0
var_b = 9
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 2
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = 2
list_d=list_b.copy()
list_d.sort()
var_h = list_d[var_g-1]
var_i = var_f - var_h
print(int(var_i))
Category: Geometry

Question (EN): Find the number of diagonals that can be drawn from one vertex of the icosikaipentagon.
Question (KO): 이십오각형의 한 꼭짓점에서 그을 수 있는 대각선의 개수를 구하시오.

Answer: 22

Solution (Python):
var_a = 25
var_b = 3
var_c = var_a - var_b
print(int(var_c))
Category: Comparison

Question (EN): You draw 2 number cards. The sum of the numbers written on the two cards is 1443 and the difference is 141. Which of the numbers on the two cards is greater?
Question (KO): 숫자 카드 2개를 뽑았습니다. 두 카드에 적힌 숫자의 합은 1443이고 차는 141입니다. 두 카드에 적힌 숫자 중 큰 수는 얼마입니까?

Answer: 792

Solution (Python):
var_a = 1443
var_b = 141
var_c = var_a + var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e))
Category: Geometry

Question (EN): What is the length in centimeters (cm) of one edge of a cube-shaped box whose volume is 1 cubic centimeter (cm2) less than a cuboid-shaped box whose base is 10 square centimeter (cm2) wide and whose height is 73 centimeters (cm)?
Question (KO): 밑면의 넓이가 10제곱센티미터(㎠)이고 높이가 73센티미터(㎝)인 직육면체 모양의 상자보다 부피가 1세제곱센티미터(㎤) 더 적은 정육면체 모양의 상자의 한 모서리의 길이는 몇 센티미터(㎝)인지 구하세요.

Answer: 9

Solution (Python):
var_a = 10
var_b = 73
var_c = var_a * var_b
var_d = 1
var_e = var_c - var_d
var_f = 0.3333333333333333
var_g = var_e ** var_f
print(int(eval('{:.2f}'.format(round(var_g+1e-10,2)))))
Category: Arithmetic calculation

Question (EN): There are 21 cookies in one bag and there are 4 bags of cookies in one box. If there are 2 cookie boxes, find how many cookies there are.
Question (KO): 한 봉투에 21개의 과자가 들어 있고 한 박스에는 4개의 과자 봉지가 들어 있다. 과자 박스가 2개 있을 때, 과자는 몇 개있는지 구하시오.

Answer: 168

Solution (Python):
var_a = 21
var_b = 4
var_c = var_a * var_b
var_d = 2
var_e = var_c * var_d
print(int(var_e))
Category: Correspondence

Question (EN): When I mistakenly multiplied a number by 14 instead of subtracting 6, I got 70. What is the correct calculation result?
Question (KO): 어떤 수에 6을 빼야 할 것을 잘못하여 14을 곱한 결과는 70이 되었습니다. 바르게 계산한 결과는 얼마인가요?

Answer: -1

Solution (Python):
var_a = 70
var_b = 14
var_c = var_a / var_b
var_d = 6
var_e = var_c - var_d
print(int(var_e))