philschmid/DMath huggingface dataset:
Category: Comparison

Question (EN): Dongkyun, Youngtak, and Seunghwan have snacks. If Dongkyun has more than Youngtak and Seunghwan has more than Dongkyun, who has the most cookies?
Question (KO): 동균, 영탁, 승환이가 과자를 갖고 있다. 동균이가 영탁보다 많이 갖고있고 승환이가 동균보다 많다면 누가 쿠키를 가장 많이 가지고 있을까요?

Answer: Seunghwan

Solution (Python):
var_a = 'Dongkyun'
var_b = 'Youngtak'
var_c = 'Seunghwan'
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 = 'Dongkyun'
var_e = 'Youngtak'
var_f = '>'
var_g = 'Seunghwan'
var_h = 'Dongkyun'
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): If the volume of the cuboid is 36.48 cubic centimeters (cm3) and the area of the base is 6.0 square centimeters (cm2), what is the height?
Question (KO): 직육면체의 부피가 36.48세제곱센티미터(㎤)이고 밑면의 넓이가 6.0제곱센티미터(㎠)라면 높이는 얼마인지 구하시오.

Answer: 6

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

Question (EN): 13+AB=58 is true. How much is A?
Question (KO): 13+AB=58입니다. A는 얼마인가요?

Answer: 4

Solution (Python):
var_a = '13+AB=58'
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): AB-21=14. How much is B, where AB is twe-digit number?
Question (KO): AB-21=14입니다. B는 얼마인가요?

Answer: 5

Solution (Python):
var_a = 'AB-21=14'
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: Possibility

Question (EN): Dayoon is trying to make a four-digit number by rearranging the position of each digit in 2596. Including the initial number, how many numbers can he make?
Question (KO): 다윤이는 2596의 각 숫자의 위치를 바꾸어 네 자리 수를 만드려고 한다. 처음의 숫자를 포함하여 모두 몇 개를 만들 수 있는가?

Answer: 24

Solution (Python):
var_a = 2596
list_a = []
var_a = int(var_a)
while var_a//10 > 0:
    list_a.append(var_a%10)
    var_a = var_a//10
list_a.append(var_a%10)
list_a = list_a[::-1]
var_b = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_b))
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_c = len(list_b)
print(int(var_c))
Category: Arithmetic calculation

Question (EN): An item was wrapped with tape measuring 16 meters (m) in length. If 5 meters (m) were used to wrap the 1 item, how many meters (m) of tape are left after wrapping 2 items?
Question (KO): 길이가 16미터(m)인 테이프로 (가) 물건을 포장했습니다. (가) 물건 1개를 포장하는데 5미터(m)를 사용했다면, (가) 물건 2개를 포장하고 남은 테이프는 몇 미터(m)입니까?

Answer: 6

Solution (Python):
var_a = 16
var_b = 5
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): It costs 30 won to eat an apple. If you eat 25 apples, how much do you need?
Question (KO): 사과 1개를 먹으려면 30원이 필요합니다. 사과 25개를 먹는다면 얼마가 필요하나요?

Answer: 750

Solution (Python):
var_a = 30
var_b = 25
var_c = var_a * var_b
print(int(var_c))
Category: Possibility

Question (EN): You want to distribute 10 apples among 4 students. Given that at least one apple is given to each student, find the number of possible cases.
Question (KO): 사과 10개를 4명의 학생에게 나누어 주려고 한다. 학생당 최소 1개의 사과는 준다고 할 때, 가능한 경우의 수를 구하시오.

Answer: 84

Solution (Python):
var_a = 1
var_b = 9
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 4
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 = 10
var_g = 0
var_f = int(var_f)
for i in list_c:
    i = int(i)
    if i == var_f:
        var_g = var_g + 1
print(int(var_g))
Category: Correspondence

Question (EN): Find B to satisfy 57A-B14=364.
Question (KO): 57A-B14=364가 성립하기 위한 B를 구하시오.

Answer: 2

Solution (Python):
var_a = '57A-B14=364'
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): Jimin had 12 tangerines. 7 of them were eaten. How many tangerines are left to Jimin?
Question (KO): 지민이는 12개의 귤을 가지고 있었습니다. 그중에서 7개를 먹었습니다. 지민이에게 남은 귤은 몇 개입니까?

Answer: 5

Solution (Python):
var_a = 12
var_b = 7
var_c = var_a - var_b
print(int(var_c))
Category: Geometry

Question (EN): The surface area of a rectangular cuboid is 442 square centimeters (cm2). If the width is 7 centimeters (cm) and the length is 8 centimeters (cm), how many centimeters (cm) is the height?
Question (KO): 직육면체의 겉넓이가 442제곱센티미터(㎠) 입니다. 가로의 길이가 7센티미터(㎝), 세로의 길이가 8센티미터(㎝)이라면 높이는 몇 센티미터(㎝)입니까?

Answer: 11

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

Question (EN): Your younger brother is 1.1 meters (m) taller, you are 0.2 meters (m) taller than your younger brother, and your older brother is 1/10 meter (m) taller than you. How tall is your brother in meters (m)?
Question (KO): 동생의 키는 1.1미터(m)이며, 나는 동생보다 0.2미터(m) 크고, 형은 나보다 1/10미터(m) 큽니다. 형의 키는 몇 미터(m)입니까?

Answer: 1.4

Solution (Python):
var_a = 0.2
var_b = 1.1
var_c = var_a + var_b
var_d = 0.1
var_e = var_c + var_d
print('{:.2f}'.format(round(var_e+1e-10,2)))
Category: Possibility

Question (EN): You want to find the difference between the third smallest and the second smallest number of three number cards. If you have cards with 1, 6, and 8 written on them, what is the difference?
Question (KO): 세 장의 숫자 카드로 만든 수 중 세 번째로 작은 수와 두 번째로 작은 수의 차를 구하고 싶다. 1, 6, 8이 적힌 카드가 있을 때, 구하고 싶은 답은 얼마인가?

Answer: 432

Solution (Python):
var_a = 1
var_b = 6
var_c = 8
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.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 3
list_c=list_b.copy()
list_c.sort()
var_f = list_c[var_e-1]
var_g = 2
list_d=list_b.copy()
list_d.sort()
var_h = list_d[var_g-1]
var_i = var_f - var_h
print(int(var_i))
Category: Geometry

Question (EN): When the toy train was completely submerged in a cuboid-shaped water tank whose two sides of the bottom is 44 centimeters (cm) and 35 centimeters (cm), respectively, the height of the water increased by 7 centimeters (cm). And then the toy car was completely submerged, which increased the height of the water by 3 centimeters (cm). Find the sum of the volumes of the toy train and the car in cubic centimeters (cm3).
Question (KO): 밑면의 두 변 길이가 각각 44센티미터(㎝), 35센티미터(㎝)인 직육면체 모양의 수조에 장난감 기차를 완전히 잠기도록 넣었더니 물의 높이가 7센티미터(㎝) 늘어났고, 거기에 장난감 자동차를 완전히 잠기게 넣었더니 물의 높이가 3센티미터(㎝) 늘어났습니다. 장난감 기차와 자동차의 부피의 합은 몇 세제곱센티미터(㎤) 인지 구하시오.

Answer: 15400

Solution (Python):
var_a = 44
var_b = 35
var_c = var_a * var_b
var_d = 7
var_e = 3
var_f = var_d + var_e
var_g = var_c * var_f
print(int(var_g))
Category: Correspondence

Question (EN): 66 is the result of mistakenly subtracting 3 and adding 49 when should have multiplifed the number by 3 and adding 49. Find the difference between the incorrectly calculated value and the correct calculated value.
Question (KO): 66은 어떤 수에 3을 곱하고 49를 더해야 하는데 실수로 3을 빼고 49를 더한 결과입니다. 틀리게 계산한 값과 바르게 계산한 값의 차를 구하시오.

Answer: 43

Solution (Python):
var_a = 66
var_b = 49
var_c = var_a - var_b
var_d = 3
var_e = var_c + var_d
var_f = 3
var_g = var_e * var_f
var_h = 49
var_i = var_g + var_h
var_j = 66
var_k = var_i - var_j
print(int(var_k))
Category: Possibility

Question (EN): Find the product of the largest three-digit number and the smallest three-digit number when numbers can be formed of 4 number cards 1, 3, 5, and 8 allowing the duplicates.
Question (KO): 1, 3, 5, 8의 4장의 숫자 카드를 중복을 사용하여 세 자리 수를 만들 때 가장 큰 세 자리 수와 가장 작은 세 자리 수의 곱을 구하시오.

Answer: 98568

Solution (Python):
var_a = 1
var_b = 3
var_c = 5
var_d = 8
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.product(list_b, repeat=var_e))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_f = 1
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
var_h = 1
list_d=list_b.copy()
list_d.sort()
var_i = list_d[var_h-1]
var_j = var_g * var_i
print(int(var_j))
Category: Comparison

Question (EN): Jimin, Taehyung, and Hoseok each bought and ate a bag of the same candy. Jimin ate 1/9 of the total, Taehyung ate 1/3 of the total, and Hoseok ate 1/6 of the total. Who has the most candy left?
Question (KO): 지민, 태형, 호석이는 각각 똑같은 사탕을 1봉지씩 사서 먹었습니다. 지민이는 전체의 1/9을, 태형이는 전체의 1/3을, 호석이는 전체의 1/6을 먹었습니다. 사탕이 가장 많이 남아 있는 사람은 누구입니까?

Answer: Jimin

Solution (Python):
var_a = 'Jimin'
var_b = 'Taehyung'
var_c = 'Hoseok'
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 = 0.1111111111111111
var_e = 0.3333333333333333
var_f = 0.16666666666666666
list_b= []
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()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[var_g-1]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j)
Category: Possibility

Question (EN): Using the four digits 1, 4, 5, and 9 once, find the second large three-digit number with 9 in the tens place.
Question (KO): 4개의 숫자 1, 4, 5, 9를 한 번씩 사용하여 십의 자리 숫자가 9인 두 번째 큰 세 자리수 를 만들어 보시오.

Answer: 591

Solution (Python):
var_a = 1
var_b = 4
var_c = 5
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 = 10
var_g = 9
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]
print(int(var_i))
Category: Geometry

Question (EN): Find the area of a rectangular wall whose sides are 5 meters (m) long and 17/20 meters (m) wide.
Question (KO): 가로의 길이가 5미터(m)이고, 세로의 길이가 17/20미터(m)인 직사각형 모양의 담벼락의 넓이를 구하시오.

Answer: 4.25

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

Question (EN): There are 28 notebooks. I gave 1/4 of the 28 books to Yeonju, and 3/7 of the 28 books to Minji. Find how many notebooks are left.
Question (KO): 공책이 28권 있습니다. 연주에게 28권의 1/4만큼을 주었고, 민지에게 28권의 3/7만큼을 주었습니다. 남은 공책은 몇 권인지 구해 보시오.

Answer: 9

Solution (Python):
var_a = 28
var_b = 1
var_c = 0.25
var_d = var_b - var_c
var_e = 0.42857142857142855
var_f = var_d - var_e
var_g = var_a * var_f
print(int(var_g))
Category: Geometry

Question (EN): People are standing in 5 rows of 5 people. How many people are standing on the circumference?
Question (KO): 사람들이 한 줄에 5명씩 5줄로 서 있다. 둘레에 서 있는 사람들의 수는 몇 명입니까?

Answer: 16

Solution (Python):
var_a = 5
var_b = 4
var_c = var_a * var_b
var_d = 4
var_e = var_c - var_d
print(int(var_e))
Category: Comparison

Question (EN): There are 28 students in Jungkook's class, and each is a different height. If you line up these students in order of height, Jungkook will be 14th from the front and Eunji will be 20th from the front. How many students are standing between Jungkook and Eunji?
Question (KO): 정국이네 반 학생은 모두 28명이고 각각의 키가 다릅니다. 이 학생들을 키가 큰 학생부터 순서대로 줄을 세우면 정국이는 앞에서 14번째에 서고 은지는 앞에서 20번째에 섭니다. 정국이와 은지 사이에 서 있는 학생은 몇 명입니까?

Answer: 5

Solution (Python):
var_a = 20
var_b = 14
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e))
Category: Possibility

Question (EN): Find the sum of all numbers that are divisible by 3 and 5 when choosing three different numbers from 2, 3, 5, and 7 to make a three-digit number.
Question (KO): 2, 3, 5, 7 중에서 서로 다른 숫자 3개를 뽑아 세 자리 수를 만들 때, 3과 5로 나누어떨어지는 모든 수의 합을 구하시오.

Answer: 1110

Solution (Python):
var_a = 2
var_b = 5
var_c = 3
var_d = 7
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 = 3
list_c = []
var_f = int(var_f)
for i in list_b:
    i = int(i)
    if i % var_f == 0:
        list_c.append(i)
var_g = 5
list_d = []
var_g = int(var_g)
for i in list_c:
    i = int(i)
    if i % var_g == 0:
        list_d.append(i)
list_d = [float(i) for i in list_d]
var_h = sum(list_d)
print(int(var_h))
Category: Arithmetic calculation

Question (EN): Some apartment complex has 1 to 22 apartment buildings, each with up to 6 floors. If there are 5 apartments on each floor, how many apartments can live in this apartment complex?
Question (KO): 어떤 아파트 단지에는 1동부터 22동까지 있고, 각 동마다 6층까지 있습니다. 각 층마다 5가구씩 있다면, 이 아파트 단지에는 모두 몇 가구가 살 수 있습니까?

Answer: 660

Solution (Python):
var_a = 22
var_b = 6
var_c = var_a * var_b
var_d = 5
var_e = var_c * var_d
print(int(var_e))
Category: Correspondence

Question (EN): 55 is a number obtained by adding 45 to some number and subtracting 62 from it. What is the result when 7 is multiplied by this number?
Question (KO): 55는 어떤 수에서 45를 더하고 62를 뺀 수이다. 어떤 수에 7을 곱하면 얼마가 되는가?

Answer: 504

Solution (Python):
var_a = 55
var_b = 45
var_c = var_a - var_b
var_d = 62
var_e = var_c + var_d
var_f = 7
var_g = var_e * var_f
print(int(var_g))
Category: Comparison

Question (EN): Students are standing in a line. Yoojeong is standing at the very back. When 8 people are standing in front of Yoojeong, how many students are standing in the line?
Question (KO): 학생들이 한 줄로 서 있습니다. 유정이는 맨 뒤에 서 있습니다. 유정이 앞에 8명이 서 있을 때, 줄을 서 있는 학생은 모두 몇 명입니까?

Answer: 9

Solution (Python):
var_a = 8
var_b = 1
var_c = var_a + var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): You want to plant trees on one side of a road that is 156 meters (m) long at 6 meters (m) intervals. How many trees will you need if you plant trees at the beginning and at the end?
Question (KO): 6미터(m)간격으로 길이가 156미터(m)인 도로 한쪽에 나무를 심으려고 합니다. 처음과 끝에도 나무를 심는다고 할 때 필요한 나무는 모두 몇 그루입니까?

Answer: 27

Solution (Python):
var_a = 156
var_b = 6
var_c = var_a / var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): I am going to sell 200 carnations parceling into 25 bundles. If 1 carnation is 500 won, how much is a bundle?
Question (KO): 카네이션 200송이를 25묶음으로 똑같이 나누어 팔려고 합니다. 카네이션 1송이에 500원이라면 한 묶음은 얼마입니까?

Answer: 4000

Solution (Python):
var_a = 200
var_b = 25
var_c = var_a / var_b
var_d = 500
var_e = var_c * var_d
print(int(var_e))
Category: Geometry

Question (EN): Gasoline was filled in a cuboid-shaped oil tank with dimensions of 350 centimeters (cm), 260 centimeters (cm), and 165 centimeters (cm) in width, length, and height, respectively. If gasoline is 1,600 won per liter (L), how much money is needed to fill the gas tank?
Question (KO): 가로, 세로, 높이가 각각 350센티미터(㎝), 260센티미터(㎝), 165센티미터(㎝)이고, 직육면체 모양의 기름 탱크에 휘발유를 가득 채웠습니다. 휘발유가 1리터(L)에 1600원이라면 기름 탱크를 가득 채우는 데 필요한 금액은 얼마입니까?

Answer: 24024000

Solution (Python):
var_a = 350
var_b = 260
var_c = var_a * var_b
var_d = 165
var_e = var_c * var_d
var_f = 1000
var_g = var_e / var_f
var_h = 1600
var_i = var_g * var_h
print(int(var_i))
Category: Possibility

Question (EN): Find the number of ways where numbers from 1 to 100 are smaller than 40 and each digit is not equal to one another and consists of only 1, 3, 7, and 8?
Question (KO): 1이상 100이하의 수 중 40 이하이고, 각 자리의 수가 같지 않으며 1, 3, 7, 8로만 이루어져 있는 경우는 몇 가지인지 구하시오.

Answer: 6

Solution (Python):
var_a = 1
var_b = 3
var_c = 7
var_d = 8
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 = 2
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 = 40
list_c = []
for i in list_b:
    if i <= var_f:
        list_c.append(i)
var_g = len(list_c)
print(int(var_g))
Category: Arithmetic calculation

Question (EN): Yuna and her grandmother are 12 and 72 years old, respectively. A few years later, grandmother's age is 5 times Yuna's age. How old is your grandmother at that year?
Question (KO): 유나와 할머니는 각각 12살, 72살입니다. 몇 년 후, 할머니의 나이가 유나 나이의 5배가 되었습니다. 할머니는 몇 살입니까?

Answer: 75

Solution (Python):
var_a = 72
var_b = 12
var_c = var_a - var_b
var_d = 5
var_e = var_c * var_d
var_f = 5
var_g = 1
var_h = var_f - var_g
var_i = var_e / var_h
print(int(var_i))