philschmid/DMath huggingface dataset:
Category: Arithmetic calculation

Question (EN): In a running match, Jungkook can run 2.7 kilometers (km) in an hour. How many hours would it take for Jimin to run 4.86 kilometers (km) at the same speed in this match?
Question (KO): 달리기 시합에서 정국이는 한 시간 동안 2.7킬로미터(㎞)를 달릴 수 있습니다. 이 시합에서 지민이가 같은 빠르기로 4.86킬로미터(㎞)를 달린다면 몇 시간이 걸리겠습니까?

Answer: 1.8

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

Question (EN): Out of 5 students, 3 are boys and 2 are girls. When 5 people are lined up in a row, find the case where all the female students stand in a row.
Question (KO): 5명의 학생 중 3명이 남학생이고 2명이 여학생이다. 5명을 1열로 세울 때, 여학생들이 모두 연속해서 서는 경우를 구하시오.

Answer: 48

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 = 'C'
list_b= []
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
list_c = list(set(list_a) - set(list_b))
var_g = len(list_c)
var_h = len(list_c)
var_i = 1
var_g = int(var_g)
var_h = int(var_h)
for i, elem in enumerate(range(var_h)):
    var_i = var_i * (var_g-i)
var_j = 'C'
var_k = 'D'
list_d= []
if "/" in str(var_k):
    var_k = eval(str(var_k))
list_d.append(var_k)
if "/" in str(var_j):
    var_j = eval(str(var_j))
list_d.append(var_j)
list_d.reverse()
var_l = len(list_d)
var_m = len(list_d)
var_n = 1
var_l = int(var_l)
var_m = int(var_m)
for i, elem in enumerate(range(var_m)):
    var_n = var_n * (var_l-i)
var_o = var_i * var_n
print(int(var_o))
Category: Arithmetic calculation

Question (EN): Namjoon gave two strokes of a pencil he had to Yoongi, and he had 15 left. If one stroke is 12 pencils, how many pencils did Yoongi receive from Namjoon?
Question (KO): 남준이가 가지고 있던 연필 2타 중 몇 자루를 윤기에게 주었더니 15자루가 남았습니다. 연필 1타는 12자루일때, 윤기가 남준이에게 받은 연필은 몇 자루입니까?

Answer: 9

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

Question (EN): Hoseok subtracted 46 from a number to get 15. Find the exact result of subtracting 29 from this number.
Question (KO): 호석이는 46을 어떤 수에서 빼서 15를 얻었습니다. 어떤 수에 29를 뺀 결과값을 정확히 구하시오.

Answer: 32

Solution (Python):
var_a = 15
var_b = 46
var_c = var_a + var_b
var_d = 29
var_e = var_c - var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): When a children's book is placed on one side of the two-arm scale, and a 0.5 kilograms (kg) weight and two 0.3 kilograms (kg) weights are placed on the other side, and they are level, how many kilograms (kg) is the children's book.
Question (KO): 양팔 저울의 한쪽에는 동화책 한 권을 올려놓고, 다른 한쪽에는 0.5킬로그램(㎏)짜리 추 한 개와 0.3킬로그램(㎏)짜리 추 2개를 올려놓았더니 수평이 되었다면, 동화책 한 권의 무게는 몇 킬로그램(㎏)일지 구하시오.

Answer: 1.1

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

Question (EN): You want to create a four-digit number using the numbers 7, 3, 5, and 8 only once. How many four-digit numbers can you make in total?
Question (KO): 숫자 7, 3, 5, 8를 한 번씩만 사용하여 네 자리 수를 만들려고 합니다. 만들 수 있는 네 자리 수는 모두 몇 개입니까?

Answer: 24

Solution (Python):
var_a = 7
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 = 4
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 = len(list_b)
print(int(var_f))
Category: Arithmetic calculation

Question (EN): Fifteen sheets of colored tape, each 25 centimeters (cm) long, were joined together with an overlap of 0.5 centimeters (cm). How many meters (m) is the total length of the continuous color tape?
Question (KO): 길이가 25 센티미터(㎝) 인 색 테이프 15 장을 0.5 센티미터(㎝) 씩 겹치게 이어 붙였습니다. 이은 색 테이프 전체의 길이는 몇 미터(m) 입니까?

Answer: 3.68

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

Question (EN): It took Daehyun 12 days to read the 288-page novel, and Seung-hoon took 9 days to read the 243-page novel. Find out who of the two read more pages in one day.
Question (KO): 대현이는 288쪽의 소설책을 읽는 데 12일이 걸렸고, 승훈이는 243쪽의 소설책을 읽는 데 9일이 걸렸습니다. 하루 동안 더 많은 쪽을 읽은 친구는 누구인지 구하시오.

Answer: Seung-hoon

Solution (Python):
var_a = 'Daehyun'
var_b = 'Seung-hoon'
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 = 288
var_d = 12
var_e = var_c / var_d
var_f = 243
var_g = 9
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): What is the number of faces of a quadrangular pyramid?
Question (KO): 사각뿔의 면의 개수는?

Answer: 5

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

Question (EN): There are cows and pigs on Gihun's farm. There are 100 pigs in total, and subtracting 3/4 of the number of cows by 25, dividing it by 7, and adding 50 equals the number of pigs. How many cows are there on Gihun's farm?
Question (KO): 기훈이네 농장에 소와 돼지가 있습니다. 돼지는 모두 100마리가 있고 소의 수의 3/4에서 25를 빼고 7로 나눈 뒤 50을 더하면 돼지의 수와 같아집니다. 기훈이네 농장의 소는 모두 몇마리입니까?

Answer: 500

Solution (Python):
var_a = 100
var_b = 50
var_c = var_a - var_b
var_d = 7
var_e = var_c * var_d
var_f = 25
var_g = var_e + var_f
var_h = 0.75
var_i = var_g / var_h
print(int(var_i))
Category: Geometry

Question (EN): A prism has 24 vertices, and all edges are 5 centimeters (cm) long. What is the sum of the lengths of all the edges of this prism in centimeters (cm)?
Question (KO): 꼭짓점의 수가 24개이고 모서리의 길이가 5센티미터(㎝)로 모두 같은 각기둥이 있습니다. 이 각기둥의 모든 모서리의 길이의 합은 몇 센티미터(㎝)입니까?

Answer: 180

Solution (Python):
var_a = 24
var_b = 2
var_c = var_a / var_b
var_d = 3
var_e = var_c * var_d
var_f = 5
var_g = var_e * var_f
print(int(var_g))
Category: Correspondence

Question (EN): I accidentally divided a certain number by 63 when I was supposed to add this number to 36, and I got 9. How much is it if I calculate it correctly?
Question (KO): 36에 어떤 수를 더해야 할 것을 잘못하여 63에 어떤 수를 나누었더니 9가 되었습니다. 바르게 계산하면 얼마인지 구하시오.

Answer: 43

Solution (Python):
var_a = 36
var_b = 63
var_c = 9
var_d = var_b / var_c
var_e = var_a + var_d
print(int(var_e))
Category: Correspondence

Question (EN): When the five-digit number ABCDE is divided by 6, the quotient is 13579 without a remainder. Find the value of ABC+DE.
Question (KO): 다섯 자리 수 ABCDE를 6으로 나누었을 때 몫이 13579로 나누어떨어졌습니다. ABC+DE의 값을 구하시오.

Answer: 888

Solution (Python):
var_a = 6
var_b = 13579
var_c = var_a * var_b
list_a = []
var_c = int(var_c)
while var_c//10 > 0:
    list_a.append(var_c%10)
    var_c = var_c//10
list_a.append(var_c%10)
list_a = list_a[::-1]
var_d = 1
var_e = list_a[var_d-1]
var_f = 100
var_g = var_e * var_f
var_h = 2
var_i = list_a[var_h-1]
var_j = 10
var_k = var_i * var_j
var_l = 3
var_m = list_a[var_l-1]
var_n = var_k + var_m
var_o = var_g + var_n
var_p = 4
var_q = list_a[var_p-1]
var_r = 10
var_s = var_q * var_r
var_t = 5
var_u = list_a[var_t-1]
var_v = var_s + var_u
var_w = var_o + var_v
print(int(var_w))
Category: Arithmetic calculation

Question (EN): How many full buckets are there when 135.1 liters (L) of water is divided into 7 liters (L) buckets?
Question (KO): 135.1리터(L)의 물을 7리터(L) 물통에 나누어 담을 때 가득 찬 물통은 몇 개 있나요?

Answer: 19

Solution (Python):
var_a = 135.1
var_b = 7
var_c = var_a // var_b
print(int(var_c))
Category: Possibility

Question (EN): There are 3 ways to get to the bookstore by bus, and 4 ways to go by subway. Find the number of cases you take the bus or subway from your home to the bookstore.
Question (KO): 집에서 서점까지 버스를 타고 가는 방법은 3가지, 지하철을 타고 가는 방법은 4가지이다. 집에서 서점까지 버스 또는 지하철을 타고 가는 경우의 수를 구하시오.

Answer: 7

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

Question (EN): Red paint was applied to all faces of a cuboid measuring 5 centimeters (cm) wide, 4 centimeters (cm) long, and 3 centimeters (cm) high. Then, this cuboid was cut into 60 cubes with each edge being 1 centimeters (cm) long. What is the number of cube pieces that are colored on only one side?
Question (KO): 가로가 5센티미터(㎝), 세로가 4센티미터(㎝), 높이가 3센티미터(㎝)인 직육면체의 모든 면에 빨간색 물감을 칠하였습니다. 그리고 이 직육면체를 한 모서리의 길이가 1센티미터(㎝)인 정육면체 60개로 잘랐습니다. 1개의 면에만 색칠된 정육면체 조각은 몇 개입니까?

Answer: 22

Solution (Python):
var_a = 5
var_b = 2
var_c = var_a - var_b
var_d = 4
var_e = 2
var_f = var_d - var_e
var_g = var_c * var_f
var_h = 5
var_i = 2
var_j = var_h - var_i
var_k = 3
var_l = 2
var_m = var_k - var_l
var_n = var_j * var_m
var_o = var_g + var_n
var_p = 4
var_q = 2
var_r = var_p - var_q
var_s = 3
var_t = 2
var_u = var_s - var_t
var_v = var_r * var_u
var_w = var_o + var_v
var_x = 2
var_y = var_w * var_x
print(int(var_y))
Category: Arithmetic calculation

Question (EN): One box contains 20 pairs of shoes. There are 8 boxes of (A) shoes, and the number of (B) shoe boxes is 5 times greater than the number of (A) shoe boxes. How many pairs of (B) shoes do you have more than (A) shoes?
Question (KO): 한 상자에는 20켤레의 신발이 들어 있습니다. (가) 신발은 8상자 있고, (나) 신발 상자 수는 (가) 신발 상자 수의 5배입니다. (나) 신발은 (가) 신발보다 몇 켤레 더 많습니까?

Answer: 640

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

Question (EN): I want to distribute 81 candies to students. How many students can get candy if I give 9 candies to each student?
Question (KO): 사탕 81개를 학생들에게 나누어주려고 합니다. 한 명에게 9개씩 주려고할 때 사탕을 받을 수 있는 학생 수는 몇 명입니까?

Answer: 9

Solution (Python):
var_a = 81
var_b = 9
var_c = var_a / var_b
print(int(var_c))
Category: Geometry

Question (EN): There is a regular pentagon with a side length of 15 centimeters (cm). Find the perimeter of this figure in centimeters (cm).
Question (KO): 한 변의 길이가 15센티미터(㎝)인 정오각형이 있습니다. 이 도형의 둘레는 몇 센티미터(㎝)인지 구하시오.

Answer: 75

Solution (Python):
var_a = 15
var_b = 5
var_c = var_a * var_b
print(int(var_c))
Category: Correspondence

Question (EN): In the orchard, 170 apples, 268 tangerines, and 120 mangoes were loaded equally into each of trucks. There are 8 apples left, 2 tangerines short, and 12 mangoes left. Find the maximum number of trucks in the orchard.
Question (KO): 과수원에서 사과 170개, 귤 268개, 망고 120개를 트럭에 똑같이 나누어 실었다. 사과는 8개가 남았고, 귤을 2개가 모자랐으며 망고는 12개가 남았다. 과수원에 트럭은 최대 몇 대인지 구하시오.

Answer: 54

Solution (Python):
var_a = 170
var_b = 8
var_c = var_a - var_b
var_d = 268
var_e = 2
var_f = var_d + var_e
var_g = math.gcd(int(var_f), int(var_c))
var_h = 120
var_i = 12
var_j = var_h - var_i
var_k = math.gcd(int(var_j), int(var_g))
print(int(var_k))
Category: Correspondence

Question (EN): What is the corresponding number for the variable B that fits the equation: A45+2B3=418.
Question (KO): A45+2B3=418입니다. B는 얼마인가요?

Answer: 7

Solution (Python):
var_a = 'A45+2B3=418'
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): A regular polygon has a perimeter of 49 and a side length of 7. Find how many sides there are in total.
Question (KO): 어떤 정다각형의 둘레가 49이고 한변의 길이가 7이다. 총 몇 개의 변이 있는지 구하여라.

Answer: 7

Solution (Python):
var_a = 49
var_b = 7
var_c = var_a / var_b
print(int(var_c))
Category: Correspondence

Question (EN): I mistakingly multiplied a number by 6, when I should have multiplied it by 7, and the result was 12. What will be the answer to the correct calculation?
Question (KO): 어떤 수에 7을 곱해야 할 것을 잘못하여 6을 곱한 결과는 12가 되었습니다. 바르게 계산한 결과는 얼마인가요?

Answer: 14

Solution (Python):
var_a = 12
var_b = 6
var_c = var_a / var_b
var_d = 7
var_e = var_c * var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Of the 80 students, 45 already have colored paper and the rest do not. If you want to distribute 1645 pieces of colored paper equally to students who do not have colored paper, how many pieces do you need to distribute to each student?
Question (KO): 80명의 학생 중 45명은 색종이가 이미 있고 나머지는 없다. 색종이가 없는 학생들에게 1645개의 색종이를 동일하게 나누어 주려면 1명당 몇 개씩 나누어 주어야합니까?

Answer: 47

Solution (Python):
var_a = 1645
var_b = 80
var_c = 45
var_d = var_b - var_c
var_e = var_a / var_d
print(int(var_e))
Category: Geometry

Question (EN): In the auditorium, students sit in four lines to take the exam. If there are 8 people in a line, find the number of students sitting at the perimeter.
Question (KO): 강당에서 학생들이 4줄로 떨어져 앉아 시험을 본다. 한 줄에 8명씩 있을 때 둘레에 앉은 학생들의 수를 구하시오.

Answer: 20

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

Question (EN): The length of the red string is 8 meters (m). If the blue string is 8 times the length of the white string and the white string is 5 times the length of the red string, how many meters (m) is the blue string?
Question (KO): 빨간색 끈의 길이가 8미터(m)입니다. 파란색 끈은 하얀색 끈의 길이에 8배이고, 하얀색 끝은 빨간색 끈의 5배일 때, 파란색 끈은 몇 미터(m)가 됩니까?

Answer: 320

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

Question (EN): What is the largest four-digit number that is a multiple of 5 and a multiple of 6 and a multiple of 2?
Question (KO): 5의 배수이면서 6의 배수이면서 2의 배수인 수 중 가장 큰 네 자리 수는?

Answer: 9990

Solution (Python):
var_a = 1000
var_b = 9999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 5
list_b = []
var_d = int(var_d)
for i in list_a:
    i = int(i)
    if i % var_d == 0:
        list_b.append(i)
var_e = 6
list_c = []
var_e = int(var_e)
for i in list_b:
    i = int(i)
    if i % var_e == 0:
        list_c.append(i)
var_f = 2
list_d = []
var_f = int(var_f)
for i in list_c:
    i = int(i)
    if i % var_f == 0:
        list_d.append(i)
var_g = 1
list_e=list_d.copy()
list_e.sort()
var_h = list_e[-var_g]
print(int(var_h))
Category: Arithmetic calculation

Question (EN): Suppose that the average of Korean, English, and Science is 89 points, and the average including the Social studies test rises by 1 point. Find the score of Social studies.
Question (KO): 국어, 영어, 과학의 평균이 89점이며 사회 시험을 포함한 평균은 1점 오른다. 호석이의 사회는 몇 점인가

Answer: 93

Solution (Python):
var_a = 89
var_b = 1
var_c = var_a + var_b
var_d = 4
var_e = var_c * var_d
var_f = 89
var_g = 3
var_h = var_f * var_g
var_i = var_e - var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): 8 of the freshmen participated in the running competition. The number of sophomores participating in the competition is 5 times the number of students in the first grade. What is a total number of freshmen and sophomores participated in the competition?
Question (KO): 1학년 학생 중에서 8명이 달리기 시합에 참가하였습니다. 달리기 시합에 참가한 2학년 학생 수는 1학년에서 참가한 학생 수의 5배입니다. 달리기 시합에 참가한 1학년과 2학년 학생은 모두 몇 명입니까?

Answer: 48

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

Question (EN): The students in Jungkook's class are all different heights and there are a total of 28 students. If you line up them in order of height, Eunji is 20th from the front and Jungkook is 14th from the front. How many students are between Jungkook and Eunji at this time?
Question (KO): 정국이네 반 학생들은 모두 키가 다르고 총 28명입니다. 키가 큰 순서대로 줄을 세우면 은지는 앞에서 20번째, 정국이는 앞에서 14번째입니다. 이때 정국과 은지 사이에 있는 학생은 모두 몇 명입니까?

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): Given the three natural numbers 1, 7, and 0, what is the largest number that can be formed by using all of these numbers once?
Question (KO): 세 자연수 1, 7, 0이 있을 때, 이 숫자들을 한 번씩 모두 사용하여 만들 수 있는 가장 큰 수는 얼마입니까?

Answer: 710

Solution (Python):
var_a = 7
var_b = 1
var_c = 0
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 = len(list_a)
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 = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
print(int(var_f))
Category: Geometry

Question (EN): How many triangles are formed when a diagonal is drawn from a vertex of a nonagon?
Question (KO): 구각형의 한 꼭짓점에서 대각선을 그을 때 생기는 삼각형의 개수는?

Answer: 7

Solution (Python):
var_a = 9
var_b = 3
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e))
Category: Geometry

Question (EN): Drinks are lined up in a square shape. If there were 240 drinks in the perimeter, what is the total number of drinks?
Question (KO): 음료수를 정사각형 모양으로 줄세웠습니다. 둘레에 놓인 음료수의 개수가 240개였다면, 전체 음료수의 개수는 몇 개입니까?

Answer: 3721

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

Question (EN): A cuboid is 12 centimeters (cm) wide, 16 centimeters (cm) long, and 14 centimeters (cm) high. What is the surface area of the largest cube that can be cut out of this cube?
Question (KO): 가로가 12센티미터(㎝), 세로가 16센티미터(㎝), 높이가 14센티미터(㎝)인 직육면체가 있다. 이 직육면체를 잘라 만들 수 있는 가장 큰 정육면체의 겉넓이는?

Answer: 864

Solution (Python):
var_a = 12
var_b = 16
var_c = 14
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
list_b=list_a.copy()
list_b.sort()
var_e = list_b[var_d-1]
var_f = 2
var_g = var_e ** var_f
var_h = 6
var_i = var_g * var_h
print(int(var_i))
Category: Geometry

Question (EN): There is a park with a side length of 14 meters (m). If the park is divided into districts in a rectangular shape measuring 8 meters (m) long by 2 meters (m) wide. How many districts can there be in the maximum?
Question (KO): 한 변의 길이가 14미터(m)인 공원이 있습니다. 이 공원을 가로가 8미터(m), 세로가 2미터(m)인 직사각형 구역으로 여러개 나누려고 합니다. 구역은 최대 몇 개로 나누어질 수 있겠습니까?

Answer: 12

Solution (Python):
var_a = 14
var_b = 2
var_c = var_a ** var_b
var_d = 8
var_e = 2
var_f = var_d * var_e
var_g = var_c // var_f
print(int(var_g))
Category: Possibility

Question (EN): You want to distribute 5 different pencils to 4 students. There may be students who do not receive a pencil. Find out the number of cases of distributing the pencils to the students.
Question (KO): 서로 다른 종류의 연필 5자루를 4명의 학생에게 남김 없이 나누어주려고 합니다. 이때, 연필을 받지 못하는 학생이 있을 수 있습니다. 연필을 학생들에게 나누어주는 경우는 모두 몇 가지인가요?

Answer: 1024

Solution (Python):
var_a = 4
var_b = 5
var_c = var_a ** var_b
print(int(var_c))
Category: Geometry

Question (EN): To make clothes, I decided to sew up the leftover fabric. If 20 pieces of fabric each 10 centimeters (cm) long are sewn together and the length of the joint is 5 millimeters (mm), how many centimeters (cm) is the length of the piece of fabric sewn together?
Question (KO): 옷을 만들기 위해 짜투리 천을 이어 붙이기로 하였습니다. 길이가 10센티미터(㎝)인 천 20장을 이어 붙이고 연결 부분의 길이가 5밀리미터(㎜)로 모두 같다면 이어 붙인 천의 길이는 몇 센티미터(㎝)인지 구하시오.

Answer: 190.5

Solution (Python):
var_a = 10
var_b = 20
var_c = var_a * var_b
var_d = 5
var_e = 10
var_f = var_d / var_e
var_g = 20
var_h = 1
var_i = var_g - var_h
var_j = var_f * var_i
var_k = var_c - var_j
print('{:.2f}'.format(round(var_k+1e-10,2)))
Category: Correspondence

Question (EN): 57A-2B4=364. What number is B?
Question (KO): 57A-2B4=364입니다. B는 얼마인가요?

Answer: 1

Solution (Python):
var_a = '57A-2B4=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): How many natural numbers are more than 40 and less than 70?
Question (KO): 40 이상 70 미만인 자연수는 모두 몇 개입니까?

Answer: 30

Solution (Python):
var_a = 70
var_b = 40
var_c = var_a - var_b
print(int(var_c))