philschmid/DMath huggingface dataset:
Category: Comparison

Question (EN): Among the five numbers 1.4, 9/10, 1.2, 0.5, and 13/10, you picked the number that is smaller than or equal to 1.1. And you arranged them in order of their size. Which number is in the first place?
Question (KO): 1.4, 9/10, 1.2, 0.5, 13/10 5개 숫자 중에서 1.1보다 작거나 같은 숫자를 골라 크거나 같은 순서대로 나열했을 때, 가장 앞에 있는 숫자는 무엇입니까?

Answer: 0.9

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

Question (EN): You are comparing the heights of 20 students. If there are 11 students shorter than Yoongi, how many students are taller than Yoongi?
Question (KO): 20명의 학생들의 키를 비교하고 있습니다. 윤기보다 큰 학생이 11명일 때, 윤기보다 작은 학생은 모두 몇 명입니까?

Answer: 8

Solution (Python):
var_a = 20
var_b = 11
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e))
Category: Correspondence

Question (EN): This candle is currently 48 centimeters (cm) long. If it was originally 1.33 times the current length, find the length of the original candle.
Question (KO): 양초가 현재 48센티미터(㎝)라고 한다. 처음에는 지금의 길이에 1.33배였다고 한다면 처음 양초의 길이를 구하시오.

Answer: 63.84

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

Question (EN): Among the people who came to watch the soccer game, there were 1518 adults, and 536 of them were women. There were 525 more students than adults, 1257 of whom were male. How many women came to watch a soccer game?
Question (KO): 축구 경기를 보러 온 사람 중 성인은 1518명이었고, 이 중에서 여성은 536명이었습니다. 학생은 성인보다 525명이 더 많았고, 이 중에서 남성은 1257명이었습니다. 축구 경기를 보러 온 여성은 몇 명입니까?

Answer: 1322

Solution (Python):
var_a = 1518
var_b = 525
var_c = var_a + var_b
var_d = 1257
var_e = var_c - var_d
var_f = 536
var_g = var_e + var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): I bought 3 sets of top and bottom pajama sets and paid 21,000 won. If the top costs 300 won more than the bottom, what is the price of the bottom?
Question (KO): 상의와 하의 잠옷 세트를 3세트를 사고 21000원을 냈습니다. 상의가 하의보다 300원 비싸다고 할 때, 하의의 가격은 얼마인지 구하시오.

Answer: 3350

Solution (Python):
var_a = 21000
var_b = 3
var_c = var_a / var_b
var_d = 300
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
print(int(var_g))
Category: Comparison

Question (EN): There are three different numbers A, B, and C. A is 38 greater than 18, and B is A minus 26. If C is equal to the quotient of B divided by 3, which of the three numbers is the smallest?
Question (KO): 서로 다른 세 수 A, B, C가 있습니다. A는 18보다 38 크고, B는 A에서 26을 뺀 수입니다. C가 B를 3으로 나눈 몫과 같다면, 세 수 중 가장 작은 수는 무엇입니까?

Answer: C

Solution (Python):
var_a = 'A'
var_b = 'B'
var_c = 'C'
list_a= []
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 18
var_e = 38
var_f = var_d + var_e
var_g = 18
var_h = 38
var_i = var_g + var_h
var_j = 26
var_k = var_i - var_j
var_l = 18
var_m = 38
var_n = var_l + var_m
var_o = 26
var_p = var_n - var_o
var_q = 3
var_r = var_p / var_q
list_b= []
if "/" in str(var_r):
    var_r = eval(str(var_r))
list_b.append(var_r)
if "/" in str(var_k):
    var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
var_s = 1
list_c=list_b.copy()
list_c.sort()
var_t = list_c[var_s-1]
var_u = list_b.index(var_t)+1
var_v = list_a[var_u-1]
print(var_v)
Category: Correspondence

Question (EN): B+B+A=814.8. Multiplying B by 10 equals A. Find the value of A-B including the decimal point.
Question (KO): B+B+A=814.8입니다. B를 10배하면 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: Comparison

Question (EN): Jungkook has a card with the number 0.8 on it, Yoongi has 1/2, and Yoojeong has 0.9. How many people have number cards less than 0.3?
Question (KO): 정국이는 0.8, 윤기는 1/2, 유정이는 0.9의 숫자카드를 갖고 있습니다. 0.3보다 작은 숫자카드를 가지고 있는 사람은 몇 명입니까?

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

Question (EN): How many two-digit numbers are there that are greater than 29 and less than 36?
Question (KO): 29보다 크고 36보다 작은 두 자리 수는 모두 몇 개입니까?

Answer: 6

Solution (Python):
var_a = 29
var_b = 1
var_c = var_a + var_b
var_d = 36
var_e = 1
var_f = var_d - var_e
var_g = 1
list_a = [i for i in range(var_c, var_f + 1, var_g)]
var_h = len(list_a)
print(int(var_h))
Category: Arithmetic calculation

Question (EN): When the grandpa's age was 71 last year, Jung-min was 8. Find how many times the grandpa's age is Jung-min's age this year.
Question (KO): 작년 할아버지가 71살 일 때, 정민이는 8살이였습니다. 올해 할아버지의 나이는 정민이 나이의 몇 배입니까?

Answer: 8

Solution (Python):
var_a = 71
var_b = 1
var_c = var_a + var_b
var_d = 8
var_e = 1
var_f = var_d + var_e
var_g = var_c / var_f
print(int(var_g))
Category: Comparison

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

Answer: 13

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

Question (EN): Find the difference between the largest three-digit number and the smallest three-digit number made by using the number cards 6, 2, and 5 all once.
Question (KO): 숫자 카드 6, 2, 5를 한 번씩 모두 사용하여 만든 가장 큰 세 자리 수와 가장 작은 세 자리 수의 차를 구하시오.

Answer: 650

Solution (Python):
var_a = 6
var_b = 2
var_c = 5
list_a= []
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = 1
list_d=list_a.copy()
list_d.sort()
var_h = list_d[var_g-1]
var_i = var_f - var_h
var_j = abs(var_i)
print(int(var_j))
Category: Possibility

Question (EN): Using 1, 5, 6, and 9 once, find the second smaller three-digit number whose hundreds digit is 5.
Question (KO): 4개의 숫자 1, 5, 6, 9를 한 번씩 사용하여 백의 자리 숫자가 5인 두 번째 작은 세 자리 수를 구하시오.

Answer: 519

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 = 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 = 100
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: Correspondence

Question (EN): You subtracted a particular number from 423 and it became 421. Find the number multiplied by 423 plus 421.
Question (KO): 423에서 어떤 수를 뺐더니 421이 되었습니다. 어떤 수에 423을 곱한 값에 421을 더한 값을 구하시오.

Answer: 1267

Solution (Python):
var_a = 421
var_b = 423
var_c = 423
var_d = 421
var_e = var_c - var_d
var_f = var_b * var_e
var_g = var_a + var_f
print(int(var_g))
Category: Geometry

Question (EN): Jungkook has 5 red balls, 4 blue balls, and 3 yellow balls. When Yoongi gives Jungkook 1 red ball, how many blue balls does Jungkook have?
Question (KO): 정국이는 빨간 공 5개, 파란 공 4개, 노란 공 3개를 가지고 있습니다. 윤기가 정국이에게 빨간 공 1개를 주었을 때, 정국이가 가지고 있는 파란 공의 개수는?

Answer: 4

Solution (Python):
var_a = 4
print(int(var_a))
Category: Arithmetic calculation

Question (EN): Jungkook is trying to put 14/3 liters (l) of milk into several 1/7 liters (l) bottles, and Seokjin is trying to put 15/6 liters (l) of milk into several 1/8 liters (l) bottles. How many bottles can Jungkook and Seokjin fill with milk?
Question (KO): 정국이는 우유 14/3리터(L)를 1/7리터(L)짜리 병에 담으려고 하고, 석진이는 우유 15/6리터(L)를 1/8리터(L)짜리 병에 담으려고 합니다. 우유가 가득 차는 병은 모두 몇 개입니까?

Answer: 51

Solution (Python):
var_a = 4.666666666666667
var_b = 0.14285714285714285
var_c = var_a / var_b
var_d = 0
var_e=int((var_c//(10**(var_d-1)))*10**(var_d-1))

var_f = 2.5
var_g = 0.125
var_h = var_f / var_g
var_i = 0
var_j=int((var_h//(10**(var_i-1)))*10**(var_i-1))

var_k = var_e + var_j
print(int(var_k))
Category: Arithmetic calculation

Question (EN): There are 156 chocolates in each bag. If you bought 20 bags of these chocolates, find how many chocolates there are 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: Comparison

Question (EN): If there are 2 people in front of Jungkook and 4 people behind Jungkook, and the number of people in each row and column is the same, how many people are there in total?
Question (KO): 정국 앞에 2명이 있고, 정국 뒤에 4명이 있고, 각 행, 열의 인원수가 같다면 서있는 사람은 총 몇 명입니까?

Answer: 56

Solution (Python):
var_a = 2
var_b = 4
var_c = var_a + var_b
var_d = 1
var_e = var_c + var_d
var_f = 8
var_g = var_e * var_f
print(int(var_g))
Category: Correspondence

Question (EN): There are marbles in the bag. Divide these marbles into groups of 3, so that you have 2 left, and divide them into groups of 8, so that you have 5 left. Find the 20th smallest number of possible marbles.
Question (KO): 주머니 안에 구슬이 있습니다. 이 구슬을 3개씩 나누어 담으면 2개가 남고, 8개씩 나누어 담으면 5개가 남습니다. 이때 가능한 구슬의 개수 중 20번째로 작은 구슬의 개수를 구하시오.

Answer: 461

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

Question (EN): Find the largest three-digit number that can be formed by using the numbers 2, 5, and 6 when repetition is allowed.
Question (KO): 숫자 2, 5, 6을 중복으로 사용하여 만들 수 있는 세 자리 수 중 가장 큰 수를 구하시오.

Answer: 666

Solution (Python):
var_a = 2
var_b = 5
var_c = 6
list_a= []
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
print(int(var_f))
Category: Correspondence

Question (EN): The quotient of 172 divided by this number is equal to the quotient of 172 divided by 4 minus 28. Find the number when the remainder of 172 divided by this number is 7.
Question (KO): 172를 어떤 수로 나눈 몫은 172를 4로 나눈 몫에서 28을 뺀 값과 같다. 172를 어떤 수로 나눈 나머지가 7일 때,어떤 수를 구하시오.

Answer: 11

Solution (Python):
var_a = 172
var_b = 7
var_c = var_a - var_b
var_d = 172
var_e = 4
var_f = var_d / var_e
var_g = 28
var_h = var_f - var_g
var_i = var_c / var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): Minji drank 0.26 liters (L) of water in the morning and 0.37 liters (L) in the afternoon. Find how many liters (L) of water Minji drank during the day.
Question (KO): 민지는 오전에 0.26리터(L)의 물을 마셨고 오후에 0.37리터(L)의 물을 마셨습니다. 민지가 하루 동안 마신 물은 몇 리터(L)인지 구하시오.

Answer: 0.63

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

Question (EN): The six-digit number 14A56A is a multiple of 4 and also a multiple of 3. Find this six-digit number.
Question (KO): 여섯 자리 수 14A56A는 4의 배수이면서 3의 배수입니다. 이러한 여섯 자리 수를 구하시오.

Answer: 144564

Solution (Python):
var_a = '14A56A'
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 = 3
list_b = []
var_b = int(var_b)
for i in list_a:
    i = int(i)
    if i % var_b == 0:
        list_b.append(i)
var_c = 4
list_c = []
var_c = int(var_c)
for i in list_b:
    i = int(i)
    if i % var_c == 0:
        list_c.append(i)
var_d = 1
var_e = list_c[var_d-1]
print(int(var_e))
Category: Arithmetic calculation

Question (EN): It is said that out of 1256 Go stones, there are 408 more white ones than black ones. Find the number of black Go stones.
Question (KO): 1256개의 바둑돌 중에서 흰 바둑돌이 검은 바둑돌보다 408개 많다고 한다. 검은 바둑돌의 개수를 구하십시오.

Answer: 424

Solution (Python):
var_a = 1256
var_b = 408
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Jungkook picked 25 persimmons. If 3 times the persimmons that Hoseok picked is 4 less than the number of persimmons that Jungkook picked, how many persimmons did Hoseok pick?
Question (KO): 정국이는 감을 25개 땄습니다. 호석이가 딴 감의 3배가 정국이가 딴 감보다 4개 적다면, 호석이가 딴 감은 몇 개입니까?

Answer: 7

Solution (Python):
var_a = 25
var_b = 4
var_c = var_a - var_b
var_d = 3
var_e = var_c // var_d
print(int(var_e))
Category: Correspondence

Question (EN): How many A's from 1 to 9 make A345>5555 true?
Question (KO): 1부터 9까지의 수 A 중 A345>5555가 되게 하는 A는 모두 몇 개 입니까?

Answer: 4

Solution (Python):
var_a = 'A345>5555'
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] = []
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].append(int(c[i]))
list_a = list(set(ans_dict[var_b]))
var_c = len(list_a)
print(int(var_c))
Category: Arithmetic calculation

Question (EN): There is a ball that bounces 1/10 of the height it is dropped. If this ball is dropped from a height of 15 meters (m), find the height in meters (m) of the third jump round to two decimal places.
Question (KO): 떨어뜨린 높이의 1/10만큼씩 튀어 오르는 공이 있습니다. 이 공을 15미터(m) 높이에서 떨어뜨렸다면 세 번째로 튀어 오른 공의 높이를 소수 둘째자리에서 반올림하면 몇 미터(m)인지 구하시오.

Answer: 0.02

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

Question (EN): When A82+3B=216 is valid, find A.
Question (KO): A82+3B=216일 때, A를 구하시오.

Answer: 1

Solution (Python):
var_a = 'A82+3B=216'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
    if v in variable_candi:
        ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
    temp = var_a
    for i, (k, _) in enumerate(ans_dict.items()):
        temp = temp.replace(k, str(c[i]))
    term_list = []
    op_list = []
    temp_c = ''
    for tc in temp:
        if tc not in '+-*/=><().':
            temp_c += tc
        else:
            op_list.append(tc)
            term_list.append(temp_c)
            temp_c = ''
    term_list.append(temp_c)
    new_eq = ''
    for i in range(len(op_list)):
        new_eq += str(int(term_list[i]))+op_list[i]
    new_eq += str(int(term_list[-1]))
    if len(new_eq) == len(var_a):
        new_eq=new_eq.replace('=', '==')
        new_eq=new_eq.replace('>==', '>=')
        new_eq=new_eq.replace('<==', '<=')
        eval_result = False
        try:
            eval_result = eval(new_eq)
        except:
            pass
        if eval_result:
            for i, (k, _) in enumerate(ans_dict.items()):
                ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c))
Category: Geometry

Question (EN): There is a prism whose base side is a regular triangle with sides of 10 centimeters (cm). If the sum of the lengths of all the edges of this prism is 84 centimeters (cm), what is the height of the prism in centimeters (cm)?
Question (KO): 한 변의 길이가 10센티미터(㎝)인 정삼각형을 밑면으로 하는 각기둥이 있습니다. 이 각기둥의 모든 모서리의 길이의 합이 84센티미터(㎝)일 때 각기둥의 높이는 몇 센티미터(㎝)입니까?

Answer: 8

Solution (Python):
var_a = 84
var_b = 10
var_c = 3
var_d = var_b * var_c
var_e = 2
var_f = var_d * var_e
var_g = var_a - var_f
var_h = 3
var_i = var_g / var_h
print(int(var_i))
Category: Correspondence

Question (EN): 5A8-B14=364. What is A?
Question (KO): 5A8-B14=364이 성립합니다. A는 무엇인가요?

Answer: 7

Solution (Python):
var_a = '5A8-B14=364'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
    if v in variable_candi:
        ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
    temp = var_a
    for i, (k, _) in enumerate(ans_dict.items()):
        temp = temp.replace(k, str(c[i]))
    term_list = []
    op_list = []
    temp_c = ''
    for tc in temp:
        if tc not in '+-*/=><().':
            temp_c += tc
        else:
            op_list.append(tc)
            term_list.append(temp_c)
            temp_c = ''
    term_list.append(temp_c)
    new_eq = ''
    for i in range(len(op_list)):
        new_eq += str(int(term_list[i]))+op_list[i]
    new_eq += str(int(term_list[-1]))
    if len(new_eq) == len(var_a):
        new_eq=new_eq.replace('=', '==')
        new_eq=new_eq.replace('>==', '>=')
        new_eq=new_eq.replace('<==', '<=')
        eval_result = False
        try:
            eval_result = eval(new_eq)
        except:
            pass
        if eval_result:
            for i, (k, _) in enumerate(ans_dict.items()):
                ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c))
Category: Comparison

Question (EN): Which shape has the greater area: a square with a side of 4 centimeters (cm) or a triangle with a base of 6 centimeters (cm) and a height of 4 centimeters (cm)?
Question (KO): 한 변의 길이가 4센티미터(㎝)인 정사각형과 밑변의 길이가 6센티미터(㎝)이고, 높이가 4센티미터(㎝)인 삼각형 중에서 넓이가 더 넓은 것은 어느 도형입니까?

Answer: square

Solution (Python):
var_a = 'square'
var_b = 'triangle'
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 = 4
var_d = 2
var_e = var_c ** var_d
var_f = 6
var_g = 4
var_h = var_f * var_g
var_i = 2
var_j = var_h / var_i
list_b= []
if "/" in str(var_j):
    var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_k = 1
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: Geometry

Question (EN): If the width of a rectangular desk is 9 centimeters (cm) and the perimeter is 46 centimeters (cm), what is the length of the desk?

Question (KO): 네모난 책상의 가로가 9센티미터(㎝)이고 둘레가 46센티미터(㎝)이면 책상의 세로는 얼마입니까?

Answer: 14

Solution (Python):
var_a = 46
var_b = 2
var_c = var_a / var_b
var_d = 9
var_e = var_c - var_d
print(int(var_e))
Category: Geometry

Question (EN): The width of the monitor is 12 centimeters (cm) and the circumference is 38 centimeters (cm). Find the height of the monitor.
Question (KO): 모니터의 가로 길이가 12센티미터(㎝)이고 둘레 길이가 38센티미터(㎝)이다. 모니터의 세로 길이를 구하시오.

Answer: 7

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

Question (EN): Yoongi tried to add a three-digit number to 57. Yoongi misread the 9 in the ones in the three-digit number as 6. When the sum obtained by Yoongi was 823, find the correct calculation result.
Question (KO): 윤기는 세 자리 수와 57의 덧셈을 하려 합니다. 윤기는 세 자리 수의 일의 자리 숫자 9를 6으로 잘못 보았습니다. 윤기가 구한 합은 823 일 때, 바르게 계산한 결과를 구하시오.

Answer: 826

Solution (Python):
var_a = 823
var_b = 57
var_c = var_a - var_b
var_d = 6
var_e = 9
var_f = var_d - var_e
var_g = var_c - var_f
var_h = 57
var_i = var_g + var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): Juwon has 105.8 meters (m) of wire. If he needs 4 meters (m) of wire to make one mobile, find how many meters (m) of wire are left after making as many mobiles as Juwon can make.
Question (KO): 주원이는 105.8미터(m)의 철사가 있습니다. 모빌 한 개를 만들기 위해서는 철사 4미터(m)가 필요하다면 주원이가 만들 수 있는 최대한의 모빌을 만들고 남은 철사는 몇 미터(m)인지 구하세요.

Answer: 1.8

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