philschmid/DMath huggingface dataset:
Category: Correspondence

Question (EN): When 9A3B was rounded up to the tens place, it was 9430. What is A?
Question (KO): 9A3B를 올림하여 십의 자리까지 나타내었더니 9430이었다. A는 무엇인가?

Answer: 4

Solution (Python):
var_a = '9A3B'
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 = 9430
list_b = []
for i in list_a:
    if i >= var_b:
        list_b.append(i)
var_c = 9430
var_d = 10
var_e = var_c + var_d
list_c = []
for i in list_b:
    if i < var_e:
        list_c.append(i)
var_f = '9A3B'
var_g = 'A'
var_f = str(var_f)
var_g = str(var_g)
unk_idx = var_f.index(var_g)
var_h = 0
for elem in list_c:
    elem = str(elem)
    var_h = int(elem[unk_idx])
print(int(var_h))
Category: Arithmetic calculation

Question (EN): Hoseok jumped the rope 34 times and Minyoung jumped it 51 times. How many more times does Hoseok have to jump to get the same number of jumps as Minyoung?
Question (KO): 줄넘기를 호석이는 34번, 민영이는 51번 넘었습니다. 호석이가 몇 번을 더 넘어야 민영이의 줄넘기 횟수와 같아집니까?

Answer: 17

Solution (Python):
var_a = 51
var_b = 34
var_c = var_a - var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): There are 5 consecutive natural numbers whose sum is 100. What is the smallest of these numbers?
Question (KO): 합이 100이 되는 연속된 5개의 자연수가 있습니다. 이 중에서 가장 작은 수는 얼마입니까?

Answer: 18

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

Question (EN): There are five boxes: A, B, C, D, and E. D box is larger than B box and smaller than A box. B box is larger than E box. A box is smaller than C box. Which box is the largest?
Question (KO): (가), (나), (다), (라), (마) 5개의 상자가 있습니다. (라) 상자는 (나) 상자보다 크고 (가) 상자보다 작습니다. (나) 상자는 (마) 상자보다 큽니다. (가) 상자는 (다) 상자보다 작습니다. 가장 큰 상자는 어느 상자입니까?

Answer: C

Solution (Python):
var_a = 'A'
var_b = 'B'
var_c = 'C'
var_d = 'D'
var_e = 'E'
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 = 'D'
var_g = 'B'
var_h = '>'
var_i = 'D'
var_j = 'A'
var_k = '<'
var_l = 'B'
var_m = 'E'
var_n = '>'
var_o = 'A'
var_p = 'C'
var_q = '<'
list_b= []
if "/" in str(var_q):
    var_q = eval(str(var_q))
list_b.append(var_q)
if "/" in str(var_p):
    var_p = eval(str(var_p))
list_b.append(var_p)
if "/" in str(var_o):
    var_o = eval(str(var_o))
list_b.append(var_o)
if "/" in str(var_n):
    var_n = eval(str(var_n))
list_b.append(var_n)
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)
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_r = 1
var_s = list_c[var_r-1]
print(var_s)
Category: Correspondence

Question (EN): The quotient of a number divided by 8 is 0.65. Find the value of the quotient of the number divided by 5 multiplied by 7.
Question (KO): 어떤 수를 8로 나눈 몫이 0.65입니다. 어떤 수를 5로 나눈 몫에 7을 곱하면 얼마인지 구해보세요.

Answer: 7

Solution (Python):
var_a = 0.65
var_b = 8
var_c = var_a * var_b
var_d = 5
var_e = var_c // var_d
var_f = 7
var_g = var_e * var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): There were 7 buses in the parking lot and 6 more came a few minutes later. How many buses are in the parking lot right now?
Question (KO): 주차장에 7대의 버스가 있었는데 몇 분 후 6대의 버스가 더 왔습니다. 지금 주차장에 있는 버스는 모두 몇 대입니까?

Answer: 13

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

Question (EN): A number subtracted by 5 multiplied by 4 equals the number multiplied by 2. Find the number.
Question (KO): 어떤 수에서 5를 뺀 것의 4배는 어떤 수에서 2를 곱한 것과 같다. 어떤 수를 구하시오.

Answer: 10

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

Question (EN): There are 5 tuna and 2 spearfish in the sea. What is the total number of fish in the sea?
Question (KO): 바다에 물고기 5마리와 고래 2마리가 있습니다. 바다에는 총 몇 마리의 물고기가 있나요?

Answer: 7

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

Question (EN): A large cube was made out of eight dices of the same size. If the surface area of one die is 96 square centimeters (cm2), find the volume in cubic centimeters (cm3) of the cube created.
Question (KO): 크기가 같은 주사위 8개로 큰 정육면체 한 개를 만들었습니다. 주사위 한 개의 겉넓이가 96제곱센티미터(㎠)일 때 만든 정육면체의 부피는 몇 세제곱센티미터(㎤)인지 구하시오.

Answer: 512

Solution (Python):
var_a = 96
var_b = 6
var_c = var_a / var_b
var_d = 0.5
var_e = var_c ** var_d
var_f = 8
var_g = 2
var_h = var_f / var_g
var_i = 2
var_j = var_h / var_i
var_k = var_e * var_j
var_l = 3
var_m = var_k ** var_l
print(int(var_m))
Category: Comparison

Question (EN): The number of students at Sejeong's School is 1443. However, there are 141 more male students than female students. How many male students are there?
Question (KO): 세정이네 학교 학생 수는 1443명입니다. 그런데 남학생 수는 여학생 수보다 141명 더 많다고 합니다. 남학생의 수는 몇 명입니까?

Answer: 792

Solution (Python):
var_a = 1443
var_b = 141
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
var_f = 141
var_g = var_e + var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): Taehyung is 5 years older than his younger brother, and this year Taehyung's younger brother is 7 years old. How old is his mother when the age difference between Taehyung and his mother is 31 years?
Question (KO): 태형이는 동생보다 5살이 많고 올해 태형이 동생은 7살입니다. 태형이와 어머니의 나이차가 31살일때 어머니는 몇 살입니까?

Answer: 43

Solution (Python):
var_a = 7
var_b = 5
var_c = var_a + var_b
var_d = 31
var_e = var_c + var_d
print(int(var_e))
Category: Correspondence

Question (EN): A and B are two natural numbers. If B is the number obtained by multiplying A by 9 and then adding 13, what is the remainder when B is divided by 9?
Question (KO): 두 자연수 A, B가 있습니다. B는 A에서 9를 곱한 후 13을 더했을 때 나오는 숫자라면, B를 9로 나누었을 때의 나머지는 얼마입니까?

Answer: 4

Solution (Python):
var_a = 13
var_b = 9
var_c = var_a % var_b
print(int(var_c))
Category: Possibility

Question (EN): How many ways are possible to make a three-digit number by selecting three of 1, 3, 5, 7, and 9?
Question (KO): 1, 3, 5, 7, 9 중 세 개를 뽑아 세 자리 자연수를 만들 때, 가능한 모든 경우의 수는 얼마입니까?

Answer: 60

Solution (Python):
var_a = 1
var_b = 3
var_c = 5
var_d = 7
var_e = 9
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.permutations(list_b, 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 = len(list_b)
print(int(var_g))
Category: Possibility

Question (EN): Jungkook has 5 red balls, 4 blue balls, and 3 yellow balls. When Yoongi gives Jungkook one red ball, how many yellow balls does Jungkook have?
Question (KO): 정국이는 빨간 공 5개, 파란 공 4개, 노란 공 3개를 가지고 있습니다. 윤기가 정국이에게 빨간 공 1개를 주었을 때, 정국이가 가지고 있는 노란 공의 개수는?

Answer: 3

Solution (Python):
var_a = 3
print(int(var_a))
Category: Geometry

Question (EN): If you bend a 12 centimeters (cm) wire in half, and then bend the bent wire in half again, how many centimeters (cm) is the current length of the wire?
Question (KO): 길이가 12센티미터(㎝)인 철사를 절반으로 구부리고, 구부린 철사를 다시 절반으로 구부렸다면, 현재 철사의 길이는 몇 센티미터(㎝)입니까?

Answer: 3

Solution (Python):
var_a = 12
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): If you add 10 to A, you get 15. How much is A?
Question (KO): A에 10을 더했더니 15가 되었습니다. A는 얼마인가요?

Answer: 5

Solution (Python):
var_a = 15
var_b = 10
var_c = var_a - var_b
print(int(var_c))
Category: Correspondence

Question (EN): Students are trying to line up on the playground. When they are stood in 5 lines, 2 students were left out, when stood in 8 lines, 3 students were left, and when stood in 9 lines, it fit perfectly. Find how many students there are in total. However, the number of students in the playground is between 200 and 500.
Question (KO): 운동장에 학생들이 줄을 맞춰 서려고 한다. 5줄로 섰더니 2명이 남고, 8줄로 섰더니 3명이 남고, 9줄로 섰더니 꼭 맞았다. 학생수는 모두 몇 명인지 구하여라. 단, 운동장에 있는 학생수는 200 이상 500명 이하이다.

Answer: 387

Solution (Python):
var_a = 200
var_b = 500
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 5
var_e = 2
list_b = [] 
var_d = int(var_d)
var_e = int(var_e)
if var_e < 0:
    var_e = var_e + var_d
for i in list_a:
    i = int(i)
    if i%var_d == var_e:
        list_b.append(i)
var_f = 8
var_g = 3
list_c = [] 
var_f = int(var_f)
var_g = int(var_g)
if var_g < 0:
    var_g = var_g + var_f
for i in list_b:
    i = int(i)
    if i%var_f == var_g:
        list_c.append(i)
var_h = 9
var_i = 0
list_d = [] 
var_h = int(var_h)
var_i = int(var_i)
if var_i < 0:
    var_i = var_i + var_h
for i in list_c:
    i = int(i)
    if i%var_h == var_i:
        list_d.append(i)
var_j = 1
var_k = list_d[var_j-1]
print(int(var_k))
Category: Arithmetic calculation

Question (EN): There are 6 (A) animals, 8 (B) animals, and 4 (C) animals. How many animals are there in all?
Question (KO): (가) 동물 6마리, (나) 동물 8마리, (다) 동물 4마리가 있습니다. 동물은 모두 몇 마리입니까?

Answer: 18

Solution (Python):
var_a = 6
var_b = 8
var_c = var_a + var_b
var_d = 4
var_e = var_c + var_d
print(int(var_e))
Category: Geometry

Question (EN): There is a cube with a side with an area of 64 square centimeters (cm2). What is the volume of this cube?
Question (KO): 한 면의 넓이가 64제곱센티미터(㎠)인 정육면체가 있습니다. 이 정육면체의 부피는 얼마입니까?

Answer: 512

Solution (Python):
var_a = 64
var_b = 0.5
var_c = var_a ** var_b
var_d = 3
var_e = var_c ** var_d
print(int(var_e))
Category: Correspondence

Question (EN): Divide 3 times a number by 5, subtract 220, multiply by 4, add 40, and you get 360. Find the number.
Question (KO): 어떤 수의 3배를 5로 나눈 뒤 220을 빼고 4를 곱하고 40을 더했더니 360이 되었습니다. 어떤 수를 구하시오.

Answer: 500

Solution (Python):
var_a = 360
var_b = 40
var_c = var_a - var_b
var_d = 4
var_e = var_c / var_d
var_f = 220
var_g = var_e + var_f
var_h = 5
var_i = var_g * var_h
var_j = 3
var_k = var_i / var_j
print(int(var_k))
Category: Comparison

Question (EN): Seokjin drank 11/10 liters (l) of milk, and Jungkook drank 1.3 liters (l). When Yoongi drank 7/6 liters (l), who drank the least amount of milk?
Question (KO): 석진이는 우유를 11/10리터(L) 마셨고, 정국이는 1.3리터(L) 마셨습니다. 윤기는 7/5리터(L) 마셨을 때 우유를 가장 적게 마신 사람은 누구입니까?

Answer: Seokjin

Solution (Python):
var_a = 'Jungkook'
var_b = 'Seokjin'
var_c = 'Yoongi'
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.3
var_e = 11
var_f = 10
var_g = var_e / var_f
var_h = 7
var_i = 5
var_j = var_h / var_i
list_b= []
if "/" in str(var_j):
    var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
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): If a factory produces 500 soccer balls in 30 minutes and 800 basketball balls in 1 hour, which ball will be produced more after 5 hours?
Question (KO): 어느 공장에서 축구공은 30분에 500개가 만들어지고, 농구공은 1시간에 800개가 만들어진다면, 5시간 후에는 어떤 공이 더 많이 만들어질지 구하시오.

Answer: soccer

Solution (Python):
var_a = 'soccer'
var_b = 'basketball'
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 = 5
var_d = 60
var_e = var_c * var_d
var_f = 30
var_g = var_e // var_f
var_h = 500
var_i = var_g * var_h
var_j = 5
var_k = 60
var_l = var_j * var_k
var_m = 60
var_n = var_l // var_m
var_o = 800
var_p = var_n * var_o
list_b= []
if "/" in str(var_p):
    var_p = eval(str(var_p))
list_b.append(var_p)
if "/" in str(var_i):
    var_i = eval(str(var_i))
list_b.append(var_i)
list_b.reverse()
var_q = 1
list_c=list_b.copy()
list_c.sort()
var_r = list_c[-var_q]
var_s = list_b.index(var_r)+1
var_t = list_a[var_s-1]
print(var_t)
Category: Correspondence

Question (EN): A number divided by 6 equals 1/10. Find the value of the number divided by 3/25.
Question (KO): 어떤 수를 6으로 나눈 값이 1/10입니다. 어떤 수를 3/25으로 나눈 값을 구하시오.

Answer: 5

Solution (Python):
var_a = 0.1
var_b = 6
var_c = var_a * var_b
var_d = 0.12
var_e = var_c / var_d
print(int(eval('{:.2f}'.format(round(var_e+1e-10,2)))))
Category: Possibility

Question (EN): If there are 5 people A, B, C, D, and E, find the number of ways to select 3 representatives.
Question (KO): A, B, C, D, E 5명이 있을 때, 대표 3명을 뽑는 경우의 수를 구하시오.

Answer: 10

Solution (Python):
var_a = 5
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)
for i, elem in enumerate(range(var_b)):
    var_c = var_c / (i+1)
print(int(var_c))
Category: Arithmetic calculation

Question (EN): A clock tower bell in a village rings once every hour on the hour. If a year is counted as 365 days, how many times does the clock tower bell ring in a year?
Question (KO): 어느 마을에 있는 시계탑의 종은 매시간 정각에 종을 한 번씩 울립니다. 1년을 365일로 계산한다면 이 시계탑의 종은 1년 동안 몇 번을 울리는지 구해 보시오.

Answer: 8760

Solution (Python):
var_a = 24
var_b = 365
var_c = var_a * var_b
print(int(var_c))
Category: Possibility

Question (EN): Using the four numbers 1, 5, 6, and 9 once, find the second smallest two-digit number when the hundredth number is 5.
Question (KO): 네 개의 숫자 1, 5, 6, 9를 한 번만 사용한 두자리 수의 십의자리 숫자가 5일 때, 두 번째로 작은 두 자리 숫자를 구하시오.

Answer: 56

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

Question (EN): I made a square with a long piece of string, and each side was 21 centimeters (cm). If you use this string to make the largest triangle among triangles with a length of the three sides equal, how many centimeters (cm) will each lengths of a side be?
Question (KO): 긴 끈으로 정사각형을 만들었더니 한 변의 길이가 21센티미터(㎝)가 되었습니다. 이 끈으로 세 변의 길이가 같은 삼각형 중에서 가장 큰 삼각형을 만든다면, 한 변의 길이는 몇 센티미터(㎝)가 되겠습니까?

Answer: 28

Solution (Python):
var_a = 21
var_b = 4
var_c = var_a * var_b
var_d = 3
var_e = var_c / var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): When the five numbers 9867, 8976, 9876, 9687, and 9689 are arranged from smallest to largest, write the 4th smallest number.
Question (KO): 5개의 수 9867, 8976, 9876, 9687, 9689를 작은 수부터 차례대로 나열했을 때, 4번째로 작은 수를 쓰시오.

Answer: 9867

Solution (Python):
var_a = 9867
var_b = 8976
var_c = 9876
var_d = 9687
var_e = 9689
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 = 4
list_b=list_a.copy()
list_b.sort()
var_g = list_b[var_f-1]
print(int(var_g))
Category: Correspondence

Question (EN): B minus A equals 211.5. Multiplying the decimal number A by 10 equals B. Calculate A, including the decimal point.
Question (KO): B에서 A를 뺀 값은 211.5입니다. 소수 A를 10배 하면 B와 같습니다. 소수점을 포함하여 A를 구하시오.

Answer: 23.5

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

Question (EN): A, B, and C are all different single-digit natural numbers. What is B that satisfies AB+CB=CC6?
Question (KO): A, B, C는 서로 다른 한자리 수 자연수입니다. AB+CB=CC6을 만족하는 B는 무엇인가요?

Answer: 8

Solution (Python):
var_a = 'AB+CB=CC6'
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 box with 16 basketballs of the same weight weighs 17.88 kilograms (kg). Consider that the empty box weighs 0.6 kilograms (kg), find out how much 7 basketballs weigh in kilograms (kg).
Question (KO): 무게가 똑같은 농구공이 16개가 들어있는 상자의 무게는 17.88킬로그램(㎏)입니다. 빈 상자의 무게가 0.6킬로그램(㎏)일 때, 농구공 7개의 무게는 몇 킬로그램(㎏)입니까?

Answer: 7.56

Solution (Python):
var_a = 17.88
var_b = 0.6
var_c = var_a - var_b
var_d = 16
var_e = var_c / var_d
var_f = 7
var_g = var_e * var_f
print('{:.2f}'.format(round(var_g+1e-10,2)))
Category: Correspondence

Question (EN): ABCD+ABCD=5472. If different letters mean different numbers, what is D?
Question (KO): ABCD+ABCD=5472입니다. 서로 다른 알파벳이 다른 숫자를 의미한다면, D는 얼마입니까?

Answer: 6

Solution (Python):
var_a = 'ABCD+ABCD=5472'
var_b = 'D'
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): The distance from Hyoseong's house to Mimi's house is 2.5 kilometers. The two started at the same time from their respective homes and walked towards each other at a steady pace. If Hyosung walks at 0.08 kilometers (km) per minute and Mimi walks at 2.4 kilometers (km) per hour, how many kilometers (km) is the distance between the two after 15 minutes?
Question (KO): 효성이네 집에서 미미네 집까지의 거리는 2.5 킬로미터(㎞) 입니다. 두 사람이 각자의 집에서 동시에 출발하여 일정한 빠르기로 서로의 집을 향해 걸어갔습니다. 효성이는 1 분에 0.08 킬로미터(㎞) 를 걷고 미미는 한 시간에 2.4 킬로미터(㎞) 를 걸을 때 15 분 후 두 사람 사이의 거리는 몇 킬로미터(㎞) 입니까?

Answer: 0.7

Solution (Python):
var_a = 2.5
var_b = 0.08
var_c = 15
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 2.4
var_g = 60
var_h = var_f / var_g
var_i = 15
var_j = var_h * var_i
var_k = var_e - var_j
print('{:.2f}'.format(round(var_k+1e-10,2)))
Category: Comparison

Question (EN): How many numbers are greater than or equal to 0.4 out of 0.8 and 1/2?
Question (KO): 0.8, 1/2 중에서 0.4보다 크거나 같은 수는 몇 개입니까?

Answer: 2

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

Question (EN): There are wicks that are 25 centimeters (cm) long. If you light this wick, it is said to burn 1.75 centimeters (cm) in 10 seconds. How many seconds after lighting will the wick be 11 centimeters (cm) long?
Question (KO): 길이가 25센티미터(㎝)인 심지가 있습니다. 이 심지에 불을 붙이면 10초에 1.75센티미터(㎝)씩 탄다고 합니다. 불을 붙힌 뒤 몇 초 후 심지의 길이가 11센티미터(㎝)가 되겠습니까?

Answer: 80

Solution (Python):
var_a = 25
var_b = 11
var_c = var_a - var_b
var_d = 1.75
var_e = 10
var_f = var_d / var_e
var_g = var_c / var_f
print(int(var_g))