philschmid/DMath huggingface dataset:
Category: Geometry

Question (EN): Some triangles have all three sides equal in length of 14/8 centimeters (cm). What is the sum of the lengths of the three sides of this triangle in centimeters (cm)?
Question (KO): 어떤 삼각형은 세 변의 길이가 14/8센티미터(㎝)로 모두 같습니다. 이 삼각형의 세 변의 길이의 합은 몇 센티미터(㎝)입니까?

Answer: 5.25

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

Question (EN): There are five numbers 9/10, 1.8, 2, 1, and 11/5. Of these, write the number greater than 1 and less than 2 including the decimal point.
Question (KO): 5개의 수 9/10, 1.8, 2, 1, 11/5이 있습니다. 이 중에서 1보다 크고 2보다 작은 수를 소수점을 포함하여 답을 쓰시오.

Answer: 1.8

Solution (Python):
var_a = 0.9
var_b = 1.8
var_c = 2
var_d = 1
var_e = 2.2
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 = []
for i in list_a:
    if i > var_f:
        list_b.append(i)
var_g = 2
list_c = []
for i in list_b:
    if i < var_g:
        list_c.append(i)
var_h = 1
var_i = list_c[var_h-1]
print('{:.2f}'.format(round(var_i+1e-10,2)))
Category: Correspondence

Question (EN): A is a single digit natural number. Find A from the multiplication formula AA×AA=5929 of two digit numbers where each digit is A.
Question (KO): A는 한 자리 자연수입니다. 각 자리 수가 A로 이루어진 두 자리 수끼리의 곱셈식 AA×AA=5929에서 A를 구하시오.

Answer: 7

Solution (Python):
var_a = 'AA×AA=5929'
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: Possibility

Question (EN): Ga-yeon wants to open the lock. The password for the lock is a three-digit number using only three numbers out of 1, 4, 5, and 9, and is said to be the second largest three-digit number with 9 in the tens place. When all digits are different, what is the password?
Question (KO): 가연이는 자물쇠를 열고자 합니다. 자물쇠의 비밀번호는 1, 4, 5, 9 중 숫자 세 개만 사용한 세 자리 수이며, 십의 자리가 9인 두 번째 큰 세 자리수라고 합니다. 각 자릿수는 모두 다를 때, 비밀번호는 무엇입니까?

Answer: 591

Solution (Python):
var_a = 1
var_b = 4
var_c = 5
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 = 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 = 9
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 = 2
list_d=list_c.copy()
list_d.sort()
var_i = list_d[-var_h]
print(int(var_i))
Category: Comparison

Question (EN): Jungkook had 6 apples, but he got 3 more. When Yoongi has 4 apples and Yuna has 5 apples, who has the most apples?
Question (KO): 6개의 사과를 가지고 있던 정국이는 3개의 사과를 더 받았습니다. 윤기는 4개, 유나는 5개의 사과를 가지고 있을 때, 누가 가장 사과를 많이 가지고 있습니까?

Answer: Jungkook

Solution (Python):
var_a = 'Jungkook'
var_b = 'Yoongi'
var_c = 'Yuna'
list_a= []
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 6
var_e = 3
var_f = var_d + var_e
var_g = 4
var_h = 5
list_b= []
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
var_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[-var_i]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l)
Category: Arithmetic calculation

Question (EN): I am trying to cut a log into 16 slices. It takes 9 seconds to make one cut, and after one cut, it is said to rest for 5 seconds and then cut again. How many seconds will it take to cut all these logs?
Question (KO): 통나무를 16도막으로 자르려고 합니다. 한 번 자르는 데 9초가 걸리고 한 번 자른 후에는 5초 동안 쉬었다가 다시 자른다고 합니다. 이 통나무를 모두 자르는 데 걸리는 시간은 몇 초인가?

Answer: 210

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

Question (EN): When the paint was weighed using a scale and a 100 grams (g) eraser of the same weight, it was equal to the weight of 3 erasers, and when the crayons were weighed, it was equal to the weight of 5 erasers. Which is lighter, paint or crayons?
Question (KO): 무게가 같은 100그램(g)짜리 지우개와 저울을 사용하여 물감의 무게를 재었더니 지우개 3개의 무게와 같았고, 크레파스의 무게를 재었더니 지우개 5개의 무게와 같았습니다. 물감과 크레파스 중 더 가벼운 것은 무엇입니까?

Answer: paint

Solution (Python):
var_a = 'paint'
var_b = 'crayons'
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 = 100
var_d = 3
var_e = var_c * var_d
var_f = 100
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-1]
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 wall in the shape of a rectangle with dimensions of 36 centimeters (cm) wide and 72 centimeters (cm) long. On this wall, I want to attach tiles that are 3 centimeters (cm) and 4 centimeters (cm) in width and length, respectively, without empty spaces. How many tiles should I glue in all?
Question (KO): 어떤 벽이 가로와 세로의 길이가 각각 36센티미터(㎝), 72센티미터(㎝)인 직사각형 모양이다. 이 벽에 가로와 세로의 길이가 각각 3센티미터(㎝), 4센티미터(㎝)인 타일을 빈 공간 없이 붙이려고 합니다. 모두 몇 개를 붙혀야합니까?

Answer: 216

Solution (Python):
var_a = 36
var_b = 3
var_c = var_a // var_b
var_d = 72
var_e = 4
var_f = var_d // var_e
var_g = var_c * var_f
print(int(var_g))
Category: Comparison

Question (EN): There are a total of 4 numbers: 0.8, 1/2, 0.5, 1/3. What is the sum of all numbers greater than 0.1?
Question (KO): 총 4개의 숫자 0.8, 1/2, 0.5, 1/3이 있습니다. 이 중 0.1보다 큰 수를 모두 더하면 얼마인가요?

Answer: 2.13

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 = 0.1
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: Possibility

Question (EN): There are five different points on a circle. Find the number of line segments formed by joining two non-contiguous points.
Question (KO): 원 위에 서로 다른 5개의 점이 있다. 이때 서로 인접하지 않는 2개의 점을 이어서 만든 선분은 모두 몇 개인지 구하시오.

Answer: 10

Solution (Python):
var_a = 5
var_b = 2
var_c = 1
var_a = int(var_a)
var_b = int(var_b)
for i, elem in enumerate(range(var_b)):
    var_c = var_c * (var_a-i)
for i, elem in enumerate(range(var_b)):
    var_c = var_c / (i+1)
print(int(var_c))
Category: Geometry

Question (EN): There is a rectangular farm. If the length of the long side is 1 kilometer (km) and the length of the short side is 2/8 km (km) shorter than the length of the long side, what is the total circumference of the farm in kilometers (km)?
Question (KO): 직사각형 모양의 농장이 있습니다. 긴 변의 길이는 1킬로미터(㎞)이고, 짧은 변의 길이는 긴 변의 길이보다 2/8킬로미터(㎞) 짧다면, 농장의 총 둘레는 몇 킬로미터(㎞)입니까?

Answer: 3.5

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

Question (EN): Students lined up in order of seniority. Yuna is younger than Yujeong who is 15th oldest and older than Eunji who is 17th oldest. In what number oldest is Yuna?
Question (KO): 나이가 많은 순서대로 학생들이 줄을 섰습니다. 유나는 15번째인 유정이보다 나이가 적고 17번째인 은지보다는 나이가 많습니다. 유나는 몇 번째로 나이가 많습니까?

Answer: 16

Solution (Python):
var_a = 15
var_b = 17
var_c = var_a + var_b
var_d = 2
var_e = var_c // var_d
print(int(var_e))
Category: Possibility

Question (EN): If there are 6 students A, B, C, D, E, and F, find the number of ways to select 3 representatives.
Question (KO): A, B, C, D, E, F 6명의 학생이 있을 때, 대표 3명을 뽑는 경우의 수를 구하시오.

Answer: 20

Solution (Python):
var_a = 'A'
var_b = 'B'
var_c = 'C'
var_d = 'D'
var_e = 'E'
var_f = 'F'
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 = len(list_a)
var_h = 3
var_i = 1
var_g = int(var_g)
var_h = int(var_h)
for i, elem in enumerate(range(var_h)):
    var_i = var_i * (var_g-i)
for i, elem in enumerate(range(var_h)):
    var_i = var_i / (i+1)
print(int(var_i))
Category: Comparison

Question (EN): What is the largest number less than 0.7 among 0.8, 1/2, 0.9, and 1/3?
Question (KO): 0.8, 1/2, 0.9, 1/3 중에서 0.7보다 작은 수 중 가장 큰 수는 무엇인가요?

Answer: 0.5

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.7
list_b = []
for i in list_a:
    if i < var_e:
        list_b.append(i)
var_f = 1
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
print('{:.2f}'.format(round(var_g+1e-10,2)))
Category: Geometry

Question (EN): Eight smaller cubes of the same size are stacked to form a larger cube. If the volume of the stacked cubes is 1000 cubic centimeters (cm3), how many centimeters (cm) is the length of one edge of the smaller cube?
Question (KO): 크기가 같은 작은 정육면체 8개를 큰 정육면체 모양으로 쌓았습니다. 쌓은 정육면체 모양의 부피가 1000세제곱센티미터(㎤)일 때 작은 정육면체의 한 모서리의 길이는 몇 센티미터(㎝) 입니까?

Answer: 5

Solution (Python):
var_a = 1000
var_b = 8
var_c = var_a / var_b
var_d = 0.3333333333333333
var_e = var_c ** var_d
print(int(eval('{:.2f}'.format(round(var_e+1e-10,2)))))
Category: Arithmetic calculation

Question (EN): There were 24 cars in the parking lot, and after 8 cars went out, another 6 cars went out. How many cars are left in the parking lot?
Question (KO): 주차장에 자동차 24대가 있었는데 8대가 나간 후에 또 6대가 나갔습니다. 주차장에 남아있는 자동차는 몇 대입니까?

Answer: 10

Solution (Python):
var_a = 24
var_b = 8
var_c = var_a - var_b
var_d = 6
var_e = var_c - var_d
print(int(var_e))
Category: Possibility

Question (EN): What is the tenth largest number among four digits with odd digits?
Question (KO): 각 자리 수가 홀수인 네 자리 수 중에서 열 번째로 큰 수는 무엇입니까?

Answer: 9971

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 = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=var_c))
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_d = 10
list_c=list_b.copy()
list_c.sort()
var_e = list_c[-var_d]
print(int(var_e))
Category: Correspondence

Question (EN): Hoseok added 36 to a certain number and got 71. What is the value of adding 10 to this certain number?
Question (KO): 호석이는 어떤 수에 36을 더해 71을 얻었습니다. 어떤 수에 10을 더한 값은 얼마입니까?

Answer: 45

Solution (Python):
var_a = 71
var_b = 36
var_c = var_a - var_b
var_d = 10
var_e = var_c + var_d
print(int(var_e))
Category: Comparison

Question (EN): 20 cars are parked in a row. The black car is 16th from the right, and the white car is 11th from the left. How many cars are between the black and white cars?
Question (KO): 자동차 20대가 한 줄로 주차되어 있습니다. 검은색 자동차는 오른쪽에서 16번째에 있고, 흰색 자동차는 왼쪽에서 11번째에 있습니다. 검은색 자동차와 흰색 자동차 사이에 있는 자동차는 몇 대입니까?

Answer: 5

Solution (Python):
var_a = 16
var_b = 11
var_c = var_a + var_b
var_d = 20
var_e = var_c - var_d
var_f = 2
var_g = var_e - var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): Taehyung's average score for Korean, English, and science is 95. When Taehyung says his average score dropped by 3 points after taking the math test, what is his math score?
Question (KO): 태형이는 국어, 영어, 과학의 평균 점수는 95점입니다. 태형이가 수학 시험을 본 후 평균 점수가 3점 떨어졌다고 할 때, 태형이의 수학 점수는 몇 점입니까?

Answer: 83

Solution (Python):
var_a = 95
var_b = 3
var_c = var_a - var_b
var_d = 4
var_e = var_c * var_d
var_f = 95
var_g = 3
var_h = var_f * var_g
var_i = var_e - var_h
print(int(var_i))
Category: Geometry

Question (EN): Given that the sum of the lengths of the edges of one face of a regular tetrahedron is 18 centimeters (cm), how long is the length of one edge of this tetrahedron?
Question (KO): 정사면체의 한 면을 선택해 모서리 길이의 합을 구하였더니 18센티미터(㎝)였습니다. 이 정사면체의 한 모서리의 길이는 얼마입니까?

Answer: 6

Solution (Python):
var_a = 18
var_b = 3
var_c = var_a / var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): Randomly selected two digit numbers were 31, 49, 62, and 76. What is the difference between the largest and smallest of these numbers?
Question (KO): 두 자리 수 중 몇 개의 수를 무작위로 선택하였더니 31, 49, 62, 76이었습니다. 이 수들 중 가장 큰 수와 가장 작은 수의 차를 구하면 얼마입니까?

Answer: 45

Solution (Python):
var_a = 49
var_b = 31
var_c = 76
var_d = 62
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 = 1
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: Geometry

Question (EN): There is an icosikaipentagon. How many diagonals can you draw from one vertex?
Question (KO): 이십오각형이 있습니다. 한 꼭짓점에서 대각선을 그으려고 할 때, 그을 수 있는 대각선의 수는 몇 개 인가요?

Answer: 22

Solution (Python):
var_a = 25
var_b = 3
var_c = var_a - var_b
print(int(var_c))
Category: Geometry

Question (EN): Jaewoong's house has a rectangular swimming pool with an area of 143.2 square meters (m2). If the length of this pool is 4 meters (m), what is the width in meters (m)?
Question (KO): 재웅이네 집에는 넓이가 143.2제곱미터(㎡)인 직사각형 모양의 수영장이 있습니다. 이 수영장의 세로가 4미터(m) 일 때, 가로는 몇 미터(m)입니까?

Answer: 35.8

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

Question (EN): A+B+B=814.8. When a decimal point of B is moved one place to the right, it becomes equivalent to A. Calculate the value of A-B including the decimal point.
Question (KO): A+B+B=814.8입니다. B의 소수점을 오른쪽으로 한 칸 옮기면 A와 같습니다. 소수점을 포함하여 A-B의 값을 구하시오.

Answer: 34.92

Solution (Python):
var_a = 814.8
var_b = 10
var_c = 10
var_d = var_b + var_c
var_e = 1
var_f = var_d + var_e
var_g = var_a / var_f
var_h = 814.8
var_i = 10
var_j = 10
var_k = var_i + var_j
var_l = 1
var_m = var_k + var_l
var_n = var_h / var_m
var_o = 10
var_p = var_n / var_o
var_q = var_g - var_p
print('{:.2f}'.format(round(var_q+1e-10,2)))
Category: Arithmetic calculation

Question (EN): The distance from the orchard to the house is 800 meters (m), the distance from the house to the pharmacy is 1300 meters (m), and the distance from the pharmacy to the school is 1700 meters (m). How many meters (m) is the distance from the orchard through the house to the pharmacy greater than the distance from the pharmacy to the school?
Question (KO): 과수원에서 집까지의 거리는 800미터(m)이고, 집에서 약국까지의 거리는 1300미터(m), 약국에서 학교까지의 거리는 1700미터(m)입니다. 과수원에서 집을 거쳐 약국까지의 거리는 약국에서 학교까지의 거리보다 몇 미터(m) 더 멉니까?

Answer: 400

Solution (Python):
var_a = 800
var_b = 1300
var_c = var_a + var_b
var_d = 1700
var_e = var_c - var_d
print(int(var_e))
Category: Correspondence

Question (EN): ABCD+ABCD=5472. What is the value of D when A, B, C, and D are different numbers?
Question (KO): ABCD+ABCD=5472입니다. A, B, C, D가 서로 다른 수 일때 D의 값은 무엇인가요?

Answer: 6

Solution (Python):
var_a = 'ABCD+ABCD=5472'
var_b = 'D'
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): If there are four numbers 10, 11, 12, and 13, what is the 2nd largest number divided by the 2nd smallest number?
Question (KO): 4개의 수 10, 11, 12, 13이 있습니다. 그 중에서 2번째로 큰 수와 2번째로 작은 수로 나눈 값은 얼마입니까?

Answer: 1.09

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

Question (EN): How many diagonals can you draw in a hexagon?
Question (KO): 육각형 내에 그릴 수 있는 대각선의 개수는?

Answer: 9

Solution (Python):
var_a = 6
var_b = 6
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: Arithmetic calculation

Question (EN): Find how many divisors of 40 are there excluding 40.
Question (KO): 40의 약수 중 40을 제외한 약수의 개수를 구하시오.

Answer: 7

Solution (Python):
var_a = 40
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 = 40
list_b= []
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_b.append(var_b)
list_b.reverse()
list_c = list(set(list_a) - set(list_b))
var_c = len(list_c)
print(int(var_c))
Category: Arithmetic calculation

Question (EN): There were 25 boxes of apples and 12 boxes of pears in the mart. If you buy 8 more boxes of apples and 8 more boxes of pears, how many more boxes of apples there are than boxes of pears?
Question (KO): 마트에 사과 25상자와 배 12상자가 있었습니다. 사과 8상자와 배 8상자를 더 사 왔을 때, 사과는 배보다 몇 상자 더 많아집니까?

Answer: 13

Solution (Python):
var_a = 25
var_b = 8
var_c = var_a + var_b
var_d = 12
var_e = 8
var_f = var_d + var_e
var_g = var_c - var_f
print(int(var_g))
Category: Geometry

Question (EN): The volume of a cuboid is 315 square centimeters (cm2). If the width is 9 centimeters (cm) and the length is 7 centimeters (cm), what is the height in centimeters (cm)?
Question (KO): 직육면체의 부피가 315제곱센티미터(㎠) 입니다. 가로의 길이가 9센티미터(㎝), 세로의 길이가 7센티미터(㎝)이라면 높이는 몇 센티미터(㎝)입니까?

Answer: 5

Solution (Python):
var_a = 315
var_b = 9
var_c = var_a / var_b
var_d = 7
var_e = var_c / var_d
print(int(var_e))
Category: Correspondence

Question (EN): Yoongi tries to find the difference between a two-digit number and 53. Yoongi misunderstood the tens and ones digits of 53 and thought it was 35. The difference Yoongi calculated incorrectly is 27. Find the correct result.
Question (KO): 윤기는 두 자리 수와 53의 차를 구하려 합니다. 윤기는 53의 십의 자리 숫자와 일의 자리 숫자를 잘못 보아 35라고 보았습니다. 윤기가 잘못 계산한 차가 27, 바르게 계산한 결과를 구하시오.

Answer: 9

Solution (Python):
var_a = 27
var_b = 35
var_c = var_a + var_b
var_d = 53
var_e = var_c - var_d
print(int(var_e))
Category: Geometry

Question (EN): Find the product of the number of faces and the number of vertices of a cube.
Question (KO): 정육면체의 면의 수와 꼭짓점의 수의 곱을 구하시오.

Answer: 48

Solution (Python):
var_a = 6
var_b = 8
var_c = var_a * var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): How many natural numbers are there not more than 30 are odd or multiples of 5?
Question (KO): 30이하의 자연수 중에서 5의 배수이거나 홀수인 수는 모두 몇 개인지 구하시오.

Answer: 18

Solution (Python):
var_a = 1
var_b = 30
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 5
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 = 1
var_f = 30
list_c = []
if var_e%2==0:
    for i in range(var_e+1, var_f+1, 2):
        list_c.append(i)
else:
    for i in range(var_e, var_f+1, 2):
        list_c.append(i)
list_d = list(set(list_b) | set(list_c))
var_g = len(list_d)
print(int(var_g))
Category: Correspondence

Question (EN): When we divide 37 by 8, the remainder is B and the quotient is A. Find the right value for A.
Question (KO): 37을 8로 나눴더니 나머지가 B, 몫이 A가 되었습니다. A에 알맞은 값을 구하시오.

Answer: 4

Solution (Python):
var_a = 37
var_b = 8
var_c = var_a // var_b
print(int(var_c))