philschmid/DMath huggingface dataset:
Category: Possibility

Question (EN): Hoseok intends to distribute the 7 notebooks to his older sister and older brother. The older sister and older brother each receive at least one notebook. How many total ways to hand out notebooks?
Question (KO): 공책 7개를 호석이는 누나와 형에게 나누어주려고 합니다. 누나와 형은 각자 적어도 1개의 공책을 받습니다. 공책을 나누어주는 방법은 총 몇 개입니까?

Answer: 6

Solution (Python):
var_a = 7
var_b = 2
var_c = 1
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 1
var_g = var_e + var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): It takes 6.64 kg (kg) of glutinous rice flour to make one glutinous rice cake. After making a glutinous rice cake with 202.66 kg (kg) of glutinous rice flour, find how many grams (g) of glutinous rice flour is left.
Question (KO): 찹쌀떡 1개를 만드는 데 찹쌀가루가 6.64킬로그램(㎏) 필요합니다. 찹쌀가루 202.66킬로그램(㎏)으로 찹쌀떡을 다 만들고 남은 찹쌀가루는 몇 그램(g)인지 구하시오.

Answer: 3460

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

Question (EN): Find the sum of the natural numbers from 6 to 21
Question (KO): 6부터 21까지 자연수의 합을 구하시오

Answer: 216

Solution (Python):
var_a = 6
var_b = 21
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
list_a = [float(i) for i in list_a]
var_d = sum(list_a)
print(int(var_d))
Category: Correspondence

Question (EN): What number must go in B in order to satisfy A78-21B=364?
Question (KO): A78-21B=364라는 식이 성립하려면, B에 들어가야 하는 숫자는 무엇인가요?

Answer: 4

Solution (Python):
var_a = 'A78-21B=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): A car needs 0.14 liters (l) of gasoline to travel 1 kilometer (km). This car ran for 2 hours and 30 minutes at 93.6 kilometers (km) per hour. Find how many liters (L) of gasoline were used.
Question (KO): 1킬로미터(㎞)를 달리는 데 휘발유 0.14리터(L)가 필요한 자동차가 있습니다. 이 자동차로 1시간에 93.6킬로미터(㎞)씩 2시간 30분 동안 달렸습니다. 사용한 휘발유는 모두 몇 리터(L)인지 구하시오.

Answer: 32.76

Solution (Python):
var_a = 0.14
var_b = 93.6
var_c = var_a * var_b
var_d = 2
var_e = 30
var_f = 60
var_g = var_e / var_f
var_h = var_d + var_g
var_i = var_c * var_h
print('{:.2f}'.format(round(var_i+1e-10,2)))
Category: Possibility

Question (EN): Using the number cards 1, 6, and 8 all once, find the sum of the second largest three-digit number and the third largest three-digit number.
Question (KO): 숫자 카드 1, 6, 8를 한 번씩 모두 사용하여 두 번째로 큰 세 자리 수와 세 번째로 큰 세 자리수의 합을 구하시오.

Answer: 1434

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 = 2
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = 3
var_h = list_b[var_g-1]
var_i = var_f + var_h
print(int(var_i))
Category: Geometry

Question (EN): There is a piece of colored paper in the shape of a square with a side length of 4 centimeters (cm). The four sides of this colored paper were cut into diamond shapes by connecting the two equally divided dots. Find the area of this rhombus.
Question (KO): 한 변의 길이가 4센티미터(㎝)인 정사각형 모양의 색종이가 있습니다. 이 색종이의 네 변을 각각 똑같게 둘로 나눈 점들을 이어 마름모 모양을 만들어 잘랐습니다. 이 마름모의 넓이를 구하시오.

Answer: 8

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

Question (EN): Gyeongyeon rides a bicycle for half of the entire route, travels another 300 meters (m), rides a bus to travel half of the remaining route, and then travels another 400 meters (m) before arriving at his destination. Find how many meters (m) is the total path traveled by Gyeongyeon.
Question (KO): 경연이는 자전거를 타고 전체 경로의 절반을 이동하고 다시 300미터(m)를 이동한 후 버스를 타고 남은 경로의 절반을 이동한 뒤 400미터(m)를 더 갔더니 목적지에 도착했다고 한다. 경연이가 이동한 총 경로는 몇 미터(m)인지 구하시오.

Answer: 2200

Solution (Python):
var_a = 0
var_b = 400
var_c = var_a + var_b
var_d = 1
var_e = 0.5
var_f = var_d - var_e
var_g = var_c / var_f
var_h = 300
var_i = var_g + var_h
var_j = 1
var_k = 0.5
var_l = var_j - var_k
var_m = var_i / var_l
print(int(var_m))
Category: Correspondence

Question (EN): There are two different numbers: A and B. Find the value of A×B in the two-digit subtraction formula of A2-5A=B3.
Question (KO): 서로 다른 두 수 A, B가 있습니다. 두 자리 수끼리의 뺄셈식 A2-5A=B3에서 A×B의 값을 구하시오.

Answer: 27

Solution (Python):
var_a = 'A2-5A=B3'
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]
var_d = 'A2-5A=B3'
var_e = 'B'
ans_dict = dict()
var_d = var_d.replace('×','*')
var_d = var_d.replace('x','*')
var_d = var_d.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_d):
    if v in variable_candi:
        ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
    temp = var_d
    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_d):
        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_f = ans_dict[var_e]
var_g = var_c * var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): A few years ago, when Jimin was 16, his father was 47. If the father is twice Jimin's age this year, how many years have passed?
Question (KO): 몇 년 전 지민이가 16살일 때, 아버지는 47살이였습니다. 올해 아버지의 나이가 지민이의 2배라면, 몇 년이 흘렀습니까?

Answer: 15

Solution (Python):
var_a = 47
var_b = 16
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 2
var_g = 1
var_h = var_f - var_g
var_i = var_e / var_h
print(int(var_i))
Category: Possibility

Question (EN): How many times can you choose and buy 2 of 4 different fruits?
Question (KO): 서로 다른 4개의 과일 중에서 2개를 골라서 사는 경우는 모두 몇 가지입니까?

Answer: 6

Solution (Python):
var_a = 4
var_b = 2
var_c = 1
var_a = int(var_a)
var_b = int(var_b)
for i, elem in enumerate(range(var_b)):
    var_c = var_c * (var_a-i)
for i, elem in enumerate(range(var_b)):
    var_c = var_c / (i+1)
print(int(var_c))
Category: Possibility

Question (EN): Find the difference between the largest and smallest two-digit numbers that can be formed by picking two different numbers from 8, 3, 4, and 6.
Question (KO): 8, 3, 4, 6 중에서 서로 다른 숫자 2개를 뽑아 만들 수 있는 두 자리 수 중에서 가장 큰 수와 가장 작은 수의 차를 구하시오.

Answer: 52

Solution (Python):
var_a = 8
var_b = 3
var_c = 4
var_d = 6
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 = 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: Correspondence

Question (EN): If the number 26 greater than a number is 50, find the number that is 9 times the number.
Question (KO): 어떤 수보다 26 큰 수가 50일 때, 어떤 수의 9배인 수를 구하시오.

Answer: 216

Solution (Python):
var_a = 50
var_b = 26
var_c = var_a - var_b
var_d = 9
var_e = var_c * var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): We are trying to put 2135 marbles, 100 each in a barrel. Find the minimum number of barrels needed to hold the marbles.
Question (KO): 2135개의 구슬을 한 통에 100개씩 담으려고 합니다. 구슬을 담을 통은 최소 몇 개 필요한지 구하시오.

Answer: 22

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

Question (EN): Pencil, eraser, pen, ruler, and notebook are on the desk in this order. When you swap the positions of the pen and the notebook, in what position (in ordinal number) would the notebook be?
Question (KO): 연필, 지우개, 볼펜, 자, 공책 순으로 책상위에 있습니다. 볼펜과 공책의 위치를 바꿨을 떄 공책은 몇 번째에 있나요?

Answer: 5

Solution (Python):
var_a = 'Pencil'
var_b = 'eraser'
var_c = 'pen'
var_d = 'ruler'
var_e = 'notebook'
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 = 'notebook'
var_g = list_a.index(var_f)+1
print(int(var_g))
Category: Correspondence

Question (EN): A is 238 and B is 143 greater than that. Find A+C when B is the value of C minus 304.
Question (KO): A는 238이고 B는 이보다 143만큼 큽니다. B가 C에서 304를 뺀 값일때 A+C를 구하시오.

Answer: 637

Solution (Python):
var_a = 238
var_b = 238
var_c = 143
var_d = var_b - var_c
var_e = 304
var_f = var_d + var_e
var_g = var_a + var_f
print(int(var_g))
Category: Geometry

Question (EN): Taehyung is the 6th shortest in the class, and Seokjin is the next shortest. In what order is Seokjin short in the classroom?
Question (KO): 태형이는 교실에서 6번째로 키가 작고, 석진이는 그 다음으로 키가 작습니다. 석진이는 몇 번째로 키가 작습니까?

Answer: 7

Solution (Python):
var_a = 6
var_b = 1
var_c = var_a + var_b
print(int(var_c))
Category: Comparison

Question (EN): After filling a 1 liter (l) 400 milliliter (ml) water bottle and a 2800 milliliter (ml) tank full of water, they poured all the water into a basin, and the basin was full. Which one can have more water inside - the basin or a tank with 4 liters (l) and 100 milliliters (ml)?
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: Correspondence

Question (EN): Find the single digit number greater than 0 and less than 2.
Question (KO): 0보다 크고 2보다 작은 한자리 수를 구하시오.

Answer: 1

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 = 0
list_b = []
for i in list_a:
    if i > var_d:
        list_b.append(i)
var_e = 2
list_c = []
for i in list_b:
    if i < var_e:
        list_c.append(i)
var_f = 1
var_g = list_c[var_f-1]
print(int(var_g))
Category: Correspondence

Question (EN): The homeroom teacher expected the sum of the students' final exam scores to increase by 2152 compared to the sum of their midterm exam scores, but it only increased by 1264. What is the difference between the teacher's estimate and the actual score?
Question (KO): 담임선생님은 학생들의 기말고사 점수의 총합이 중간고사 점수의 총합보다 2152점이 오를거라 예상했지만 실제로는 1264점 밖에 오르지 않았습니다. 선생님의 예상과 실제 점수 사이의 차이는 얼마입니까?

Answer: 888

Solution (Python):
var_a = 2152
var_b = 1264
var_c = var_a - var_b
print(int(var_c))
Category: Geometry

Question (EN): A parallelogram has a height of 11 centimeters (cm) and an area of 44 square centimeters (cm2). What is the length of the base of this parallelogram in centimeters (cm)?
Question (KO): 어떤 평행사변형은 높이가 11센티미터(㎝), 넓이가 44제곱센티미터(㎠)입니다. 이 평행사변형의 밑변의 길이는 몇 센티미터(㎝)입니까?

Answer: 4

Solution (Python):
var_a = 44
var_b = 11
var_c = var_a / var_b
print(int(var_c))
Category: Possibility

Question (EN): Three of the five numbers 0, 1, 2, 3, and 4 were used to make a three-digit even number. If you can use the same number multiple times, how many even numbers can you make?
Question (KO): 다섯 개의 숫자 0, 1, 2, 3, 4 중에서 3개를 골라 세 자리의 짝수를 만들었다. 같은 수를 여러 번 사용해도 된다면, 만들 수 있는 모든 짝수의 개수는 몇개인가?

Answer: 60

Solution (Python):
var_a = 0
var_b = 1
var_c = 2
var_d = 3
var_e = 4
list_a= []
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=var_f))
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_g = 2
list_c = []
var_g = int(var_g)
for i in list_b:
    i = int(i)
    if i % var_g == 0:
        list_c.append(i)
var_h = len(list_c)
print(int(var_h))
Category: Geometry

Question (EN): There is a rhombus with two diagonals measuring 9 centimeters (cm) and 14 centimeters (cm), respectively. Find the area of this figure.
Question (KO): 두 대각선의 길이가 각각 9센티미터(㎝), 14센티미터(㎝)인 마름모가 있습니다. 이 도형의 넓이를 구하세요.

Answer: 63

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

Question (EN): I joined 15 pieces of paper tape, each of which is 30 centimeters (cm) wide and 2 centimeters (cm) long, to each other to extend it. If the length of the overlapping glued part is 2 centimeters (cm) long, what is the total width of the created piece of paper tape in centimeters (cm)?
Question (KO): 가로가 30센티미터(㎝), 세로가 2센티미터(㎝)인 종이 테이프 15장을 연결하여 길게 만들었습니다. 연결할 때 풀칠 부분의 겹쳐진 부분의 길이가 2센티미터(㎝)라면, 만들어진 종이 테이프의 가로의 전체 길이는 몇 센티미터(㎝)입니까?

Answer: 422

Solution (Python):
var_a = 30
var_b = 15
var_c = var_a * var_b
var_d = 15
var_e = 1
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: Geometry

Question (EN): We are going to make a long rope by tying 64 ropes each 25 centimeters (cm) in length. By tying two ropes together and making a knot, the length is reduced by 3 centimeters (cm). What is the length of the newly made rope?
Question (KO): 길이가 25센티미터(㎝)인 밧줄 64개를 서로 묶어 긴 줄을 만드려고 한다. 2개의 밧줄을 서로 묶어서 매듭을 지으면 길이가 3센티미터(㎝)가 줄어든다. 새로 만든 밧줄의 길이는 얼마입니까?

Answer: 1411

Solution (Python):
var_a = 25
var_b = 64
var_c = var_a * var_b
var_d = 3
var_e = 64
var_f = 1
var_g = var_e - var_f
var_h = var_d * var_g
var_i = var_c - var_h
print(int(var_i))
Category: Geometry

Question (EN): A square was created by arranging 10 square-shaped colored papers horizontally and vertically without gaps. If the colored papers on the periphery is red and the colored papers on the inside is yellow, how many yellow colored papers are there?
Question (KO): 정사각형 모양의 색종이를 가로와 세로 모두 10장씩 빈틈없이 늘어놓아 정사각형을 만들었습니다. 둘레에 놓인 색종이의 색깔은 빨간색이고, 안쪽에 놓인 색종이의 색깔은 노란색일 때, 노란 색종이는 모두 몇 장입니까?

Answer: 64

Solution (Python):
var_a = 10
var_b = 2
var_c = var_a - var_b
var_d = 2
var_e = var_c ** var_d
print(int(var_e))
Category: Correspondence

Question (EN): In the addition between three-digit numbers, 6A5+10B=748, what number should go in B?
Question (KO): 6A5+10B=748일 때, B에 들어가야 하는 숫자는 무엇인가요?

Answer: 3

Solution (Python):
var_a = '6A5+10B=748'
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: Geometry

Question (EN): You have a picture frame in the shape of a square with a perimeter 100 centimeters (cm) long. How many centimeters (cm) of colored tape are needed to decorate one side of this frame?
Question (KO): 둘레의 길이가 100센티미터(㎝)인 정사각형 모양의 액자가 있습니다. 이 액자의 한 변에 색테이프를 붙여 장식을 할 때, 색 테이프는 몇 센티미터(㎝) 필요합니까?

Answer: 25

Solution (Python):
var_a = 100
var_b = 4
var_c = var_a / var_b
print(int(var_c))
Category: Comparison

Question (EN): Box A and B are 3 centimeters (cm) and 3.5 centimeters (cm), respectively. When Taehyung stacked 16 boxes of A and Yoongi stacked 14 boxes of B, who would be the one that piled boxes higher?
Question (KO): (가) , (나) 상자는 각각 3센티미터(㎝), 3.5센티미터(㎝)이다. 태형이는 16개의 (가) 상자를, 윤기는 14개의 (나) 상자를 쌓았을 때 더 높이 쌓은 사람은 누구인가요?

Answer: Yoongi

Solution (Python):
var_a = 'Taehyung'
var_b = 'Yoongi'
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 = 3
var_d = 16
var_e = var_c * var_d
var_f = 3.5
var_g = 14
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)
Category: Correspondence

Question (EN): When you divide A by 9, the quotient is 2 and the remainder is 6. Find A at this time.
Question (KO): A는 9로 나누면 몫이 2이고 나머지가 6인 수이다. 이때 A를 구하여라.

Answer: 24

Solution (Python):
var_a = 9
var_b = 2
var_c = var_a * var_b
var_d = 6
var_e = var_c + var_d
print(int(var_e))
Category: Comparison

Question (EN): Namjoon came second, and Yoongi went right in front of him. What's Yoongi's rank?
Question (KO): 남준이는 2등을 했고, 윤기는 바로 그 앞에 들어갔습니다. 윤기는 몇등입니까?

Answer: 1

Solution (Python):
var_a = 2
var_b = 1
var_c = var_a - var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): A baby koala in the zoo weighs 2 kilograms (kg) and 460 grams (g). How many grams (g) does the baby koala weigh?
Question (KO): 동물원에 있는 새끼 코알라의 몸무게는 2킬로그램(㎏) 하고도 460그램(g) 입니다. 새끼 코알라의 몸무게는 몇 그램(g)입니까?

Answer: 2460

Solution (Python):
var_a = 2
var_b = 1000
var_c = var_a * var_b
var_d = 460
var_e = var_c + var_d
print(int(var_e))
Category: Comparison

Question (EN): Among the numbers greater than 0 and less than 100, write the common multiples of 4 and 6 in order from smallest. Find the 7th number from the left.
Question (KO): 0보다 크고 100보다 작은 수 중에서 4와 6의 공배수를 작은 수부터 차례대로 썼습니다. 왼쪽에서 7번째 수를 구하시오.

Answer: 84

Solution (Python):
var_a = 0
var_b = 1
var_c = var_a + var_b
var_d = 100
var_e = 1
var_f = var_d - var_e
var_g = 1
list_a = [i for i in range(var_c, var_f + 1, var_g)]
var_h = 4
var_i = 6
var_j = var_i * var_h / math.gcd(int(var_i), int(var_h))
list_b = []
var_j = int(var_j)
for i in list_a:
    i = int(i)
    if i % var_j == 0:
        list_b.append(i)
var_k = 7
var_l = list_b[var_k-1]
print(int(var_l))