philschmid/DMath huggingface dataset:
Category: Possibility

Question (EN): Find the sum of the largest number and the third largest number when selecting three of 1, 3, 4, and 7 to form a three-digit number with 3 in the tens place.
Question (KO): 1, 3, 4, 7 중 세 개를 뽑아 십의 자리가 3인 세 자리 수를 만들 때, 가장 큰 수와 세 번째로 큰 수의 합을 구하시오.

Answer: 1171

Solution (Python):
var_a = 1
var_b = 3
var_c = 4
var_d = 7
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 = 3
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]
var_j = 3
list_e=list_c.copy()
list_e.sort()
var_k = list_e[-var_j]
var_l = var_i + var_k
print(int(var_l))
Category: Arithmetic calculation

Question (EN): You have five numbers 10, 11, 12, 13, and 14. What is the sum of the largest number and the second smallest number?
Question (KO): 5개의 수 10, 11, 12, 13, 14가 있습니다. 그 중에서 가장 큰 수와 2번째로 작은 수의 합은 얼마입니까?

Answer: 25

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 = 2
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: Arithmetic calculation

Question (EN): When 14.23 is divided by 4.7, find the value to two decimal places.
Question (KO): 14.23을 4.7로 나누었을 때 값을 소수 둘째 자리까지 구하시오.

Answer: 3.03

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

Question (EN): How many three-digit numbers are divisible by the two numbers - 4 and 5?
Question (KO): 2개의 수 4, 5로 나누어 떨어질 수 있는 세 자리 수는 모두 몇 개 있습니까?

Answer: 45

Solution (Python):
var_a = 100
var_b = 999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 4
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 = 5
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 = len(list_c)
print(int(var_f))
Category: Comparison

Question (EN): It rained 135 millimeters (mm) yesterday and 12 centimeters (cm) 7 millimeters (mm) today. Find the answer on which day it rained more between yesterday and today.
Question (KO): 비가 어제는 135 밀리미터(㎜) 내렸고 오늘은 12 센티미터(㎝) 7 밀리미터(㎜) 내렸습니다. 어제와 오늘 중 비가 더 많이 내린 날은 언제인지 답을 구해 보세요.

Answer: yesterday

Solution (Python):
var_a = 'yesterday'
var_b = 'today'
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 = 135
var_d = 12
var_e = 10
var_f = var_d * var_e
var_g = 7
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_c):
    var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[-var_i]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l)
Category: Correspondence

Question (EN): When you multiply a number by 2, you get 18. What is the value of this number when you subtract 4?
Question (KO): 어떤 수에 2를 곱했더니 18이 되었습니다. 어떤 수에서 4를 빼면 얼마입니까?

Answer: 5

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

Question (EN): It is said that it takes an hour to make 8 toys from one machine. How many hours would it take to make 200 toys using 5 machines?
Question (KO): 하나의 기계에서 8개의 장난감을 만드는 데 1시간이 걸린다고 합니다. 200개의 장난감을 만들기 위해 5개의 기계를 사용한다면 총 몇 시간이 걸리는지 구하시오.

Answer: 5

Solution (Python):
var_a = 200
var_b = 8
var_c = 5
var_d = var_b * var_c
var_e = var_a / var_d
print(int(var_e))
Category: Correspondence

Question (EN): I have to divide a number by 8, but I accidentally multiply a number by 6 is 96. What is the correct calculation result?
Question (KO): 어떤 수에 8을 나눠야 할 것을 잘못하여 6을 곱한 결과는 96이 되었습니다. 바르게 계산한 결과는 얼마인가요?

Answer: 2

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

Question (EN): 16 teams are about to have a soccer match. Two teams have a game to eliminate the losing team, while only the winning team is allowed to proceed to the next game, and the team who won the last game wins the match. Find the total number of games.
Question (KO): 16개 팀이 축구 시합을 하려고 합니다. 두 팀씩 경기를 하여 패배한 팀은 탈락하고 승리한 팀만 다음 경기를 할 수 있으며, 마지막에 승리한 팀이 우승합니다. 경기의 총 횟수를 구하시오.

Answer: 15

Solution (Python):
var_a = 16
var_b = 1
var_c = var_a - var_b
print(int(var_c))
Category: Correspondence

Question (EN): Multiplying a number by 11 and adding 1 equals 45. Find the number.
Question (KO): 어떤 수에 11을 곱한 뒤 1을 더하면 45이다. 어떤 수를 구하시오.

Answer: 4

Solution (Python):
var_a = 45
var_b = 1
var_c = var_a - var_b
var_d = 11
var_e = var_c / var_d
print(int(var_e))
Category: Possibility

Question (EN): There are 5 types of hot coffee and 4 types of cold coffee in the cafe, and there are 3 types of cookies and 5 types of muffins. Find the number of cases where you order 1 coffee and 1 bread each.
Question (KO): 카페에 커피는 뜨거운 커피 5종류, 차가운 커피 4종류가 있고 빵은 쿠키가 3종류, 머핀이 5종류가 있다. 커피와 빵을 각각 1개식 주문하는 경우의 수를 구하시오.

Answer: 72

Solution (Python):
var_a = 5
var_b = 4
var_c = var_a + var_b
var_d = 3
var_e = 5
var_f = var_d + var_e
var_g = var_c * var_f
print(int(var_g))
Category: Geometry

Question (EN): A cuboid box is 18 centimeters (cm) long, 10 centimeters (cm) wide, and 2 centimeters (cm) high. How many square centimeters (cm2) will be covered to paint the entire inside of this uncovered box?
Question (KO): 어떤 직육면체 모양의 상자는 가로가 18센티미터(㎝), 세로가 10센티미터(㎝), 높이가 2센티미터(㎝)이다. 이 뚜껑이 없는 상자의 안쪽 전체를 색칠하려면 몇 제곱센티미터(㎠)를 칠해야 하는가?

Answer: 292

Solution (Python):
var_a = 18
var_b = 10
var_c = var_a * var_b
var_d = 10
var_e = 2
var_f = var_d * var_e
var_g = 2
var_h = 18
var_i = var_g * var_h
var_j = var_f + var_i
var_k = 2
var_l = var_j * var_k
var_m = var_c + var_l
print(int(var_m))
Category: Possibility

Question (EN): You can go to the academy from school in 3 ways, and from the academy to the playground in 4 ways. In total, how many ways are there to get from school to the playground passing the academy?
Question (KO): 학교가 끝난 후 학원까지 3가지의 방법으로 갈 수 있고, 학원에서 놀이터까지 4가지의 방법으로 갈 수 있습니다. 학교에서 학원을 거쳐 놀이터로 가는 방법은 총 몇 가지입니까?

Answer: 12

Solution (Python):
var_a = 3
var_b = 4
var_c = var_a * var_b
print(int(var_c))
Category: Correspondence

Question (EN): There is a number that is a multiple of 9. The quotient of a number divided by 9 is then divided again by 9, and the quotient is 25 and the remainder is 7. Find the number.
Question (KO): 9의 배수인 어떤 수가 있다. 어떤 수를 9로 나눈 몫을 다시 9로 나누었더니 몫이 25이고 나머지가 7이었습니다. 어떤 수를 구하시오.

Answer: 2088

Solution (Python):
var_a = 25
var_b = 9
var_c = var_a * var_b
var_d = 7
var_e = var_c + var_d
var_f = 9
var_g = var_e * var_f
print(int(var_g))
Category: Comparison

Question (EN): As a result of the Korean language test in the school, Taehyung, Minju, Sangmin, Yoonjung, and Yoojung received the highest score in that order. Who got the highest score?
Question (KO): 학교에서 한국어 시험을 본 결과 태형, 민주, 상민, 윤정, 유정이 순으로 높은 점수를 받았다. 누가 가장 높은 점수를 얻었습니까?

Answer: Taehyung

Solution (Python):
var_a = 'Taehyung'
var_b = 'Minju'
var_c = 'Sangmin'
var_d = 'Yoonjung'
var_e = 'Yoojung'
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
var_g = list_a[var_f-1]
print(var_g)
Category: Comparison

Question (EN): There are 9 people standing in a line from shortest to tallest. Consider Hoseok is the shortest. Then what place does Hoseok take when the line is in order from tallest to shortest?
Question (KO): 키가 작은 사람부터 순서대로 9명이 한 줄로 서 있습니다. 호석이가 가장 키가 작습니다. 키가 큰 사람부터 순서대로 다시 줄을 서면 호석이는 앞에서부터 몇 번째에 서게 됩니까?

Answer: 9

Solution (Python):
var_a = 9
var_b = 1
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e))
Category: Geometry

Question (EN): What is the sum of the lengths of the four sides of a square with a side of 9 centimeters (cm), in cm (cm)?
Question (KO): 한 변이 9센티미터(㎝)인 정사각형의 네 변의 길이의 합은 몇 센티미터(㎝)입니까?

Answer: 36

Solution (Python):
var_a = 9
var_b = 4
var_c = var_a * var_b
print(int(var_c))
Category: Geometry

Question (EN): Find the perimeter of a regular octagon with a side length of 12 meters (m), in meters (m).
Question (KO): 한 변의 길이가 12미터(m)인 정팔각형의 둘레는 몇 미터(m)인지 구해 보시오.

Answer: 96

Solution (Python):
var_a = 12
var_b = 8
var_c = var_a * var_b
print(int(var_c))
Category: Correspondence

Question (EN): A is a number comprised of 1 group of 1000, 16 groups of 100, and 28 groups of 10. B is calculated as 3 jumps from 355 with an interval of 245. Find the value of A-B.
Question (KO): A는 1000개씩 묶음이 1개, 100개씩 묶음이 16개, 10개씩 묶음이 28개인 수입니다. B는 355에서 245씩 커지게 3번 뛰어서 센 수입니다. A-B의 값을 구하시오.

Answer: 1790

Solution (Python):
var_a = 1000
var_b = 1
var_c = var_a * var_b
var_d = 100
var_e = 16
var_f = var_d * var_e
var_g = var_c + var_f
var_h = 10
var_i = 28
var_j = var_h * var_i
var_k = var_g + var_j
var_l = 355
var_m = 245
var_n = 3
var_o = var_m * var_n
var_p = var_l + var_o
var_q = var_k - var_p
print(int(var_q))
Category: Arithmetic calculation

Question (EN): A full bottle of milk weighs 1650 grams (g). After drinking 1/3 of the milk, I weighed the bottle again, which was 1250 grams (g). How many grams (g) does the bottle alone weigh?
Question (KO): 우유가 가득 담긴 병의 무게는 1650그램(g)입니다. 이 중 우유의 1/3을 마신 후 병의 무게를 다시 재어 보니 1250그램(g)입니다. 병만의 무게는 몇 그램(g)입니까?

Answer: 450

Solution (Python):
var_a = 1650
var_b = 1650
var_c = 1250
var_d = var_b - var_c
var_e = 1
var_f = var_d * var_e
var_g = 0.3333333333333333
var_h = var_f / var_g
var_i = var_a - var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): Find the sum of 100 consecutive odd numbers from 1.
Question (KO): 1부터 연속하는 홀수 100개의 합을 구하시오

Answer: 10000

Solution (Python):
var_a = 1
var_b = 100
var_c = 1
var_d = var_b - var_c
var_e = 2
var_f = var_d * var_e
var_g = 1
var_h = var_f + var_g
var_i = 2
list_a = [i for i in range(var_a, var_h + 1, var_i)]
list_a = [float(i) for i in list_a]
var_j = sum(list_a)
print(int(var_j))
Category: Correspondence

Question (EN): A number is less than 10 and is not a multiple of 2 or 3. Which number is it out of 7, 8, 9, or 10?
Question (KO): 어떤 수는 10보다 작고, 2의 배수나 3의 배수가 아닙니다. 7, 8, 9, 10 중 어떤 수를 구하시오.

Answer: 7

Solution (Python):
var_a = 7
var_b = 8
var_c = 9
var_d = 10
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 = []
var_e = int(var_e)
for i in list_a:
    i = int(i)
    if i % var_e == 0:
        list_b.append(i)
list_c = list(set(list_a) - set(list_b))
var_f = 3
list_d = []
var_f = int(var_f)
for i in list_c:
    i = int(i)
    if i % var_f == 0:
        list_d.append(i)
list_e = list(set(list_c) - set(list_d))
var_g = 10
list_f = []
for i in list_e:
    if i < var_g:
        list_f.append(i)
var_h = 1
var_i = list_f[var_h-1]
print(int(var_i))
Category: Possibility

Question (EN): The dice are rolled and the dots 2, 4, and 3 come out. How many three-digit numbers formed by using all the digits once are less than 340?
Question (KO): 주사위를 던져 나온 숫자가 2, 4, 3입니다. 나온 숫자를 한 번씩 모두 사용하여 만든 세 자리 수 중 340보다 작은 수는 모두 몇 개입니까?

Answer: 3

Solution (Python):
var_a = 2
var_b = 4
var_c = 3
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 = 340
list_c = []
for i in list_b:
    if i < var_e:
        list_c.append(i)
var_f = len(list_c)
print(int(var_f))
Category: Arithmetic calculation

Question (EN): Find the sum of the digits of the even numbers from 600 to 800.
Question (KO): 600부터 800까지의 짝수들의 각 자리의 숫자를 더하면 얼마인지 구하여라.

Answer: 1508

Solution (Python):
var_a = 600
var_b = 800
var_c = 2
list_a = [i for i in range(var_a, var_b + 1, var_c)]
list_b=[]
for i in list_a:
    var_d = 0
    i = int(i)
    while i//10 > 0:
        var_d = var_d + i%10
        i = i//10
    var_d = var_d + i%10
    list_b.append(var_d)
list_b = [float(i) for i in list_b]
var_e = sum(list_b)
print(int(var_e))
Category: Correspondence

Question (EN): Seoyoon's teacher bought her class pizzas. There were 7 students in Seoyoon's class, and each student took 12 pieces, leaving 5 pieces. At this moment, Seoyoon's neighboring classmate came in to play, so it is decided to distribute the pizza again to 8 people including Seoyoon's friend. Find the number of remaining pizza slices at this time.
Question (KO): 서윤이네 반 선생님께서 피자를 사주셨다. 서윤이네 반 학생은 모두 7명인데 한 명당 12조각씩 가지고 5조각이 남았다. 이때 서윤이의 옆 반 친구가 놀러와 서윤이의 친구를 포함해서 8명에게 다시 나눠주기로 하였다. 이때 남는 피자 조각의 개수는 몇 조각인지 구하시오.

Answer: 1

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

Question (EN): JungKook and Jimin walked up the stairs to the third floor. Jimin took the elevator from the 3rd floor to the 5th floor. Who has risen higher, Jung Kook or Jimin?
Question (KO): 정국이와 지민이는 계단을 걸어서 3층까지 올라갔습니다. 지민이는 3층에서 엘리베이터를 타고 5층까지 올라갔습니다. 정국이와 지민이 중 더 높이 올라간 사람은 누구입니까?

Answer: Jimin

Solution (Python):
var_a = 'Jungkook'
var_b = 'Jimin'
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 = 3
var_d = 5
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: Correspondence

Question (EN): A is 348 and A is less than B by 173. C is greater than B by 299. Find C.
Question (KO): A는 348입니다. A는 B보다 173만큼 작습니다. C는 B보다 299만큼 큽니다. C를 구하시오.

Answer: 820

Solution (Python):
var_a = 348
var_b = 173
var_c = var_a + var_b
var_d = 299
var_e = var_c + var_d
print(int(var_e))
Category: Comparison

Question (EN): 20 cars of different colors 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: Correspondence

Question (EN): The number of students in Class 1 is 69 and the number of students in Class 2 is 86. When I asked the students in Class 1 and Class 2 to form groups, there were 5 students left in Class 1 and 6 students in Class 2. Find the maximum number of people in a group.
Question (KO): 1반 학생들의 수는 69명이고 2반 학생들의 수는 86명이다. 1반과 2반 학생들에게 몇 명씩 조를 짜라고 하였더니 1반에서는 5명이 남고 2반에는 6명이 남았다. 한 조에 최대 몇 명이 모일 수 있는지 구하시오.

Answer: 16

Solution (Python):
var_a = 69
var_b = 5
var_c = var_a - var_b
var_d = 86
var_e = 6
var_f = var_d - var_e
var_g = math.gcd(int(var_f), int(var_c))
print(int(var_g))
Category: Arithmetic calculation

Question (EN): Thirty sheets of 25 centimeters (cm) long paper strips were overlapped by 6 centimeters (cm) each and made a long line. Find the total length in centimeters (cm) of the 30 strips of paper glued together.
Question (KO): 길이가 25센티미터(㎝)인 종이띠 30장을 6센티미터(㎝)씩 겹쳐서 한 줄로 길게 이어 붙였습니다. 30장을 이어 붙인 종이띠의 전체 길이는 몇 센티미터(㎝)인지 구해 보시오.

Answer: 576

Solution (Python):
var_a = 25
var_b = 25
var_c = 6
var_d = var_b - var_c
var_e = 30
var_f = 1
var_g = var_e - var_f
var_h = var_d * var_g
var_i = var_a + var_h
print(int(var_i))
Category: Correspondence

Question (EN): What number must go into A to make 632-5AB=41?
Question (KO): 632-5AB=41이 성립하기 위해 A에 들어가야 하는 숫자는 무엇인가요?

Answer: 9

Solution (Python):
var_a = '632-5AB=41'
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): A is 3 groups of 10 and 7 individual units, and B is the number obtained by subtracting 1 from 40. Which is smaller, A or B?
Question (KO): A는 10개씩 3묶음과 낱개가 7개이고, B는 40에서 1을 뺀 수입니다. A, B 중 작은 수는 무엇입니까?

Answer: A

Solution (Python):
var_a = 'A'
var_b = 'B'
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 = 10
var_d = 3
var_e = var_c * var_d
var_f = 7
var_g = var_e + var_f
var_h = 40
var_i = 1
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_g):
    var_g = eval(str(var_g))
list_b.append(var_g)
list_b.reverse()
var_k = 1
list_c=list_b.copy()
list_c.sort()
var_l = list_c[var_k-1]
var_m = list_b.index(var_l)+1
var_n = list_a[var_m-1]
print(var_n)
Category: Geometry

Question (EN): A rectangle-shaped notebook and a square-shaped notebook have the same area. If the lengths of the two sides of the notebook are 9 centimeters (cm) and 16 centimeters (cm), respectively. How many centimeters (cm) are the length of one side of the notebook?
Question (KO): 직사각형 모양의 공책과 정사각형 모양의 수첩의 넓이는 같습니다. 공책의 두 변의 길이가 각각 9센티미터(㎝), 16센티미터(㎝)일 때, 수첩의 한 변의 길이는 몇 센티미터(㎝)인지 구하시오.

Answer: 12

Solution (Python):
var_a = 9
var_b = 16
var_c = var_a * var_b
var_d = 0.5
var_e = var_c ** var_d
print(int(var_e))
Category: Geometry

Question (EN): You have a rectangle with a perimeter of 40 centimeters (cm). If the width of this rectangle is 8 centimeters (cm), how many centimeters (cm) is the length?
Question (KO): 둘레가 40센티미터(㎝)인 직사각형이 있습니다. 이 직사각형의 가로 길이가 8센티미터(㎝)일 때 세로는 몇 센티미터(㎝)입니까?

Answer: 12

Solution (Python):
var_a = 40
var_b = 2
var_c = var_a / var_b
var_d = 8
var_e = var_c - var_d
print(int(var_e))
Category: Possibility

Question (EN): Find how many multiples of 4 are less than 30.
Question (KO): 30보다 작은 4의 배수는 모두 몇 개인지 구하세요.

Answer: 7

Solution (Python):
var_a = 1
var_b = 30
var_c = 1
var_d = var_b - var_c
var_e = 1
list_a = [i for i in range(var_a, var_d + 1, var_e)]
var_f = 4
list_b = []
var_f = int(var_f)
for i in list_a:
    i = int(i)
    if i % var_f == 0:
        list_b.append(i)
var_g = len(list_b)
print(int(var_g))
Category: Arithmetic calculation

Question (EN): There are 9 dogs and 23 cats. How many more cats are there than dogs?
Question (KO): 개가 9마리, 고양이가 23마리 있습니다. 고양이는 개보다 몇 마리 더 많습니까?

Answer: 14

Solution (Python):
var_a = 23
var_b = 9
var_c = var_a - var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): There are 45 apples. There are 21 fewer pears than apples. How many tangerines are there if there are 18 fewer pears than tangerines?
Question (KO): 사과가 45개 있습니다. 배는 사과보다 21개 적습니다. 배가 귤보다 18개 더 적다면 귤은 몇 개입니까?

Answer: 42

Solution (Python):
var_a = 45
var_b = 21
var_c = var_a - var_b
var_d = 18
var_e = var_c + var_d
print(int(var_e))
Category: Possibility

Question (EN): You want to put 5 different books A, B, C, D, and E on a bookshelf. When A, B, and C are placed on the left side in such order, find the number of ways to place books on the bookshelf.
Question (KO): 서로 다른 책 A, B, C, D, E 5권을 책꽂이에 꽂으려고 한다. A, B, C를 차례로 왼쪽에 꽂을 때, 책을 책꽂이에 꽂는 경우의 수를 구하시오.

Answer: 2

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 = 'A'
var_g = 'B'
var_h = 'C'
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()
list_c = list(set(list_a) - set(list_b))
var_i = len(list_c)
var_j = len(list_c)
var_k = 1
var_i = int(var_i)
var_j = int(var_j)
for i, elem in enumerate(range(var_j)):
    var_k = var_k * (var_i-i)
print(int(var_k))
Category: Comparison

Question (EN): Two students, Yoongi and Jungkook, have numbers 7 and 6, respectively. Whose number is smaller?
Question (KO): 두 명의 학생 윤기, 정국은 각각 7, 6만큼의 숫자를 가지고 있습니다. 누구의 수가 더 작습니까?

Answer: Jungkook

Solution (Python):
var_a = 'Yoongi'
var_b = 'Jungkook'
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 = 7
var_d = 6
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)