philschmid/DMath huggingface dataset:
Category: Arithmetic calculation

Question (EN): You want to make no dolls left after handing out dolls equally to 8 students. When there are 62 dolls, how many more dolls do you need at least?
Question (KO): 8명의 학생에게 인형을 똑같이 나누어 준 후 남는 인형이 없게 하려고 합니다. 인형이 62개 있을 때, 몇 개의 인형이 최소로 더 필요합니까?

Answer: 2

Solution (Python):
var_a = 62
var_b = 8
var_c = var_a % var_b
var_d = 8
var_e = var_c - var_d
var_f = abs(var_e)
print(int(var_f))
Category: Comparison

Question (EN): Find the product of the largest number and the smallest number among 0.34, 2/4, 9/11, 0.22, and 0.76.
Question (KO): 0.34, 2/4, 9/11, 0.22, 0.76 중 가장 큰 수와 가장 작은 수의 곱을 구하시오

Answer: 0.18

Solution (Python):
var_a = 0.34
var_b = 0.5
var_c = 0.8181818181818182
var_d = 0.22
var_e = 0.76
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('{:.2f}'.format(round(var_j+1e-10,2)))
Category: Arithmetic calculation

Question (EN): There are five numbers 10, 11, 12, 13, and 14. What is the value of difference between the 3rd smallest number and the 2nd smallest number?
Question (KO): 5개의 수 10, 11, 12, 13, 14가 있습니다. 그 중에서 3번째로 작은 수와 2번째로 작은 수의 차는 얼마입니까?

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 = 3
list_b=list_a.copy()
list_b.sort()
var_g = list_b[var_f-1]
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: Correspondence

Question (EN): Suyeong goes shopping and uses 3/8 of her money at the first store, 1/3 of the remaining money at the second store, and 4/5 of the remaining money at the third store. The money was 1200 won. Find how much money Sooyoung had at first.
Question (KO): 수영이는 물건을 사러가서 첫 번째 가게에서 가진 돈의 3/8을 사용하고 두 번째 가게에서 남은 돈의 1/3을 사용하고, 세 번째 가게에서 다시 남은 돈의 4/5를 사용하였더니 남은 돈이 1200원이였습니다. 수영이가 처음 가지고 있던 돈은 얼마인지 구하십시오.

Answer: 14400

Solution (Python):
var_a = 1200
var_b = 1
var_c = 0.8
var_d = var_b - var_c
var_e = var_a / var_d
var_f = 1
var_g = 0.3333333333333333
var_h = var_f - var_g
var_i = var_e / var_h
var_j = 1
var_k = 0.375
var_l = var_j - var_k
var_m = var_i / var_l
print(int(var_m))
Category: Geometry

Question (EN): What is the length of the radius of a circle with an area equal to the surface area of a sphere with a radius of 3 centimeters (cm)?
Question (KO): 반지름이 3센티미터(㎝)인 구의 겉넓이와 같은 넓이를 가지는 원의 반지름의 길이는?

Answer: 6

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

Question (EN): When 4A+B3=68, what number should go into A, when 4A and B3 is two-digit number?
Question (KO): 4A+B3=68이 성립할 때, A에 들어가야 하는 숫자는 무엇인가요?

Answer: 5

Solution (Python):
var_a = '4A+B3=68'
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 cube with the sum of the lengths of all its edges equal to 96 centimeters (cm). How many centimeters (cm) is the length of one edge of this cube?
Question (KO): 모든 모서리의 길이의 합이 96센티미터(㎝)인 정육면체가 있습니다. 이 정육면체의 한 모서리의 길이는 몇 센티미터(㎝)입니까?

Answer: 8

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

Question (EN): Taehyung's class has 3 more students than Jimin's class, and Jimin's class has 2 fewer students than Seokjin's class. If there are 35 students in Taehyung's class, how many students are in Seokjin's class?
Question (KO): 지민이네 반보다 태형이네 반 학생 수가 3명 많고, 석진이네 반보다 지민이네 반 학생 수가 2명 적습니다. 태형이네 반 학생이 모두 35명일 때 석진이네 반 학생은 모두 몇 명입니까?

Answer: 34

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

Question (EN): There are five numbers 10, 11, 12, 13, and 14. What is the remainder of the 2nd largest number divided by the 3rd largest number?
Question (KO): 5개의 수 10, 11, 12, 13, 14가 있습니다. 그 중에서 3번째로 큰 수를 2번째로 큰 수로 나눈 나머지는 얼마입니까?

Answer: 12

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 = 3
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]
var_j = var_g % var_i
print(int(var_j))
Category: Arithmetic calculation

Question (EN): There is flour in the box. When the box full of flour was weighed, it was 3.4 kilograms (kg), and after using 1/5 of the flour, the box is weighed again and it was 2.98 kilograms (kg). Find the weight of the empty box.
Question (KO): 상자 속에 밀가루가 담겨있습니다. 밀가루가 가득 담긴 상자의 무게를 재었더니 3.4킬로그램(㎏)이었고 밀가루의 1/5를 사용한 후 다시 잰 상자의 무게는 2.98킬로그램(㎏)이었습니다. 상자만의 무게는 얼마인지 구하세요.

Answer: 1.3

Solution (Python):
var_a = 3.4
var_b = 3.4
var_c = 2.98
var_d = var_b - var_c
var_e = 0.2
var_f = var_d / var_e
var_g = var_a - var_f
print('{:.2f}'.format(round(var_g+1e-10,2)))
Category: Geometry

Question (EN): Jung-min bought wire at a stationery store to make a regular pentagon with a side length of 13 centimeters (cm). After making a regular pentagon with this wire, only 8 centimeters (cm) of wire was left. How many centimeters (cm) of wire did Jung-min buy at the store?
Question (KO): 정민이는 한 변의 길이가 13센티미터(㎝)인 정오각형을 만들기 위해 문방구에서 철사를 샀습니다. 이 철사를 이용해서 정오각형을 1개 만들었더니 8센티미터(㎝)의 철사가 남았다고 합니다. 정민이가 문방구에서 산 철사는 몇 센티미터(㎝)입니까?

Answer: 73

Solution (Python):
var_a = 13
var_b = 5
var_c = var_a * var_b
var_d = 8
var_e = var_c + var_d
print(int(var_e))
Category: Geometry

Question (EN): How many diagonals does an octagon have?
Question (KO): 팔각형의 대각선은 모두 몇 개입니까?

Answer: 20

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

Question (EN): There were some coins in the box. After a while, I put 8 more coins in the box, and there are 29 coins in total. How many coins were in the first place?
Question (KO): 상자에 동전이 몇 개 들어 있었습니다. 잠시 후 상자에 동전 8개를 더 넣었더니 모두 29개가 되었습니다. 처음 상자에 들어 있던 동전은 몇 개입니까?

Answer: 21

Solution (Python):
var_a = 29
var_b = 8
var_c = var_a - var_b
print(int(var_c))
Category: Comparison

Question (EN): Ten people of different heights stand in a line in order, starting with the shortest. Yoojung is standing at the 4th from the front. If the line is organized in order from the tallest, what place does Yoojung take in the line?
Question (KO): 각각의 키가 다른 10명이 키가 작은 사람부터 순서대로 한 줄로 서 있습니다. 유정이는 앞에서 4번째에 서 있습니다. 키가 큰 사람부터 순서대로 다시 줄을 서면 유정이는 앞에서 몇 번째에 서게 됩니까?

Answer: 7

Solution (Python):
var_a = 10
var_b = 4
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): There is a box weighing 11.14 kilograms (kg). If there are 14 fans in the box, and the empty box weighs 0.5 kilograms (kg), how many kilograms (kg) does one fan weigh?
Question (KO): 선풍기 14개가 들어 있는 상자의 무게는 11.14킬로그램(㎏)입니다. 빈 상자의 무게가 0.5킬로그램(㎏)이라면 선풍기 한 개의 무게는 몇 킬로그램(㎏)입니까?

Answer: 0.76

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

Question (EN): Yuna solved 8 English questions a day. How many English questions did Yuna solve in 7 days?
Question (KO): 유나가 하루에 영어문제를 8문제씩 풀었습니다. 유나가 7일 동안 푼 영어 문제는 모두 몇 문제입니까?

Answer: 56

Solution (Python):
var_a = 7
var_b = 8
var_c = var_a * var_b
print(int(var_c))
Category: Possibility

Question (EN): Two different numbers will be used as numerator and denominator, respectively. How many improper fractions can there be when those numbers are selected from 3, 5, 7, 11, 13, and 17?
Question (KO): 서로 다른 두개의 수를 뽑아 각각 분자와 분모로 사용하려고 한다. 6개의 수3, 5, 7, 11, 13, 17중에서 숫자를 뽑을 때 만들 수 있는 분수 중 가분수는 모두 몇 개입니까?

Answer: 15

Solution (Python):
var_a = 6
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): You want to create a three-digit number from 2, 7, 0, and 9. What is the 5th smallest of them?
Question (KO): 2, 7, 0, 9 중 서로 다른 숫자 3개를 뽑아 세 자리 수를 만들려고 합니다. 만든 세 자리 수 중 5번째로 작은 수는 몇 입니까?

Answer: 290

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

Question (EN): You incorrectly multiplied 2.4 to a number that should have been divided by 2.4 and got 288. What is the correct number?
Question (KO): 어떤 수를 2.4 로 나누어야 할 것을 잘못하여 곱하였더니 288 이 되었습니다. 바르게 계산하면 얼마입니까?

Answer: 50

Solution (Python):
var_a = 288
var_b = 2.4
var_c = var_a / var_b
var_d = 2.4
var_e = var_c / var_d
print(int(var_e))
Category: Possibility

Question (EN): You can throw the ball 3 times while playing ball toss. If you hit inside the red circle, you get 3 points, if you hit inside the yellow circle, you get 2 points, and if you don't fit inside the circle, you get 0 points. What is the total number of points you can get?
Question (KO): 공 던지기 놀이를 하는데 공을 3번 던질 수 있습니다. 빨간색 원안에 맞히면 3점, 노란색 원안에 맞히면 2점, 원안에 맞히지 못하면 0점입니다. 이때 얻을 수 있는 점수는 모두 몇 가지입니까?

Answer: 18

Solution (Python):
var_a = 3
var_b = 2
var_c = 0
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]
list_c=[]
for i in list_b:
    var_e = 0
    i = int(i)
    while i//10 > 0:
        var_e = var_e + i%10
        i = i//10
    var_e = var_e + i%10
    list_c.append(var_e)
var_f = len(list_c)
print(int(var_f))
Category: Geometry

Question (EN): A 50 cm (cm) wire was used to make a regular hexagon with a side of 8 cm (cm). If some wire is left over, calculate how much it would have left.
Question (KO): 한 변이 8센티미터(㎝)인 정육각형을 만드는 데에 50센티미터(㎝)짜리 철사를 사용했습니다. 육각형 모양을 만들고 철사가 남았다면, 얼마나 남았을지 계산해보시오.

Answer: 2

Solution (Python):
var_a = 50
var_b = 8
var_c = 6
var_d = var_b * var_c
var_e = var_a - var_d
print(int(var_e))
Category: Geometry

Question (EN): 8 students are gathered in octagonal shapes. Find out how many times all of these students shake hands when they shake hands once except for their neighbors.
Question (KO): 여덟 명의 학생이 팔각형 모양으로 모여 있습니다. 이 학생들이 자신과 이웃한 친구들을 제외하고 한 번씩 악수를 할 때 악수는 모두 몇 번이 이루어지는지 구하시오.

Answer: 20

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

Question (EN): The production cost of one refrigerator is 450,000 won, and the sales price is 800,000 won. If the sales revenue of this refrigerator is 16.45 million won, how many refrigerators have been sold?
Question (KO): 어떤 냉장고 1대의 생산 원가는 45만 원이고, 판매 가격은 80만 원이라고 한다. 이 냉장고의 판매 수익이 1645만 원일 때, 판매한 냉장고는 몇 대인지 구하여라.

Answer: 47

Solution (Python):
var_a = 1645
var_b = 80
var_c = 45
var_d = var_b - var_c
var_e = var_a / var_d
print(int(var_e))
Category: Geometry

Question (EN): There is a water tank (A) in the shape of a rectangular parallelepiped shape that is 3 centimeters (cm) long, 2 centimeters (cm) wide, and 4 centimeters (cm) high. There is another tank (B) with 4 centimeters (cm) long and 2 centimeters (cm) wide. If you move all the water filled in (B) that was 1.5 centimeters (cm) high into (A), what will be the height of water in (A) in centimeters (cm)?
Question (KO): 가로가 3센티미터(㎝), 세로가 2센티미터(㎝), 높이가 4센티미터(㎝)인 직육면체 모양의 (가) 통과 가로가 4센티미터(㎝), 세로가 2센티미터(㎝)인 직육면체 모양의 (나) 통이 있습니다. (나) 통에 높이가 1.5센티미터(㎝)만큼 차 있던 물을 (가) 통으로 모두 옮긴다면, (가) 통의 물의 높이는 몇 센티미터(㎝)가 됩니까?

Answer: 2

Solution (Python):
var_a = 4
var_b = 2
var_c = var_a * var_b
var_d = 1.5
var_e = var_c * var_d
var_f = 3
var_g = 2
var_h = var_f * var_g
var_i = var_e / var_h
print(int(var_i))
Category: Geometry

Question (EN): A cuboid-shaped fish tank with a width of 50 centimeters (cm) and a length of 16 centimeters (cm) was filled with water to a height of 15 centimeters (cm). Here, a cube-shaped object with an edge of 10 centimeters (cm) is completely submerged in the water. Calculate how many centimeters (cm) the height of the water in this fish tank is, including the decimal point.
Question (KO): 가로가 50센티미터(㎝), 세로가 16센티미터(㎝)인 직육면체 모양의 어항에 높이가 15센티미터(㎝)만큼 되도록 물을 채워 넣었습니다. 여기에 한 모서리의 길이가 10센티미터(㎝)인 정육면체 모양의 (가) 물건을 물 안에 완전히 잠기게 넣었습니다. 이 어항의 물의 높이는 몇 센티미터(㎝)가 되는지 소수점을 포함하여 구하시오.

Answer: 16.25

Solution (Python):
var_a = 15
var_b = 10
var_c = 10
var_d = var_b * var_c
var_e = 10
var_f = var_d * var_e
var_g = 50
var_h = 16
var_i = var_g * var_h
var_j = var_f / var_i
var_k = var_a + var_j
print('{:.2f}'.format(round(var_k+1e-10,2)))
Category: Geometry

Question (EN): Find the area of a square with one side equal to 30.
Question (KO): 한 변이 30인 정사각형의 넓이를 구하시오.

Answer: 900

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

Question (EN): Mina has a piece of rectangular-shaped colored paper with one side 5.9 centimeters (cm) long and the other side 3 centimeters (cm) long. What is the area of this piece of paper in square centimeters (cm2)?
Question (KO): 미나는 한 변의 길이가 5.9센티미터(㎝)이고 다른 한 변의 길이가 3센티미터(㎝)인 직사각형 모양의 색종이를 가지고 있습니다. 이 색종이의 넓이는 몇 제곱센티미터(㎠)입니까?

Answer: 17.7

Solution (Python):
var_a = 5.9
var_b = 3
var_c = var_a * var_b
print('{:.2f}'.format(round(var_c+1e-10,2)))
Category: Comparison

Question (EN): Jungkook collected 6 divided by 3 apples, Yoongi collected 4 apples, and Yuna collected 5 apples. Who has the most apples?
Question (KO): 정국이는 6 나누기 3만큼 사과를 모았고, 윤기는 4개, 유나는 5개의 사과를 모았습니다. 누가 가진 사과가 가장 큽니까?

Answer: Yuna

Solution (Python):
var_a = 'Jungkook'
var_b = 'Yoongi'
var_c = 'Yuna'
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 = 6
var_e = 3
var_f = var_d // var_e
var_g = 4
var_h = 5
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()
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): 2A3+36=269. What is A?
Question (KO): 2A3+36=269입니다. A는 얼마인가요?

Answer: 3

Solution (Python):
var_a = '2A3+36=269'
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: Possibility

Question (EN): When you try to pick two different numbers out of the six numbers 3, 5, 7, 11, 13, and 17 as the numerator and denominator of one fraction. How many improper fractions can there be?
Question (KO): 6개의 수 3, 5, 7, 11, 13, 17 중 서로 다른 두 개의 수를 뽑아 각각 한 분수의 분자와 분모로 합니다. 만들 수 있는 분수 중 가분수는 모두 몇 개입니까?

Answer: 15

Solution (Python):
var_a = 6
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: Arithmetic calculation

Question (EN): Currently, Minjoo's piggy bank has 12,000 won and Siwoo's piggy bank has 4,000 won. If Minjoo puts 300 won a day and Siwoo 500 won a day into their piggy banks tarting tomorrow, after how many days will the money in Minjoo's and Siwoo's piggy banks become the same?
Question (KO): 현재 민주의 저금통에는 12000원, 시우의 저금통에는 4000원이 들어 있다. 내일부터 민주는 매일 300원씩, 시우는 매일 500원씩 저금통에 넣는다면 민주와 시우의 저금통에 들어 있는 금액이 같아지는 것은 며칠 후인가?

Answer: 40

Solution (Python):
var_a = 12000
var_b = 4000
var_c = var_a - var_b
var_d = 500
var_e = 300
var_f = var_d - var_e
var_g = var_c / var_f
print(int(var_g))
Category: Comparison

Question (EN): Seokjin, Hoseok, and Namjoon took a math test. Seokjin's math score is higher than Hoseok's math score, and Namjoon's math score is also higher than Hoseok's math score. If Seokjin's math score is lower than Namjoon's math score, who has the highest math score?
Question (KO): 석진, 호석, 남준이는 수학 시험을 봤습니다. 석진이의 수학 점수가 호석이의 수학 점수보다 높고 남준이의 수학 점수도 호석이의 수학 점수보다 높습니다. 석진이의 수학 점수가 남준이의 수학 점수보다 낮다면 수학 점수가 가장 높은 친구는 누구인가요?

Answer: Namjoon

Solution (Python):
var_a = 'Seokjin'
var_b = 'Hoseok'
var_c = 'Namjoon'
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 = 'Seokjin'
var_e = 'Hoseok'
var_f = '>'
var_g = 'Namjoon'
var_h = 'Hoseok'
var_i = '>'
var_j = 'Seokjin'
var_k = 'Namjoon'
var_l = '<'
list_b= []
if "/" in str(var_l):
    var_l = eval(str(var_l))
list_b.append(var_l)
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)
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_b.append(var_e)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
    if cond_ in ("<", ">", "="):
        operand_right = temp_stack.pop()
        operand_left = temp_stack.pop()
        if cond_ == "=":
            cond_ = "=="
        conditions.append(f"{operand_left} {cond_} {operand_right}")
    else:
        if not cond_.isdigit():
            cond_ = "{" + cond_ + "}"
        temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
    item_name_index_dict = dict(zip(items_name_list, perm))
    formatted_conditions = \
        [condition.format_map(item_name_index_dict) for condition in conditions]
    if all(map(eval, formatted_conditions)):
        break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_m = 1
var_n = list_c[var_m-1]
print(var_n)
Category: Arithmetic calculation

Question (EN): Eunji received pocket money from her mother and went to the mart to buy a book with 1/4 of the money she took. Consider 1/3 of the remaining money was used to buy snack, and then she got 1,600 won at last. Find out the amount of initial money Eunji took to the mart.
Question (KO): 은지는 어머니께 용돈을 받아 마트에 가서 가져간 돈의 1/4로 책을 샀습니다. 나머지 돈의 1/3로 과자를 샀더니 남은 돈이 1,600원이었다면, 은지가 처음에 가져간 돈은 얼마였는지 구하시오.

Answer: 3200

Solution (Python):
var_a = 1600
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.25
var_h = var_f - var_g
var_i = var_e / var_h
print(int(eval('{:.2f}'.format(round(var_i+1e-10,2)))))
Category: Geometry

Question (EN): If the short diagonal of a rhombus is 6 centimeters (cm) and the long diagonal is 10 centimeters (cm), what is the area of this rhombus?
Question (KO): 마름모의 짧은 대각선의 길이는 6센티미터(㎝)이고, 긴 대각선의 길이는 10센티미터(㎝)일 때, 이 마름모의 넓이는 얼마입니까?

Answer: 30

Solution (Python):
var_a = 6
var_b = 10
var_c = var_a * var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e))