philschmid/DMath huggingface dataset:
Category: Comparison

Question (EN): We filled a 1 liter (l) 400 milliliter (ml) vase and a 2800 milliliter (ml) milk bottle with water, and then poured it all into a basin, which made the basin full. Between this basin a tank with 4 liters (L) and 100 milliliters (ml), which one can have more water inside?
Question (KO): 들이가 1리터(L) 400밀리리터(㎖)인 꽃병과 들이가 2800밀리리터(㎖)인 우유병에 물을 가득 채운 뒤 대야에 모두 부었더니 대야가 가득 찼습니다. 들이가 4리터(L) 100밀리리터(㎖)인 수조와 대야 중에서 어느 쪽의 들이가 더 많습니까?

Answer: basin

Solution (Python):
var_a = 'tank'
var_b = 'basin'
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 = 1000
var_e = var_c * var_d
var_f = 100
var_g = var_e + var_f
var_h = 2800
var_i = 1
var_j = 1000
var_k = var_i * var_j
var_l = 400
var_m = var_k + var_l
var_n = var_h + var_m
list_b= []
if "/" in str(var_n):
    var_n = eval(str(var_n))
list_b.append(var_n)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_b.append(var_g)
list_b.reverse()
var_o = 1
list_c=list_b.copy()
list_c.sort()
var_p = list_c[-var_o]
var_q = list_b.index(var_p)+1
var_r = list_a[var_q-1]
print(var_r)
Category: Arithmetic calculation

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

Answer: 2

Solution (Python):
var_a = 100
var_b = 999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 6
list_b = []
var_d = int(var_d)
for i in list_a:
    i = int(i)
    if i % var_d == 0:
        list_b.append(i)
var_e = 5
list_c = []
var_e = int(var_e)
for i in list_b:
    i = int(i)
    if i % var_e == 0:
        list_c.append(i)
var_f = 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: Comparison

Question (EN): There are five types of shapes: triangular-prism, quadrangular-prism, triangular-pyramid, quadrangular-pyramid, and truncated-quadrangular-pyramid. Given that you place a sticker on the center of each face of each shape, which shape needs the least number of stickers?
Question (KO): 삼각기둥, 사각기둥, 삼각뿔, 사각뿔, 사각뿔대 이렇게 다섯 종류의 도형이 있습니다. 각 도형에 있는 면의 중심에 스티커를 붙인다고 할 때 스티커가 가장 적게 필요한 도형은 무엇입니까?

Answer: triangular-pyramid

Solution (Python):
var_a = 'triangular-prism'
var_b = 'quadrangular-prism'
var_c = 'triangular-pyramid'
var_d = 'quadrangular-pyramid'
var_e = 'truncated-quadrangular-pyramid'
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
var_g = 2
var_h = var_f + var_g
var_i = 4
var_j = 2
var_k = var_i + var_j
var_l = 3
var_m = 1
var_n = var_l + var_m
var_o = 4
var_p = 1
var_q = var_o + var_p
var_r = 4
var_s = 2
var_t = var_r + var_s
list_b= []
if "/" in str(var_t):
    var_t = eval(str(var_t))
list_b.append(var_t)
if "/" in str(var_q):
    var_q = eval(str(var_q))
list_b.append(var_q)
if "/" in str(var_n):
    var_n = eval(str(var_n))
list_b.append(var_n)
if "/" in str(var_k):
    var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_b.append(var_h)
list_b.reverse()
var_u = 1
list_c=list_b.copy()
list_c.sort()
var_v = list_c[var_u-1]
var_w = list_b.index(var_v)+1
var_x = list_a[var_w-1]
print(var_x)
Category: Geometry

Question (EN): There are two cubes of different sizes. When the sum of the lengths of all edges of the large cube is 82.8 centimeters (cm), and the length of one edge of the small cube is 1/3 of the length of one edge of the large cube, select each one of the edges of the two cubes and determine its length. Add up to how many centimeters (cm)?
Question (KO): 크기가 다른 두 개의 정육면체가 있습니다. 큰 정육면체의 모든 모서리의 길이의 합이 82.8센티미터(㎝)이고, 작은 정육면체의 한 모서리의 길이는 큰 정육면체의 한 모서리의 길이의 1/3일 때, 두 정육면체의 모서리 중 하나씩을 선택해 그 길이를 더하면 몇 센티미터(㎝)입니까?

Answer: 9.2

Solution (Python):
var_a = 82.8
var_b = 4
var_c = 3
var_d = var_b * var_c
var_e = var_a / var_d
var_f = 0.3333333333333333
var_g = var_e * var_f
var_h = 82.8
var_i = 4
var_j = 3
var_k = var_i * var_j
var_l = var_h / var_k
var_m = var_g + var_l
print('{:.2f}'.format(round(var_m+1e-10,2)))
Category: Arithmetic calculation

Question (EN): Which four-digit number is the smallest common multiple of 5, 6, and 2?
Question (KO): 네 자리 수 중 5, 6, 2의 공배수 중 가장 작은 수는 무엇입니까?

Answer: 1020

Solution (Python):
var_a = 1000
var_b = 9999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 5
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 = 6
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 = 2
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 = 1
list_e=list_d.copy()
list_e.sort()
var_h = list_e[var_g-1]
print(int(var_h))
Category: Correspondence

Question (EN): Yoongi wants to subtract 57 from a three-digit number. Yoongi misread the three-digit ones digit 9 as a 6. When Yoongi's car is 819, find the correct calculation result.
Question (KO): 윤기는 세 자리 수와 57의 뺄셈을 하려 합니다. 윤기는 세 자리 수의 일의 자리 숫자 9를 6으로 잘못 보았습니다. 윤기가 구한 차는 819 일 때, 바르게 계산한 결과를 구하시오.

Answer: 822

Solution (Python):
var_a = 819
var_b = 57
var_c = var_a + var_b
var_d = 6
var_e = 9
var_f = var_d - var_e
var_g = var_c - var_f
var_h = 57
var_i = var_g - var_h
print(int(var_i))
Category: Comparison

Question (EN): Suzy has a wire of 9 centimeters (cm) 8 millimeters (mm), Yeongju has 8.9 centimeters (cm), and Youngho has 9.3 centimeters (cm). Who has the shortest wire length?
Question (KO): 철사를 수지는 9센티미터(㎝) 8밀리미터(㎜), 영주는 8.9센티미터(㎝), 영호는 9.3센티미터(㎝)가지고 있습니다. 가지고 있는 철사의 길이가 가장 짧은 사람은 누구입니까?

Answer: Yeongju

Solution (Python):
var_a = 'Suzy'
var_b = 'Yeongju'
var_c = 'Youngho'
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 = 9
var_e = 8
var_f = 10
var_g = var_e / var_f
var_h = var_d + var_g
var_i = 8.9
var_j = 9.3
list_b= []
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)
list_b.reverse()
var_k = 1
list_c=list_b.copy()
list_c.sort()
var_l = list_c[var_k-1]
var_m = list_b.index(var_l)+1
var_n = list_a[var_m-1]
print(var_n)
Category: Comparison

Question (EN): Jungkook has 0.8, Yoongi has 1/2, Yoojeong has 0.9, and Yuna has 1/3 written on their cards. How many people have cards with numbers less than 0.3 written? 
Question (KO): 정국이는 0.8, 윤기는 1/2, 유정이는 0.9, 유나는 1/3의 숫자카드를 갖고 있습니다. 0.3보다 작은 숫자카드를 가지고 있는 사람은 몇 명입니까?

Answer: 0

Solution (Python):
var_a = 0.8
var_b = 0.5
var_c = 0.9
var_d = 0.3333333333333333
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 = 0.3
list_b = []
for i in list_a:
    if i < var_e:
        list_b.append(i)
var_f = len(list_b)
print(int(var_f))
Category: Arithmetic calculation

Question (EN): When Jimin counted the money he had, there were 5 100 won coins and 1 50 won coin. If Seok-jin, who was next to him, had 2 100-won coins and 7 10-won coins, what would be the most expensive item the two of them could buy with the money they had?
Question (KO): 지민이가 가진 돈을 세어보니 100원짜리 동전이 5개, 50원짜리 동전이 1개였습니다. 옆에 있던 석진이는 100원짜리 동전 2개와 10원짜리 동전 7개를 가지고 있다면 두 사람이 가지고 있는 돈으로 살 수 있는 가장 비싼 물건은 얼마입니까?

Answer: 820

Solution (Python):
var_a = 100
var_b = 5
var_c = var_a * var_b
var_d = 50
var_e = 1
var_f = var_d * var_e
var_g = var_c + var_f
var_h = 100
var_i = 2
var_j = var_h * var_i
var_k = var_g + var_j
var_l = 10
var_m = 7
var_n = var_l * var_m
var_o = var_k + var_n
print(int(var_o))
Category: Arithmetic calculation

Question (EN): You are trying to find a two-digit number that is divisible by 3 and 4 and divided by 5 has a remainder of 4. What is the smallest two-digit number you can make?
Question (KO): 3과 4로 나누어떨어지고 5로 나누면 나머지가 4인 두 자리 수를 찾으려고 합니다. 만들 수 있는 두 자리 수 중 가장 작은 수는 무엇입니까?

Answer: 24

Solution (Python):
var_a = 10
var_b = 99
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 3
var_e = 4
var_f = var_e * var_d / math.gcd(int(var_e), int(var_d))
list_b = []
var_f = int(var_f)
for i in list_a:
    i = int(i)
    if i % var_f == 0:
        list_b.append(i)
var_g = 5
var_h = 4
list_c = [] 
var_g = int(var_g)
var_h = int(var_h)
if var_h < 0:
    var_h = var_h + var_g
for i in list_b:
    i = int(i)
    if i%var_g == var_h:
        list_c.append(i)
var_i = 1
list_d=list_c.copy()
list_d.sort()
var_j = list_d[var_i-1]
print(int(var_j))
Category: Possibility

Question (EN): What is the largest possible sum that can be calculated in an addition expression comprised of two-digit numbers that were made using 1, 7, 9, and 2 once? 
Question (KO): 1, 7, 9, 2를 한 번씩 모두 사용하여 두 자리 수끼리의 덧셈식을 만들 때, 나올 수 있는 가장 큰 합은 무엇입니까?

Answer: 163

Solution (Python):
var_a = 1
var_b = 7
var_c = 9
var_d = 2
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 = 1
list_b=list_a.copy()
list_b.sort()
var_f = list_b[-var_e]
var_g = 10
var_h = var_f * var_g
var_i = 1
list_c=list_a.copy()
list_c.sort()
var_j = list_c[var_i-1]
var_k = var_h + var_j
var_l = 2
list_d=list_a.copy()
list_d.sort()
var_m = list_d[-var_l]
var_n = 10
var_o = var_m * var_n
var_p = 2
list_e=list_a.copy()
list_e.sort()
var_q = list_e[var_p-1]
var_r = var_o + var_q
var_s = var_k + var_r
print(int(var_s))
Category: Comparison

Question (EN): 1000 marbles are divided between class 1 and 2, but class 1 has 50 more marbles. Then, the students in class 2 were divided into two teams of boys and girls and shared the marbles they brought, and the boys got 35 more. If 17 male students in class 2 share the marbles equally, find how many marbles each male student in class 2 has.
Question (KO): 1000개의 구슬을 1반과 2반이 나누어 가지는데 1반이 50개 더 가졌습니다. 그리고 2반 학생들은 남학생과 여학생 두 팀으로 나누어서 가져온 구슬을 다시 나누어 가지는데 남학생 팀이 35개 더 가졌습니다. 2반 남학생 17명이 구슬을 똑같이 나누어 가질 때, 2반 남학생 한 명이 가지는 구슬은 몇 개인지 구하시오.

Answer: 15

Solution (Python):
var_a = 1000
var_b = 50
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
var_f = 35
var_g = var_e - var_f
var_h = 2
var_i = var_g / var_h
var_j = 35
var_k = var_i + var_j
var_l = 17
var_m = var_k / var_l
print(int(var_m))
Category: Correspondence

Question (EN): When 632-AB1=41, what number should go in B?
Question (KO): 632-AB1=41일 때, B에 들어가야 하는 숫자는 무엇인가요?

Answer: 9

Solution (Python):
var_a = '632-AB1=41'
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: Arithmetic calculation

Question (EN): Minyoung drank 7/9 liters (L) of water, and Yuna drank 2 liters (L). Find how many times the amount of water Minyoung drank compared to the amount of water Yuna drank.
Question (KO): 민영이가 물을 7/9리터(L), 유나는 2리터(L) 마셨습니다. 민영이가 마신 물의 양은 유나가 마신 물의 양의 몇 배인지 구하시오.

Answer: 0.39

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

Question (EN): There are a total of three numbers: 0.8, 1/2, and 0.5. How many of these numbers are less than or equal to 3?
Question (KO): 총 3개의 숫자 0.8, 1/2, 0.5이 있습니다. 이 중 3보다 작거나 같은 수는 몇 개 일까요?

Answer: 3

Solution (Python):
var_a = 0.8
var_b = 0.5
var_c = 0.5
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 = []
for i in list_a:
    if i <= var_d:
        list_b.append(i)
var_e = len(list_b)
print(int(var_e))
Category: Correspondence

Question (EN): 27 times a number plus 143 is 9693. Find the number.
Question (KO): 어떤 수와 143을 더한 값의 27배는 9693입니다. 어떤 수를 구하시오.

Answer: 216

Solution (Python):
var_a = 9693
var_b = 27
var_c = var_a / var_b
var_d = 143
var_e = var_c - var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Yulgi and Dongmin had 5,000 won in total. Yulgi paid all the money he had, and Dongmin paid 300 won more than Yulgi to buy a doll of 4,500 won. How much money did Dongmin have at first?
Question (KO): 율기와 동민이가 가지고 있던 돈의 합은 5000원이었습니다. 율기는 가지고 있던 돈을 모두 냈고, 동민이는 율기보다 300원을 더 내어 4500원짜리 인형 하나를 샀습니다. 동민이가 처음에 가지고 있던 돈은 얼마입니까?

Answer: 2900

Solution (Python):
var_a = 5000
var_b = 4500
var_c = 300
var_d = var_b - var_c
var_e = 2
var_f = var_d / var_e
var_g = var_a - var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): Roosters outnumber hens by 16. How many chickens are there on the farm when there are 52 hens?
Question (KO): 수탉은 암탉보다 16마리 많습니다. 암탉이 52마리 일 때 농장에 있는 닭은 모두 몇 마리입니까?

Answer: 120

Solution (Python):
var_a = 52
var_b = 52
var_c = 16
var_d = var_b + var_c
var_e = var_a + var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Street lamps are erected on a bridge over a river that is 1650 meters (m) at intervals of 50 meters (m). If there are street lamps from the beginning to the end of the bridge, how many lamps are there on both sides of the bridge?
Question (KO): 가로등이 50미터(m) 간격으로 1650미터(m)인 강의 다리위에 세워져있습니다. 다리의 처음부터 끝까지 가로등이 세워져 있을 때, 다리의 양쪽에 세워진 가로등의 수는 모두 몇 개 입니까?

Answer: 68

Solution (Python):
var_a = 1650
var_b = 50
var_c = var_a / var_b
var_d = 1
var_e = var_c + var_d
var_f = 2
var_g = var_e * var_f
print(int(var_g))
Category: Comparison

Question (EN): Nine people stand in a line in order from shortest to tallest. Hoseok is the tallest, and Yuna stands 5th ahead of Hoseok. If you line up again in order of tallest people, what number will Yuna stand from the front?
Question (KO): 키가 작은 사람부터 순서대로 9명이 한 줄로 서 있습니다. 호석이는 가장 키가 크고, 유나는 호석이로부터 5번째 앞에 서 있습니다. 키가 큰 사람부터 순서대로 다시 줄을 서면 유나는 앞에서부터 몇 번째에 서게 됩니까?

Answer: 6

Solution (Python):
var_a = 9
var_b = 9
var_c = var_a - var_b
var_d = 5
var_e = var_c + var_d
var_f = 1
var_g = var_e + var_f
print(int(var_g))
Category: Correspondence

Question (EN): A and B are single-digit numbers. A is 3 greater than 5, and B is 2 less than A. Calculate the sum of A and B.
Question (KO): A, B는 한 자리 수입니다. A는 5보다 3 큰 수이고, B는 A보다 2 작은 수입니다. A와 B의 합을 구하시오.

Answer: 14

Solution (Python):
var_a = 5
var_b = 3
var_c = var_a + var_b
var_d = 5
var_e = 3
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: Correspondence

Question (EN): You had to add 2 to a certain number, but you mistakenly subtracted it, and the result was 5. What is the value if it is correctly calculated?
Question (KO): 어떤 수에서 2를 더해야 하는데 잘못해서 빼었더니 5가 되었다. 바르게 계산하면 얼마인지 구하시오.

Answer: 9

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

Question (EN): When the entire school students were arranged in a large square, there were 240 students standing at the perimeter. How many students were there in all?
Question (KO): 전교생을 큰 정사각형으로 줄세웠더니 둘레에 세워진 학생이 240명이었습니다. 전교생은 모두 몇 명일까요?

Answer: 3721

Solution (Python):
var_a = 240
var_b = 4
var_c = var_a / var_b
var_d = 1
var_e = var_c + var_d
var_f = 2
var_g = var_e ** var_f
print(int(var_g))
Category: Geometry

Question (EN): A large square was created by arranging the square-shaped tiles regularly without any gaps. If the number of tiles arranged at the perimeter was 240, how many tiles in total were used?
Question (KO): 정사각형 모양의 타일을 빈틈없이 규칙적으로 늘어놓아 큰 정사각형을 만들었습니다. 둘레에 놓인 타일의 개수가 240개였다면, 사용한 타일 전체의 개수는 몇 개입니까?

Answer: 3721

Solution (Python):
var_a = 240
var_b = 4
var_c = var_a / var_b
var_d = 1
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 2.3 liters (L) of Coke extract. It is said that 3 bottles of cola are made with 400 milliliters (ml) of cola extract. How many bottles of Coke can you make? (However, 3 bottles of Coke can be made at a time.)
Question (KO): 콜라 원액이 2.3리터(L) 있다. 콜라 원액 400밀리리터(㎖)로 콜라 3병을 만든다고 한다. 콜라 몇 병을 만들 수 있는가?(단, 콜라는 한번에 3병씩 만든다.)

Answer: 15

Solution (Python):
var_a = 2.3
var_b = 1000
var_c = var_a * var_b
var_d = 400
var_e = var_c // var_d
var_f = 3
var_g = var_e * var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): I'm going to distribute 400 notebooks to each of the Yellow, Red, and Blue class students. If the number of students in each class is 30, 27, and 28, how many notebooks are left?
Question (KO): 공책 400권을 노랑반, 빨강반, 파랑반 학생들에게 4권씩 나누어주려고 합니다. 각 반의 학생 수가 각각 30명, 27명, 28명 이라고 할 때 남은 공책은 몇 권입니까?

Answer: 60

Solution (Python):
var_a = 400
var_b = 30
var_c = 27
var_d = var_b + var_c
var_e = 28
var_f = var_d + var_e
var_g = 4
var_h = var_f * var_g
var_i = var_a - var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): Find the average of the natural numbers that are divisible by 6 and are between 30 and 50.
Question (KO): 6으로 나누어 떨어지고 30이상 50이하인 자연수들의 평균을 구하시오.

Answer: 39

Solution (Python):
var_a = 30
var_b = 50
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 6
list_b = []
var_d = int(var_d)
for i in list_a:
    i = int(i)
    if i % var_d == 0:
        list_b.append(i)
list_b = [float(i) for i in list_b]
var_e = sum(list_b)/len(list_b)
print(int(var_e))
Category: Comparison

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

Answer: (a)

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 = '(c)'
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)
Category: Comparison

Question (EN): Choose a number less than 1.1 from 1.4, 9/10, 1.2, 0.5, 13/10 and find the sum of the selected numbers
Question (KO): 1.4, 9/10, 1.2, 0.5, 13/10 중에서 1.1보다 작은 숫자를 고르고, 선택된 숫자들의 합을 구하세요

Answer: 1.4

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)
list_b = [float(i) for i in list_b]
var_g = sum(list_b)
print('{:.2f}'.format(round(var_g+1e-10,2)))
Category: Geometry

Question (EN): There is a prism with the sum of the number of edges and vertices equal to 30. What is the number of sides of this prism plus 2?
Question (KO): 모서리와 꼭짓점의 수의 합이 30인 각기둥이 있다. 이 각기둥의 옆면의 개수에 2를 더하면 얼마인가?

Answer: 8

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

Question (EN): At a constant speed, a taxi travels a distance of 17.28 kilometers (km) in 16 minutes, and a car travels a distance of 8.52 kilometers (km) in 6 minutes. If you start from the same place and drive for 15 minutes, which goes farther: a taxi or a car?
Question (KO): 일정한 빠르기로 택시는 17.28킬로미터(㎞)의 거리를 16분 동안에 가고, 승용차는 8.52킬로미터(㎞)의 거리를 6분 동안에 갑니다. 같은 곳에서 출발해서 15분 동안 달린다면 택시와 승용차 중 어느 것이 더 멀리 위치하겠습니까?

Answer: car

Solution (Python):
var_a = 'taxi'
var_b = 'car'
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 = 17.28
var_d = 16
var_e = var_c / var_d
var_f = 15
var_g = var_e * var_f
var_h = 8.52
var_i = 6
var_j = var_h / var_i
var_k = 15
var_l = var_j * var_k
list_b= []
if "/" in str(var_l):
    var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_b.append(var_g)
list_b.reverse()
var_m = 1
list_c=list_b.copy()
list_c.sort()
var_n = list_c[-var_m]
var_o = list_b.index(var_n)+1
var_p = list_a[var_o-1]
print(var_p)