philschmid/DMath huggingface dataset:
Category: Correspondence

Question (EN): Junhyung traveled 1/5 of the total distance on the first day of the trip, and 3/4 of the remaining distance on the second day. If the trip was completed after moving 1 kilometer (km) and 500 meters (m) on the third day, what is the total distance of Junhyung's trip in kilometers (km)?
Question (KO): 준형이는 여행 중 첫째날에는 전체 거리의 1/5를 이동하였고, 둘째날에는 나머지의 거리의 3/4을 이동하였습니다. 셋째날에 1킬로미터(㎞) 500미터(m)를 이동하고 여행을 마무리했다면 준형이가 여행 중 이동한 전체 거리는 몇 킬로미터(㎞)인지 구하시오.

Answer: 7.5

Solution (Python):
var_a = 1
var_b = 500
var_c = 1000
var_d = var_b / var_c
var_e = var_a + var_d
var_f = 1
var_g = 0.75
var_h = var_f - var_g
var_i = var_e / var_h
var_j = 1
var_k = 0.2
var_l = var_j - var_k
var_m = var_i / var_l
print('{:.2f}'.format(round(var_m+1e-10,2)))
Category: Geometry

Question (EN): I am going to make as many small square pieces as possible by cutting out a large rectangular piece of paper that is 172 centimeters (cm) wide and 295 centimeters (cm) long. Find how many square pieces of paper you can make.
Question (KO): 가로가 172센티미터(㎝)이고 세로가 295센티미터(㎝)인 직사각형 모양의 큰 도화지를 오려서 한 변이 24센티미터(㎝)인 정사각형 모양의 작은 종이를 될 수 있는 대로 많이 만들려고 합니다. 정사각형 모양의 종이는 모두 몇 장까지 만들 수 있는지 구해 보시오.

Answer: 84

Solution (Python):
var_a = 172
var_b = 24
var_c = var_a // var_b
var_d = 295
var_e = 24
var_f = var_d // var_e
var_g = var_c * var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): The weight of the box is 0.5 kilograms (kg). When six billiard balls of the same weight were placed in a box, the box weighed 1.82 kilograms (kg). How many kilograms (kg) does one billiard ball weigh?
Question (KO): 상자의 무게가 0.5킬로그램(㎏)입니다. 상자에 무게가 같은 당구공 6개를 넣었더니 상자의 무게는 1.82킬로그램(㎏)이 되었습니다. 당구 공 한 개의 무게는 몇 킬로그램(㎏)입니까?

Answer: 0.22

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

Question (EN): This year, the age of the father is four times the age of the daughter. After 5 years, the sum of the ages of father and daughter will be 50. How old is your father this year?
Question (KO): 올해 아버지 나이는 딸 나이의 4배입니다. 5년 후에 아버지와 딸의 나이의 합은 50살이 됩니다. 올해 아버지의 나이는 몇 살입니까?

Answer: 32

Solution (Python):
var_a = 50
var_b = 5
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 1
var_g = 4
var_h = var_f + var_g
var_i = var_e / var_h
var_j = 4
var_k = var_i * var_j
print(int(var_k))
Category: Comparison

Question (EN): Fruit (a) is lighter than fruit (b). Fruit (c) is lighter than fruit (a). What is the heaviest fruit?
Question (KO): (가) 과일은 (나) 과일보다 가볍습니다. (다) 과일은 (가) 과일보다 가볍습니다. 가장 무거운 과일은 무엇입니까?

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 = '(a)'
var_e = '(b)'
var_f = '<'
var_g = '(c)'
var_h = '(a)'
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: Arithmetic calculation

Question (EN): How many of the numbers 5, 1, 9, 0, 6, and 8 are greater than 4 and less than 8?
Question (KO): 5, 1, 9, 0, 6, 8의 수 중 4보다 크고 8보다 작은 수는 모두 몇 개인가요?

Answer: 3

Solution (Python):
var_a = 5
var_b = 1
var_c = 9
var_d = 0
var_e = 6
var_f = 8
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 = 4
list_b = []
for i in list_a:
    if i >= var_g:
        list_b.append(i)
var_h = 8
list_c = []
for i in list_b:
    if i <= var_h:
        list_c.append(i)
var_i = len(list_c)
print(int(var_i))
Category: Geometry

Question (EN): The circumference of a Polaroid photo is 40 centimeters (cm). Find the length of the length when the width is 8 centimeters (cm).
Question (KO): 폴라로이드 사진의 둘레가 40센티미터(㎝)이다. 가로가 8센티미터(㎝)일때 세로의 길이를 구하시오.

Answer: 12

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

Question (EN): What number A is to make 57A-B14=364?
Question (KO): 57A-B14=364가 성립하기 위한 A는 얼마인가요?

Answer: 8

Solution (Python):
var_a = '57A-B14=364'
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: Geometry

Question (EN): If you draw a circle with a diameter of 14 centimeters (cm) on a piece of paper, what is the length of its radius in centimeters (cm)?
Question (KO): 도화지에 지름이 14 센티미터(㎝)인 원을 그렸을 때, 반지름의 길이가 몇 센티미터(㎝) 일까요?

Answer: 7

Solution (Python):
var_a = 14
var_b = 2
var_c = var_a / var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): Hosok jumped rope 88 times on Monday, 75 times on Tuesday, 62 times on Wednesday, 91 times on Thursday, and 80 times on Friday. Find the difference between the number of jumps on the days of the most and the least jumps.
Question (KO): 호석이는 줄넘기를 월요일에 88번, 화요일에 75번, 수요일에 62번, 목요일에 91번, 금요일에 80번 했습니다. 호석이가 줄넘기를 가장 많이 한 요일과 가장 적게 한 요일의 줄넘기 횟수의 차를 구하시오.

Answer: 29

Solution (Python):
var_a = 88
var_b = 75
var_c = 62
var_d = 91
var_e = 80
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]
var_h = 1
list_c=list_a.copy()
list_c.sort()
var_i = list_c[var_h-1]
var_j = var_g - var_i
print(int(var_j))
Category: Arithmetic calculation

Question (EN): Ji-young and her sister ran errands for their mother and received pocket money. If the sum of their pocket money is 12,000 won and the younger sister received 1,000 won less than Ji-young, how much money did Ji-young receive?
Question (KO): 지영이는 동생과 같이 엄마의 심부름을 하고 용돈을 받았습니다. 두 사람이 받은 용돈의 합은 12000원이고, 동생이 지영이보다 1000원 덜 받았다면, 지영이가 받은 용돈은 얼마입니까?

Answer: 6500

Solution (Python):
var_a = 12000
var_b = 1000
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
var_f = 1000
var_g = var_e + var_f
print(int(var_g))
Category: Comparison

Question (EN): The height of the green chair is 0.309 meters (m) and the height of the blue chair is 48.2 centimeters (cm). Which color is the taller chair?
Question (KO): 초록색 의자의 높이는 0.309미터(m)이고, 파란색 의자의 높이는 48.2센티미터(㎝)입니다. 높이가 더 높은 의자는 어느 색입니까?

Answer: blue

Solution (Python):
var_a = 'green'
var_b = 'blue'
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.309
var_d = 48.2
var_e = 100
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: Geometry

Question (EN): Find the number of corners of the pentagonal prism.
Question (KO): 오각기둥의 모서리 개수를 구하세요.

Answer: 15

Solution (Python):
var_a = 5
var_b = 3
var_c = var_a * var_b
print(int(var_c))
Category: Geometry

Question (EN): If the radius of a circular lake is 7 meters (m), what is the diameter of the lake in meters (m)?
Question (KO): 원 모양 호수의 반지름의 길이가 7미터(m)일 때, 호수의 지름의 길이는 몇 미터(m)인가요?

Answer: 14

Solution (Python):
var_a = 7
var_b = 2
var_c = var_a * var_b
print(int(var_c))
Category: Geometry

Question (EN): A cuboid is said to have a base area of 14 square centimeters (cm2) and a height of 13 centimeters (cm). What is the volume of this cuboid in cubic centimeters (cm)?
Question (KO): 어떤 직육면체는 한 밑면의 넓이가 14제곱센티미터(㎠)이고 높이가 13센티미터(㎝)라고 합니다. 이 직육면체의 부피는 몇 세제곱센티미터(㎤)입니까?

Answer: 182

Solution (Python):
var_a = 14
var_b = 13
var_c = var_a * var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): A movie theater has 500 chairs. If all chairs are numbered from 1 to 500 in order, how many times is the number 4 written on them?
Question (KO): 어느 영화관에 500개의 의자가 있습니다. 모든 의자에는 1부터 500까지의 번호가 차례로 적혀있을 때, 숫자 4는 모두 몇 번 적혀 있는지 구하시오.

Answer: 200

Solution (Python):
var_a = 1
var_b = 500
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d=""
for i in list_a:
    i = str(i)
    var_d = var_d + i
list_b = []
var_d = int(var_d)
while var_d//10 > 0:
    list_b.append(var_d%10)
    var_d = var_d//10
list_b.append(var_d%10)
list_b = list_b[::-1]
var_e = 4
var_f = 0
var_e = int(var_e)
for i in list_b:
    i = int(i)
    if i == var_e:
        var_f = var_f + 1
print(int(var_f))
Category: Arithmetic calculation

Question (EN): There are 6, 2, 4, 1, 5, and 9. Find out how many of the largest numbers are larger than the second largest.
Question (KO): 6, 2, 4, 1, 5, 9가 있습니다. 그중에서 가장 큰 수는 2번째로 큰 수보다 몇 큰 수인지 구하시오.

Answer: 3

Solution (Python):
var_a = 6
var_b = 2
var_c = 4
var_d = 1
var_e = 5
var_f = 9
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 = 1
list_b=list_a.copy()
list_b.sort()
var_h = list_b[-var_g]
var_i = 2
list_c=list_a.copy()
list_c.sort()
var_j = list_c[-var_i]
var_k = var_h - var_j
print(int(var_k))
Category: Comparison

Question (EN): People are standing in a line at an amusement park. If Eunji can ride the ride 6th from the back and there are 7 people in front of Eunji, how many people are in line to ride the ride?
Question (KO): 놀이공원에 사람들이 한 줄서기를 하고 있습니다. 은지는 맨 뒤에서 6번째로 놀이기구를 탈 수 있고 은지 앞에 7명의 사람들이 있을 때 놀기기구를 타기위해 줄을 선 사람은 모두 몇 명인지 구하시오.

Answer: 13

Solution (Python):
var_a = 6
var_b = 7
var_c = var_a + var_b
print(int(var_c))
Category: Geometry

Question (EN): If you make a square with 32 kilometers (km) of string, you will be given all the land. What is the largest size of land you could possibly get in square kilometers (km²)?
Question (KO): 32킬로미터(㎞)의 끈으로 사각형을 만들면 그 땅을 모두 준다고 한다. 받을 수 있는 땅의 넓이 중 가장 넓은 크기는 몇 제곱킬로미터(㎢)인가?

Answer: 64

Solution (Python):
var_a = 32
var_b = 4
var_c = var_a / var_b
var_d = 2
var_e = var_c ** var_d
print(int(var_e))
Category: Geometry

Question (EN): There is some octagon. Find the number of all diagonals that can be drawn within this octagon.
Question (KO): 어떤 팔각형이 있습니다. 이 팔각형 안에 그을 수 있는 모든 대각선의 개수를 구하시오.

Answer: 20

Solution (Python):
var_a = 8
var_b = 8
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: Possibility

Question (EN): Write the smallest three-digit number that can be formed by drawing three different numbers from 3, 0, 2, 5, and 7.
Question (KO): 3, 0, 2, 5, 7 중에서 서로 다른 숫자 3개를 뽑아 만들 수 있는 세 자리 수 중에서 가장 작은 수를 쓰시오.

Answer: 203

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

Question (EN): Yoongi collected 7 points, Jungkook 6 points, Yuna 9 points, Yoojung 8 points, and Taehyung 10 points. Who has the 2nd largest number?
Question (KO): 윤기는 7, 정국은 6, 유나는 9, 유정은 8, 태형은 10만큼 모았습니다. 2번째로 큰 숫자를 가진 사람은 누구입니까?

Answer: Yuna

Solution (Python):
var_a = 'Yoongi'
var_b = 'Jungkook'
var_c = 'Yuna'
var_d = 'Yoojung'
var_e = 'Taehyung'
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 = 7
var_g = 6
var_h = 9
var_i = 8
var_j = 10
list_b= []
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)
list_b.reverse()
var_k = 2
list_c=list_b.copy()
list_c.sort()
var_l = list_c[-var_k]
var_m = list_b.index(var_l)+1
var_n = list_a[var_m-1]
print(var_n)
Category: Comparison

Question (EN): The weight of the apple box is 3/5 kilograms (kg), and the weight of the tangerine box is 0.49 kilograms (kg). Which box is heavier?
Question (KO): 사과 상자의 무게는 3/5킬로그램(㎏) , 귤 상자의 무게는 0.49킬로그램(㎏) 입니다. 어느 상자가 더 무겁습니까?

Answer: apple

Solution (Python):
var_a = 'apple'
var_b = 'tangerine'
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.6
var_d = 0.49
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: Geometry

Question (EN): You want to make a square with a side of 7 centimeters (cm) by cutting a rectangular paper that is 112 centimeters (cm) wide and 63 centimeters (cm) long. How many squares can you make in total?
Question (KO): 가로가 112센티미터(㎝), 세로가 63센티미터(㎝)인 직사각형 모양의 종이를 잘라 한 변의 길이가 7센티미터(㎝)인 정사각형을 만들려고 합니다. 모두 몇 개를 만들 수 있습니까?

Answer: 144

Solution (Python):
var_a = 112
var_b = 7
var_c = var_a // var_b
var_d = 63
var_e = 7
var_f = var_d // var_e
var_g = var_c * var_f
print(int(var_g))
Category: Possibility

Question (EN): You want to use all three dice rolls at least once to create a three-digit number less than 340. When 2, 4, and 3 are rolled, how many numbers can you make?
Question (KO): 주사위를 던져 나온 수 세 개를 한 번씩 모두 이용해 340보다 작은 세 자리 수를 만들고자 합니다. 2, 4, 3이 나왔을 때, 몇개의 수를 만들 수 있습니까?

Answer: 3

Solution (Python):
var_a = 2
var_b = 4
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 = 3
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 = 340
list_c = []
for i in list_b:
    if i < var_e:
        list_c.append(i)
var_f = len(list_c)
print(int(var_f))
Category: Correspondence

Question (EN): A, B, and C are three different numbers. A is 4 less than 9, B is 5 greater than A, and 8 less than C is 1. What is B minus C?
Question (KO): 서로 다른 수 A, B, C가 있습니다. A는 9보다 4 작은 수이고, B는 A보다 5 큰 수이고, C보다 8 작은 수는 1입니다. B에서 C를 뺀 값은 얼마입니까?

Answer: 1

Solution (Python):
var_a = 9
var_b = 4
var_c = var_a - var_b
var_d = 5
var_e = var_c + var_d
var_f = 8
var_g = 1
var_h = var_f + var_g
var_i = var_e - var_h
print(int(var_i))
Category: Comparison

Question (EN): There are 24 cars. Of these cars, red cars make up 1/4 of the total, blue cars outnumber red cars by 6, and the rest are yellow cars. What color cars do you have the most?
Question (KO): 자동차 24대가 있습니다. 이 중에서 빨간색 자동차는 전체의 1/4이고, 파란색 자동차는 빨간색 자동차보다 6대 더 많고, 나머지는 노란색 자동차입니다. 어떤 색의 자동차가 가장 많을까요?

Answer: blue

Solution (Python):
var_a = 'red'
var_b = 'blue'
var_c = 'yellow'
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 = 24
var_e = 0.25
var_f = var_d * var_e
var_g = 24
var_h = 0.25
var_i = var_g * var_h
var_j = 6
var_k = var_i + var_j
var_l = 24
var_m = 24
var_n = 0.25
var_o = var_m * var_n
var_p = 6
var_q = var_o + var_p
var_r = var_l - var_q
var_s = 24
var_t = 0.25
var_u = var_s * var_t
var_v = var_r - var_u
list_b= []
if "/" in str(var_v):
    var_v = eval(str(var_v))
list_b.append(var_v)
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_w = 1
list_c=list_b.copy()
list_c.sort()
var_x = list_c[-var_w]
var_y = list_b.index(var_x)+1
var_z = list_a[var_y-1]
print(var_z)
Category: Geometry

Question (EN): You have an aquarium in the shape of a cube with one corner measuring 20 centimeters (cm). What is the surface area of this aquarium in square centimeters (cm2)?
Question (KO): 한 모서리의 길이가 20센티미터(㎝)인 정육면체 모양의 수족관이 있습니다. 이 수족관의 겉넓이는 몇 제곱센티미터(㎠)입니까?

Answer: 2400

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

Question (EN): There are four-digit numbers with 2 in the thousands digit which are divisible by 12. How many of these four-digit numbers are there?
Question (KO): 천의 자리 숫자가 2인 네 자리 수를 12로 나누면 나누어떨어집니다. 이런 네 자리 수는 모두 몇 개입니까?

Answer: 83

Solution (Python):
var_a = 2
var_b = 1000
var_c = var_a * var_b
var_d = 2
var_e = 1000
var_f = var_d * var_e
var_g = 999
var_h = var_f + var_g
var_i = 1
list_a = [i for i in range(var_c, var_h + 1, var_i)]
var_j = 12
list_b = []
var_j = int(var_j)
for i in list_a:
    i = int(i)
    if i % var_j == 0:
        list_b.append(i)
var_k = len(list_b)
print(int(var_k))
Category: Arithmetic calculation

Question (EN): You are trying to find a two-digit number that is divisible by 3 and 4 and that has a remainder of 4 when divided by 5. What is the largest two-digit number you can make?
Question (KO): 3과 4로 나누어떨어지고 5로 나누면 나머지가 4인 두 자리 수를 찾으려고 합니다. 만들 수 있는 두 자리 수 중 가장 큰 수는 무엇입니까?

Answer: 84

Solution (Python):
var_a = 10
var_b = 99
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 3
var_e = 4
var_f = var_e * var_d / math.gcd(int(var_e), int(var_d))
list_b = []
var_f = int(var_f)
for i in list_a:
    i = int(i)
    if i % var_f == 0:
        list_b.append(i)
var_g = 5
var_h = 4
list_c = [] 
var_g = int(var_g)
var_h = int(var_h)
if var_h < 0:
    var_h = var_h + var_g
for i in list_b:
    i = int(i)
    if i%var_g == var_h:
        list_c.append(i)
var_i = 1
list_d=list_c.copy()
list_d.sort()
var_j = list_d[-var_i]
print(int(var_j))
Category: Comparison

Question (EN): Jimin received box A and a box B that was heavier than box A. When he wants to open a heavy box first, which box is to open first?
Question (KO): 지민이는 (가) 상자와 (가) 상자보다 무거운 (나) 상자를 선물받았습니다. 무거운 상자를 먼저 열어보려고 할 때, 먼저 열어볼 상자는 무엇인가요?

Answer: B

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 = 'A'
var_d = 'B'
var_e = '<'
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)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_b.append(var_c)
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_f = 1
var_g = list_c[var_f-1]
print(var_g)