philschmid/DMath huggingface dataset:
Category: Arithmetic calculation

Question (EN): Adding 8 consecutive even numbers gives 424. Find the first of the 8 even numbers.
Question (KO): 연속하는 8개의 짝수를 더하였더니 424가 되었습니다. 8개의 짝수 중 첫번째 수를 구하시오.

Answer: 46

Solution (Python):
var_a = 424
var_b = 0
var_c = 8
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e * var_f
var_h = 2
list_a = [i for i in range(var_b, var_g + 1, var_h)]
list_a = [float(i) for i in list_a]
var_i = sum(list_a)
var_j = var_a - var_i
var_k = 8
var_l = var_j / var_k
print(int(var_l))
Category: Arithmetic calculation

Question (EN): You have a rod that is 2 meters (m) 50 centimeters (cm) long. You are going to cut this stick to make several 25 centimeter (cm) sticks. How many times should you cut this rod?
Question (KO): 길이가 2미터(m) 50센티미터(㎝)인 막대가 있습니다. 이 막대를 잘라 25센티미터(㎝)짜리 막대를 여러 개 만들려고 합니다. 이 막대를 몇 번 잘라야 합니까?

Answer: 9

Solution (Python):
var_a = 2
var_b = 100
var_c = var_a * var_b
var_d = 50
var_e = var_c + var_d
var_f = 25
var_g = var_e / var_f
var_h = 1
var_i = var_g - var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): (A) car travels at 60 kilometers (km) per hour and (B) car travels at 45 kilometers (km) per hour. If 5 hours have passed since starting from the same starting point, how many kilometers (km) is (A) car ahead of (B) car?
Question (KO): (가) 자동차는 시속 60킬로미터(km)로 달리고 (나) 자동차는 1시간에 45킬로미터(km)를 달립니다. 같은 시작점에서 출발해서 5시간이 흘렀다면 (가) 자동차는 (나) 자동차보다 몇 킬로미터(km) 앞서있는지 구하시오.

Answer: 75

Solution (Python):
var_a = 60
var_b = 5
var_c = var_a * var_b
var_d = 45
var_e = 5
var_f = var_d * var_e
var_g = var_c - var_f
print(int(var_g))
Category: Possibility

Question (EN): If there are 3 bus routes and 2 subway routes going from Seohee's house to school, find the number of ways to go by bus or subway.
Question (KO): 서희네 집에서 학교까지 가는 버스 노선은 3개, 지하철 노선은 2개일 때 버스 또는 지하철로 가는 경우의 수를 구하시오.

Answer: 5

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

Question (EN): A dunk shot is a shot in which a player jumps high into the air and slams a ball into a 3.05-meter (m) high goal post with a ball in the hand. If a dunked ball bounces 0.7 of its landing height, how many meters (m) does the ball travel until it hits the ground for the third time?
Question (KO): 덩크슛은 손으로 농구공을 잡고 공중으로 높이 뛰어 올라 공을 3.05미터(m) 높이의 골대 안으로 내리꽂듯이 집어넣는 슛을 말합니다. 덩크슛으로 들어간 공이 떨어진 높이의 0.7만큼 튀어 오른다면 이 공이 세 번째로 땅에 닿을 때까지 움직인 거리는 모두 몇 미터(m)입니까?

Answer: 10.31

Solution (Python):
var_a = 3.05
var_b = 3.05
var_c = 0.7
var_d = var_b * var_c
var_e = 2
var_f = var_d * var_e
var_g = var_a + var_f
var_h = 3.05
var_i = 0.7
var_j = 2
var_k = var_i ** var_j
var_l = var_h * var_k
var_m = 2
var_n = var_l * var_m
var_o = var_g + var_n
print('{:.2f}'.format(round(var_o+1e-10,2)))
Category: Geometry

Question (EN): What is the volume in cubic centimeters (cm3) of a cube with an edge of 7 cm?
Question (KO): 한 모서리의 길이가 7㎝인 정육면체의 부피는 몇 세제곱센티미터입니까?

Answer: 343

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

Question (EN): How many numbers are less than 1 among 9/5, 3/5, 1.7, 3/2, 0.4, and 9/10?
Question (KO): 9/5, 3/5, 1.7, 3/2, 0.4, 9/10 중에서 1보다 작은 수는 모두 몇개입니까?

Answer: 3

Solution (Python):
var_a = 1.8
var_b = 0.6
var_c = 1.7
var_d = 1.5
var_e = 0.4
var_f = 0.9
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
list_b = []
for i in list_a:
    if i < var_g:
        list_b.append(i)
var_h = len(list_b)
print(int(var_h))
Category: Possibility

Question (EN): When one ball is drawn from a bag containing 12 balls each of which is written each of natural numbers from 1 to 12 and put back in and then draw one ball again, find the number of cases in which the number written on the first ball is less than 3, and the number written on the next ball is 10 or greater, 
Question (KO): 1부터 12까지의 자연수가 각각 하나씩 적힌 12개의 공이 들어있는 주머니에서 1개의 공을 뽑았다가 다시 넣고, 다시 1개의 공을 뽑을 때, 처음 나온 공에 적힌 수가 3 미만이고, 다음에 나온 공에 적힌 수가 10 이상인 경우의 수를 구하시오.

Answer: 6

Solution (Python):
var_a = 1
var_b = 12
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 3
list_b = []
for i in list_a:
    if i < var_d:
        list_b.append(i)
var_e = len(list_b)
var_f = 10
list_c = []
for i in list_a:
    if i >= var_f:
        list_c.append(i)
var_g = len(list_c)
var_h = var_e * var_g
print(int(var_h))
Category: Arithmetic calculation

Question (EN): Consider Taehyung can move 0.45 meters (m) in one step. If he moved 90 steps for 13 times, find the distance he walked in meters (m).
Question (KO): 태형이는 한 걸음에 0.45미터(m)를 이동할 수 있습니다. 태형이가 90걸음씩 13번 이동했다면 태형이가 걸은 거리는 몇 미터(m)인지 구하세요.

Answer: 526.5

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

Question (EN): There is a rectangular piece of land measuring 18 meters (m) wide and 24 meters (m) long. If you must drive stakes at the four corners and drive stakes at equal intervals around the perimeter of the land, at least how many stakes are needed?
Question (KO): 가로가 18미터(m), 세로가 24미터(m)인 직사각형 모양의 땅이 있습니다. 네 모퉁이에는 반드시 말뚝을 박기로 하고 같은 간격으로 땅의 둘레에 말뚝을 박을 때, 최소한 몇 개의 말뚝이 필요합니까?

Answer: 14

Solution (Python):
var_a = 18
var_b = 18
var_c = 24
var_d = math.gcd(int(var_c), int(var_b))
var_e = var_a / var_d
var_f = 24
var_g = 18
var_h = 24
var_i = math.gcd(int(var_h), int(var_g))
var_j = var_f / var_i
var_k = var_e + var_j
var_l = 2
var_m = var_k * var_l
print(int(var_m))
Category: Arithmetic calculation

Question (EN): How many 5-digit numbers are there that are multiples of 2, 3, 8, and 9?
Question (KO): 2의 배수이면서 3의 배수이면서 8의 배수이면서 9의 배수인 수 중 다섯 자리 수는 모두 몇 개 입니까?

Answer: 1250

Solution (Python):
var_a = 10000
var_b = 99999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 2
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 = 3
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 = 8
list_d = []
var_f = int(var_f)
for i in list_c:
    i = int(i)
    if i % var_f == 0:
        list_d.append(i)
var_g = 9
list_e = []
var_g = int(var_g)
for i in list_d:
    i = int(i)
    if i % var_g == 0:
        list_e.append(i)
var_h = len(list_e)
print(int(var_h))
Category: Correspondence

Question (EN): I had to add 40 to a certain number, but I accidentally multiply 21 by that number and the result is 63. How much is it if I calculate it correctly?
Question (KO): 40을 어떤 수에 더해야 할 것을 잘못하여 21을 어떤 수에 곱한 결과는 63이 나옵니다. 바르게 계산하면 얼마인가요?

Answer: 43

Solution (Python):
var_a = 63
var_b = 21
var_c = var_a / var_b
var_d = 40
var_e = var_c + var_d
print(int(var_e))
Category: Possibility

Question (EN): There are 6 people: A, B, C, D, E, and F. Find the number of ways in which 3 of them are lined up.
Question (KO): 가, 나, 다, 라, 마, 바 6명의 사람이 있다. 이 중 3명을 뽑아 일렬로 세우는 경우의 수를 구하시오.

Answer: 120

Solution (Python):
var_a = 6
var_b = 3
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)
print(int(var_c))
Category: Comparison

Question (EN): Fruit (d) is heavier than fruit (a) and lighter than fruit (b). Fruit (b) is lighter than fruit (c). Which fruit is the lightest?
Question (KO): (라) 과일은 (가) 과일보다 무겁고 (나) 과일보다 가볍습니다. (나) 과일은 (다) 과일보다 가볍습니다. 가장 가벼운 과일은 무엇입니까?

Answer: (a)

Solution (Python):
var_a = '(a)'
var_b = '(b)'
var_c = '(c)'
var_d = '(d)'
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 = '(d)'
var_f = '(a)'
var_g = '>'
var_h = '(d)'
var_i = '(b)'
var_j = '<'
var_k = '(b)'
var_l = '(c)'
var_m = '<'
list_b= []
if "/" in str(var_m):
    var_m = eval(str(var_m))
list_b.append(var_m)
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)
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_n = len(list_c)
var_o = list_c[var_n-1]
print(var_o)
Category: Possibility

Question (EN): Put two number of cards that marked 10, 30, 50 each into a box and draw 3 of them to find the sum. How many different sums can there be?
Question (KO): 10, 30, 50이라고 적힌 카드를 2장씩 상자에 넣고, 이 중 3장의 카드를 뽑아 합을 구하려고 합니다. 서로 다른 합이 될 수 있는 수는 모두 몇 가지입니까?

Answer: 20

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

Question (EN): Gyeongyeon gave 7 out of 20 cookies to his friends and received 5 more cookies from her friends. Find the number of cookies Gyeongyeon now has.
Question (KO): 경연이는 과자 20개 중 7개를 친구들에게 주었고 다시 친구들로 부터 5개의 과자를 받았다. 경연이가 가지고 있는 과자의 개수를 구하시오.

Answer: 18

Solution (Python):
var_a = 20
var_b = 7
var_c = var_a - var_b
var_d = 5
var_e = var_c + var_d
print(int(var_e))
Category: Possibility

Question (EN): If the three-digit natural number 7AB is a multiple of 7, how many numbers are possible to become two-digit natural number AB?
Question (KO): 세 자리 자연수 7AB가 7의 배수일 때, 두 자리 자연수 AB로 가능한 수는 몇 가지인지 구하시오.

Answer: 15

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

Question (EN): Find the quotient when 32 is divided by 6.544.
Question (KO): 32를 6.544으로 나누었을 때의 몫을 구하시오.

Answer: 4

Solution (Python):
var_a = 32
var_b = 6.544
var_c = var_a // var_b
print(int(var_c))
Category: Correspondence

Question (EN): When a number is multiplied by 14, it is 458.64. Find the value of the number divided by 17 and round it up to two decimal places.
Question (KO): 어떤 수에 14를 곱하였더니 458.64가 되었습니다. 어떤 수를 17로 나누었을 때의 값을 반올림하여 소수 둘째 자리까지 나타내시오.

Answer: 1.93

Solution (Python):
var_a = 458.64
var_b = 14
var_c = var_a / var_b
var_d = 17
var_e = var_c / var_d
var_f = 2
var_g = round(float(var_e)+1e-10, var_f)
print('{:.2f}'.format(round(var_g+1e-10,2)))
Category: Possibility

Question (EN): Using the four digits 1, 5, 6, and 9 once, find the largest three-digit number with hundreds digit of 1.
Question (KO): 4개의 숫자 1, 5, 6, 9를 한 번씩 사용하여 백의 자리 숫자가 1인 가장 큰 세 자리 수를 구하시오.

Answer: 196

Solution (Python):
var_a = 1
var_b = 5
var_c = 6
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 = 100
var_g = 1
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]
print(int(var_i))
Category: Correspondence

Question (EN): When Jung-mi added -2/3 to a number and multiplied it by -4/5, the result was -1/2. Find that number. 
Question (KO): 정미가 어떤 수에 -2/3을 더하고 -4/5를 곱했더니 그 결과가 -1/2이었습니다. 어떤 수를 구하시오.

Answer: 1.29

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

Question (EN): When you gave Yuna 30 of the 210 pieces of colored paper that Yoojung had, the number of colored paper that Yoojung had was 50 more than Yuna. How many pieces of colored paper did Yuna have at first?
Question (KO): 유정이가 가지고 있던 색종이 210장 중 30장을 유나에게 주었더니 유정이가 가진 색정이의 수가 유나보다 50장 더 많아졌습니다. 처음 유나가 가지고 있던 색종이는 몇 장일까요?

Answer: 100

Solution (Python):
var_a = 210
var_b = 30
var_c = var_a - var_b
var_d = 50
var_e = var_c - var_d
var_f = 30
var_g = var_e - var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): When it comes to mountain climbing, there are two routes. One is shorter and the other is 2 kilometers (km) longer. When I went up, I walked at 3 kilometers (km) per hour on a short path, and when I came down, I came down a long path at 4 kilometers (km) per hour. The hike took 4 hours in total. Find the time taken to come down.
Question (KO): 등산을 할 때는 두 가지의 길이 있다. 하나는 짧은 길이고 하나는 2킬로미터(㎞)더 긴 길이다. 올라갈 때는 짧은 길로 시속 3킬로미터(㎞)로 걸었고, 내려올 때는 긴 길로 시속 4킬로미터(㎞)로 내려왔다. 등산은 총 4시간이 걸렸다. 내려올 때 걸린 시간을 구하라.

Answer: 2

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

Question (EN): You made a regular hexagon that has a side length of 4 centimeters (cm) with yarn. If you make a square using the same yarn as the regular hexagon, what is the area of the square?
Question (KO): 실을 가지고 한 변의 길이가 4센티미터(㎝)인 정육각형을 만들었습니다. 똑같은 실을 가지고 정사각형을 만들었을 때, 이 정사각형의 넓이는 얼마입니까?

Answer: 36

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

Question (EN): There are three numbers 10, 11, and 12. What is the difference between the largest number and the next largest number?
Question (KO): 3개의 수 10, 11, 12가 있습니다. 그 중에서 가장 큰 수와 그 다음으로 큰 수의 차는 얼마입니까?

Answer: 1

Solution (Python):
var_a = 10
var_b = 11
var_c = 12
list_a= []
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 1
list_b=list_a.copy()
list_b.sort()
var_e = list_b[-var_d]
var_f = 2
list_c=list_a.copy()
list_c.sort()
var_g = list_c[-var_f]
var_h = var_e - var_g
print(int(var_h))
Category: Correspondence

Question (EN): A number divided by 5 plus 16 equals 58. Find the value of the following equation: a number divided by 15 and added by 74.
Question (KO): 어떤 수를 5로 나눈 다음 16을 더한 수가 58입니다. 어떤 수를 15로 나눈 뒤 74를 더한 값을 구하시오.

Answer: 88

Solution (Python):
var_a = 58
var_b = 16
var_c = var_a - var_b
var_d = 5
var_e = var_c * var_d
var_f = 15
var_g = var_e / var_f
var_h = 74
var_i = var_g + var_h
print(int(var_i))
Category: Comparison

Question (EN): Yoojung placed balls of various colors in a row on the desk. When she places red, blue, yellow, purple, and white ball in sequence, what color is the last ball?
Question (KO): 유정이가 책상 위에 여러가지 색깔의 공을 한 줄로 놓았습니다. 빨간색, 파란색, 노란색, 보라색, 흰색 공을 차례로 놓았을 때, 마지막 공의 색깔은 무엇입니까?

Answer: white

Solution (Python):
var_a = 'red'
var_b = 'blue'
var_c = 'yellow'
var_d = 'purple'
var_e = 'white'
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 = len(list_a)
var_g = list_a[var_f-1]
print(var_g)
Category: Correspondence

Question (EN): When 17 is divided by 2, the quotient is A and the remainder is B. Find what B is.
Question (KO): 17을 2로 나눴더니 몫이 A가 되었고, 나머지는 B가 되었습니다. 이 때 B를 구하시오.

Answer: 1

Solution (Python):
var_a = 17
var_b = 2
var_c = var_a % var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): There are 6/5 and 1/10. What is the difference between them?
Question (KO): 6/5과 1/10이 있습니다. 이들의 차이는 얼마인가요?

Answer: 1.1

Solution (Python):
var_a = 1.2
var_b = 0.1
var_c = var_a - var_b
var_d = abs(var_c)
print('{:.2f}'.format(round(var_d+1e-10,2)))
Category: Comparison

Question (EN): A rose is planted in the 7th row from the front, the 16th row from the back, the 9th row from the left, and the 13th row from the right. If the number of flowers planted in each row is the same, how many flowers are planted in all?
Question (KO): 장미는 앞에서 7번째 줄, 뒤에서 16번째 줄, 왼쪽에서 9번째 열, 오른쪽에서 13번째 열에 심어져 있습니다. 각 열마다 심어져 있는 꽃의 수가 같다고 할 때, 심어져 있는 꽃은 모두 몇 송이입니까?

Answer: 462

Solution (Python):
var_a = 7
var_b = 16
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 9
var_g = 13
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: Correspondence

Question (EN): Subtracting 10 from a number yields 15. How much do you get if you add 5 to this number?
Question (KO): 어떤 수에서 10을 뺐더니 결과가 15가 나왔습니다. 어떤 수에 5를 더하면?

Answer: 30

Solution (Python):
var_a = 15
var_b = 10
var_c = var_a + var_b
var_d = 5
var_e = var_c + var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): The weight of Jung-min's dog is 2 kilograms (kg) and 600 grams (g), and the weight of the cat is 3700 grams (g). Find the total weight in grams (g) of the animals that Jung-min raises.
Question (KO): 보민이는 오늘 2킬로미터(㎞) 600미터(m) 걸었고, 윤식이는 3700미터(m) 걸었습니다. 보민이와 윤식이가 오늘 하루 걸은 거리는 몇 미터(m)인지 구하시오.

Answer: 6300

Solution (Python):
var_a = 2
var_b = 1000
var_c = var_a * var_b
var_d = 600
var_e = var_c + var_d
var_f = 3700
var_g = var_e + var_f
print(int(var_g))
Category: Correspondence

Question (EN): Sunghoon took the midterm exam. When Sunghoon's Korean score is divided by his math score and the quotient is 1.2, and when his math score is divided by his English score and the quotient is 5/6. If you divide his Korean score by his English score, what is the quotient?
Question (KO): 성훈이는 중간시험을 봤다. 성훈이의 국어 점수를 수학점수로 나누면 몫이 1.2로 나누어떨어지고, 수학점수를 영어점수로 나누면 5/6으로 나누어떨어진다. 국어점수를 영어점수로 나누면 그 몫은 얼마인가?

Answer: 1

Solution (Python):
var_a = 1.2
var_b = 0.8333333333333334
var_c = var_a * var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): The average liter (L) of water and milk is 94 liters (L). If there is 100 liters of coffee, what is the average liter of water, milk and coffee?
Question (KO): 물, 우유의 평균 리터(L)가 94리터(L)이다. 커피가 100리터(L) 있다면 물, 우유, 커피의 평균 리터(L)는 무엇인가

Answer: 96

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

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

Answer: 24

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

Question (EN): There are three fruits, (a), (b), and (c). If fruit (a) is lighter than fruit (b) and fruit (c) is lighter than fruit (a), which fruit is the heaviest?
Question (KO): (가), (나), (다) 과일이 있다. (가) 과일은 (나) 과일보다 가볍고 (다) 과일은 (가) 과일보다 가벼울 때 가장 무거운 과일은 무엇인가?

Answer: (b)

Solution (Python):
var_a = '(a)'
var_b = '(b)'
var_c = '(c)'
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 = '(a)'
var_e = '(b)'
var_f = '<'
var_g = '(c)'
var_h = '(a)'
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)