philschmid/DMath huggingface dataset:
Category: Correspondence

Question (EN): A72+23=695. How much is A?
Question (KO): A72+23=695입니다. A는 얼마인가요?

Answer: 6

Solution (Python):
var_a = 'A72+23=695'
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): I had to multiply a number by 6 but instead subtracted and it resulted in 51. What is the number if I calculate correctly?
Question (KO): 6을 어떤 수에 곱해야 하는데 실수로 뺐더니 51이 됐습니다. 바르게 계산하면 얼마입니까?

Answer: 342

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

Question (EN): A square was made using all of the 34.8 centimeters (cm) lengths of wire. How many centimeters (cm) is the length of one side of the square?
Question (KO): 길이가 34.8센티미터(㎝)인 철사를 모두 사용하여 정사각형을 만들었습니다. 정사각형의 한 변의 길이는 몇 센티미터(㎝)입니까?

Answer: 8.7

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

Question (EN): In the running event, Yuna is running in 17th place. Eunji is ahead of Yuna, and there are 8 people between Eunji and Yuna. What rank is Eunji running?
Question (KO): 달리기 시합에서 유나는 17등으로 달리고 있고, 은지는 유나보다 앞에 있고 은지와 유나 사이에는 8명이 있습니다. 은지는 몇 등으로 달리고 있습니까?

Answer: 8

Solution (Python):
var_a = 17
var_b = 8
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e))
Category: Comparison

Question (EN): The difference between the lengths of the two sticks is 12 centimeters (cm), and the length of the longer stick multiplied by 2/3 is the length of the shorter stick. What is the length of the shorter stick?
Question (KO): 두 막대의 길이 차는 12센티미터(㎝)이고, 긴 막대의 길이에 2/3을 곱한 것이 짧은 막대의 길이입니다. 짧은 막대의 길이는 얼마입니까?

Answer: 24

Solution (Python):
var_a = 12
var_b = 1
var_c = 0.6666666666666666
var_d = var_b - var_c
var_e = var_a / var_d
var_f = 0.6666666666666666
var_g = var_e * var_f
print(int(eval('{:.2f}'.format(round(var_g+1e-10,2)))))
Category: Comparison

Question (EN): Villages A, B, and C have different numbers of people. Village A has more people than Village C, and Village A has more people than Village B. If Village B has fewer people than Village C, which village has the most people?
Question (KO): A, B, C 마을의 사람 수는 서로 다릅니다. A 마을이 C 마을보다 사람이 많고, A 마을이 B 마을보다 사람이 많습니다. B 마을이 C 마을보다 사람이 적다면, 사람 수가 가장 많은 마을은 어느 마을인가요?

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 = 'A'
var_e = 'B'
var_f = '>'
var_g = 'B'
var_h = 'C'
var_i = '<'
var_j = 'A'
var_k = 'C'
var_l = '>'
list_b= []
if "/" in str(var_l):
    var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
    var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
    var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
    var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_b.append(var_e)
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_m = 1
var_n = list_c[var_m-1]
print(var_n)
Category: Arithmetic calculation

Question (EN): 4 friends bought 5 fish-shaped bread which is  200 won each and 7 hotteoks which is 800 won each. Write how much each person would have to pay if the money were to be divided equally among 4 people.
Question (KO): 친구 4명이 200원짜리 붕어빵 5개, 800원짜리 호떡 7개를 사 먹었습니다. 돈을 4명이 똑같이 나누어 내려면 한 명이 얼마씩 내야 하는지 쓰시오.

Answer: 1650

Solution (Python):
var_a = 200
var_b = 5
var_c = var_a * var_b
var_d = 800
var_e = 7
var_f = var_d * var_e
var_g = var_c + var_f
var_h = 4
var_i = var_g / var_h
print(int(var_i))
Category: Geometry

Question (EN): If the width of a door with an area of 3 square meters (m2) is 150 centimeters (cm), find the length in centimeters (cm).
Question (KO): 넓이가 3제곱미터(㎡)인 문의 가로 길이가 150센티미터(㎝)라면, 세로의 길이는 몇 센티미터(㎝)인지 구하시오.

Answer: 200

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

Question (EN): You are told to divide 30 white balls and 18 red balls into boxes by the color. There are 6 balls in each box. How many more boxes of white balls would there be than boxes of red balls? 
Question (KO): 흰색 공 30개와 빨간색 공 18개를 같은 색끼리 상자에 나누어 넣습니다. 각 상자마다 공이 6개씩 들어있습니다. 흰색 공이 든 상자는 빨간색 공이 든 상자보다 몇 상자 더 많습니까?

Answer: 2

Solution (Python):
var_a = 30
var_b = 6
var_c = var_a / var_b
var_d = 18
var_e = 6
var_f = var_d / var_e
var_g = var_c - var_f
print(int(var_g))
Category: Correspondence

Question (EN): A number divided by 11 equals 2. Hoseok multiplied the number by 6 to get the result value. What is this value?
Question (KO): 어떤 수를 11로 나누면 2가 됩니다. 호석이는 이 어떤 수에 6을 곱해 결과값을 얻었습니다. 이 값은?

Answer: 132

Solution (Python):
var_a = 2
var_b = 11
var_c = var_a * var_b
var_d = 6
var_e = var_c * var_d
print(int(var_e))
Category: Possibility

Question (EN): At home, there are 2 pairs of pants and 3 pairs of tops. How many looks can you wear?
Question (KO): 집에 서로 다른 바지가 2벌, 윗옷이 3벌 있습니다. 몇 가지의 모습으로 입을 수 있습니까?

Answer: 6

Solution (Python):
var_a = 2
var_b = 3
var_c = var_a * var_b
print(int(var_c))
Category: Comparison

Question (EN): If ducks on the farm have a total of 40 legs and rabbits have a total of 60 legs, which animal are there more, ducks or rabbits?
Question (KO): 농장에 있는 오리의 다리 수는 총 40개, 토끼의 다리 수는 총 60개 일 때, 오리와 토끼 중 어느 동물이 더 많이 있습니까?

Answer: ducks

Solution (Python):
var_a = 'ducks'
var_b = 'rabbits'
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 = 40
var_d = 2
var_e = var_c / var_d
var_f = 60
var_g = 4
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: Geometry

Question (EN): Find the sum of the lengths of all edges of a prism made by stacking 11 regular hexagonal prisms with a height of 1 centimeter (cm) and its base as 6 centimeters (cm).
Question (KO): 한 변의 길이가 6센티미터(㎝)인 정육각형을 밑면으로 하고 높이가 1센티미터(㎝)인 정육각기둥을 11개 쌓아 만든 각기둥의 모든 모서리 길이의 합을 구하시오.

Answer: 138

Solution (Python):
var_a = 6
var_b = 6
var_c = var_a * var_b
var_d = 2
var_e = var_c * var_d
var_f = 11
var_g = 6
var_h = var_f * var_g
var_i = var_e + var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): If each box has 100 marbles, how many marbles do 10 boxes have?
Question (KO): 한 상자당 100개의 구슬을 가졌다면 10개의 상자는 몇 개의 구슬을 가졌는가?

Answer: 1000

Solution (Python):
var_a = 100
var_b = 10
var_c = var_a * var_b
print(int(var_c))
Category: Comparison

Question (EN): Five numbers were drawn. The average is 81.6, and the average scores excluding the largest number is 6 higher than the average of the remaining scores. If the middle three numbers are 88, 84, and 75, what is the lowest number?
Question (KO): 5개의 수를 뽑았다. 평균은 81.6이고 가장 큰 수를 뺀 나머지 점수의 평균보다 가장 작은 수를 뺀 나머지 점수들의 평균이 6높다고 한다. 중간의 세 숫자는 88, 84, 75라고 했을 때 가장 낮은 수는 얼마인가?

Answer: 68.5

Solution (Python):
var_a = 81.6
var_b = 5
var_c = var_a * var_b
var_d = 88
var_e = 84
var_f = var_d + var_e
var_g = 75
var_h = var_f + var_g
var_i = var_c - var_h
var_j = 6
var_k = 4
var_l = var_j * var_k
var_m = var_i - var_l
var_n = 2
var_o = var_m / var_n
print('{:.2f}'.format(round(var_o+1e-10,2)))
Category: Arithmetic calculation

Question (EN): Hyosung and Mimi started at the same speed toward each other at the end of the playground. The distance of the playground is 2.5 kilometers (km). If Hyosung walks 0.08 kilometers (km) per minute and Mimi walks 2.4 kilometers (km) an hour, how many kilometers (km) is the distance between the two people 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: Correspondence

Question (EN): When 12 is divided by A, the quotient is B and the remainder is C. A, B, and C are natural numbers. What is the largest number that can be C?
Question (KO): 12를 A로 나눴더니 몫이 B가 되었고, 나머지는 C가 되었습니다. A, B, C는 자연수 입니다. 가능한 C 중 가장 큰 수는 무엇인가요?

Answer: 11

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

Question (EN): If the length of the hypotenuse of a right triangle is 5 and the length of the non-hypotenuse is 3, what is the length of the other side?
Question (KO): 직각삼각형의 빗변의 길이가 5, 빗변이 아닌 한 변의 길이가 3이면 나머지 한 변의 길이는 얼마입니까?

Answer: 4

Solution (Python):
var_a = 5
var_b = 2
var_c = var_a ** var_b
var_d = 3
var_e = 2
var_f = var_d ** var_e
var_g = var_c - var_f
var_h = 0.5
var_i = var_g ** var_h
print(int(var_i))
Category: Correspondence

Question (EN): 9 is the sum of a number and 5. What is the number?
Question (KO): 9는 어떤 수와 5의 합입니다. 어떤 수는 얼마입니까?

Answer: 4

Solution (Python):
var_a = 9
var_b = 5
var_c = var_a - var_b
print(int(var_c))
Category: Possibility

Question (EN): For the three natural numbers A, B, and C, find the number of ordered pairs that satisfy A + B + C = 8.
Question (KO): 세 자연수 A, B, C에 대하여 A + B + C = 8을 만족하는 순서쌍의 개수를 구하시오.

Answer: 21

Solution (Python):
var_a = 1
var_b = 8
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 3
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 = 8
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: Arithmetic calculation

Question (EN): There are 2180 ballpoint pens. A total of 12 pencil cases are left after organizing pens into 200 pencil cases and 150 pencil cases. Also, there are 30 ballpoint pens left. Find the number of 200 pencil cases.
Question (KO): 볼펜이 2180개 있습니다. 200개짜리 필통과 150개짜리 필통에 담아 모두 12개의 필통이 되었습니다. 또한 30개의 볼펜이 남았는데 200개짜리 필통은 몇 개 있나요?

Answer: 7

Solution (Python):
var_a = 2180
var_b = 30
var_c = var_a - var_b
var_d = 150
var_e = 12
var_f = var_d * var_e
var_g = var_c - var_f
var_h = 200
var_i = 150
var_j = var_h - var_i
var_k = var_g / var_j
print(int(var_k))
Category: Geometry

Question (EN): There is a cube whose sum of all its edges equals to 108 centimeters (cm). How long is one edge of this cube in centimeters (cm)?
Question (KO): 모든 모서리의 길이의 합이 108센티미터(㎝)인 정육면체가 있습니다. 이 정육면체의 한 모서리의 길이는 몇 센티미터(㎝)입니까?

Answer: 9

Solution (Python):
var_a = 108
var_b = 4
var_c = 3
var_d = var_b * var_c
var_e = var_a / var_d
print(int(var_e))
Category: Geometry

Question (EN): There are hexagonal prisms and quadrangular pyramids whose all edges are the same length. If the sum of the lengths of all the edges of the hexagonal prism is 81 centimeters (cm), find the sum of the lengths of all the edges of the pyramid.
Question (KO): 모든 모서리의 길이가 같은 육각기둥과 사각뿔이 있습니다. 육각기둥의 모든 모서리의 길이의 합이 81센티미터(㎝)일 때, 사각뿔의 모든 모서리의 길이의 합을 구하시오.

Answer: 36

Solution (Python):
var_a = 81
var_b = 6
var_c = 3
var_d = var_b * var_c
var_e = var_a / var_d
var_f = 4
var_g = 2
var_h = var_f * var_g
var_i = var_e * var_h
print(int(var_i))
Category: Geometry

Question (EN): In the middle of each face of a cube with an edge length of 10 centimeters (cm), a cube shape with an edge length of 2 centimeters (cm) was dug out to create a new shape. What is the surface area of this shape in square centimeters (cm2)?
Question (KO): 한 모서리의 길이가 10센티미터(㎝)인 정육면체의 각 면의 한가운데서 각각 한 모서리의 길이가 2센티미터(㎝)인 정육면체 모양을 파내어서 새로운 도형을 만들었습니다. 이 도형의 겉넓이는 몇 제곱센티미터입니까?

Answer: 696

Solution (Python):
var_a = 10
var_b = 10
var_c = var_a * var_b
var_d = 6
var_e = var_c * var_d
var_f = 2
var_g = 2
var_h = var_f * var_g
var_i = 4
var_j = var_h * var_i
var_k = 6
var_l = var_j * var_k
var_m = var_e + var_l
print(int(var_m))
Category: Correspondence

Question (EN): When the quotient of a certain division formula was incorrectly calculated as the number moved to the left by one from the decimal point, the difference of wrong and correct calculated quotient was 37.35. Find the correct quotient.
Question (KO): 어떤 나눗셈식의 몫을 잘못하여 소수점을 기준으로 수를 왼쪽으로 한 자리씩 이동하여 나타내었더니 바르게 계산한 몫과의 차가 37.35 가 되었습니다. 바르게 계산한 몫을 구해 보시오

Answer: 4.15

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

Question (EN): Among all numbers greater than 280, find the smallest number that has a remainder of 30 when divided by 70.
Question (KO): 280보다 큰 수들 중, 70으로 나누었을때 나머지가 30인 가장 작은 수를 구하시오.

Answer: 310

Solution (Python):
var_a = 280
var_b = 30
var_c = var_a + var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): I ate 140 cookies today. If there are 30 fewer cookies yesterday than today, how many cookies did I eat yesterday?
Question (KO): 오늘은 쿠키를 140개 먹었다. 어제 먹은 쿠키가 오늘 먹은 쿠키보다 30개 적을 때 어제 먹은 쿠키의 개수는 몇 개 인가?

Answer: 110

Solution (Python):
var_a = 140
var_b = 30
var_c = var_a - var_b
print(int(var_c))
Category: Possibility

Question (EN): Two people try to share 20 apples. If you say every person should have at least one, how many ways are there?
Question (KO): 사과 20개를 2명이서 모두 나누어 가지려고 한다. 최소 1개씩은 갖는다고 한다면, 나누어 가질 수 있는 방법은 모두 몇 가지가 있습니까?

Answer: 19

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

Question (EN): What is the sum of the numbers 7.31 and 1/5?
Question (KO): 숫자 7.31, 1/5를 더하면 얼마인가요?

Answer: 7.51

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

Question (EN): You are trying to compare the weight of paint and crayons using a scale and a 100 won coin. Paint is equal to the weight of 3 100 won coins, and crayons are equal to the weight of 5 100 won coins. Which is lighter, paint or crayons?
Question (KO): 저울과 100원짜리 동전을 사용하여 물감과 크레파스의 무게를 비교하려 합니다. 물감은 100원짜리 동전 3개의 무게와 같고 크레파스는 100원짜리 동전 5개의 무게와 같습니다. 물감과 크레파스 중 더 가벼운 것은 무엇입니까?

Answer: paint

Solution (Python):
var_a = 'paint'
var_b = 'crayons'
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 = 100
var_d = 3
var_e = var_c * var_d
var_f = 100
var_g = 5
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-1]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l)
Category: Geometry

Question (EN): In the math test, Seokjin is ranked 4th, and Jimin is ranked right after Seokjin. What is Jimin's rank?
Question (KO): 수학 시험에서 석진이는 4등이고, 지민이는 석진이 바로 다음으로 등수를 받았습니다. 지민이는 몇 등입니까?

Answer: 5

Solution (Python):
var_a = 4
var_b = 1
var_c = var_a + var_b
print(int(var_c))
Category: Geometry

Question (EN): You have a rhombus with a perimeter of 60 centimeters (cm). Find the distance in centimeters (cm) from one vertex of this rhombus to the next vertex.
Question (KO): 둘레의 길이가 60센티미터(㎝)인 마름모가 있습니다. 이 마름모의 한 꼭짓점에서 이웃한 꼭짓점까지의 거리는 몇 센티미터(㎝)인지 구하시오.

Answer: 15

Solution (Python):
var_a = 60
var_b = 4
var_c = var_a / var_b
print(int(var_c))
Category: Geometry

Question (EN): Find the pi of a circle with a diameter of 8 centimeters (cm) and a circumference of 25.12 centimeters (cm).
Question (KO): 지름이 8센티미터(㎝) 이고, 원주가 25.12센티미터(㎝) 인 원의 원주율을 구하시오.

Answer: 3.14

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

Question (EN): There are two circles A and B. The area of A is 198.4 square centimeters (cm2), and the area of B is 251.1 square centimeters (cm2). When the pi is calculated as 3.1, find the number of centimeters (cm) by subtracting the circumference of A from the circumference of B including the decimal point.
Question (KO): 두 원 (가), (나)가 있습니다. (가)의 넓이는 198.4제곱센티미터(㎠), (나)의 넓이는 251.1제곱센티미터(㎠)입니다. 원주율을 3.1로 계산할 때 (나)의 원주에서 (가)의 원주를 뺀 값은 몇 센티미터(㎝)인지 소수점을 포함하여 구하시오.

Answer: 6.2

Solution (Python):
var_a = 198.4
var_b = 3.1
var_c = var_a / var_b
var_d = 1
var_e = 2
var_f = var_d / var_e
var_g = var_c ** var_f
var_h = 2
var_i = var_g * var_h
var_j = 3.1
var_k = var_i * var_j
var_l = 251.1
var_m = 3.1
var_n = var_l / var_m
var_o = 1
var_p = 2
var_q = var_o / var_p
var_r = var_n ** var_q
var_s = 2
var_t = var_r * var_s
var_u = 3.1
var_v = var_t * var_u
var_w = var_k - var_v
var_x = abs(var_w)
print('{:.2f}'.format(round(var_x+1e-10,2)))
Category: Arithmetic calculation

Question (EN): I want to create a cuboid with 24 centimeters (cm) width, 15 centimeters (cm) length, and 28 centimeters (cm) height by stacking cuboids with 4 centimeters (cm) width, 5 centimeters (cm) length, and 7 centimeters (cm) height. How many cuboids do you need to make it?
Question (KO): 가로 4센티미터(㎝), 세로 5센티미터(㎝), 높이 7센티미터(㎝)인 직육면체를 빈틈없이 쌓아 가로 24센티미터(㎝), 세로 15센티미터(㎝), 높이 28센티미터(㎝)인 직육면체를 만들기 위해선 직육면체가 몇 개 필요합니까?

Answer: 72

Solution (Python):
var_a = 24
var_b = 15
var_c = var_a * var_b
var_d = 28
var_e = var_c * var_d
var_f = 4
var_g = 5
var_h = var_f * var_g
var_i = 7
var_j = var_h * var_i
var_k = var_e / var_j
print(int(var_k))
Category: Comparison

Question (EN): After filling the water into the 1100 milliliter (㎖) water bottle and 3 liter (L) and 400 milliliter (㎖) juice bottle, they were transported to the bucket. As the bucket became full, which one has more capacity: a kettle with a capacity of 4 liters (L) and 800 milliliters (㎖) or the bucket?
Question (KO): 들이가 1100밀리리터(㎖) 인 물통과 들이가 3리터(L) 400밀리리터(㎖) 인 주스병에 물을 가득 채운 후 양동이에 옮겨 담았더니 양동이가 가득 찼습니다. 들이가 4리터(L) 800밀리리터(㎖) 인 주전자와 양동이 중에서 어느 것의 들이가 더 많습니까?

Answer: kettle

Solution (Python):
var_a = 'kettle'
var_b = 'bucket'
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 = 800
var_g = var_e + var_f
var_h = 1100
var_i = 3
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): Find the sum of all natural numbers less than or equal to 5.
Question (KO): 5 이하인 자연수들의 합을 구하시오.

Answer: 15

Solution (Python):
var_a = 1
var_b = 5
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): 7ABABA is a six-digit number consisting of single digit numbers of A and B. When it is said to be a multiple of 6, how many of these six digits are there?
Question (KO): A, B는 한 자리 수입니다. 7ABABA가 여섯 자리 수이면서 6의 배수라고 합니다. 이러한 여섯 자리 수는 모두 몇 가지입니까?

Answer: 15

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