philschmid/DMath huggingface dataset:
Category: Arithmetic calculation

Question (EN): The 30 students in Yejin's class have their own attendance numbers from 1 to 30. Among the students in Yejin's class, students wearing short sleeves today are students number 1, 3, 7, 10, 23, and 27, and students number 1, 9, 11, 20, and 23 are wearing short pants today, how many students were wearing short sleeves but not short pants today?
Question (KO): 예지네 반 학생 30명은 1번부터 30번까지 자신의 출석 번호를 가지고 있습니다. 예지네 반 학생 중 오늘 반팔을 입은 학생은 1번, 3번, 7번, 10번, 23번, 27번 학생이고, 오늘 반바지를 입은 학생은 1번, 9번, 11번, 20번, 23번 학생일 때, 오늘 반팔을 입었지만 반바지는 입지 않은 학생은 몇 명입니까?

Answer: 4

Solution (Python):
var_a = 1
var_b = 3
var_c = 7
var_d = 10
var_e = 23
var_f = 27
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 = 1
var_h = 9
var_i = 11
var_j = 20
var_k = 23
list_b= []
if "/" in str(var_k):
    var_k = eval(str(var_k))
list_b.append(var_k)
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)
list_b.reverse()
list_c = list(set(list_a) - set(list_b))
var_l = len(list_c)
print(int(var_l))
Category: Possibility

Question (EN): We are trying to pick a class president and a vice president from Jungkook, Jimin, Yoongi, and Yuna. How many possible cases are there?
Question (KO): 정국, 지민, 윤기, 유나 중에서 반장, 부반장을 뽑으려고 합니다. 가능한 경우의 수는 모두 몇 가지 입니까

Answer: 12

Solution (Python):
var_a = 'Jungkook'
var_b = 'Jimin'
var_c = 'Yoongi'
var_d = 'Yuna'
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 = len(list_a)
var_f = 2
var_g = 1
var_e = int(var_e)
var_f = int(var_f)
for i, elem in enumerate(range(var_f)):
    var_g = var_g * (var_e-i)
print(int(var_g))
Category: Comparison

Question (EN): There are 13 students behind Youngbin. If a total of 25 students are standing in a line, how many students are in front of Youngbin?
Question (KO): 영빈이 뒤에 13명의 학생이 있다. 총 25명의 학생이 한 줄로 서 있다면 영빈이 앞에 있는 학생의 수는 몇 명인가?

Answer: 11

Solution (Python):
var_a = 25
var_b = 13
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e))
Category: Arithmetic calculation

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

Answer: 5

Solution (Python):
var_a = 5
print(int(var_a))
Category: Comparison

Question (EN): There are 221 first-year female students, and 255 first-year male students at Taein's School, 275 second-year female students and 226 second-year male students. Find which grade has more students.
Question (KO): 태인이네 학교 1학년 여학생은 221명, 1학년 남학생은 255명이고, 2학년 여학생은 275명, 2학년 남학생은 226명입니다. 몇 학년 학생이 더 많은지 구하시오.

Answer: 2

Solution (Python):
var_a = 1
var_b = 2
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 = 221
var_d = 255
var_e = var_c + var_d
var_f = 275
var_g = 226
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(int(var_l))
Category: Arithmetic calculation

Question (EN): 7 out of 13 flowers are withered and discarded. How many live flowers are there?
Question (KO): 꽃 13송이 중 7송이가 시들어서 버렸습니다. 살아 있는 꽃은 몇 송이입니까?

Answer: 6

Solution (Python):
var_a = 13
var_b = 7
var_c = var_a - var_b
print(int(var_c))
Category: Comparison

Question (EN): A certain number is a natural number greater than 52. If there are 15 consecutive natural numbers between 52 and the certain number, which number is in the middle of the numbers between 52 and the certain number?
Question (KO): 어떤 수는 52보다 큰 자연수입니다. 52와 어떤 자연수 사이에 연속된 자연수가 15개 있을때 52와 어떤 수 사이에 있는 수 중 한가운데 있는 수는 무엇인가요?

Answer: 60

Solution (Python):
var_a = 52
var_b = 15
var_c = var_a + var_b
var_d = 1
var_e = var_c + var_d
var_f = 52
var_g = var_e + var_f
var_h = 2
var_i = var_g / var_h
print(int(var_i))
Category: Geometry

Question (EN): A polygon can draw only one diagonal from one vertex. How many sides does this polygon have?
Question (KO): 어떤 다각형은 한 꼭짓점에서 1개의 대각선만 그을 수 있다. 이 다각형의 변의 개수는?

Answer: 4

Solution (Python):
var_a = 1
var_b = 3
var_c = var_a + var_b
print(int(var_c))
Category: Correspondence

Question (EN): 812 divided by a particular number equals 25. Find out the value when that particular number is divided by 4.
Question (KO): 812를 어떤 수로 나눈 값이 25이다. 어떤 수를 4로 나누면 얼마인지 구하시오.

Answer: 8.12

Solution (Python):
var_a = 812
var_b = 25
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: Comparison

Question (EN): The heights of 7 students in class 1 of 6th grade are 161.5 centimeters (cm), 154.3 centimeters (cm), 143.7 centimeters (cm), 160.1 centimeters (cm), 158.0 centimeters (cm), 153.5 centimeters (cm), 147.8 centimeters (cm). Find how many of these students are above average.
Question (KO): 6학년 1반 학생 7명의 키가 161.5센티미터(㎝), 154.3센티미터(㎝), 143.7센티미터(㎝), 160.1센티미터(㎝), 158.0센티미터(㎝), 153.5센티미터(㎝), 147.8센티미터(㎝)일 때, 이 중에서 평균보다 큰 학생은 몇 명인지 구하시오.

Answer: 4

Solution (Python):
var_a = 161.5
var_b = 154.3
var_c = 143.7
var_d = 160.1
var_e = 158
var_f = 153.5
var_g = 147.8
list_a= []
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_a.append(var_g)
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()
list_a = [float(i) for i in list_a]
var_h = sum(list_a)/len(list_a)
list_b = []
for i in list_a:
    if i > var_h:
        list_b.append(i)
var_i = len(list_b)
print(int(var_i))
Category: Comparison

Question (EN): What is the largest number between 5 and 8?
Question (KO): 5, 8 중에서 가장 큰 숫자는 무엇인가요?

Answer: 8

Solution (Python):
var_a = 5
var_b = 8
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 = 1
list_b=list_a.copy()
list_b.sort()
var_d = list_b[-var_c]
print(int(var_d))
Category: Possibility

Question (EN): You would like to buy 2 fruits. If there are 4 types of fruit to choose from, how many ways are there for you to buy?

Question (KO): 2가지 과일을 사려고 합니다. 고를 수 있는 과일의 종류가 4개라면, 살 수 있는 경우의 수는 모두 몇 가지입니까?

Answer: 6

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

Question (EN): 1234567891011121314...998999 was created by writing the numbers from 1 to 999 in order. Find the sum of each digit in this number.
Question (KO): 1에서 999까지의 숫자를 차례로 이어 써서 1234567891011121314...998999를 만들었다. 이 수의 각 자리 숫자들의 총합을 구하여라.

Answer: 13500

Solution (Python):
var_a = 1
var_b = 999
var_c = 1
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: Possibility

Question (EN): When there are 6 students A, B, C, D, E, and F, find the number of ways to select 1 president and 1 secretary.
Question (KO): A, B, C, D, E, F 6명의 학생이 있을 때, 회장 1명, 서기 1명을 뽑는 경우의 수를 구하시오.

Answer: 30

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

Question (EN): A necklace is made by attaching 16 pieces of colored paper each 10.4 centimeters (cm) in length, overlapping each other by 3.5 centimeters (cm). How many centimeters (cm) is the total length of the necklace made of colored paper?
Question (KO): 길이가 10.4센티미터(㎝)인 색종이 16개를 3.5센티미터(㎝)씩 겹치게 이어 붙여 목걸이를 만들었습니다. 색종이로 만든 목걸이의 전체 길이는 몇 센티미터(㎝)입니까?

Answer: 110.4

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

Question (EN): Miyoung made a large cube using 8 cube-shaped boxes with a surface area of 96 square centimeters (㎠). What is the volume of this large cube?
Question (KO): 미영이는 겉넓이가 96제곱센티미터(㎠)인 정육면체 모양의 상자 8개를 이용해 큰 정육면체를 만들었습니다. 이 큰 정육면체의 부피는?

Answer: 512

Solution (Python):
var_a = 96
var_b = 6
var_c = var_a / var_b
var_d = 0.5
var_e = var_c ** var_d
var_f = 8
var_g = 2
var_h = var_f / var_g
var_i = 2
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: Correspondence

Question (EN): Find A from this formula AB9=459 which is expressed as a three-digit number.
Question (KO): 세 자리 수 식으로 표현된 AB9=459 에서 A를 구하시오.

Answer: 4

Solution (Python):
var_a = 'AB9=459'
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: Correspondence

Question (EN): The three-digit number 751 is less than 7A5. A is a tens digit and can contain any number from 0 to 9. How many digits can you write in A?
Question (KO): 세 자리 수 751은 7A5보다 작습니다. A는 십의 자리 숫자이고 A에는 0부터 9까지의 숫자를 쓸 수 있습니다. A에 쓸 수 있는 숫자는 모두 몇 개입니까?

Answer: 5

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

Question (EN): There were 7 crates containing 6 bottles of juice each, and I broke the juice bottles in 3 of the crates while moving the crates. How many bottles of juice are left?
Question (KO): 주스가 6병 들어있는 상자가 7개 있었는데 상자를 옮기다가 상자 세 개에 담겨 있는 주스 병들을 깼다. 남아 있는 주스는 모두 몇 병일까?

Answer: 24

Solution (Python):
var_a = 7
var_b = 3
var_c = var_a - var_b
var_d = 6
var_e = var_c * var_d
print(int(var_e))
Category: Correspondence

Question (EN): Moving a decimal point to the left by one place makes a particular decimal number 0.72 less than it originally was. Find the original decimal.
Question (KO): 어떤 소수의 소수점을 왼쪽으로 한 자리 옮기면 원래의 소수보다 0.72만큼 작아집니다. 원래의 소수를 구하시오.

Answer: 0.8

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

Question (EN): I made the mistake of multiplying a number by 4, when I should have divided this number by 4. I got 32 from this miscalculation. Find out how much it is if I calculate it correctly.
Question (KO): 어떤 수를 4로 나누어야 할 것을 잘못하여 어떤 수에 4를 곱했더니 32가 되었습니다. 바르게 계산하면 얼마인지 구해 보시오.

Answer: 2

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

Question (EN): 12 friends, including Yoonseok, are standing as a dodecagon. Every student shook hands once with every friend except for the friend on either side of them. How many handshakes did Yoonseok shake?
Question (KO): 윤석이를 포함한 12명의 친구가 십이각형을 그리고 서 있습니다. 모든 학생들이 자신의 양옆 친구를 제외하고 모든 친구와 한 번씩 악수를 했습니다. 윤석이는 몇 번의 악수를 했습니까?

Answer: 9

Solution (Python):
var_a = 12
var_b = 3
var_c = var_a - var_b
print(int(var_c))
Category: Comparison

Question (EN): There are two circles A and B. The area of A is 25 square centimeters (cm2), and the area of B is 49 square centimeters (cm2). How many centimeters (cm) is the diameter of the larger circle when pi is calculated as 3.1?
Question (KO): 두 원 (가), (나)가 있습니다. (가)의 넓이는 25제곱센티미터(㎠)이고, (나)의 넓이는 49제곱센티미터(㎠)입니다. 원주율을 3.1로 계산할 때 더 큰 원의 지름의 길이는 몇 센티미터(㎝)입니까?

Answer: 7.95

Solution (Python):
var_a = 25
var_b = 49
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 = 1
list_b=list_a.copy()
list_b.sort()
var_d = list_b[-var_c]
var_e = 3.1
var_f = var_d / var_e
var_g = 0.5
var_h = var_f ** var_g
var_i = 2
var_j = var_h * var_i
print('{:.2f}'.format(round(var_j+1e-10,2)))
Category: Comparison

Question (EN): Yoongi has 4 apples and Jungkook has 6 plus 3 apples. Who has fewer apples?
Question (KO): 윤기는 4개, 정국이는 6에 3을 합한 개수의 사과를 가지고 있습니다. 누가 더 사과를 적게 가지고 있습니까?

Answer: Yoongi

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 = 4
var_d = 6
var_e = 3
var_f = var_d + var_e
list_b= []
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[var_g-1]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j)
Category: Possibility

Question (EN): When using all of the given number cards 7, 5, and 2 once to make a number greater than 530 and less than 710, write the number that can be placed in the ones place.
Question (KO): 주어진 숫자 카드 7, 5, 2를 한 번씩 모두 사용하여 530보다 크고 710보다 작은 수를 만들 때, 일의 자리에 올 수 있는 숫자를 쓰시오.

Answer: 2

Solution (Python):
var_a = 7
var_b = 5
var_c = 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 = len(list_a)
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 = 530
list_c = []
for i in list_b:
    if i > var_e:
        list_c.append(i)
var_f = 710
list_d = []
for i in list_c:
    if i < var_f:
        list_d.append(i)
var_g = 1
var_h = list_d[var_g-1]
var_i = 100
var_j = var_h % var_i
var_k = 10
var_l = var_j % var_k
print(int(var_l))
Category: Arithmetic calculation

Question (EN): A one bundle means 10. If X is comprised of 6 plus 2 bundles, and Y is comprised of 1 plus 4 bundles, what is the sum of X and Y?
Question (KO): 1묶음의 개수는 10개입니다. X는 2묶음에 낱개로 6개 있고, Y는 4묶을에 낱개로 1개 있다면, X와 Y의 합은 얼마입니까?

Answer: 67

Solution (Python):
var_a = 10
var_b = 2
var_c = var_a * var_b
var_d = 6
var_e = var_c + var_d
var_f = 10
var_g = 4
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: Arithmetic calculation

Question (EN): Minji took the train and Seonkyung took the car. If the car travels 65 kilometers (km) per hour and the train travels 95 kilometers (km) per hour, how long is the distance between Minjin and Seonkyung after 8 hours?
Question (KO): 민지는 기차를 타고 선경이는 자동차를 타고 출발했습니다. 자동차는 1시간에 65킬로미터(km)를 가고 기차는 1시간에 95킬로미터(km)를 타고 간다면, 8시간 후 민진이와 선경이의 거리는 얼마나 차이납니까?

Answer: 240

Solution (Python):
var_a = 95
var_b = 65
var_c = var_a - var_b
var_d = 8
var_e = var_c * var_d
print(int(var_e))
Category: Correspondence

Question (EN): Find the number B that satisfies 6A5+10B=748, where 6A5 and 10B are three-digit numbers.
Question (KO): 6A5+10B=748이 성립합니다. B는 무엇인가요?

Answer: 3

Solution (Python):
var_a = '6A5+10B=748'
var_b = 'B'
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): What is the average of all natural numbers greater than 28 and less than or equal to 31?
Question (KO): 28 초과 31 이하인 자연수를 모두 평균 내면 모두 얼마인가요?

Answer: 30

Solution (Python):
var_a = 28
var_b = 1
var_c = var_a + var_b
var_d = 31
var_e = 1
list_a = [i for i in range(var_c, var_d + 1, var_e)]
list_a = [float(i) for i in list_a]
var_f = sum(list_a)/len(list_a)
print(int(var_f))
Category: Correspondence

Question (EN): When you add 43 to a number, you get 81. What is the result of adding 25 to this number?
Question (KO): 어떤 수에 43을 더했더니 81이 되었습니다. 어떤 수에 25를 더하면 얼마가 되는지 구하시오.

Answer: 63

Solution (Python):
var_a = 81
var_b = 43
var_c = var_a - var_b
var_d = 25
var_e = var_c + var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Moving any decimal point two places to the right increases it by 29.7. Find the original decimal.
Question (KO): 어떤 소수의 소수점을 오른쪽으로 두 자리 옮기면 원래보다 29.7만큼 커집니다. 원래의 소수를 구하시오.

Answer: 0.3

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

Question (EN): There are 3 watermelons and 7 apples. How many melons are there when the number of melons is twice the sum of the number of watermelons and apples?
Question (KO): 수박 3개, 사과 7개가 있다. 참외는 수박과 사과의 개수의 합의 두 배 일때 참외는 몇개 있는가?

Answer: 20

Solution (Python):
var_a = 3
var_b = 7
var_c = var_a + var_b
var_d = 2
var_e = var_c * var_d
print(int(var_e))
Category: Possibility

Question (EN): You want to create a three-digit number by drawing three from 0, 2, 4, and 6 and using them only once. Find the sum of the largest and smallest possible numbers.
Question (KO): 0, 2, 4, 6 중에서 3개 뽑아 한 번씩만 사용하여 세 자리 수를 만들려고 합니다. 만들 수 있는 가장 큰 수와 가장 작은 수의 합을 구하시오.

Answer: 846

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: Comparison

Question (EN): Yuna was 77th in line at a market, there were 15 people between Yuna and Yoojeong, who was ahead of Yuna. In what place is Yoojeong standing in line? Express in ordinal number.
Question (KO): 유나는 마트에서 77번째로 줄을 섰고, 유정이는 유나보다 15명 앞에 줄을 섰습니다. 유정이는 몇 번째로 섰습니까?

Answer: 61

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

Question (EN): Hoseok subtracted 7 from a number to get 9, then multiplied this number by 3. What is the result Hoseok would get?
Question (KO): 호석이는 7을 어떤 수에서 빼 9를 얻었고, 이 수에 3을 곱했습니다. 호석이가 구한 결과는 얼마입니까?

Answer: 48

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

Question (EN): Shinyoung saved 1/2 of her mother's pocket money and bought school supplies with the remaining 3/8, leaving 2,500 won. How much money does Shinyoung save?
Question (KO): 신영이는 어머니께서 주신 용돈의 1/2를 저축하고, 그 나머지의 3/8으로 학용품을 샀더니 2500원이 남았습니다. 신영이가 저축한 돈은 얼마입니까?

Answer: 4000

Solution (Python):
var_a = 2500
var_b = 1
var_c = 0.375
var_d = var_b - var_c
var_e = var_a / var_d
var_f = 0.5
var_g = var_e / var_f
var_h = 0.5
var_i = var_g * var_h
print(int(var_i))
Category: Correspondence

Question (EN): If a number multiplied by -2/3 and divided by -4/5 equals -1/2, what number is it?
Question (KO): 어떤 수에 -2/3을 곱하고 -4/5를 나누면 -1/2일 때, 어떤 수를 구하시오.

Answer: -0.6

Solution (Python):
var_a = -0.5
var_b = -0.8
var_c = var_a * var_b
var_d = -0.6666666666666666
var_e = var_c / var_d
print('{:.2f}'.format(round(var_e+1e-10,2)))