philschmid/DMath huggingface dataset:
Category: Arithmetic calculation

Question (EN): There are 41 students in the piano academy that Yejun attends, and among them, 3 more students attend Purum Elementary School than those who do not attend Purum Elementary School. How many students attend Purum Elementary School?
Question (KO): 예준이가 다니는 피아노 학원의 학생 수는 41명이고, 그중에서 푸름초등학교에 다니는 학생은 푸름초등학교에 다니지 않는 학생보다 3명 많습니다. 푸름초등학교에 다니는 학생은 몇 명입니까?

Answer: 22

Solution (Python):
var_a = 41
var_b = 3
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
var_f = 3
var_g = var_e + var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): There are 20 bags of chocolates, each containing 156 pieces. How many chocolates are there in all?
Question (KO): 한 봉지에 156개씩 담은 초콜릿이 20봉지 있습니다. 초콜릿은 모두 몇 개일까요?

Answer: 3120

Solution (Python):
var_a = 156
var_b = 20
var_c = var_a * var_b
print(int(var_c))
Category: Correspondence

Question (EN): Yoongi subtracts 56 from a certain number to get 11. Find the number.
Question (KO): 윤기는 어떤 수에서 56을 빼 11를 얻었습니다. 어떤 수를 구하시오.

Answer: 67

Solution (Python):
var_a = 11
var_b = 56
var_c = var_a + var_b
print(int(var_c))
Category: Possibility

Question (EN): Using the four digits 1, 5, 6, and 9 once, find the second smallest two-digit number whose tens digit is 5.
Question (KO): 4개의 숫자 1, 5, 6, 9를 한 번씩 사용하여 십의 자리 숫자가 5인 두 번째로 작은 두 자리 수를 구하시오.

Answer: 56

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

Question (EN): Which four-digit number is the smallest common multiple of 2, 3, 8, and 9?
Question (KO): 네 자리 수 중 2, 3, 8, 9의 공배수 중 가장 작은 수는 무엇입니까?

Answer: 1008

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

Question (EN): Some number minus 7 returns 9. What will be the answer if the number is multiplied by 5?
Question (KO): 7를 어떤 수에서 뺐더니 9가 되었습니다. 5를 어떤 수에 곱하면 얼마가 되는지 구하시오.

Answer: 80

Solution (Python):
var_a = 9
var_b = 7
var_c = var_a + var_b
var_d = 5
var_e = var_c * var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Find the sum of odd numbers from 100 to 200.
Question (KO): 100부터 200까지의 홀수의 합을 구하시오.

Answer: 7500

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

Question (EN): If you fold a 94 centimeters (cm) shoelace to be 68 centimeters (cm) so that the middle overlaps, how long is the overlapped part in centimeters (cm)?
Question (KO): 94센티미터(㎝)의 운동화 끈을 중간이 겹치도록 접어 68센티미터(㎝)로 만들었을 때, 겹쳐진 부분의 길이는 몇 센티미터(㎝)입니까?

Answer: 13

Solution (Python):
var_a = 94
var_b = 68
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e))
Category: Comparison

Question (EN): Chinese cabbage was planted on 2/7 of the field and eggplant on 3/8. Cabbage or eggplant, which planted area is larger?
Question (KO): 밭의 2/7에는 배추, 3/8에는 가지를 심었습니다. 배추와 가지 중 어느 것을 심은 부분이 더 넓을까요?

Answer: eggplant

Solution (Python):
var_a = 'cabbage'
var_b = 'eggplant'
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.2857142857142857
var_d = 0.375
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): There are 96 stakes at 10-meter (m) intervals around the sheep pasture, and 82 stakes at 20-meter (m) intervals around the perimeter of the horse pasture. What is the difference between the perimeters of the two ranches in meters (m)?
Question (KO): 양을 기르는 목장의 둘레에는 10미터(m) 간격으로 96개의 말뚝이 있고 말을 기르는 목장의 둘레에는 20미터(m) 간격으로 82개의 말뚝이 있습니다. 두 목장의 둘레의 차는 몇 미터(m)입니까?

Answer: 680

Solution (Python):
var_a = 10
var_b = 96
var_c = var_a * var_b
var_d = 20
var_e = 82
var_f = var_d * var_e
var_g = var_c - var_f
var_h = abs(var_g)
print(int(var_h))
Category: Possibility

Question (EN): How many total four-digit numbers can be formed by using all the natural numbers 2, 5, 6, and 9 without overlapping?
Question (KO): 자연수 2, 5, 6, 9를 겹치지 않게 모두 사용하여 만들 수 있는 네 자리 수는 총 몇 가지 입니까?

Answer: 24

Solution (Python):
var_a = 2
var_b = 5
var_c = 9
var_d = 6
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 = len(list_b)
print(int(var_f))
Category: Arithmetic calculation

Question (EN): While a centipede can crawl 5 meters (m) in 3 minutes, an earthworm can crawl 5 meters (m) in 2 minutes. If the centipede starts crawling 20 meters (m) ahead of the earthworm and they both start crawling at the same time, find how many minutes takes for them to meet after the departure.
Question (KO): 지네는 3분동안 5미터(m)를 기어갈 수 있습니다. 지렁이는 2분에 5미터(m)를 기어갈 수 있습니다. 지네의 출발점은 지렁이보다 20미터(m) 앞서있고 동시에 앞을 보고 출발했다면 지네와 지렁이가 만나게 되는 때는 출발 몇 분 후인지 구하세요.

Answer: 24

Solution (Python):
var_a = 20
var_b = 5
var_c = 2
var_d = var_b / var_c
var_e = 5
var_f = 3
var_g = var_e / var_f
var_h = var_d - var_g
var_i = var_a / var_h
print(int(eval('{:.2f}'.format(round(var_i+1e-10,2)))))
Category: Comparison

Question (EN): Jungkook has 0.8, Yoongi has 1/2, Yoojung has 0.9, Yuna has 1/3 number card. How many people have number cards greater than or equal to 0.3?
Question (KO): 정국이는 0.8, 윤기는 1/2, 유정이는 0.9, 유나는 1/3의 숫자카드를 갖고 있습니다. 0.3보다 크거나 같은 숫자카드를 가지고 있는 사람은 몇 명입니까?

Answer: 4

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.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))
Category: Arithmetic calculation

Question (EN): There are 34 roses. There are 13 more lilies than roses. There are 23 fewer tulips than lilies. How many roses, lilies and tulips are there in all?
Question (KO): 장미가 34송이 있습니다. 백합은 장미보다 13송이 더 많습니다. 튤립은 백합보다 23송이 적습니다. 장미, 백합, 튤립은 모두 몇 송이 있습니까?

Answer: 105

Solution (Python):
var_a = 34
var_b = 34
var_c = 13
var_d = var_b + var_c
var_e = var_a + var_d
var_f = 34
var_g = 13
var_h = var_f + var_g
var_i = 23
var_j = var_h - var_i
var_k = var_e + var_j
print(int(var_k))
Category: Arithmetic calculation

Question (EN): On day 1, 215 liters (l) of water was added to the pool, and on day 2, 76 liters (l) of water was added than on day 1. On the third day, I put 53 liters (l) less than on the second day. How many liters (l) of water do you drink on average each day?
Question (KO): 수영장에 1번째 날에는 215리터(L)의 물을 넣고, 2번째 날에는 1번째 날보다 76리터(L)의 물을 더 많이 넣었습니다. 3번째 날에는 2번째 날보다 53리터(L) 더 적게 넣었습니다. 매일 평균 몇 리터(L)의 물을 넣었습니까?

Answer: 248

Solution (Python):
var_a = 215
var_b = 215
var_c = 76
var_d = var_b + var_c
var_e = var_a + var_d
var_f = 215
var_g = 76
var_h = var_f + var_g
var_i = 53
var_j = var_h - var_i
var_k = var_e + var_j
var_l = 3
var_m = var_k / var_l
print(int(var_m))
Category: Possibility

Question (EN): You want to create a three-digit number by selecting three numbers from 0, 2, 4, and 6. If only the number can be used once, find the product of the largest possible number and the smallest possible number.
Question (KO): 0, 2, 4, 6 중 세 개를 선택하고 이를 한 번씩만 사용하여 세 자리 수를 만들려고 합니다. 가능한 가장 큰 수와 가장 작은 수의 곱을 찾으십시오.

Answer: 130968

Solution (Python):
var_a = 0
var_b = 2
var_c = 4
var_d = 6
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 = 1
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
var_h = 1
list_d=list_b.copy()
list_d.sort()
var_i = list_d[var_h-1]
var_j = var_g * var_i
print(int(var_j))
Category: Geometry

Question (EN): A square was created by arranging 10 square-shaped ttakjis for each vertical and horizontal line without gaps. Find the number of ttakjis placed at the perimeter.
Question (KO): 정사각형 모양의 딱지를 가로와 세로 모두 10장씩 빈틈없이 늘어놓아 정사각형을 만들었습니다. 둘레에 놓인 딱지의 개수를 구하시오.

Answer: 36

Solution (Python):
var_a = 10
var_b = 4
var_c = var_a * var_b
var_d = 4
var_e = var_c - var_d
print(int(var_e))
Category: Correspondence

Question (EN): 13+4A=58. How much is A?
Question (KO): 13+4A=58입니다. A는 얼마인가요?

Answer: 5

Solution (Python):
var_a = '13+4A=58'
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 car travels 2 kilometers (km) per minute on a 6-kilometer (km) road. If the car is at a 2-kilometer (km) point, find how many minutes have passed after the car set off.
Question (KO): 6킬로미터(㎞)인 도로를 1분에 2킬로미터(㎞)달리는 자동차가 있다. 자동차가 2킬로미터(㎞)지점에 있다면 출발한 지 몇 분 후인지 구하시오.

Answer: 1

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

Question (EN): If 60 notebooks and 84 pencils should be distributed equally to all students, think of the maximum number of students that can receive the supplies.
Question (KO): 모든 학생들에게 똑같이 나눌 때, 공책 60권과 연필 84자루는 최대 몇 명에게 나누어줄 수 있습니까?

Answer: 5

Solution (Python):
var_a = 60
var_b = 60
var_c = 84
var_d = math.gcd(int(var_c), int(var_b))
var_e = var_a / var_d
print(int(var_e))
Category: Possibility

Question (EN): Use the four number cards 0, 1, 4, and 8 in duplicate to find the largest three-digit number with zero in the tens digit.
Question (KO): 4개의 숫자 카드 0, 1, 4, 8을 중복을 사용하여 세 자리 수를 만들려고 한다. 십의 자리 숫자가 0인 가장 큰 세 자리 수를 구하시오.

Answer: 808

Solution (Python):
var_a = 0
var_b = 1
var_c = 4
var_d = 8
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.product(list_b, repeat=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 = 0
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 = 1
list_d=list_c.copy()
list_d.sort()
var_i = list_d[-var_h]
print(int(var_i))
Category: Possibility

Question (EN): When tossing two coins, A and B, how many times can you get 2 heads or 1 heads?
Question (KO): 두 개의 동전 A, B를 던질 때, 앞면이 2개 또는 1개가 나오는 경우의 수는 몇 가지입니까?

Answer: 3

Solution (Python):
var_a = 2
var_b = 'A'
var_c = 'B'
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)
list_a.reverse()
var_d = len(list_a)
var_e = 2
var_f = var_d - var_e
var_g = var_a ** var_f
var_h = 2
var_i = 'A'
var_j = 'B'
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)
list_b.reverse()
var_k = len(list_b)
var_l = 1
var_m = var_k - var_l
var_n = var_h ** var_m
var_o = var_g + var_n
print(int(var_o))
Category: Geometry

Question (EN): The area of a square with a side of 5 centimeters (cm) is equal to the area of a rectangle with a side of 4 centimeters (cm). Find the length of the other side of the rectangle as a decimal number.
Question (KO): 한 변의 길이가 5센티미터(㎝)인 정사각형의 넓이와 한 변의 길이가 4센티미터(㎝)인 직사각형의 넓이는 같습니다. 직사각형의 다른 한변의 길이를 소수로 나타내어 보세요.

Answer: 6.25

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

Question (EN): There are 5 bottles of 120 milliliters (ml) of soda and 3 bottles of 350 milliliters (ml) of coke. If you want to drink 2500 milliliters (ml), find how many milliliters (ml) more you need to drink.
Question (KO): 사이다 120밀리리터(㎖)가 5병이 있고 콜라 350밀리리터(㎖)가 3병이 있다. 2500밀리리터(㎖)를 마시려고 할 때 더 필요한 음료의 양은 몇 밀리리터(㎖)인지 구하시오.

Answer: 850

Solution (Python):
var_a = 2500
var_b = 120
var_c = 5
var_d = var_b * var_c
var_e = 350
var_f = 3
var_g = var_e * var_f
var_h = var_d + var_g
var_i = var_a - var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): They are going to give each person 2/5 of a pizza. How many pizzas are needed to serve 10 people?
Question (KO): 한 사람당 피자 한 판의 2/5씩 나누어 주려고 합니다. 10명에게 나누어 주려면 피자는 몇 판 필요합니까?

Answer: 4

Solution (Python):
var_a = 0.4
var_b = 10
var_c = var_a * var_b
print(int(var_c))
Category: Possibility

Question (EN): Some numbers are greater than or equal to 1620006 and less than or equal to 1629996. Find the largest of these numbers that is a multiple of 123.
Question (KO): 어떤 수는 1620006보다 같거나 크고 1629996보다 같거나 작다. 이러한 수 중 123의 배수이면서 가장 큰 수를 구하시오.

Answer: 1629996

Solution (Python):
var_a = 1620006
var_b = 1629996
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 123
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
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
print(int(var_f))
Category: Possibility

Question (EN): Find the 6th largest number among four digits that can be formed by using 1, 3, 0, and 5 only once.
Question (KO): 1, 3, 0, 5를 한 번씩만 사용하여 만들 수 있는 네 자리 수 중에서 6번째로 큰 수를 쓰시오.

Answer: 5013

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

Question (EN): The five students, Yoongi, Jungkook, Yuna, Yoojung, and Taehyung, each have the numbers 7, 6, 9, 8, and 10. 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): From Donggil's house, it takes 0.76 kilometers (km) to get to the mart, and it takes 17/25 kilometers (km) to get to the hospital. Which place is closer to Donggil's house?
Question (KO): 동길이네 집에서 마트까지는 0.76킬로미터(㎞)이며 병원까지는 17/25킬로미터(㎞)입니다. 동길이네 집에서 어느 곳이 더 가깝습니까?

Answer: hospital

Solution (Python):
var_a = 'mart'
var_b = 'hospital'
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.76
var_d = 0.68
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: Correspondence

Question (EN): What number in A makes A78-2B4=364 true?
Question (KO): A78-2B4=364를 성립시키는 A는 얼마인가요?

Answer: 5

Solution (Python):
var_a = 'A78-2B4=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: Arithmetic calculation

Question (EN): If the elements of set A are 1/2, 1/3, 1/5 and the elements of set B are 0.2, 0.4, 0.5, 0.7, find the number of elements in the union of sets A and B.
Question (KO): 집합 A의 원소는 1/2, 1/3, 1/5이고, 집합 B의 원소는 0.2, 0.4, 0.5, 0.7일 때 집합 A와 B의 합집합의 원소의 개수를 구하시오.

Answer: 5

Solution (Python):
var_a = 0.5
var_b = 0.3333333333333333
var_c = 0.2
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 = 0.2
var_e = 0.4
var_f = 0.5
var_g = 0.7
list_b= []
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()
list_c = list(set(list_a) | set(list_b))
var_h = len(list_c)
print(int(var_h))
Category: Comparison

Question (EN): 20 students stood in a line. Jungkook stands third in line, and Yoongi stands behind Jungkook. If there are 5 students between Yoongi and Jungkook, how many students are standing behind Yoongi?
Question (KO): 20명의 학생들이 한줄로 섰습니다. 정국이는 3등으로 줄을 섰고, 윤기는 정국이보다 뒤에 서있습니다. 윤기와 정국이 사이에 5명의 학생이 있을 때, 윤기 뒤에 서 있는 학생은 몇 명입니까?

Answer: 11

Solution (Python):
var_a = 20
var_b = 3
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): What is the sum of all numbers less than 0.4 among 0.8, 1/2, and 0.9?
Question (KO): 0.8, 1/2, 0.9 중에서 0.4보다 작은 수를 모두 더하면 얼마일까요?

Answer: 0

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