philschmid/DMath huggingface dataset:
Category: Geometry

Question (EN): There is a colored paper in the shape of a rhombus that fits inside a circle with a radius of 10 centimeters (cm). Find the area of the rhombus drawn by connecting the middles of all four sides of this piece of colored paper.
Question (KO): 반지름이 10센티미터(㎝)인 원 안에 딱 맞는 마름모 모양의 색종이가 있다. 이 색종이의 네 변의 한가운데를 모두 이어서 그린 마름모의 넓이를 구하라.

Answer: 100

Solution (Python):
var_a = 10
var_b = 10
var_c = var_a * var_b
print(int(var_c))
Category: Comparison

Question (EN): How many numbers are less than or equal to 1.1 out of five numbers: 1.4, 9/10, 1.2, 0.5, and 13/10?
Question (KO): 1.4, 9/10, 1.2, 0.5, 13/10 5개 숫자 중에서 1.1보다 작거나 같은 숫자를 고르면 총 몇 개 일까요?

Answer: 2

Solution (Python):
var_a = 1.4
var_b = 0.9
var_c = 1.2
var_d = 0.5
var_e = 1.3
list_a= []
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 1.1
list_b = []
for i in list_a:
    if i <= var_f:
        list_b.append(i)
var_g = len(list_b)
print(int(var_g))
Category: Arithmetic calculation

Question (EN): Item (A)s are divided into 4 boxes with 6 in each box. How many boxes are needed to pack 3 items in a box?
Question (KO): (가) 물건이 한 상자에 6개씩 4상자에 들어 있습니다. (가) 물건을 한 상자에 3개씩 넣어서 포장하려면 상자는 몇 개 필요합니까?

Answer: 8

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

Question (EN): You get the two-digit number A7+3B=73. What is the possible value of A at this time?
Question (KO): 두 자리 수 A7+3B=73이 나옵니다. 이 때 A의 값으로 가능한 값은 얼마 입니까?

Answer: 3

Solution (Python):
var_a = 'A7+3B=73'
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): A is the same as 1 group of 100 and 23 groups of 10. If B is the number that is increased 4 times by 105 from 172, what is the sum of A and B?
Question (KO): A는 100개씩 묶음 1개와 10개씩 묶음 23개와 동일한 수입니다. B는 172에서 4번 105씩 커지도록 뛰어서 센 수일 때, A와 B를 더하면 얼마입니까?

Answer: 922

Solution (Python):
var_a = 100
var_b = 1
var_c = var_a * var_b
var_d = 10
var_e = 23
var_f = var_d * var_e
var_g = var_c + var_f
var_h = 172
var_i = 105
var_j = 4
var_k = var_i * var_j
var_l = var_h + var_k
var_m = var_g + var_l
print(int(var_m))
Category: Geometry

Question (EN):  A trapezoid was created by cutting a parallelogram. The upper side of this trapezoid is 15 centimeters (cm) and the lower side is 9 centimeters (cm). If the height of the trapezoid is 12 centimeters (cm), how many centimeters (cm) is the side of a square with the same area as the trapezoid?
Question (KO): 어떤 평행사변형을 잘라서 사다리꼴을 만들었습니다. 이 사다리꼴의 윗변은 15센티미터(㎝)이고, 아랫변은 9센티미터(㎝)입니다. 사다리꼴의 높이가 12센티미터(㎝)일 때, 이 사다리꼴과 같은 넓이를 갖는 정사각형의 한 변의 길이는 몇 센티미터(㎝)입니까?

Answer: 12

Solution (Python):
var_a = 15
var_b = 9
var_c = var_a + var_b
var_d = 12
var_e = var_c * var_d
var_f = 2
var_g = var_e / var_f
var_h = 0.5
var_i = var_g ** var_h
print(int(var_i))
Category: Possibility

Question (EN): There are 3 red clothes and 7 yellow clothes in the closet. How many clothes can you wear?
Question (KO): 옷장에 빨간 옷 3개, 노랑 옷 7개가 있습니다. 입을 수 있는 옷은 모두 몇 가지입니까?

Answer: 10

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

Question (EN): Find the sum of each digit of the quotient of 111111 divided by 3.
Question (KO): 111111을 3으로 나눈 몫의 각 자리 수의 합을 구하시오.

Answer: 20

Solution (Python):
var_a = 111111
var_b = 3
var_c = var_a / var_b
list_a = []
var_c = int(var_c)
while var_c//10 > 0:
    list_a.append(var_c%10)
    var_c = var_c//10
list_a.append(var_c%10)
list_a = list_a[::-1]
list_a = [float(i) for i in list_a]
var_d = sum(list_a)
print(int(var_d))
Category: Correspondence

Question (EN): When a teacher gave an equal amount of 8204 candies, with 28 candies per student, to the 2nd graders, and there were no candies left. How many 2nd graders are there?
Question (KO): 선생님이 2학년 학생에게 8204개의 사탕을 같은 수로 주었을 때, 학생 1인당 28개의 사탕을 주었더니 사탕이 하나도 남지 않았습니다. 2학년은 모두 몇 명입니까?

Answer: 293

Solution (Python):
var_a = 1
var_b = 28
var_c = 8204
var_d = var_b / var_c
var_e = var_a / var_d
print(int(var_e))
Category: Geometry

Question (EN): There is a cuboid-shaped brick that is 20 centimeters (cm) long, 12 meters (m) wide, and 10 centimeters (cm) high. What is the volume of the largest cube-shaped brick that can be made by cutting this brick?
Question (KO): 가로 20센티미터(㎝), 세로 12미터(m), 높이 10센티미터(㎝)인 직육면체 모양의 벽돌이 있습니다. 이 벽돌을 잘라서 만들 수 있는 가장 큰 정육면체 모양의 벽돌의 부피는 얼마입니까?

Answer: 1000

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

Question (EN): When I mistakenly multiplied a decimal that should be divided by 12, I got 84.6. Find the original decimal.
Question (KO): 어떤 소수를 12 로 나누어야 할 것을 잘못하여 곱했더니 84.6 이 되었습니다. 어떤 소수를 구하시오.

Answer: 7.05

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

Question (EN): How many faces are there in a regular tetrahedron?
Question (KO): 직육면체 모양의 상자에서 어느 한 모서리와 꼬인 위치에 있는 모서리의 수를 모두 구하면 얼마인가요?

Answer: 4

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

Question (EN): Min-young used 8 tablespoons of salt, 3 tablespoons of pepper and 3 tablespoons of sugar. Yujeong used 7 tablespoons of salt and 2 tablespoons less than sugar. If Yujeong used twice as much spices as Min-young used, how many spoons of pepper did Yujeong use?
Question (KO): 민영이는 조미료로 소금 9번, 후추 3번, 다시다를 3번 뿌렸습니다. 유정이는 소금을 7번 뿌리고 후추는 다시다보다 2번 더 적게 뿌렸습니다. 유정이가 뿌린 조미료가 민영이가 뿌린 조미료보다 2번 더 많을 때, 유정이가 뿌린 후추는 몇 번인지 구하시오

Answer: 4

Solution (Python):
var_a = 9
var_b = 3
var_c = var_a + var_b
var_d = 5
var_e = var_c + var_d
var_f = 7
var_g = var_e - var_f
var_h = 2
var_i = var_g - var_h
var_j = 2
var_k = var_i // var_j
print(int(var_k))
Category: Arithmetic calculation

Question (EN): The sum of 5 consecutive even numbers is 240. Write the smallest of these 5 numbers.
Question (KO): 5개의 연속된 짝수의 합이 240입니다. 이 5개의 수 중 가장 작은 수를 쓰시오.

Answer: 44

Solution (Python):
var_a = 240
var_b = 5
var_c = var_a / var_b
var_d = 5
var_e = 2
var_f = var_d // var_e
var_g = 2
var_h = var_f * var_g
var_i = var_c - var_h
print(int(var_i))
Category: Comparison

Question (EN): On a ranch there are more pigs than cows and fewer pigs than chickens. What are the most common animals on a ranch?
Question (KO): 어느 목장에 돼지가 소보다 많고 돼지가 닭보다 적다고 한다. 목장에 가장 많은 동물은 무엇인지 구하시오.

Answer: chickens

Solution (Python):
var_a = 'cows'
var_b = 'pigs'
var_c = 'chickens'
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 = 'pigs'
var_e = 'cows'
var_f = '>'
var_g = 'pigs'
var_h = 'chickens'
var_i = '<'
list_b= []
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_j = 1
var_k = list_c[var_j-1]
print(var_k)
Category: Geometry

Question (EN): I used several wires to make a cube with a volume of 3375 cubic centimeters (cm3). Find the length of wires used to make it.
Question (KO): 몇 개의 철사로 부피가 3375세제곱센티미터(㎤)인 정육면체를 만들었습니다. 사용된 철사의 길이를 구하십시오.

Answer: 180

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

Question (EN): I am trying to hang pictures with a width of 30 centimeters (cm) in a row on a bulletin board that is 3 meters (m) and 20 centimeters (cm) wide. How many centimeters (cm) should the distance between the board and the picture and the distance between the pictures be, if all six pictures are hung at the same distance?
Question (KO): 가로가 3미터(m) 20센티미터(㎝)인 게시판에 가로가 30센티미터(㎝)인 그림을 일렬로 붙이려고 합니다. 게시판과 그림 사이, 그림과 그림 사이의 간격을 모두 같게 하여 6개를 붙이려면 간격은 몇 센티미터(㎝)로 하여야 합니까?

Answer: 20

Solution (Python):
var_a = 3
var_b = 100
var_c = var_a * var_b
var_d = 20
var_e = var_c + var_d
var_f = 30
var_g = 6
var_h = var_f * var_g
var_i = var_e - var_h
var_j = 6
var_k = 1
var_l = var_j + var_k
var_m = var_i / var_l
print(int(var_m))
Category: Geometry

Question (EN): Find the minimum number of bricks required to make a cube by stacking bricks with a width of 18 centimeters (cm), a depth of 12 centimeters (cm), and a height of 9 cm (cm).
Question (KO): 가로의 길이 18센티미터(㎝), 세로의 길이가 12센티미터(㎝), 높이가 9센티미터(㎝)인 벽돌을 쌓아 정육면체를 만들려고 할 때, 필요한 최소의 벽돌의 개수를 구하여라.

Answer: 24

Solution (Python):
var_a = 18
var_b = 12
var_c = var_b * var_a / math.gcd(int(var_b), int(var_a))
var_d = 9
var_e = var_d * var_c / math.gcd(int(var_d), int(var_c))
var_f = 18
var_g = var_e / var_f
var_h = 18
var_i = 12
var_j = var_i * var_h / math.gcd(int(var_i), int(var_h))
var_k = 9
var_l = var_k * var_j / math.gcd(int(var_k), int(var_j))
var_m = 12
var_n = var_l / var_m
var_o = 18
var_p = 12
var_q = var_p * var_o / math.gcd(int(var_p), int(var_o))
var_r = 9
var_s = var_r * var_q / math.gcd(int(var_r), int(var_q))
var_t = 9
var_u = var_s / var_t
var_v = var_n * var_u
var_w = var_g * var_v
print(int(var_w))
Category: Comparison

Question (EN): There are 168 pieces of red confetti and 173 pieces of yellow confetti. Which color of confetti do you have more?
Question (KO): 빨간색 색종이가 168장, 노란색 색종이가 173장 있습니다. 어느 색의 색종이가 더 많습니까?

Answer: yellow

Solution (Python):
var_a = 'red'
var_b = 'yellow'
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 = 168
var_d = 173
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): 7/12 of a certain number is 42. What is a value of 4 less than 11/18 of this number?
Question (KO): 어떤 수의 7/12은 42입니다. 어떤 수의 11/18보다 4 작은 수는 얼마입니까?

Answer: 40

Solution (Python):
var_a = 42
var_b = 1
var_c = 0.5833333333333334
var_d = var_b / var_c
var_e = var_a * var_d
var_f = 0.6111111111111112
var_g = var_e * var_f
var_h = 4
var_i = var_g - var_h
print(int(var_i))
Category: Geometry

Question (EN): There is a figure with 9 sides with each side length of 2 centimeters (cm). What is the perimeter of this shape in centimeters (cm)?
Question (KO): 한 변의 길이가 2센티미터(㎝)이며 변이 총 9개인 도형이 있습니다. 이 도형의 둘레는 몇 센티미터(㎝)입니까?

Answer: 18

Solution (Python):
var_a = 2
var_b = 9
var_c = var_a * var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): Jimin moved at 60 kilometers (km) per hour for two hours. If the destination is 300 kilometers (km) away, how far does Jimin have to go?
Question (KO): 지민이는 2시간동안 시속 60킬로미터(㎞)로 이동했습니다. 목적지까지는 300킬로미터(㎞)가 떨어져있다고 할 때, 지민이가 더 가야하는 거리는 얼마인가요?

Answer: 180

Solution (Python):
var_a = 300
var_b = 60
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
print(int(var_e))
Category: Geometry

Question (EN): You have a rectangle with a length of 15 centimeters (cm) and a width of 0.9 of its length. Find the area of this rectangle in square centimeters (cm2).
Question (KO): 가로가 15센티미터(㎝)이고 세로는 가로의 0.9인 직사각형이 있습니다. 이 직사각형의 넓이는 몇 제곱센티미터(㎠)인지 구하시오.

Answer: 202.5

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

Question (EN): Find the smallest five-digit number that is divided into 2, 3, or 5.
Question (KO): 2, 3, 5로 나누어떨어지는 수 중에서 가장 작은 다섯 자리 수를 찾아 쓰시오.

Answer: 10020

Solution (Python):
var_a = 10000
var_b = 10000
var_c = 10
var_d = var_b * var_c
var_e = 1
var_f = var_d - var_e
var_g = 1
list_a = [i for i in range(var_a, var_f + 1, var_g)]
var_h = 2
list_b = []
var_h = int(var_h)
for i in list_a:
    i = int(i)
    if i % var_h == 0:
        list_b.append(i)
var_i = 3
list_c = []
var_i = int(var_i)
for i in list_b:
    i = int(i)
    if i % var_i == 0:
        list_c.append(i)
var_j = 5
list_d = []
var_j = int(var_j)
for i in list_c:
    i = int(i)
    if i % var_j == 0:
        list_d.append(i)
var_k = 1
list_e=list_d.copy()
list_e.sort()
var_l = list_e[var_k-1]
print(int(var_l))
Category: Arithmetic calculation

Question (EN): To make one ribbon, you need 4 meters (m) of string. If Jimin bought 105.8 meters (m) of string, make as many ribbons as possible and find the length of the remaining string.
Question (KO): 리본 1개를 만들기 위해서는 끈 4미터(m)가 필요합니다. 지민이가 끈 105.8미터(m)를 사왔다면 최대한 많은 리본을 만들고 남은 끈의 길이를 구하세요.

Answer: 1.8

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

Question (EN): How many centimeters (cm) will be the length of a 49 centimeters (cm) wire if it is divided into 7 equal parts?
Question (KO): 길이가 49센티미터(㎝)인 철사를 7등분하면 길이가 몇 센티미터(㎝)가 되는가?

Answer: 7

Solution (Python):
var_a = 49
var_b = 7
var_c = var_a / var_b
print(int(var_c))
Category: Geometry

Question (EN): There are aliens with cube-shaped heads. The surface area of this alien's head is 150 square centimeters (cm2). Find the volume of the head.
Question (KO): 머리 모양이 정육면체인 외계인이 있습니다. 이 외계인 머리의 겉넓이는 150제곱센티미터(㎠)입니다. 머리의 부피를 구하시오.

Answer: 125

Solution (Python):
var_a = 150
var_b = 6
var_c = var_a / var_b
var_d = 0.5
var_e = var_c ** var_d
var_f = 3
var_g = var_e ** var_f
print(int(var_g))
Category: Geometry

Question (EN): A triangle has a total of 3 vertices. If two of these vertices are selected and the segment connected is a triangle with a length of 8 centimeters (cm) and an area of 24 square centimeters (cm2), how many centimeters is the distance between the unselected vertex and the segment formed by the selected vertex. 
Question (KO): 삼각형에는 총 3개의 꼭짓점이 있습니다. 이 중 두 개의 꼭짓점을 선택해 이은 선분의 길이가 8센티미터(㎝)이고, 넓이는 24제곱센티미터(㎠)인 삼각형이 있다면, 선택받지 못한 꼭짓점과 선택된 꼭짓점으로 만들어진 선분 사이의 거리는 몇 센티미터(㎝)일지 구하시오.

Answer: 6

Solution (Python):
var_a = 24
var_b = 2
var_c = var_a * var_b
var_d = 8
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 sum of the smallest number and the next smallest number?
Question (KO): 5개의 수 10, 11, 12, 13, 14가 있습니다. 그 중에서 가장 작은 수와 그 다음으로 작은 수의 합은 얼마입니까?

Answer: 21

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

Question (EN): The sum of three consecutive even numbers is 18 greater than the smallest even number among those three. What is the largest one among the 3 even numbers?
Question (KO): 연속된 짝수 3개의 합을 구하였더니 그 중 가장 작은 짝수보다 18이 컸습니다. 3개의 짝 수 중 가장 큰 수는 몇인지 구하시오.

Answer: 10

Solution (Python):
var_a = 18
var_b = 2
var_c = 1
var_d = var_b * var_c
var_e = 2
var_f = 2
var_g = var_e * var_f
var_h = var_d + var_g
var_i = var_a - var_h
var_j = 3
var_k = 1
var_l = var_j - var_k
var_m = var_i / var_l
var_n = 2
var_o = 2
var_p = var_n * var_o
var_q = var_m + var_p
print(int(var_q))
Category: Possibility

Question (EN): Using 3 of 4, 5, 8, and 9, what is the second smallest number whose units digit is 5?
Question (KO): 4, 5, 8, 9 중 3개를 사용하여 일의 자리 숫자가 5인 두 번째 작은 수는 무엇입니까?

Answer: 495

Solution (Python):
var_a = 4
var_b = 5
var_c = 8
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 = 1
var_g = 5
list_c = [] 
var_f = int(var_f)
var_g = int(var_g)
for i in list_b:
    i = int(i)
    if (i//var_f)%10 == var_g:
        list_c.append(i)
var_h = 2
list_d=list_c.copy()
list_d.sort()
var_i = list_d[var_h-1]
print(int(var_i))
Category: Geometry

Question (EN): If you draw a line bisector of the vertex angle of an isosceles triangle, the length of the each divided base is 4 meters (m). How many meters (m) is the total length of the base?
Question (KO): 이등변삼각형의 꼭지각에 대해 이등분선을 그었더니 나뉘어진 밑변의 길이가 4 미터(m) 였습니다. 이 때, 밑변의 길이는 몇 미터(m)입니까?

Answer: 8

Solution (Python):
var_a = 4
var_b = 2
var_c = var_a * var_b
print(int(var_c))
Category: Possibility

Question (EN): Write the 5th smallest number among three-digit numbers that can be made by drawing three different numbers from 2, 7, 0, and 9.
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): Yein wrapped three presents with ribbon. She used 1/2 of the total ribbon to wrap the first present, 1/3 of the remaining ribbon to wrap the second present, and 1/2 of the remaining ribbon to wrap the third present, leaving 250 centimeters (cm). How much ribbon did Yein have at first? 
Question (KO): 예인이는 리본으로 3개의 선물을 포장하기로 했다. 첫 번째 선물을 포장하는데 전체 리본의 1/2을 사용하고, 두 번째 선물을 포장하는데 남은 리본의 1/3을 사용하고, 세번째 선물을 포장하는데 남은 리본의 1/2을 사용했더니 250센티미터(㎝)가 남았습니다. 예인이가 처음 가지고 있던 리본의 양은 얼마입니까?

Answer: 1500

Solution (Python):
var_a = 250
var_b = 1
var_c = 0.5
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.5
var_l = var_j - var_k
var_m = var_i / var_l
print(int(eval('{:.2f}'.format(round(var_m+1e-10,2)))))
Category: Arithmetic calculation

Question (EN): You have a stick that is 28 meters (m) long. How many slices can you get if you cut this stick by 1.12 meters (m) each?
Question (KO): 길이가 28미터(m)인 막대가 있습니다. 이 막대를 1.12미터(m)씩 자르면 몇 도막으로 자를 수 있습니까?

Answer: 25

Solution (Python):
var_a = 28
var_b = 1.12
var_c = var_a / var_b
var_d = 1
var_e=int(((var_c+9*10**(var_d-2))//(10**(var_d-1)))*10**(var_d-1))

print(int(var_e))
Category: Arithmetic calculation

Question (EN): The weight of a full bottle of sesame oil is 3.4 kilograms (kg). If the weight of the bottle after using 1/5 of the sesame oil is 2.98 kilograms (kg), find the weight of the empty bottle in kilograms (kg).
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: Comparison

Question (EN): The rectangle is 11 centimeters (cm) wide and 8 centimeters (cm) long. The base and the height of a parallelogram are 12 centimeters (cm) and 7 centimeters (cm), respectively. Which shape has the largest area?
Question (KO): 직사각형은 가로, 세로가 각각 11센티미터(㎝), 8센티미터(㎝)이다. 평행사변형은 밑변 높이가 각각 12센티미터(㎝), 7센티미터(㎝)이다. 넓이가 가장 큰 도형은 어느 것인가?

Answer: rectangle

Solution (Python):
var_a = 'rectangle'
var_b = 'parallelogram'
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 = 11
var_d = 8
var_e = var_c * var_d
var_f = 12
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_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)