philschmid/DMath huggingface dataset:
Category: Comparison

Question (EN): Minjeong has 6 marbles and Joohwan has 7. Minjeong has 1 more marble than Sunho, and Jinyoung has 3 fewer marbles than Joohwan. Who has the fewest marbles?
Question (KO): 구슬을 민정이는 6개, 주환이는 7개 가지고 있습니다. 구슬을 민정이는 선호보다 1개 더 많이 가지고 있고, 진영이는 주환이보다 3개 더 적게 가지고 있습니다. 구슬을 가장 적게 가지고 있는 사람은 누구입니까?

Answer: Jinyoung

Solution (Python):
var_a = 'Minjeong'
var_b = 'Joohwan'
var_c = 'Sunho'
var_d = 'Jinyoung'
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 = 6
var_f = 7
var_g = 6
var_h = 1
var_i = var_g - var_h
var_j = 7
var_k = 3
var_l = var_j - var_k
list_b= []
if "/" in str(var_l):
    var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_i):
    var_i = eval(str(var_i))
list_b.append(var_i)
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_m = 1
list_c=list_b.copy()
list_c.sort()
var_n = list_c[var_m-1]
var_o = list_b.index(var_n)+1
var_p = list_a[var_o-1]
print(var_p)
Category: Arithmetic calculation

Question (EN): Each box contains 100 persimmons. How many persimmons are there in all 6 boxes?
Question (KO): 한 상자에는 감이 100개씩 들어있습니다. 6개의 상자 안에 있는 감은 모두 몇 개일까요?

Answer: 600

Solution (Python):
var_a = 100
var_b = 6
var_c = var_a * var_b
print(int(var_c))
Category: Correspondence

Question (EN): It took 13/5 tins of paint to paint one wooden board. Another identical wooden plank is painted and the amount of paint remaining is 9/7 tins. Find how many cans of paint were in the beginning.
Question (KO): 어떤 나무 판자를 하나 색 칠하는데 13/5 통의 물감이 필요했다. 동일한 나무 판자를 하나 더 색칠하고 남은 페인트의 양이 9/7통이다. 처음에 있던 페인트의 양은 몇 통인지 구하시오.

Answer: 6.49

Solution (Python):
var_a = 1.2857142857142858
var_b = 2.6
var_c = var_a + var_b
var_d = 2.6
var_e = var_c + var_d
print('{:.2f}'.format(round(var_e+1e-10,2)))
Category: Correspondence

Question (EN): Yoongi divided 11 by some number and got 2. Next, he wants to multiply some number by 6. What is the value of this result?
Question (KO): 윤기는 11을 어떤 수에서 나누어 2를 얻었습니다. 다음으로 어떤 수에 6을 곱하고자 합니다. 이 결과 값은 얼마입니까?

Answer: 132

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

Question (EN): In art class, Cheol-su and Young-hee brought clay, but Cheol-su's clay was heavier than Young-hee's. When Young-hee removed 7/5 grams (g) from her clay and stuck it to Cheol-su’s clay, Young-hee’s clay was 81/20 grams (g) lighter than Cheol-su’s clay. Find the difference in weight between the clay that Cheol-su and Young-hee brought at first.
Question (KO): 미술시간에 철수와 영희가 찰흙을 가져왔는데 철수의 찰흙이 영희의 찰흙보다 더 무거웠습니다. 영희가 자신의 찰흙에서 7/5그램(g)을 때어내어 철수의 찰흙에 붙혔더니 영희의 찰흙이 철수의 찰흙보다 81/20그램(g) 더 가벼웠습니다. 처음 철수와 영희가 가져온 찰흙의 무게 차이는 얼마였는지 구하시오.

Answer: 6.85

Solution (Python):
var_a = 4.05
var_b = 1.4
var_c = var_a + var_b
var_d = 1.4
var_e = var_c + var_d
print('{:.2f}'.format(round(var_e+1e-10,2)))
Category: Correspondence

Question (EN): You had to add a number to 36 but added 7 to the number by mistake and the result was 70. How much is it if you calculate it correctly?
Question (KO): 36에 어떤 수를 더해야 할 것을 잘못하여 7에 어떤 수를 곱했더니 70이 되었습니다. 바르게 계산하면 얼마인지 구하시오.

Answer: 46

Solution (Python):
var_a = 36
var_b = 70
var_c = 7
var_d = var_b / var_c
var_e = var_a + var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): There are 7 boxes with each box containing 9 bottles of milk. If you eat 7 of these bottles of milk and divide the remaining milk equally among 8 people, Find how many bottles of milk you should give per person.
Question (KO): 우유가 9개씩 들어있는 박스가 7개 있다. 이 중 7개의 우유는 먹고, 남은 우유를 8명에게 똑같이 나누려면 몇 개 씩 주면 되는가?

Answer: 7

Solution (Python):
var_a = 9
var_b = 7
var_c = var_a * var_b
var_d = 7
var_e = var_c - var_d
var_f = 8
var_g = var_e / var_f
print(int(var_g))
Category: Correspondence

Question (EN): When 14A+B73=418, what number should be in A, where 14A and B73 are three-digit numbers?
Question (KO): 14A+B73=418일 때, A에 들어가야 하는 숫자는 무엇인가요?

Answer: 5

Solution (Python):
var_a = '14A+B73=418'
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: Comparison

Question (EN): Thirty people voted in the Class Representative Election. A got 12 votes, 3 votes for B, and C got 15 votes. The candidate with the most votes is said to be the class president. Write down who is the candidate who won the election.
Question (KO): 학급 임원 선거에서 30명이 투표에 참여하였습니다. 가는 12표, 나는 3표, 다는 15표를 받았습니다. 득표율이 가장 높은 후보가 회장이 된다고 합니다. 회장에 당선된 후보는 누구인지 써 보세요.

Answer: C

Solution (Python):
var_a = 'A'
var_b = 'B'
var_c = 'C'
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 = 12
var_e = 3
var_f = 15
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)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
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: Comparison

Question (EN): There are three numbers A, B, and C. A is 7 greater than 32. B is a number of 3 groups of 10 and 3 units. C is 9 less than 50. Which number is the smallest?
Question (KO): 세 수 A, B, C가 있습니다. A는 32보다 7 큰 수입니다. B는 10개씩 3묶음과 낱개 3개인 수입니다. C는 50보다 9 작은 수입니다. 가장 작은 수는 어느 것입니까?

Answer: B

Solution (Python):
var_a = 'A'
var_b = 'B'
var_c = 'C'
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 = 32
var_e = 7
var_f = var_d + var_e
var_g = 3
var_h = 10
var_i = var_g * var_h
var_j = 3
var_k = var_i + var_j
var_l = 50
var_m = 9
var_n = var_l - var_m
list_b= []
if "/" in str(var_n):
    var_n = eval(str(var_n))
list_b.append(var_n)
if "/" in str(var_k):
    var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
var_o = 1
list_c=list_b.copy()
list_c.sort()
var_p = list_c[var_o-1]
var_q = list_b.index(var_p)+1
var_r = list_a[var_q-1]
print(var_r)
Category: Geometry

Question (EN): If all the angles of a figure with eight angles are in the same size and the perimeter of the figure is 23.6 centimeters (cm), how long is one side of the figure in centimeters (cm)?
Question (KO): 여덟 개의 각으로 이루어진 도형의 모든 각의 크기가 같고, 이 도형의 둘레가 23.6센티미터(㎝)라면 한 변의 길이는 몇 센티미터(㎝)일지 구하시오.

Answer: 2.95

Solution (Python):
var_a = 23.6
var_b = 8
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2)))
Category: Arithmetic calculation

Question (EN): There were 38 people in the bus. If 9 more people stepped off at the stop than those who got on at the stop, how many people are on the bus now?
Question (KO): 버스 안에 사람이 38명 있었습니다. 이번 정류장에서 내린 사람이 탄 사람보다 9명 많았다면 지금 버스 안에 있는 사람은 몇 명입니까?

Answer: 29

Solution (Python):
var_a = 38
var_b = 9
var_c = var_a - var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): A basket full of persimmons of the same weight weighed 62 kilograms (kg). After leaving only half of the persimmons, I weighed it with the basket and it was 34 kilograms (kg). How many kilograms (kg) does the basket alone weigh?
Question (KO): 무게가 같은 감이 가득 담긴 바구니의 무게가 62킬로그램(㎏)이었다. 절반의 감만 남긴 후 바구니와 함께 무게를 재어보니 34킬로그램(㎏)이 되었다. 바구니만의 무게는 몇 킬로그램(㎏)인가?

Answer: 6

Solution (Python):
var_a = 62
var_b = 62
var_c = 34
var_d = var_b - var_c
var_e = 2
var_f = var_d * var_e
var_g = var_a - var_f
print(int(var_g))
Category: Possibility

Question (EN): 16 teams are having a soccer game. The losing team is eliminated and the winning team advances to the next match. How many matches are played in total when the last winning team wins the game?
Question (KO): 16개의 팀이 축구 경기를 합니다. 두 팀중 패배한 팀은 탈락하고 승리한 팀은 다음 경기를 진행합니다. 마지막에 승리한 팀이 우승을 할때 경기는 총 몇번 이루어집니까?

Answer: 15

Solution (Python):
var_a = 16
var_b = 1
var_c = var_a - var_b
print(int(var_c))
Category: Correspondence

Question (EN): How many three-digit numbers are there where the sum of all the digits is 12?
Question (KO): 모든 자리 수의 합이 12인 세 자리 수는 모두 몇 개입니까?

Answer: 66

Solution (Python):
var_a = 100
var_b = 1000
var_c = 1
var_d = var_b - var_c
var_e = 1
list_a = [i for i in range(var_a, var_d + 1, var_e)]
list_b=[]
for i in list_a:
    var_f = 0
    i = int(i)
    while i//10 > 0:
        var_f = var_f + i%10
        i = i//10
    var_f = var_f + i%10
    list_b.append(var_f)
var_g = 12
list_c = []
for i in list_b:
    if i >= var_g:
        list_c.append(i)
var_h = 12
list_d = []
for i in list_c:
    if i <= var_h:
        list_d.append(i)
var_i = len(list_d)
print(int(var_i))
Category: Comparison

Question (EN): Students line up in five lines every time they jump rope, with an equal number of students in each line. Hoseok is always 4th from the left and 9th from the right in a row. How many students are there in all?
Question (KO): 학생들은 줄넘기를 할 때마다 5줄로 서고, 각 줄마다 학생 수가 같습니다. 호석이는 항상 어느 한 줄의 왼쪽에서 4번째, 오른쪽에서 9번째에 섭니다. 학생들은 모두 몇 명입니까?

Answer: 60

Solution (Python):
var_a = 5
var_b = 4
var_c = 9
var_d = var_b + var_c
var_e = 1
var_f = var_d - var_e
var_g = var_a * var_f
print(int(var_g))
Category: Correspondence

Question (EN): When 11 is divided by 3, the remainder is 2 and the quotient is A. Find the value of A at this time.
Question (KO): 11을 3으로 나누면 나머지가 2, 몫이 A가 됩니다. 이 때 A의 값을 구하시오.

Answer: 3

Solution (Python):
var_a = 11
var_b = 2
var_c = var_a - var_b
var_d = 3
var_e = var_c / var_d
print(int(var_e))
Category: Comparison

Question (EN): There are two numbers, A and B. A is 33 greater than 49. B is 9 multiplied by 9. Which number is greater?
Question (KO): 두 수 A, B가 있습니다. A는 49보다 33 큰 수입니다. B는 9를 9배 한 수입니다. 더 큰 수는 어느 것입니까?

Answer: A

Solution (Python):
var_a = 'A'
var_b = 'B'
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 = 49
var_d = 33
var_e = var_c + var_d
var_f = 9
var_g = 9
var_h = var_f * var_g
list_b= []
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[-var_i]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l)
Category: Arithmetic calculation

Question (EN): Jungwoo takes 20 seconds to run 150 meters (m). If Jungwoo runs for 1 minute, find how many meters (m) he can run.
Question (KO): 정우는 150미터(m)를 달리는데 20초가 걸립니다. 정우가 1분동안 달린다면 갈 수 있는 거리는 몇 미터(m)인지 구하세요.

Answer: 450

Solution (Python):
var_a = 1
var_b = 60
var_c = var_a * var_b
var_d = 20
var_e = var_c / var_d
var_f = 150
var_g = var_e * var_f
print(int(var_g))
Category: Correspondence

Question (EN): The three digit number 3AB is a multiple of 3. How many possible B's are there?
Question (KO): 세 자리 수 3AB는 3의 배수이다. 가능한 B는 모두 몇 가지인가?

Answer: 10

Solution (Python):
var_a = '3AB'
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 = 3
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 = '3AB'
var_d = 'B'
var_c = str(var_c)
var_d = str(var_d)
unk_idx = var_c.index(var_d)
list_c = []
for elem in list_b:
    elem = str(elem)
    list_c.append(int(elem[unk_idx]))
list_c = list(set(list_c))
var_e = len(list_c)
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Jungkook solved 15 math problems. He got 8 questions worth 2 points and 2 questions worth 1 point correct, and he got the rest wrong, so no points were awarded for that. How many points did Jungkook get?
Question (KO): 정국이가 수학 문제를 15문제 풀었습니다. 2점짜리 8문제와 1점짜리 2문제를 맞히고, 나머지 문제는 틀려서 점수를 얻지 못했습니다. 정국이가 얻은 점수는 몇 점입니까?

Answer: 18

Solution (Python):
var_a = 2
var_b = 8
var_c = var_a * var_b
var_d = 1
var_e = 2
var_f = var_d * var_e
var_g = var_c + var_f
print(int(var_g))
Category: Possibility

Question (EN): Two of the numbers 3, 5, and 9 were drawn and used only once to create the largest two-digit number. Find the number 27 less than the two digit number you created.
Question (KO): 3, 5, 9의 숫자 중에서 2장을 뽑아 한 번씩만 사용하여 가장 큰 두 자리 수를 만들었습니다. 만든 두 자리 수보다 27 작은 수를 구하시오.

Answer: 68

Solution (Python):
var_a = 3
var_b = 5
var_c = 9
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 = 2
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 = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = 27
var_h = var_f - var_g
print(int(var_h))
Category: Arithmetic calculation

Question (EN): Find what the sum of the natural numbers is in the range of 6 and 21.
Question (KO): 다음 범위내의 자연수의 합을 구하시오. 6과 21.

Answer: 216

Solution (Python):
var_a = 6
var_b = 21
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
list_a = [float(i) for i in list_a]
var_d = sum(list_a)
print(int(var_d))
Category: Comparison

Question (EN): Hyunji walked 3.97 kilometers (km), and Gayoung walked 4028 meters (m). Who has walked more distances?
Question (KO): 현지는 3.97킬로미터(㎞)를 걸었고, 가영이는 4028미터(m)를 걸었습니다. 더 많은 거리를 걸은 사람은 누구입니까?

Answer: Gayoung

Solution (Python):
var_a = 'Hyunji'
var_b = 'Gayoung'
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 = 3.97
var_d = 4028
var_e = 1000
var_f = var_d / var_e
list_b= []
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_b.append(var_c)
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: Arithmetic calculation

Question (EN): Hoseok did 8 workouts on Monday, 5 on Tuesday, 12 on Wednesday, 17 on Thursday, and 10 on Friday. Find the number of times he worked out on Thursday minus the number of times he worked out on Tuesday.
Question (KO): 호석이는 (가) 운동을 월요일에 8번, 화요일에 5번, 수요일에 12번, 목요일에 17번, 금요일에 10번 했습니다. 목요일에 운동한 횟수에서 화요일에 운동한 횟수를 뺀 값을 구하시오.

Answer: 12

Solution (Python):
var_a = 17
var_b = 5
var_c = var_a - var_b
print(int(var_c))
Category: Comparison

Question (EN): Yuna, Minyoung, and Yoojeong are drinking milk. Yoojeong drank the most milk, and Minyoung drank less milk than Yuna. Who drank the least milk?
Question (KO): 유나, 민영, 유정이가 우유를 마시고 있습니다. 유정이가 가장 많은 우유를 마셨고, 민영이는 유나보다 적은 우유를 마셨습니다. 가장 적은 우유를 마신 사람은 누구일까요?

Answer: Minyoung

Solution (Python):
var_a = 'Yuna'
var_b = 'Minyoung'
var_c = 'Yoojeong'
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 = 'Yoojeong'
var_e = 'Minyoung'
var_f = '>'
var_g = 'Yoojeong'
var_h = 'Yuna'
var_i = '>'
var_j = 'Minyoung'
var_k = 'Yuna'
var_l = '<'
list_b= []
if "/" in str(var_l):
    var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
    var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
    var_j = eval(str(var_j))
list_b.append(var_j)
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_m = len(list_c)
var_n = list_c[var_m-1]
print(var_n)
Category: Correspondence

Question (EN): A number has to be multiplied by 15, but I accidentally multiplied by 51 and it became 244.8. Find the correct value.
Question (KO): 어떤 수에 15 를 곱해야 할 것을 잘못하여 51 을 곱하였더니 244.8 이 되었습니다. 바르게 계산한 값을 구하시오.

Answer: 72

Solution (Python):
var_a = 244.8
var_b = 51
var_c = var_a / var_b
var_d = 15
var_e = var_c * var_d
print(int(var_e))
Category: Comparison

Question (EN): It is said that Mother used 5 liters (L) of water to wash rice, and Father used 4900 milliliters (㎖) of water. Who used more water?
Question (KO): 어머니는 쌀을 씻는 데 5리터(L) 의 물을 사용하고, 아버지는 4900밀리리터(㎖) 의 물을 사용했다고 합니다. 물을 더 많이 사용한 사람은 누구입니까?

Answer: Mother

Solution (Python):
var_a = 'Mother'
var_b = 'Father'
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 = 5
var_d = 1000
var_e = var_c * var_d
var_f = 4900
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: Arithmetic calculation

Question (EN): Hyejin only has 100 won coins in her piggy bank. If you put 24 more 100 wons in the piggy bank, it will be 4 times the current amount. How many coins is currently in Hyejin's piggy bank?
Question (KO): 혜진이는 저금통에 100원짜리만 모으고 있습니다. 저금통에 100원짜리를 24개 더 넣으면 현재 들어있는 금액의 4배가 됩니다. 혜진이의 저금통에는 현재 얼마가 있을까요?

Answer: 8

Solution (Python):
var_a = 24
var_b = 4
var_c = 1
var_d = var_b - var_c
var_e = var_a / var_d
print(int(var_e))
Category: Comparison

Question (EN): There is one box whose base looks like a square. To investigate whether the bottom of the box is actually square, the horizontal length and vertical length were measured, and it turned out that the box was not square as it measured 1.618 meters (m) wide and 162.3 centimeters (cm) long. Which is longer, the horizontal lenght or the vertical length?
Question (KO): 밑면이 정사각형처럼 보이는 상자가 하나 있습니다. 이 상자의 밑면이 실제로도 정사각형인지 조사하기 위해 가로와 세로의 길이를 재본 결과 가로의 길이는 1.618미터(m), 세로의 길이는 162.3센티미터(㎝)로 정사각형이 아닌 것으로 밝혀졌습니다. 이 상자의 가로와 세로 중 길이가 더 긴 것은 어느 쪽입니까?

Answer: vertical

Solution (Python):
var_a = 'horizontal'
var_b = 'vertical'
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.618
var_d = 100
var_e = var_c * var_d
var_f = 162.3
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: Comparison

Question (EN): Find the smallest number greater than 0.4 from 0.8, 1/2, and 0.3.
Question (KO): 0.8, 1/2, 0.3에서 0.4보다 큰 수 중 가장 작은 수는?

Answer: 0.5

Solution (Python):
var_a = 0.8
var_b = 0.5
var_c = 0.3
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 = 0.4
list_b = []
for i in list_a:
    if i > var_d:
        list_b.append(i)
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[var_e-1]
print('{:.2f}'.format(round(var_f+1e-10,2)))
Category: Comparison

Question (EN): Yoongi had 4 apples, Jungkook had 6 apples, but he ate 3. If Yuna has 5 apples, who has the fewest?
Question (KO): 윤기가 가진 사과가 4개, 정국이는 6개의 사과의 사과를 가지고 있었지만 3개를 먹었습니다. 유나가 가진 사과가 5개라면 누가 가장 적은 사과를 가지고 있나요?

Answer: Jungkook

Solution (Python):
var_a = 'Yoongi'
var_b = 'Jungkook'
var_c = 'Yuna'
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 = 4
var_e = 6
var_f = 3
var_g = var_e - var_f
var_h = 5
list_b= []
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_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
var_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[var_i-1]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l)
Category: Geometry

Question (EN): How many faces are in a regular dodecahedron?
Question (KO): 정십이면체의 면의 개수는?

Answer: 12

Solution (Python):
var_a = 12
print(int(var_a))