philschmid/DMath huggingface dataset:
Category: Comparison

Question (EN): There are 28 identical vending machines in the aisle. Each vending machine is full and has the same number of drinks, and I chose the drink in the 14th from the bottom, 20th from the top, 3rd from the right, and 2nd from the left, and drank it. Find the sum of the number of total drinks in vending machines in this aisle.
Question (KO): 통로에는 28개의 동일한 자판기가 있습니다. 각 자판기에는 동일한 수의 음료가 가득 차 있습니다. 자판기에서 밑에서 14번째, 위에서 20번째, 오른쪽에서 3번째, 왼쪽에서 2번째인 음료수를 선택하여 마셨다. 이 통로에 있는 모든 자판기들의 음료수 개수 합을 구하시오.

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: Comparison

Question (EN): Jimin, Yoongi, Taehyung, and Namjoon all live in the same apartment building. Taehyung's house is lower than Namjoon's, and Jimin's house is higher than Yoongi's. When Yoongi's is higher than Namjoon's, who lives on the lowest floor?
Question (KO): 지민, 윤기, 태형, 남준이는 모두 같은 아파트에 살고 있습니다. 태형이는 남준이보다 낮고, 지민이네 집은 윤기보다 높습니다. 윤기는 남준이보다 높을 때, 가장 낮은 층에 살고 있는 사람은 누구입니까?

Answer: Taehyung

Solution (Python):
var_a = 'Jimin'
var_b = 'Yoongi'
var_c = 'Taehyung'
var_d = 'Namjoon'
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 = 'Jimin'
var_f = 'Yoongi'
var_g = '>'
var_h = 'Taehyung'
var_i = 'Namjoon'
var_j = '<'
var_k = 'Yoongi'
var_l = 'Namjoon'
var_m = '>'
list_b= []
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_n = len(list_c)
var_o = list_c[var_n-1]
print(var_o)
Category: Correspondence

Question (EN): A5-2B=68 is said to be true. At this time, what number can go into A?
Question (KO): 등식 A5-2B=68이 성립한다고 합니다. 이 때, A에 들어갈 수 있는 숫자는 무엇인가요?

Answer: 9

Solution (Python):
var_a = 'A5-2B=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): A computer requires 30 watts of electricity to run for one second. How many watts of electricity is required to run your computer for 25 seconds?
Question (KO): 컴퓨터를 1초 사용하려면 전기 30와트가 필요합니다. 컴퓨터를 25초 사용하려면 전기 몇 와트가 필요합니까?

Answer: 750

Solution (Python):
var_a = 30
var_b = 25
var_c = var_a * var_b
print(int(var_c))
Category: Correspondence

Question (EN): Subtracting 477 from a number equals 273. How much is a number plus 273?
Question (KO): 어떤 값에서 477을 빼면 273입니다. 어떤 값에 273을 더하면 얼마입니까?

Answer: 1023

Solution (Python):
var_a = 477
var_b = 273
var_c = var_a + var_b
var_d = 273
var_e = var_c + var_d
print(int(var_e))
Category: Correspondence

Question (EN): The number of pencils is 6 times the number of notebooks. I distributed the notebooks to 6 people, and each person had 9 of them, and there was nothing left. Find the number of pencils.
Question (KO): 연필의 개수는 공책의 개수의 6배이다. 공책을 6명에게 나누어주었더니 한 명당 9개씩 가지고 남는 것이 없었다. 연필의 개수를 구하시오.

Answer: 324

Solution (Python):
var_a = 9
var_b = 6
var_c = var_a * var_b
var_d = 6
var_e = var_c * var_d
print(int(var_e))
Category: Geometry

Question (EN): There is an octadecagon-shaped pattern. If you try to draw as many diagonal lines as you can on this pattern, how many can you draw?
Question (KO): 십팔각형 모양의 무늬가 있다. 이 무늬에 대각선을 그릴 수 있는 만큼 그리려고 할 때, 몇 개를 그릴수 있는가?

Answer: 135

Solution (Python):
var_a = 18
var_b = 18
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): Find the largest four-digit number consisting of 1, 5, 9, and 4.
Question (KO): 네 자리 수 중 1, 5, 9, 4 하나씩으로 이루어진 가장 큰 수를 구하시오.

Answer: 9541

Solution (Python):
var_a = 1
var_b = 4
var_c = 9
var_d = 5
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 = 4
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
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
print(int(var_g))
Category: Correspondence

Question (EN): Seon-mi spends 1/2 of her money at the first store, 1/3 of her remaining money at the second store, and 1/2 of her remaining money at the third store, leaving her with 250 won. Find how much money Seon-mi had at first.
Question (KO): 선미는 첫 번째 가게에서 가진 돈의 1/2를 쓰고, 두 번째 가게에서 남은 돈의 1/3을 쓰고, 세 번째 가게에서 남은 돈의 1/2을 썼더니 250원이 남았습니다. 선미가 처음에 가지고 있던 돈은 얼마인지 구하시오

Answer: 1500

Solution (Python):
var_a = 250
var_b = 1
var_c = 0.5
var_d = var_b - var_c
var_e = var_a / var_d
var_f = 1
var_g = 0.3333333333333333
var_h = var_f - var_g
var_i = var_e / var_h
var_j = 1
var_k = 0.5
var_l = var_j - var_k
var_m = var_i / var_l
print(int(eval('{:.2f}'.format(round(var_m+1e-10,2)))))
Category: Correspondence

Question (EN): Subtracting 10 from AB equals 15. How much is A?
Question (KO): AB에서 10을 빼면 15입니다. A는 얼마인가요?

Answer: 2

Solution (Python):
var_a = 15
var_b = 10
var_c = var_a + var_b
var_d = 10
var_e = var_c // var_d
print(int(var_e))
Category: Comparison

Question (EN): The distance from school to Taehyung's house and Jungkook's house is 106/45 kilometers (km) and 77/30 kilometers (km), respectively. Whose house is closer to the school?
Question (KO): 학교에서 태형이네 집과 정국이네 집까지의 거리는 각각 106/45 킬로미터(㎞), 77/30 킬로미터(㎞)입니다. 누구네 집이 학교에서 더 가깝습니까?

Answer: Taehyung

Solution (Python):
var_a = 'Taehyung'
var_b = 'Jungkook'
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.3555555555555556
var_d = 2.566666666666667
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): A 1000 milliliter (ml) bottle was full of milk, but the bottle cracked and milk leaked at a rate of 5 ml (ml) per minute. After a few minutes, if you look at the milk bottle and there are 300 milliliters (ml) of milk left, find how many minutes have passed.
Question (KO): 1000밀리리터(㎖)짜리의 병에 우유가 가득 차있었는데, 이 병에 금이 가 1분에 5밀리리터(㎖)씩 우유가 샜습니다. 몇 분 후 우유 병을 보니 우유가 300밀리리터(㎖) 남아있었다면 몇 분이 지났을지 구하시오.

Answer: 140

Solution (Python):
var_a = 1000
var_b = 300
var_c = var_a - var_b
var_d = 5
var_e = var_c / var_d
print(int(var_e))
Category: Geometry

Question (EN): If the width and length of a cuboid are 30 centimeters (cm) and 22 centimeters (cm) respectively, and the sum of all edges is 224 centimeters (cm), how many centimeters (cm) is the height of this cuboid?
Question (KO): 직육면체에서 가로와 세로가 각각 30센티미터(㎝), 22센티미터(㎝)이며, 모든 모서리의 합이 224센티미터(㎝)라면, 이 직육면체의 높이는 몇 센티미터(㎝)입니까?

Answer: 4

Solution (Python):
var_a = 224
var_b = 4
var_c = var_a / var_b
var_d = 30
var_e = var_c - var_d
var_f = 22
var_g = var_e - var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): 58 flags were planted at equal intervals on both sides of the 191.8 meters (m) long road. If flags are planted at both the beginning and end of the road, find the distance between the flags in meters (m).
Question (KO): 191.8미터(m) 인 도로의 양쪽에 같은 간격으로 58 개의 깃발을 꽂았습니다. 도로의 처음과 끝에 모두 깃발을 꽂았다면 깃발과 깃발 사이의 거리는 몇 미터(m)입니까?

Answer: 6.85

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

Question (EN): Five roses and two lilies are planted in the vase. How many flowers are there in the vase?
Question (KO): 꽃병에 장미 5송이, 백합 2송이가 있습니다. 꽃병에는 총 몇 송이가 있을까요?

Answer: 7

Solution (Python):
var_a = 5
var_b = 2
var_c = var_a + var_b
print(int(var_c))
Category: Geometry

Question (EN): You have a right triangle with three sides, each measuring 10 centimeters (cm), 8 centimeters (cm), and 6 centimeters (cm). What is the length of the radius of the circumscribed circle?
Question (KO): 길이가 각각 10 센티미터(㎝), 8 센티미터(㎝), 6 센티미터(㎝)인 세 변으로 이루어진 직각삼각형이 있습니다. 외접원의 반지름의 길이는?

Answer: 5

Solution (Python):
var_a = 10
var_b = 2
var_c = var_a / var_b
print(int(var_c))
Category: Comparison

Question (EN): Yuna tries to do more jump rope than Jungkook. Yuna did 26 jump ropes in each of 1st and 2nd try and Jungkook did 81 jump ropes, then how many jump ropes should Yuna do on her 3rd try at least?
Question (KO): 유나는 정국이보다 줄넘기를 더 많이 하려고 합니다. 유나는 1번째와 2번째에 각각 26번씩 했고 정국이는 81번 했을 때 유나는 3번째에 적어도 몇 번을 해야 하나요?

Answer: 30

Solution (Python):
var_a = 81
var_b = 26
var_c = 26
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: Correspondence

Question (EN): When you multiply 10 by 100 times of a certain number, you get 17 as a result. What is that certain number?
Question (KO): 어떤 수에 100배 인 수에 10을 곱하면 17이 된다고 합니다. 어떤 수는 얼마인지 구하시오.

Answer: 0.02

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

Question (EN): If AB19 is rounded up to the hundreds place, it gets a value of 7300. What is AB19 when rounded down to the tens place?
Question (KO): AB19를 올림하여 백의 자리까지 나타낸다면 7300의 값을 얻을 수 있습니다. AB19를 십의 자리까지 버림한 값은 무엇이 되겠습니까?

Answer: 7210

Solution (Python):
var_a = 'AB19'
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 = 7300
var_c = 100
var_d = var_b - var_c
list_b = []
for i in list_a:
    if i > var_d:
        list_b.append(i)
var_e = 7300
list_c = []
for i in list_b:
    if i <= var_e:
        list_c.append(i)
var_f = 'AB19'
var_g = 'A'
var_f = str(var_f)
var_g = str(var_g)
unk_idx = var_f.index(var_g)
var_h = 0
for elem in list_c:
    elem = str(elem)
    var_h = int(elem[unk_idx])
var_i = 1000
var_j = var_h * var_i
var_k = 'AB19'
var_l = 'B'
var_k = str(var_k)
var_l = str(var_l)
unk_idx = var_k.index(var_l)
var_m = 0
for elem in list_c:
    elem = str(elem)
    var_m = int(elem[unk_idx])
var_n = 100
var_o = var_m * var_n
var_p = var_j + var_o
var_q = 19
var_r = var_p + var_q
var_s = 2
var_t=int((var_r//(10**(var_s-1)))*10**(var_s-1))

print(int(var_t))
Category: Comparison

Question (EN): The arrived parcel was located at 7th from the left, 13th from the right, 8th from the front, and 14th from the back of the parcel boxes. If the number of parcel boxes in each row is the same, what is the total number of parcel boxes?
Question (KO): 도착한 소포는 왼쪽에서 7번째, 오른쪽에서 13번째, 앞에서 8번째, 뒤에서 14번째 소포함에 있었습니다. 각 줄마다 있는 소포함의 수가 같다고 할 때, 소포함의 개수는 모두 몇 개입니까?

Answer: 399

Solution (Python):
var_a = 7
var_b = 13
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 8
var_g = 14
var_h = var_f + var_g
var_i = 1
var_j = var_h - var_i
var_k = var_e * var_j
print(int(var_k))
Category: Possibility

Question (EN): Using 3 of numbers 4, 1, 6, 7, what is the third smallest number with 1 in the tens place?
Question (KO): 4, 1, 6, 7 중 3개를 사용하여 십의 자리 숫자가 1인 세 번쩨 작은 수는 무엇입니까?

Answer: 614

Solution (Python):
var_a = 4
var_b = 1
var_c = 6
var_d = 7
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 = 3
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 = 10
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 = 3
list_d=list_c.copy()
list_d.sort()
var_i = list_d[var_h-1]
print(int(var_i))
Category: Arithmetic calculation

Question (EN): Ayeon tries to go to a hospital 0.09 kilometers (km) away. If Ayeon takes 4 seconds to go 3 meters (m), how many seconds does it take for her to get to the hospital?
Question (KO): 아연이는 0.09 킬로미터(㎞) 떨어진 병원에 가려고 합니다. 아연이가 3 미터(m)를 가는데 4초가 걸린다면 병원까지 가는데 걸린 시간은 몇 초인가요?

Answer: 120

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

Question (EN): You will need a 1/4 meter (m) block of wood. How many blocks can you make with 3 meters (m) of wood?
Question (KO): 1/4미터(m)의 나무토막이 필요합니다. 3미터(m)의 나무로 몇 도막을 만들 수 있나요?

Answer: 12

Solution (Python):
var_a = 3
var_b = 0.25
var_c = var_a / var_b
print(int(var_c))
Category: Comparison

Question (EN): By drawing lots, Jeongyun picked the seat 7th from the left, 13th from the right, 8th from the front, and 14th from the back. If the number of seats in each row is the same, how many seats are there in the classroom?
Question (KO): 정윤이는 제비뽑기로 교실 왼쪽에서 7번째, 오른쪽에서 13번째, 앞에서 8번째, 뒤에서 14번째에 있는 자리를 뽑았습니다. 각 줄마다 있는 자리의 수가 같다고 할 때, 교실 안 자리의 개수는 모두 몇 개입니까?

Answer: 399

Solution (Python):
var_a = 7
var_b = 13
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 8
var_g = 14
var_h = var_f + var_g
var_i = 1
var_j = var_h - var_i
var_k = var_e * var_j
print(int(var_k))
Category: Correspondence

Question (EN): I needed to divide a number by 3 and then subtract 5. However, I mistakenly multiplied this number by 3 and subtracted 5 and got 103 as a result. Find the correct calculated value.
Question (KO): 어떤 수를 3으로 나눈 다음 5를 빼야 할 것을 잘못하여 어떤 수에 3을 곱한 다음 5를 뺐더니 103이 되었습니다. 바르게 계산한 값을 구하시오.

Answer: 7

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

Question (EN): 52 is the result of mistakenly subtracting 48 from a certain number while 48 had to be added. Find the result of the correct calculation.
Question (KO): 52는 어떤 수에 48을 더해야 하는데 잘못하여 빼서 나온 결과이다. 바르게 계산한 결과를 구하여라.

Answer: 148

Solution (Python):
var_a = 52
var_b = 48
var_c = var_a + var_b
var_d = 48
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 difference between the smallest number and the next smallest number?
Question (KO): 4개의 수 10, 11, 12, 13이 있습니다. 그 중에서 가장 작은 수와 그 다음으로 작은 수로 나눈 값은 얼마입니까?

Answer: 0.91

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-1]
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('{:.2f}'.format(round(var_i+1e-10,2)))
Category: Comparison

Question (EN): Jungkook collected 6 times 3 apples, and Yoongi collected 4 apples. Who has fewer apples?
Question (KO): 정국에는 6 곱하기 3만큼 사과를 모았고, 윤기는 4개의 사과를 모았습니다. 누가 더 사과를 적게 가지고 있습니까?

Answer: Yoongi

Solution (Python):
var_a = 'Jungkook'
var_b = 'Yoongi'
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 = 6
var_d = 3
var_e = var_c * var_d
var_f = 4
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-1]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j)
Category: Correspondence

Question (EN): Given 2A32-BBB=1BBB, find B-A when A and B are two different numbers.
Question (KO): 2A32-BBB=1BBB입니다. A,B는 서로 다른 두 수 일때 B-A를 구하시오.

Answer: 3

Solution (Python):
var_a = '2A32-BBB=1BBB'
var_b = 'B'
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]
var_d = '2A32-BBB=1BBB'
var_e = 'A'
ans_dict = dict()
var_d = var_d.replace('×','*')
var_d = var_d.replace('x','*')
var_d = var_d.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_d):
    if v in variable_candi:
        ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
    temp = var_d
    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_d):
        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_f = ans_dict[var_e]
var_g = var_c - var_f
print(int(var_g))
Category: Correspondence

Question (EN): In the bookstore, all but 4 of the 40 books were sold out. There were 4 customers in total, and they all bought the same number of books. How many books did a customer buy?
Question (KO): 서점에서 40권의 책 중 4권을 제외한 책들이 모두 팔렸습니다. 손님이 모두 4명이고 손님들이 모두 같은 수의 책을 구매하였습니다. 손님들은 몇 권의 책을 사갔습니까?

Answer: 9

Solution (Python):
var_a = 40
var_b = 4
var_c = var_a - var_b
var_d = 4
var_e = var_c / var_d
print(int(var_e))