philschmid/DMath huggingface dataset:
Category: Comparison

Question (EN): I handed out erasers to both classes. In Dohun’s class, 15 people share 45 erasers, and in Kihun’s class, 5 people share 30 erasers. In which class will one student have more eraser?
Question (KO): 나는 두 반의 학생들에게 지우개를 나누어 주었다. 도훈이네 반은 15명이 지우개 45개를 공유하고, 기훈이네 반은 5명이 지우개 30개를 공유한다. 어떤 반에서 한 학생이 더 많은 지우개를 가지게 됩니까?

Answer: Kihun

Solution (Python):
var_a = 'Dohun'
var_b = 'Kihun'
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 = 45
var_d = 15
var_e = var_c / var_d
var_f = 30
var_g = 5
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: Correspondence

Question (EN): A is 634. A is 593 greater than C. C is 482 less than B. Get B.
Question (KO): A는 634입니다. A는 C보다 593만큼 큽니다. C는 B보다 482만큼 작습니다. B를 구하시오.

Answer: 523

Solution (Python):
var_a = 634
var_b = 593
var_c = var_a - var_b
var_d = 482
var_e = var_c + var_d
print(int(var_e))
Category: Correspondence

Question (EN): Yoongi subtracted 7 from a certain number and got 9. What is this number multiplied by 3?
Question (KO): 윤기는 어떤 숫자에 7을 빼서 9를 얻었습니다. 이 숫자에 3을 곱하면 얼마입니까?

Answer: 48

Solution (Python):
var_a = 9
var_b = 7
var_c = var_a + var_b
var_d = 3
var_e = var_c * var_d
print(int(var_e))
Category: Correspondence

Question (EN): Subtracting 46 from a number resulted in 15. Find how much it would be when 29 is subtracted from this number.
Question (KO): 어떤 수에서 46을 뺐더니 15가 되었습니다. 어떤 수에서 29를 빼면 얼마가 되는지 구하시오.

Answer: 32

Solution (Python):
var_a = 15
var_b = 46
var_c = var_a + var_b
var_d = 29
var_e = var_c - var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Gyeong-hun climbed the mountain, walking at 3 kilometers (km) per hour on the way up and walking at 4 kilometers (km) per hour on the way down, taking an extra 2 kilometers (km) on the way down, for a total of 4 hours. How far did Gyeong-hun go?
Question (KO): 경훈이가 등산을 하는데 올라갈 때는 시속 3 킬로미터(㎞)로 걷고, 내려올 때는 올라갈 때보다 2 킬로미터(㎞) 더 먼 길을 택하여 시속 4 킬로미터(㎞)로 걸어서 총 4시간이 걸렸다고 한다. 경훈이가 내려간 거리는?

Answer: 8

Solution (Python):
var_a = 4
var_b = 2
var_c = 4
var_d = var_b / var_c
var_e = var_a - var_d
var_f = 1
var_g = 3
var_h = var_f / var_g
var_i = 1
var_j = 4
var_k = var_i / var_j
var_l = var_h + var_k
var_m = var_e / var_l
var_n = 2
var_o = var_m + var_n
print(int(var_o))
Category: Possibility

Question (EN): How many four-digit numbers formed by using 1, 3, 7, and 9 once have a 7 in the ones place?
Question (KO): 1, 3, 7, 9를 한 번씩 사용하여 만든 네 자리 숫자 중 일의 자리가 7인 수는 몇 개입니까?

Answer: 6

Solution (Python):
var_a = 1
var_b = 3
var_c = 7
var_d = 9
list_a= []
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 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
var_g = 7
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 = len(list_c)
print(int(var_h))
Category: Arithmetic calculation

Question (EN): Find the smallest divisor of 28.
Question (KO): 28의 약수 중 가장 작은 수는 무엇인지 구하세요

Answer: 1

Solution (Python):
var_a = 28
list_a = []
num_sqrt = int(math.sqrt(var_a))
for i in range(1, num_sqrt+1):
    if var_a % i == 0:
        list_a.append(i)
        list_a.append(int(var_a/i))
list_a = sorted(set(list_a))
var_b = 1
list_b=list_a.copy()
list_b.sort()
var_c = list_b[var_b-1]
print(int(var_c))
Category: Geometry

Question (EN): What do you get if you add all the numbers of sides of a rectangle, triangle, and a circle?
Question (KO): 사각형, 삼각형, 원의 변의 수를 합하면 모두 얼마입니까?

Answer: 7

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

Answer: 21

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(int(var_i))
Category: Possibility

Question (EN): Find the largest quotient of (three-digit number) ÷ (two-digit number) using the number cards 4, 2, 8, 1, 9 only once.
Question (KO): 4, 2, 8, 1, 9 수 카드를 한 번씩만 사용하여 몫이 가장 큰 (세 자리 수)÷(두 자리 수)를 만들었을 때의 몫을 구하세요.

Answer: 82

Solution (Python):
var_a = 4
var_b = 2
var_c = 8
var_d = 1
var_e = 9
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]
var_i = 2
list_d = [str(i) for i in list_a]
list_d = list(itertools.permutations(list_d, var_i))
list_d = [''.join(num_list) for num_list in list_d]
list_d = [str_num for str_num in list_d if str_num[0] != '0']
list_d = [float(i) for i in list_d]
var_j = 1
list_e=list_d.copy()
list_e.sort()
var_k = list_e[var_j-1]
var_l = var_h // var_k
print(int(var_l))
Category: Geometry

Question (EN): I am trying to make a square as small as possible by arranging rectangular bricks 12 centimeters (cm) wide and 15 centimeters (cm) long without overlapping. How many bricks will you need altogether?
Question (KO): 가로가 12센티미터(㎝), 세로가 15센티미터(㎝)인 직사각형 모양의 벽돌을 겹치지 않게 늘어놓아 최대한 작은 정사각형을 만들려고 합니다. 벽돌은 모두 몇 장 필요할까요?

Answer: 20

Solution (Python):
var_a = 12
var_b = 15
var_c = var_b * var_a / math.gcd(int(var_b), int(var_a))
var_d = 2
var_e = var_c ** var_d
var_f = 12
var_g = 15
var_h = var_f * var_g
var_i = var_e / var_h
print(int(var_i))
Category: Correspondence

Question (EN): 51 is the result of mistakenly subtracting 6 from a number instead of multipling by 6. How much is it if you calculate it correctly?
Question (KO): 51은 어떤 수에 6을 곱해야 했는데 실수로 빼서 나온 결과입니다. 원래대로 계산한다면 얼마입니까?

Answer: 342

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

Question (EN): Jihoon cut a fishing line to make a fishing rod. When you add 3.1 meters (m) to the current length of this fishing line, multiply it 3.1 times, and then multiply it again by 2.1 it becomes the length of the original fishing line. If the length of the fishing line of Ji-hoon's fishing rod is 8.9 meters (m), find the original length of the fishing line in meters (m).
Question (KO): 지훈이는 낚시대를 만들기 위해 낚시줄을 잘라냈습니다. 현재 낚시줄 길이에서 3.1미터(m)를 더하고 3.1배 한 값에서 다시 2.1을 곱한 길이가 원래 낚시줄의 길이였습니다. 지훈이의 낚시대의 낚시줄 길이는 8.9미터(m) 일 때, 원래 낚시줄의 길이는 몇 미터(m)인지 구하시오.

Answer: 78.12

Solution (Python):
var_a = 8.9
var_b = 3.1
var_c = var_a + var_b
var_d = 3.1
var_e = var_c * var_d
var_f = 2.1
var_g = var_e * var_f
print('{:.2f}'.format(round(var_g+1e-10,2)))
Category: Comparison

Question (EN): 19 toys are placed in a row. If Toy (A) is 8th from the right, where is toy (A) placed from the left?
Question (KO): 장난감 19개를 한 줄로 놓았습니다. 장난감 (가)는 오른쪽에서 8번째라면 왼쪽에서는 몇 번째입니까?

Answer: 12

Solution (Python):
var_a = 19
var_b = 8
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): A bundle of colored paper includes 10 sheets. When Jungkook has 3 bundles and 8 more individual sheets, how many sheets of colored paper does Jungkook have?
Question (KO): 색종이 1묶음은 10장입니다. 정국이가 색종이 3묶음과 낱개 8장을 가지고 있을 때 정국이가 가지고 있는 색종이는 모두 몇 장 인가요?

Answer: 38

Solution (Python):
var_a = 10
var_b = 3
var_c = var_a * var_b
var_d = 8
var_e = var_c + var_d
print(int(var_e))
Category: Comparison

Question (EN): What is the sum of all numbers less than 0.4 among 0.8, 1/2, 0.9, and 1/3?
Question (KO): 0.8, 1/2, 0.9, 1/3 중에서 0.4보다 작은 수를 모두 더하면 얼마일까요?

Answer: 0.33

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

Question (EN): Yuna, Eunji, Minyoung, and Yoojeong are having a flying contest. Minyoung flew farther than Eunji, and Eunji flew farther than Yoojeong, and Yuna flew farther than Yoojeong. When Minyoung flew farther than Yoojeong, who came last in the competition?
Question (KO): 유나, 은지, 민영, 유정이가 비행기 멀리 날리기 대회를 하고 있습니다. 민영이는 은지보다, 은지가 유정이보다 비행기를 멀리 날렸고 유나는 유정이보다 비행기를 멀리 날렸습니다. 유정이보다 민영이가 비행기를 멀리 날렸을 때, 대회에서 꼴등한 사람은 누구일까요?

Answer: Yoojeong

Solution (Python):
var_a = 'Yuna'
var_b = 'Eunji'
var_c = 'Minyoung'
var_d = 'Yoojeong'
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 = 'Yuna'
var_f = 'Yoojeong'
var_g = '>'
var_h = 'Minyoung'
var_i = 'Eunji'
var_j = '>'
var_k = 'Eunji'
var_l = 'Yoojeong'
var_m = '>'
var_n = 'Yoojeong'
var_o = 'Minyoung'
var_p = '<'
list_b= []
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_q = len(list_c)
var_r = list_c[var_q-1]
print(var_r)
Category: Geometry

Question (EN): A cube with a volume of 3375 cubic centimeters (cm3) is made by stacking building blocks with a volume of 1 cubic centimeters (cm3). How many layers are there in this building of cubes?
Question (KO): 부피가 1세제곱센티미터(㎤)인 쌓기나무를 쌓아 부피가 3375세제곱센티미터(㎤)인 정육면체를 만들었습니다. 이 정육면체의 쌓기나무는 몇 층으로 쌓여 있습니까?

Answer: 15

Solution (Python):
var_a = 3375
var_b = 0.3333333333333333
var_c = var_a ** var_b
print(int(eval('{:.2f}'.format(round(var_c+1e-10,2)))))
Category: Correspondence

Question (EN): If A-10=15, what number should go in A?
Question (KO): A-10=15일 때, A에 들어가야 하는 숫자는 무엇인가요?

Answer: 25

Solution (Python):
var_a = 'A-10=15'
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] = 0
candidate_num = [i for i in range(51)]
candi = list(itertools.product(candidate_num, 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)):
        if term_list[i] == '':
            new_eq += str(term_list[i])+op_list[i]
        else:
            new_eq += str(int(term_list[i]))+op_list[i]
    new_eq += str(int(term_list[-1]))
    new_eq=new_eq.replace('=', '==')
    new_eq=new_eq.replace('>==', '>=')
    new_eq=new_eq.replace('<==', '<=')
    eval_result = False
    try:
        if '=' in new_eq and '>' not in new_eq and '<' not in new_eq:
            new_eq=new_eq.replace('==','=')
            new_eq=new_eq.replace('>','')
            new_eq=new_eq.replace('<','')
            new_eq=new_eq.split('=')
            for i in range(len(new_eq)-1):
                eval_result = math.isclose(eval(new_eq[i]), eval(new_eq[i+1]))
                if not eval_result:
                    break
        else:
            eval_result = eval(new_eq)
    except:
        eval_result = False
        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): Find the number of numbers less than or equal to 6 among single-digit even numbers.
Question (KO): 한 자리수의 짝수 중 6이하의 수의 개수를 구하시오.

Answer: 3

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)
var_c = 6
list_b = []
for i in list_a:
    if i <= var_c:
        list_b.append(i)
var_d = len(list_b)
print(int(var_d))
Category: Arithmetic calculation

Question (EN): What is the largest four-digit number that can be formed using 1, 2, 4, 6, and 5, where each digit is different?
Question (KO): 네 자리 수 중 1, 2, 4, 6, 5를 이용하여 만들 수 있고, 각 자리가 모두 다른 가장 큰 수는 얼마인가?

Answer: 6542

Solution (Python):
var_a = 1
var_b = 2
var_c = 4
var_d = 6
var_e = 5
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 = 4
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]
print(int(var_h))
Category: Arithmetic calculation

Question (EN): There were 7 buses in the parking lot, but after a while 6 more came. How many buses are currently in the parking lot?
Question (KO): 버스 7대가 주차장에 있었는데 잠시 후 6대의 버스가 더 왔다. 현재 주차장에 있는 버스는 총 몇 대인가?

Answer: 13

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

Question (EN): There is a cube with a side length of 8 centimeters (cm). What is the surface area of this cube?
Question (KO): 한 변의 길이가 8센티미터(㎝)인 정육면체가 있습니다. 이 정육면체의 겉넓이는 얼마입니까?

Answer: 384

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

Question (EN): Nine people are standing in a line in order of height from shortest to tallest. Hoseok is standing at the tail end, and Yuna is standing 5th in front of Hoseok. If you line up again in order from tallest to shortest, in what number from the front will Yuna stand?
Question (KO): 키가 작은 사람부터 순서대로 9명이 한 줄로 서 있습니다. 호석이는 가장 뒤에 서 있고, 유나는 호석이로부터 5번째 앞에 서 있습니다. 키가 큰 사람부터 순서대로 다시 줄을 서면 유나는 앞에서부터 몇 번째에 서게 됩니까?

Answer: 6

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

Question (EN): The blue bus takes 4 hours to cover 200 kilometers (km), and the green bus takes 3 hours to cover 180 kilometers (km). What color bus should you use to get to the destination quickly?
Question (KO): 파란색 버스는 200킬로미터(㎞)를 가는 데 4시간이 걸리고, 초록색 버스는 180킬로미터(㎞)를 가는 데 3시간이 걸린다고 합니다. 목적지까지 빨리 도착하기 위해선 어떤 색 버스를 이용하는 게 좋을까요?

Answer: green

Solution (Python):
var_a = 'blue'
var_b = 'green'
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 = 200
var_d = 4
var_e = var_c / var_d
var_f = 180
var_g = 3
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: Geometry

Question (EN): There is a regular tetrahedron with a side length of 7 centimeters (cm). What is the surface area of this tetrahedron in square centimeters (cm2)?
Question (KO): 한 변의 길이가 7센티미터(㎝)인 어떤 정사면체가 있습니다. 이 정사면체의 겉넓이는 몇 제곱센티미터(㎠)입니까?

Answer: 84.87

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

Question (EN): 73 is the result when you subtract 50 from a number, divide it by 4, multiply this by 3 again, and then add 28. What is this number?
Question (KO): 처음 어떤 수에서 50을 빼고 4로 나누었습니다. 여기에 다시 3을 곱하고 28을 더했습니다. 최종 결과가 73일 때 어떤 수를 구하시오.

Answer: 110

Solution (Python):
var_a = 73
var_b = 28
var_c = var_a - var_b
var_d = 3
var_e = var_c / var_d
var_f = 4
var_g = var_e * var_f
var_h = 50
var_i = var_g + var_h
print(int(var_i))
Category: Correspondence

Question (EN): There are two different numbers A and B. Find the sum of A and B in 9A6-BB=BBB.
Question (KO): 서로 다른 두 수 A, B가 있습니다. 9A6-BB=BBB에서 A와 B의 합을 구하시오.

Answer: 15

Solution (Python):
var_a = '9A6-BB=BBB'
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]
var_d = '9A6-BB=BBB'
var_e = 'B'
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: Comparison

Question (EN): There are four numbers in total: 0.8, 1/2, 0.5, and 1/3. How many of them are greater than or equal to 3?
Question (KO): 총 4개의 숫자 0.8, 1/2, 0.5, 1/3이 있습니다. 이 중 3보다 크거나 같은 수는 몇 개 일까요?

Answer: 0

Solution (Python):
var_a = 0.8
var_b = 0.5
var_c = 0.5
var_d = 0.3333333333333333
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 = []
for i in list_a:
    if i >= var_e:
        list_b.append(i)
var_f = len(list_b)
print(int(var_f))