philschmid/DMath huggingface dataset:
Category: Arithmetic calculation

Question (EN): Yoongi had 28 flowers. Among them, 7 were given to Eunji and 9 were given to Yuna. How many flowers are left for Yoongi?
Question (KO): 윤기는 꽃을 28송이 가지고 있었습니다. 그중에서 7송이는 은지에게 주고, 9송이는 유나에게 주었습니다. 윤기에게 남은 꽃은 몇 송이입니까?

Answer: 12

Solution (Python):
var_a = 28
var_b = 7
var_c = var_a - var_b
var_d = 9
var_e = var_c - var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Minsu runs 120 meters (m). Minsu says that he runs 4 meters (m) per second. If Minsu is 20 meters (m) away from the finish line, find how many seconds have elapsed since he ran.
Question (KO): 민수가 120미터(m)를 달린다. 민수는 초 당 4미터(m)를 달린다고 한다. 민수가 결승점에서 20미터(m) 떨어져 있다면 달린지 몇 초가 지났는지 구하시오.

Answer: 25

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

Question (EN): There are 6 numbers 1, 4, 25, 16, 22, and 14. What is the 2nd largest number?
Question (KO): 6개의 숫자 1, 4, 25, 16, 22, 14가 있습니다. 2번째로 큰 숫자는 무엇입니까?

Answer: 22

Solution (Python):
var_a = 1
var_b = 4
var_c = 25
var_d = 16
var_e = 22
var_f = 14
list_a= []
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_a.append(var_f)
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_g = 2
list_b=list_a.copy()
list_b.sort()
var_h = list_b[-var_g]
print(int(var_h))
Category: Arithmetic calculation

Question (EN): Find the average of odd one-digit numbers.
Question (KO): 한 자리들 수 중 홀수들의 평균을 구하시오.

Answer: 5

Solution (Python):
var_a = 1
var_b = 9
list_a = []
if var_a%2==0:
    for i in range(var_a+1, var_b+1, 2):
        list_a.append(i)
else:
    for i in range(var_a, var_b+1, 2):
        list_a.append(i)
list_a = [float(i) for i in list_a]
var_c = sum(list_a)/len(list_a)
print(int(var_c))
Category: Possibility

Question (EN): You want to make a four-digit number using the number cards 1, 2, and 3. Assuming you can use the same number card multiple times, find the sum of all the numbers that are made.
Question (KO): 숫자 카드 1, 2, 3을 사용하여 네 자리 수를 만들려고 한다. 같은 숫자 카드를 여러 번 사용해도 된다고 할 때, 만들어지는 모든 수들의 합을 구하여라.

Answer: 179982

Solution (Python):
var_a = 1
var_b = 2
var_c = 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 = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=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]
list_b = [float(i) for i in list_b]
var_e = sum(list_b)
print(int(var_e))
Category: Comparison

Question (EN): Youngbin and Sujeong had a race to pick up coins faster. If it took Yeongbin 16.23 seconds and Sujeong 16.19 seconds to pick up all the coins, who wins?
Question (KO): [OP_LIST_SOL] 영빈 수정 [OP_LIST_EOL] [OP_LIST_SOL] 100 16.23 [OP_DIV] 100 16.19 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]

Answer: Sujeong

Solution (Python):
var_a = 'Youngbin'
var_b = 'Sujeong'
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 = 16.23
var_d = 16.19
list_b= []
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[var_e-1]
var_g = list_b.index(var_f)+1
var_h = list_a[var_g-1]
print(var_h)
Category: Arithmetic calculation

Question (EN): Jungkook and Seokjin each had 12 pencils. After using a few of them, Jungkook gave 4 of the remaining pencils to Seokjin, and the number of pencils they both had became 7 each. How many pencils did Seokjin use?
Question (KO): 정국이와 석진이는 연필을 각각 12자루씩 가지고 있었습니다. 그중에서 몇 자루씩 사용하고, 정국이는 남은 연필 중 4자루를 석진이에게 주었더니 두 사람이 가지고 있는 연필의 수는 각각 7자루가 되었습니다. 석진이가 사용한 연필은 몇 자루입니까?

Answer: 9

Solution (Python):
var_a = 12
var_b = 7
var_c = var_a - var_b
var_d = 4
var_e = var_c + var_d
print(int(var_e))
Category: Comparison

Question (EN): Yerim drank 0.65 kg (kg) of milk, and Chanwoo drank 0.645 kg (kg) of milk. Who drank more milk?
Question (KO): 예림이는 0.65킬로그램(㎏)의 우유를 마셨고, 찬우는 0.645킬로그램(㎏)의 우유를 마셨습니다. 우유를 더 많이 마신 사람은 누구일까요?

Answer: Yerim

Solution (Python):
var_a = 'Yerim'
var_b = 'Chanwoo'
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 = 0.65
var_d = 0.645
list_b= []
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = list_b.index(var_f)+1
var_h = list_a[var_g-1]
print(var_h)
Category: Arithmetic calculation

Question (EN): There are 75, 91, 83, and 72. What is the sum of the largest number and the second smallest number?
Question (KO): 75, 91, 83, 72가 있습니다. 가장 큰 수와 2번째로 작은 수의 합은 얼마입니까?

Answer: 166

Solution (Python):
var_a = 75
var_b = 91
var_c = 83
var_d = 72
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 = 2
list_c=list_a.copy()
list_c.sort()
var_h = list_c[var_g-1]
var_i = var_f + var_h
print(int(var_i))
Category: Correspondence

Question (EN): I should have subtracted a number from 713, but instead mistakenly added 713 and got 928 as a result. Find out how much it is if you had calculated it correctly.
Question (KO): 713에서 어떤 수를 빼야 할 것을 잘못하여 더했더니 928이 되었습니다. 바르게 계산하면 얼마인지 구해 보시오.

Answer: 498

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

Question (EN): Consider there are four numbers of 10, 11, 12, and 13. What is the answer for the largest number minus the second largest number?
Question (KO): 4개의 수 10, 11, 12, 13이 있습니다. 그 중에서 가장 큰 수와 2번째로 큰 수의 차는 얼마입니까?

Answer: 1

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 = 2
list_c=list_a.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = var_f - var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): The fish shop sold 3/5 of the fish caught at dawn in the morning. In the afternoon, all 180 fish, including the fish left from the morning and the newly caught fish, were sold. If the number of fish sold in the morning is not different from the number of fish sold in the afternoon, how many fish were caught at dawn?
Question (KO): 생선가게에서 새벽에 잡은 생선을 오전에 3/5만큼 팔았습니다. 오후에는 오전에 팔고 남은 생선과 새로 잡은 생선을 합한 180마리를 전부 팔았습니다. 오전에 판 생선의 수와 오후에 판 생선의 수가 다르지 않다면 새벽에 잡은 생선은 몇 마리입니까?

Answer: 300

Solution (Python):
var_a = 180
var_b = 0.6
var_c = var_a / var_b
print(int(var_c))
Category: Correspondence

Question (EN): There are 52 tropical fish and koi in the tank. If there are 37 koi, how many tropical fish are there?
Question (KO): 수조에 열대어와 잉어가 모두 합쳐 52마리가 있습니다. 잉어가 37마리 있다면, 열대어는 몇 마리 있습니까?

Answer: 15

Solution (Python):
var_a = 52
var_b = 37
var_c = var_a - var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): There are 58 slices of bread. The slices of bread are 18 more than bottles of milk and 27 less than cookies. How many slices of bread, bottles of milk, and cookies are there in total?
Question (KO): 빵이 58개 있습니다. 빵은 우유보다 18개 더 많고, 과자보다 27개 더 적습니다. 빵, 우유, 과자는 모두 몇 개입니까?

Answer: 183

Solution (Python):
var_a = 58
var_b = 58
var_c = 18
var_d = var_b - var_c
var_e = var_a + var_d
var_f = 58
var_g = 27
var_h = var_f + var_g
var_i = var_e + var_h
print(int(var_i))
Category: Geometry

Question (EN): There is a rectangular farm that is three times as wide as it is length. If the length of this farm is 0.6 km (km), how many square kilometers (km2) is the farm?
Question (KO): 가로가 세로의 3배인 직사각형 모양의 농장이 있습니다. 이 농장의 세로가 0.6킬로미터(㎞)일 때, 농장의 넓이는 몇 ㎢입니까?

Answer: 1.08

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

Question (EN): The square is divided into 2 rectangles of equal size. If the sum of the lengths of the four sides of the divided rectangle is 42 centimeters (cm), how many centimeters (cm) is the side of the first square?
Question (KO): 정사각형을 크기가 같은 2개의 직사각형으로 나누었습니다. 나누어진 직사각형 1개의 네 변의 길이의 합이 42센티미터(㎝)일 때 처음 정사각형의 한 변의 길이는 몇 센티미터(㎝)입니까?

Answer: 14

Solution (Python):
var_a = 42
var_b = 2
var_c = var_a / var_b
var_d = 2
var_e = 1
var_f = var_d + var_e
var_g = var_c / var_f
var_h = 2
var_i = var_g * var_h
print(int(var_i))
Category: Correspondence

Question (EN): Equation of two-digt numbers 4A+B3=68 is said to hold. At this time, what number can go into A?
Question (KO): 등식 4A+B3=68이 성립한다고 합니다. 이 때, A에 들어갈 수 있는 숫자는 무엇인가요?

Answer: 5

Solution (Python):
var_a = '4A+B3=68'
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): Some flight requires more than 15 people to depart. If there are 9 people currently on the plane, find how many more people need to board before departure.
Question (KO): 15명 초과의 사람이 타야 출발하는 비행기가 있습니다. 현재 비행기 안에 있는 사람이 9명이라면 적어도 몇 명이 더 타야 출발할 수 있는지 구하시오.

Answer: 7

Solution (Python):
var_a = 15
var_b = 1
var_c = var_a + var_b
var_d = 9
var_e = var_c - var_d
print(int(var_e))
Category: Geometry

Question (EN): (A) and (B) are both rectangular parallelepiped-shaped tanks. (A) is 4 centimeters (cm) long, 3 centimeters (cm) wide, and 5 centimeters (cm) high, and (B) is 4 centimeters (cm) long, 2 centimeters (cm) wide, and 8 centimeters (cm) high. When the height of the water in (B) was measured as 1.5 centimeters (cm), and all of this water was transferred to (a) the barrel, how high would the water in (A) be in centimeters (cm)?
Question (KO): (가)와 (나)는 모두 직육면체 모양의 통입니다. (가) 통은 가로가 3센티미터(㎝), 세로가 4센티미터(㎝), 높이가 5센티미터(㎝)이고, (나) 통은 가로 4센티미터(㎝), 세로 2센티미터(㎝), 높이가 8센티미터(㎝)입니다. (나) 통에 담겨있는 물의 높이를 쟀을 때 1.5센티미터(㎝)였고, 이 물을 모두 (가) 통에 옮겨 담았다면, (가) 통의 물의 높이는 몇 센티미터(㎝)가 되겠습니까?

Answer: 1

Solution (Python):
var_a = 4
var_b = 2
var_c = var_a * var_b
var_d = 1.5
var_e = var_c * var_d
var_f = 4
var_g = 3
var_h = var_f * var_g
var_i = var_e / var_h
print(int(var_i))
Category: Correspondence

Question (EN): You want to subtract 24 from a number. If the answer when multiplied by 2 incorrectly is 50, what is the result of calculating correctly?
Question (KO): 어떤 수에 24를 빼려고 합니다. 잘못하여 2를 곱했을 때의 답이 50이라면 바르게 계산한 결과는 얼마일까요?

Answer: 1

Solution (Python):
var_a = 50
var_b = 2
var_c = var_a / var_b
var_d = 24
var_e = var_c - var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Donghwan packed 138 candies in a bag, 18 each, and ate the leftovers. How many candies did Donghwan eat?
Question (KO): 동환이는 사탕 138개를 한 봉지에 18개씩 담아 포장하고 남은 것을 먹었습니다. 동환이가 먹은 사탕은 몇 개일까요?

Answer: 12

Solution (Python):
var_a = 138
var_b = 18
var_c = var_a % var_b
print(int(var_c))
Category: Possibility

Question (EN): To make a two-digit integer by drawing two cards from five cards with the numbers 0, 1, 2, 3, and 4 written on them, find how many odd numbers there are.
Question (KO): 0, 1, 2, 3, 4의 수가 각각 적힌 5장의 카드에서 2장을 뽑아 두 자리 정수를 만들 때 홀수는 모두 몇 개인지 구하시오

Answer: 6

Solution (Python):
var_a = 0
var_b = 1
var_c = 2
var_d = 3
var_e = 4
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 = 2
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_f))
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_g = 2
list_c = []
var_g = int(var_g)
for i in list_b:
    i = int(i)
    if i % var_g == 0:
        list_c.append(i)
list_d = list(set(list_b) - set(list_c))
var_h = len(list_d)
print(int(var_h))
Category: Arithmetic calculation

Question (EN): What is the smallest five-digit number divisible by the four numbers 2, 3, 8, and 9?
Question (KO): 4개의 수 2, 3, 8, 9로 나누어 떨어질 수 있는 수 중 가장 작은 다섯 자리 수는 무엇입니까?

Answer: 10008

Solution (Python):
var_a = 10000
var_b = 99999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 2
list_b = []
var_d = int(var_d)
for i in list_a:
    i = int(i)
    if i % var_d == 0:
        list_b.append(i)
var_e = 3
list_c = []
var_e = int(var_e)
for i in list_b:
    i = int(i)
    if i % var_e == 0:
        list_c.append(i)
var_f = 8
list_d = []
var_f = int(var_f)
for i in list_c:
    i = int(i)
    if i % var_f == 0:
        list_d.append(i)
var_g = 9
list_e = []
var_g = int(var_g)
for i in list_d:
    i = int(i)
    if i % var_g == 0:
        list_e.append(i)
var_h = 1
list_f=list_e.copy()
list_f.sort()
var_i = list_f[var_h-1]
print(int(var_i))
Category: Arithmetic calculation

Question (EN): He bought a notebook with half the money he brought, and spent half the money on a pencil. If the remaining money is 750 won, how much money did Jungkook bring at the beginning?
Question (KO): 가져간 돈의 절반으로 공책을 사고, 연필을 사는데 나머지 돈의 절반을 썼습니다. 남은 돈이 750원이라면 정국이가 처음에 가지고 간 돈은 얼마입니까?

Answer: 3000

Solution (Python):
var_a = 750
var_b = 4
var_c = var_a * var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): Find the number of elements in set A minus set B when the elements in set A are 1, 3, and 5, and in set B are 2 and 5. 
Question (KO): 집합 A의 원소는 1, 3, 5이고, 집합 B의 원소는 2, 5일 때 A 차집합 B의 원소의 개수를 구하시오.

Answer: 2

Solution (Python):
var_a = 1
var_b = 3
var_c = 5
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
var_e = 5
list_b= []
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()
list_c = list(set(list_a) - set(list_b))
var_f = len(list_c)
print(int(var_f))
Category: Possibility

Question (EN): You chose three numbers among 0, 1, 2, 3, and 4 to make a three-digit even number. If you can use the same number multiple times, what is the sum of all even numbers that can be made?
Question (KO): 다섯 개의 숫자 0, 1, 2, 3, 4 중에서 3개를 골라 세 자리의 짝수를 만들었다. 같은 수를 여러 번 사용해도 된다면, 만들 수 있는 모든 짝수의 총합은 얼마인가?

Answer: 16320

Solution (Python):
var_a = 0
var_b = 1
var_c = 2
var_d = 3
var_e = 4
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 = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=var_f))
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_g = 2
list_c = []
var_g = int(var_g)
for i in list_b:
    i = int(i)
    if i % var_g == 0:
        list_c.append(i)
list_c = [float(i) for i in list_c]
var_h = sum(list_c)
print(int(var_h))
Category: Arithmetic calculation

Question (EN): Minyoung has 27 more marbles than Yoojeong. If Minyoung gives Eunji 9 marbles, both Minyoung and Eunji have 45 marbles. How many marbles do Minyoung, Yoojeong, and Eunji have?
Question (KO): 민영이는 유정이보다 구슬을 27개 더 많이 가지고 있습니다. 민영이가 은지에게 구슬을 9개 주면 민영, 은지 두 사람이 가지고 있는 구슬은 45개로 같아집니다. 민영, 유정, 은지 세 사람이 가지고 있는 구슬은 모두 몇 개입니까?

Answer: 117

Solution (Python):
var_a = 45
var_b = 27
var_c = var_a - var_b
var_d = 9
var_e = var_c + var_d
var_f = 27
var_g = var_e + var_f
var_h = 45
var_i = 27
var_j = var_h - var_i
var_k = 9
var_l = var_j + var_k
var_m = var_g + var_l
var_n = 45
var_o = 9
var_p = var_n - var_o
var_q = var_m + var_p
print(int(var_q))
Category: Arithmetic calculation

Question (EN): Daeyoung bought 8 materials in total, including an eraser of 300 won and a pencil of 500 won. If he paid 3,000 won, how many pencils did Daeyoung buy?
Question (KO): 대영이는 300원짜리 지우개와 500원짜리 연필을 모두 더하여 8개를 샀습니다. 그리고 3000원을 냈다면 대영이가 산 연필은 모두 몇 개일까요?

Answer: 3

Solution (Python):
var_a = 3000
var_b = 300
var_c = 8
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 500
var_g = 300
var_h = var_f - var_g
var_i = var_e / var_h
print(int(var_i))
Category: Possibility

Question (EN): You want to distribute 7 apples to 2 different monkeys. The monkey takes at least 1 apple. How many ways are there to distribute apples?
Question (KO): 사과 7개를 서로 다른 2마리의 원숭이에게 나누어 주려고 합니다. 원숭이는 적어도 사과 1개는 받습니다. 사과를 나누어 주는 방법은 모두 몇 가지입니까?

Answer: 6

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

Question (EN): Among gray and white cat, gray cat is the heaviest. Gray cat is lighter than black cat, and the lightest is the yellow cat. What color is the heaviest cat?
Question (KO): 회색 고양이와 흰색 고양이 중에는 회색 고양이가 무겁습니다. 회색 고양이가 검은색 고양이보다 가볍고, 가장 가벼운 고양이는 노란색 고양이입니다. 가장 무거운 고양이는 무슨 색입니까?

Answer: black

Solution (Python):
var_a = 'gray'
var_b = 'white'
var_c = 'black'
var_d = 'yellow'
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 = 'gray'
var_f = 'white'
var_g = '>'
var_h = 'gray'
var_i = 'black'
var_j = '<'
var_k = 'yellow'
var_l = 'gray'
var_m = '<'
var_n = 'yellow'
var_o = 'white'
var_p = '<'
var_q = 'yellow'
var_r = 'black'
var_s = '<'
list_b= []
if "/" in str(var_s):
    var_s = eval(str(var_s))
list_b.append(var_s)
if "/" in str(var_r):
    var_r = eval(str(var_r))
list_b.append(var_r)
if "/" in str(var_q):
    var_q = eval(str(var_q))
list_b.append(var_q)
if "/" in str(var_p):
    var_p = eval(str(var_p))
list_b.append(var_p)
if "/" in str(var_o):
    var_o = eval(str(var_o))
list_b.append(var_o)
if "/" in str(var_n):
    var_n = eval(str(var_n))
list_b.append(var_n)
if "/" in str(var_m):
    var_m = eval(str(var_m))
list_b.append(var_m)
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)
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_t = 1
var_u = list_c[var_t-1]
print(var_u)
Category: Correspondence

Question (EN): A is the number 3 greater than 5 and B is A minus 2. WhenA and B are single-digit numbers, find what A+B is.
Question (KO): A, B는 한 자리 수이다. 5보다 3 큰 숫자는 A이고 B는 A에서 2를 뺀 숫자일때 A+B를 구하여라.

Answer: 14

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

Question (EN): I need to subtract 32, but I accidentally subtracted 23 from some number and got 14. What number is it?
Question (KO): 32를 빼야한는데 실수로 23을 어떤 수에서 빼서 14가 나왔습니다. 어떤 수는 얼마입니까?

Answer: 37

Solution (Python):
var_a = 14
var_b = 23
var_c = var_a + var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): In art class, when Mijin cuts a piece of colored paper in the shape of a rectangle measuring 32 centimeters (cm) wide and 74 centimeters (cm) long, and wants to make several identical squares without any leftovers, how many squares can be the largest? ?
Question (KO): 미술시간에 미진이가 가로 32센티미터(㎝), 세로 74센티미터(㎝)인 직사각형 모양의 색종이를 잘라 남는 부분 없이 똑같은 정사각형 모양을 여러 장 만들려고 할 때, 만들 수 있는 가장 큰 정사각형은 몇 장입니까?

Answer: 592

Solution (Python):
var_a = 32
var_b = 32
var_c = 74
var_d = math.gcd(int(var_c), int(var_b))
var_e = var_a // var_d
var_f = 74
var_g = 32
var_h = 74
var_i = math.gcd(int(var_h), int(var_g))
var_j = var_f // var_i
var_k = var_e * var_j
print(int(var_k))