philschmid/DMath huggingface dataset:
Category: Possibility

Question (EN): There are 4 female students and 3 male students. If one female student and one male student want to be in charge of weekly duty, in how many ways can you choose students to be in charge of weekly duty?
Question (KO): 여학생 4명과 남학생 3명이 있습니다. 여학생 한 명과 남학생 한 명이 주번이 되려고 한다면 가능한 주번의 종류는 몇 가지 인가요?

Answer: 12

Solution (Python):
var_a = 4
var_b = 1
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)
var_d = 3
var_e = 1
var_f = 1
var_d = int(var_d)
var_e = int(var_e)
for i, elem in enumerate(range(var_e)):
    var_f = var_f * (var_d-i)
for i, elem in enumerate(range(var_e)):
    var_f = var_f / (i+1)
var_g = var_c * var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): What is the sum of 1.48, 2.32, and 8.45?
Question (KO): 1.48, 2.32, 8.45의 총합은 얼마입니까?

Answer: 12.25

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

Question (EN): It is said that water comes out of the faucet at 36.6 liters (L) per minute. It is also said that 2.4 liters (L) of water evaporates per minute. If there were 10 liters (L) of water at the beginning, how many liters (L) will there be after 7 minutes and 45 seconds?
Question (KO): 수도에서 물이 분당 36.6리터(L)나온다고 합니다. 또한 분당 2.4리터(L)의 물이 증발한다고 합니다. 처음에는 물이 10리터(L) 있었다면 7분 45초 후에는 몇 리터(L)있을까요?

Answer: 275.05

Solution (Python):
var_a = 10
var_b = 36.6
var_c = 2.4
var_d = var_b - var_c
var_e = 7
var_f = 45
var_g = 60
var_h = var_f / var_g
var_i = var_e + var_h
var_j = var_d * var_i
var_k = var_a + var_j
print('{:.2f}'.format(round(var_k+1e-10,2)))
Category: Arithmetic calculation

Question (EN): Moving the decimal point of a decimal number three digits left makes it 2.71 smaller than it originally was. Find the original decimal number.
Question (KO): 어떤 소수의 소수점을 왼쪽으로 세 자리 옮겼더니 원래보다 2.71만큼 더 작아졌습니다. 원래의 소수를 구하시오.

Answer: 2.71

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

Question (EN): Taehyung solved the workbook with 161 problems for 7 days. Find the average number of problems Taehyung solved per day.
Question (KO): 태형이는 161문제가 있는 문제집을 7일 동안 풀었습니다. 태형이가 하루에 푼 문제는 평균 몇 문제인지 구하세요.

Answer: 23

Solution (Python):
var_a = 161
var_b = 7
var_c = var_a / var_b
print(int(var_c))
Category: Correspondence

Question (EN): A number minus 8 equals 5 times 7 plus 12. Find the value of the number.
Question (KO): 어떤 수에서 8 을 뺀 값은 5 와 7 의 곱에 12 를 더한 값과 같습니다. 어떤 수는 얼마인지 구하시오.

Answer: 55

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

Question (EN): Yoongi's school has 280 students, 127 of which are female students. Find how many more male students than female students in Yoongi's school.
Question (KO): 윤기네 학교 학생 수는 280명이고 그중에서 여학생은 127명입니다. 윤기네 학교는 남학생이 여학생보다 몇 명 더 많은지 구하시오.

Answer: 26

Solution (Python):
var_a = 280
var_b = 127
var_c = var_a - var_b
var_d = 127
var_e = var_c - var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Mingi's math test covers from page 8 to page 21 of the textbook. How many pages is it in total?
Question (KO): 민기네 수학 시험의 범위는 교과서 8쪽부터 21쪽 까지이다. 총 몇 장인가?

Answer: 14

Solution (Python):
var_a = 8
var_b = 21
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = len(list_a)
print(int(var_d))
Category: Correspondence

Question (EN): In the three-digit addition expression 7A5+B7C=D38, A through D are different numbers. How much is D?
Question (KO): 7A5+B7C=D38에서 A부터 D는 서로 다른 수입니다. D는 얼마입니까?

Answer: 9

Solution (Python):
var_a = '7A5+B7C=D38'
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: Comparison

Question (EN): In the swimming competition, my sister crossed the finish line in 51st place, and my grandfather crossed the finish line in 53rd place. I was better than my grandfather but worse than my sister. What is my rank?
Question (KO): 수영 시합에서 누나는 51등으로 결승선을 넘었고, 할아버지는 53등으로 결승선을 넘었습니다. 나는 할아버지보다 잘했지만 누나보다는 못했습니다. 나의 등수는 몇 등입니까?

Answer: 52

Solution (Python):
var_a = 51
var_b = 53
var_c = var_a + var_b
var_d = 2
var_e = var_c // var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): When there are five different numbers: 10, 11, 12, 13, and 14, what is the quotient of the largest number divided by the smallest number?
Question (KO): 5개의 수 10, 11, 12, 13, 14가 있습니다. 그 중에서 가장 큰 수를 가장 작은 수로 나눈 몫은 얼마입니까?

Answer: 1

Solution (Python):
var_a = 10
var_b = 11
var_c = 12
var_d = 13
var_e = 14
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=list_a.copy()
list_b.sort()
var_g = list_b[-var_f]
var_h = 1
list_c=list_a.copy()
list_c.sort()
var_i = list_c[var_h-1]
var_j = var_g // var_i
print(int(var_j))
Category: Comparison

Question (EN): Yoongi has 4, and Yuna has 5, and Jungkook has 6 minus 3. Who has the biggest number?
Question (KO): 윤기는 4, 유나는 5, 정국에는 6에서 3을 뺀 수를 모았습니다. 누가 가장 큰 수를 가지고 있나요?

Answer: Yuna

Solution (Python):
var_a = 'Yoongi'
var_b = 'Yuna'
var_c = 'Jungkook'
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 = 4
var_e = 5
var_f = 6
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)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
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): What is the sum of 15.58, 21.32, 642.51, and 51.51?
Question (KO): 15.58, 21.32, 642.51 51.51의 총합은 얼마입니까?

Answer: 730.92

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

Question (EN): 20 students are waiting for the bus. Jungkook came before Yoongi, and there are 5 students between Yoongi and Jungkook. There are 6 students standing in front of Jungkook. How many students are standing behind Yoongi?
Question (KO): 20명의 학생들이 버스를 기다리고 있습니다. 정국이는 윤기보다 먼저 왔고, 윤기와 정국이 사이에는 5명의 학생이 있습니다. 정국의 앞에는 6명의 학생들이 서 있습니다. 윤기의 뒤에 서 있는 학생은 몇 명입니까?

Answer: 7

Solution (Python):
var_a = 20
var_b = 6
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
var_f = 5
var_g = var_e - var_f
var_h = 1
var_i = var_g - var_h
print(int(var_i))
Category: Possibility

Question (EN): If there are 5 people, A, B, C, D, and E, find the number of ways to put C and D next to each other.
Question (KO): A, B, C, D, E 5명이 있을 때, C, D를 이웃하여 세우는 경우의 수를 구하시오.

Answer: 48

Solution (Python):
var_a = 'A'
var_b = 'B'
var_c = 'C'
var_d = 'D'
var_e = 'E'
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 = 'C'
list_b= []
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
list_c = list(set(list_a) - set(list_b))
var_g = len(list_c)
var_h = len(list_c)
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)
var_j = 'C'
var_k = 'D'
list_d= []
if "/" in str(var_k):
    var_k = eval(str(var_k))
list_d.append(var_k)
if "/" in str(var_j):
    var_j = eval(str(var_j))
list_d.append(var_j)
list_d.reverse()
var_l = len(list_d)
var_m = len(list_d)
var_n = 1
var_l = int(var_l)
var_m = int(var_m)
for i, elem in enumerate(range(var_m)):
    var_n = var_n * (var_l-i)
var_o = var_i * var_n
print(int(var_o))
Category: Correspondence

Question (EN): When Hyejin's age is multiplied by Hyejin's younger sister's age, and the result is 12, how many possible numbers can there be with Hyejin's age?
Question (KO): 혜진이의 나이와 혜진이 동생의 나이를 곱하였더니 12가 되었을 때, 혜진이의 나이로 가능한 수는 몇 개입니까?

Answer: 3

Solution (Python):
var_a = 12
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 = len(list_a)
var_c = 2
var_d = var_b // var_c
print(int(var_d))
Category: Possibility

Question (EN): Find the number of natural numbers that can be made with three of the number cards 1, 2, 4, 8, and 9.
Question (KO): 숫자 카드 1, 2, 4, 8, 9 중에서 3장을 뽑아 만들 수 있는 자연수의 개수를 구하시오.

Answer: 60

Solution (Python):
var_a = 1
var_b = 2
var_c = 4
var_d = 8
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 = len(list_b)
print(int(var_g))
Category: Comparison

Question (EN): In a PE class, if there are 5 and 6 rows of students on either side of Mijoo, and 6 and 7 rows of students in front of and behind her, respectively, and the number of students in each row is the same, how many students are in PE class in total?
Question (KO): 체육시간에 미주의 양옆에는 각각 5, 6줄의 학생들이 섰고, 앞뒤에는 각각 6, 7줄의 학생들이 섰다면 각 줄마다 있는 학생의 수가 같다고 할 때, 체육수업을 듣는 학생은 모두 몇 명입니까?

Answer: 168

Solution (Python):
var_a = 5
var_b = 6
var_c = var_a + var_b
var_d = 1
var_e = var_c + var_d
var_f = 6
var_g = 7
var_h = var_f + var_g
var_i = 1
var_j = var_h + var_i
var_k = var_e * var_j
print(int(var_k))
Category: Comparison

Question (EN): There are 40 baskets of tangerines, 28 each, and 65 baskets of plums, 15 each. Which one has the bigger number among tangerines and plums?
Question (KO): 귤은 한 바구니에 28개씩 40바구니가 있고, 자두는 한 바구니에 15개씩 65바구니가 있습니다. 귤과 자두 중 어떤 것이 더 많습니까?

Answer: tangerines

Solution (Python):
var_a = 'tangerines'
var_b = 'plums'
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 = 28
var_d = 40
var_e = var_c * var_d
var_f = 15
var_g = 65
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: Comparison

Question (EN): The five numbers 1.4, 9/10, 1.1, 0.5, and 13/10 are written on the blackboard. How many of the numbers written on the board are greater than 0.9?
Question (KO): 칠판에 5개의 숫자 1.4, 9/10, 1.1, 0.5, 13/10가 적혀 있습니다. 칠판에 적힌 수 중에서 0.9보다 큰 수는 몇 개입니까?

Answer: 3

Solution (Python):
var_a = 1.4
var_b = 0.9
var_c = 1.1
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 = 0.9
list_b = []
for i in list_a:
    if i > var_f:
        list_b.append(i)
var_g = len(list_b)
print(int(var_g))
Category: Arithmetic calculation

Question (EN): How many numbers that are greater than 50 and less than 100 have a remainder of 4 when divided by 8?
Question (KO): 50이상 100이하인 수 중에서 8로 나누었을 때 나머지가 4인 수는 모두 몇 개입니까?

Answer: 7

Solution (Python):
var_a = 50
var_b = 100
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 8
var_e = 4
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 = len(list_b)
print(int(var_f))
Category: Correspondence

Question (EN): If you divide the chopsticks used by 8 people into 4 groups, how many bundles will you get?
Question (KO): 8명이 사용하던 젓가락을 4개씩 나누면 몇 묶음이 나오는가?

Answer: 4

Solution (Python):
var_a = 8
var_b = 2
var_c = var_a * var_b
var_d = 4
var_e = var_c / var_d
print(int(var_e))
Category: Geometry

Question (EN): If the perimeter of a rectangle whose width is 3 centimeters (cm) longer than its length is 54 centimeters (cm), find the length of its width.
Question (KO): 가로의 길이가 세로의 길이보다 3 센티미터(㎝) 더 긴 직사각형의 둘레의 길이가 54 센티미터(㎝)일 때, 가로의 길이를 구하시오.

Answer: 15

Solution (Python):
var_a = 54
var_b = 2
var_c = var_a / var_b
var_d = 3
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
var_h = 3
var_i = var_g + var_h
print(int(var_i))
Category: Possibility

Question (EN): How many three-digit integers can be made by drawing 3 out of 6 cards with the numbers 0, 1, 2, 3, 4, and 5 written on them?
Question (KO): 0, 1, 2, 3, 4, 5의 숫자가 각각 적힌 6장의 카드 중 3개를 뽑아서 만들 수 있는 세 자리 정수의 개수는?

Answer: 100

Solution (Python):
var_a = 0
var_b = 1
var_c = 2
var_d = 3
var_e = 4
var_f = 5
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 = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_g))
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_h = len(list_b)
print(int(var_h))
Category: Correspondence

Question (EN): Seokgi gave 1/2 of the candies he had to Yeseul, and gave the remaining 1/3 to Dongmin, leaving 12 candies. How many candies did Seokgi originally have at first?
Question (KO): 석기는 가지고 있던 사탕의 1/2를 예슬이에게 주고, 그 나머지의 1/3을 동민이에게 주었더니 12개가 남았습니다. 석기는 처음에 몇 개의 사탕을 가지고 있었습니까?

Answer: 36

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

Question (EN): A car needs 12.2 liters (L) of gasoline to run 366.8 kilometers (km), and the amount of gasoline in one oil drum is 3 liters (L). How many barrels of oil are needed to drive 533.32 kilometers (km)?
Question (KO): 한 자동차가 366.8킬로미터(㎞)를 달리는 데 휘발유 12.2리터(L)이 필요하고, 한 기름통에 들어있는 휘발유의 양은 3리터(L)입니다. 이 자동차가 533.32킬로미터(㎞)를 달리는 데 필요한 기름통은 모두 몇 통이 필요합니까?

Answer: 6

Solution (Python):
var_a = 12.2
var_b = 366.8
var_c = var_a / var_b
var_d = 533.32
var_e = var_c * var_d
var_f = 3
var_g = var_e / var_f
var_h = 1
var_i=int(((var_g+9*10**(var_h-2))//(10**(var_h-1)))*10**(var_h-1))

print(int(var_i))
Category: Correspondence

Question (EN): There are two different numbers A and B. What is A+B when BBB+BBBB=8AA4?
Question (KO): 서로 다른 두 수 A, B가 있다. 8AA4-BBB=BBBB일 때 A+B는 무엇인가?

Answer: 12

Solution (Python):
var_a = '8AA4-BBB=BBBB'
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 = '8AA4-BBB=BBBB'
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: Arithmetic calculation

Question (EN): How many two-digit numbers are there that are between 45 and 54?

Question (KO): 54보다 작고 45보다 큰 두 자리 수는 모두 몇 개입니까?

Answer: 8

Solution (Python):
var_a = 45
var_b = 1
var_c = var_a + var_b
var_d = 54
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): There are three numbers: 10, 11 and 12. What is the remainder when you divide the second largest number by the smallest number?
Question (KO): 3개의 수 10, 11, 12가 있습니다. 그 중에서 2번째로 큰 수와 가장 작은 수로 나눈 나머지는 얼마입니까?

Answer: 1

Solution (Python):
var_a = 10
var_b = 11
var_c = 12
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 = 2
list_b=list_a.copy()
list_b.sort()
var_e = list_b[-var_d]
var_f = 1
list_c=list_a.copy()
list_c.sort()
var_g = list_c[var_f-1]
var_h = var_e % var_g
print(int(var_h))
Category: Geometry

Question (EN): The length of all four sides of a quadrilateral is the same and the sum of the lengths of the four sides is 32. What is the length of one side?
Question (KO): 사각형의 네 변의 길이가 모두 같고 네 변의 길이의 합이 32이다. 한변의 길이가 얼마인가?

Answer: 8

Solution (Python):
var_a = 32
var_b = 4
var_c = var_a / var_b
print(int(var_c))
Category: Possibility

Question (EN): There are two ways to get to the playground from school. Find the number of cases in which Seung-a, Jeong-hyeok, and Hyeong-jun go from school to the playground.
Question (KO): 학교에서 놀이터로 가는 길은 두 가지가 있습니다. 승아, 정혁, 형준이 학교에서 놀이터로 가는 경우의 수를 구하시오.

Answer: 8

Solution (Python):
var_a = 2
var_b = 3
var_c = var_a ** var_b
print(int(var_c))
Category: Geometry

Question (EN): If the horizontal length of the entire figure drawn by attaching several circles with a radius of 4 centimeters (cm) side by side is 24 centimeters (cm), how many circles are drawn?
Question (KO): 반지름의 길이가 4센티미터(㎝)인 원 여러 개를 가로로 나란히 붙여서 그린 전체 도형의 가로 길이가 24센티미터(㎝)라면, 몇 개의 원을 그렸을까요?

Answer: 3

Solution (Python):
var_a = 24
var_b = 4
var_c = 2
var_d = var_b * var_c
var_e = var_a / var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): There are 5 times as many blue marbles as red marbles, and yellow marbles are three times more than red marbles. If the total number of blue marbles and yellow marbles is 160, how many red marbles are there?
Question (KO): 파란 구슬은 빨간 구슬의 5배만큼 있습니다. 노란 구슬은 빨간 구슬의 3배만큼 있습니다. 파란 구슬과 노란 구슬의 개수가 모두 160개일 때, 빨간 구슬은 몇 개있을까요?

Answer: 20

Solution (Python):
var_a = 160
var_b = 5
var_c = 3
var_d = var_b + var_c
var_e = var_a / var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): I made 8640 of (a) items. I put 12 items in each small box, and put 6 of these small boxes in a big box. How many big boxes did I pack in total?
Question (KO): (가) 물건을 8640개 만들었습니다. 작은 상자 1개에는 (가) 물건을 12개씩 넣고, 이렇게 만든 작은 상자를 큰 상자에 6개씩 넣어 포장했습니다. 포장한 큰 상자는 모두 몇 개입니까?

Answer: 120

Solution (Python):
var_a = 8640
var_b = 12
var_c = var_a / var_b
var_d = 6
var_e = var_c / var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): There are 40 ducks and 30 rabbits on the farm. Also, the number of hens is 20 more than ducks, and the number of roosters is 10 fewer than rabbits. How many chickens are there in the farm totally?
Question (KO): 농장에 오리가 40마리, 토끼가 30마리 있습니다. 또 암탉은 오리보다 20마리 많고, 수탉은 토끼보다 10마리 적습니다. 농장에 있는 닭은 모두 몇 마리입니까?

Answer: 80

Solution (Python):
var_a = 40
var_b = 20
var_c = var_a + var_b
var_d = 30
var_e = 10
var_f = var_d - var_e
var_g = var_c + var_f
print(int(var_g))