philschmid/DMath huggingface dataset:
Category: Comparison

Question (EN): Of A, B, C, and D, A is 36, and B is 5 greater than 27. C is the number with 3 groups of 10,and D is 3 less than 40. Which number is the smallest?
Question (KO): A, B, C, D 중 A가 36이고, B는 27보다 5 큽니다. C는 10개씩 3묶음과 낱개 1개가 있는 수이고, D는 40보다 3 작습니다. 어떤 수가 가장 작습니까?

Answer: C

Solution (Python):
var_a = 'A'
var_b = 'B'
var_c = 'C'
var_d = 'D'
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 = 36
var_f = 27
var_g = 5
var_h = var_f + var_g
var_i = 3
var_j = 10
var_k = var_i * var_j
var_l = 1
var_m = var_k + var_l
var_n = 40
var_o = 3
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_m):
    var_m = eval(str(var_m))
list_b.append(var_m)
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_q = 1
list_c=list_b.copy()
list_c.sort()
var_r = list_c[var_q-1]
var_s = list_b.index(var_r)+1
var_t = list_a[var_s-1]
print(var_t)
Category: Correspondence

Question (EN): When you add 8 to a number, you get 88. Find the result of dividing 10 by the number.
Question (KO): 어떤 수에 8을 더했더니 88이 되었습니다. 10을 어떤 수에서 나눈 결과를 구하시오.

Answer: 8

Solution (Python):
var_a = 88
var_b = 8
var_c = var_a - var_b
var_d = 10
var_e = var_c / var_d
print(int(var_e))
Category: Correspondence

Question (EN): Subtracting 46 from a number gives you 15. What is the subtraction of 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: Comparison

Question (EN): Nine people are standing in a line in the order of shortest to tallest. Hoseok is the tallest. If they were lined up again in the order of tallest to shortest, in what position will Hoseok be from the very front? Answer in ordinal number.
Question (KO): 키가 작은 사람부터 순서대로 9명이 한 줄로 서 있습니다. 호석이가 가장 키가 큽니다. 키가 큰 사람부터 순서대로 다시 줄을 서면 호석이는 앞에서부터 몇 번째에 서게 됩니까?

Answer: 1

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

Question (EN): Say that the equation 32+A7B=705 holds. What number should be in A?
Question (KO): 등식 32+A7B=705이 성립한다고 합니다. A에 들어가야 하는 숫자는 무엇인가요?

Answer: 6

Solution (Python):
var_a = '32+A7B=705'
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: Arithmetic calculation

Question (EN): The cat is 92 centimeters (cm) tall and the dog is 94 centimeters (cm) tall. If the average height of a cat, dog, or bird is 95 centimeters (cm), how tall is the bird in centimeters (cm)?
Question (KO): 고양이는 키가 92cm이고 개는 키가 94cm이다. 고양이, 개, 새의 평균 키가 95cm일때 새의 키는 몇 cm인가?

Answer: 99

Solution (Python):
var_a = 95
var_b = 3
var_c = var_a * var_b
var_d = 92
var_e = var_c - var_d
var_f = 94
var_g = var_e - var_f
print(int(var_g))
Category: Geometry

Question (EN): A clock with a radius of 2 centimeters (cm) is placed inside a square box with a side length of 8 centimeters (cm), without overlapping it. How many clocks can you fit on one floor?
Question (KO): 한 변의 길이가 8센티미터(㎝)인 정사각형 상자 안에 반지름의 길이가 2센티미터(㎝)인 시계를 겹치지 않게 넣으려고 합니다. 한 층에 시계는 모두 몇 개를 넣을 수 있습니까?

Answer: 4

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

Question (EN): There is a rectangular piece of land with an area of 215.6 square meters (m2). If the width is 14 meters (m), how many meters (m) is the length?
Question (KO): 넓이가 215.6제곱미터(㎡)인 직사각형 모양의 땅이 있습니다. 가로가 14미터(m)이면 세로는 몇 미터(m)입니까?

Answer: 15.4

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

Question (EN): I have a book of 500 pages. If all pages are numbered from 1 to 500 in order, find how many times the number 4 is written on all pages.
Question (KO): 500쪽 짜리 책이 있습니다. 모든 쪽에는 1부터 500까지의 번호가 차례로 적혀있을 때, 숫자 4는 모두 몇 번 적혀 있는지 구하시오.

Answer: 200

Solution (Python):
var_a = 1
var_b = 500
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d=""
for i in list_a:
    i = str(i)
    var_d = var_d + i
list_b = []
var_d = int(var_d)
while var_d//10 > 0:
    list_b.append(var_d%10)
    var_d = var_d//10
list_b.append(var_d%10)
list_b = list_b[::-1]
var_e = 4
var_f = 0
var_e = int(var_e)
for i in list_b:
    i = int(i)
    if i == var_e:
        var_f = var_f + 1
print(int(var_f))
Category: Comparison

Question (EN): There are 28 identical bookshelves in the library. Each bookshelf has 6 floors, and the number of books on each floor is the same. There are 19 books on one floor of a bookshelf. How many books are on the shelves in the library?
Question (KO): 도서관에 똑같은 책장이 28개 있습니다. 각 책장은 6층이고, 각 층마다 꽂혀 있는 책의 수는 같습니다. 어느 책장의 한 층에 19개의 책이 꽂혀 있습니다. 도서관의 책장에 꽂혀 있는 책은 모두 몇 권입니까?

Answer: 3192

Solution (Python):
var_a = 28
var_b = 6
var_c = var_a * var_b
var_d = 19
var_e = var_c * var_d
print(int(var_e))
Category: Comparison

Question (EN): In the beginning, Seokjin and Taehyung each received 10 pieces of drawing paper. While Seokjin used 5 pieces, Taehyung used 4. Who has more drawing paper now?
Question (KO): 처음 석진이와 태형이가 각각 10장씩 도화지를 선물 받았습니다. 석진이가 5장을 사용하는 동안 태형이는 4장을 사용했습니다. 지금 도화지를 더 많이 갖고 있는 사람은 누구입니까?

Answer: Taehyung

Solution (Python):
var_a = 'Seokjin'
var_b = 'Taehyung'
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 = 10
var_d = 5
var_e = var_c - var_d
var_f = 10
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: Comparison

Question (EN): People are standing in line at the amusement park. When Eunji can ride at sixth place and there are seven people behind her, find how many people are in line to ride.
Question (KO): 놀이동산에 사람들이 줄을 서 있다. 은지가 여섯 번째로 탈 수 있고 뒤에 7명이 있을 때, 몇 명이 타기 위해 줄을 서고 있는지 구하시오.

Answer: 13

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

Question (EN): Snacks cost 300 won each and candies cost 500 won each. If you buy 8 of them in total and spend 3,000 won, what is the number of candies you buy?
Question (KO): 과자는 한 개에 300원이고 사탕은 한 개에 500원입니다. 과자와 사탕을 합하여 8개 사고 3000원을 사용했다면 사탕은 몇 개 샀을지 구하세요.

Answer: 3

Solution (Python):
var_a = 3000
var_b = 300
var_c = 8
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 500
var_g = 300
var_h = var_f - var_g
var_i = var_e / var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): To make one ribbon, you need 4 meters (m) of string. If Jimin bought 105.8 meters (m) of string, how many ribbons can he make?
Question (KO): 리본 1개를 만들기 위해서는 끈 4미터(m)가 필요합니다. 지민이가 끈 105.8미터(m)를 사왔다면 리본을 몇 개 만들 수 있나요?

Answer: 26

Solution (Python):
var_a = 105.8
var_b = 4
var_c = var_a // var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): Jungkook gave 125 mm (mm) of the 65 centimeters (cm) tape to Jimin and used 153 mm (mm) in art class. How long is the remaining tape in centimeters (cm) with Jungkook?
Question (KO): 65센티미터(㎝)의 테이프 중 125밀리미터(㎜)를 지민이에게 주고 미술 시간에 153밀리미터(㎜)를 사용했습니다. 정국이에게 남아있는 테이프의 길이는 몇 센티미터(㎝)입니까?

Answer: 37.2

Solution (Python):
var_a = 65
var_b = 125
var_c = 10
var_d = var_b / var_c
var_e = var_a - var_d
var_f = 153
var_g = 10
var_h = var_f / var_g
var_i = var_e - var_h
print('{:.2f}'.format(round(var_i+1e-10,2)))
Category: Arithmetic calculation

Question (EN): There are four numbers 10, 11, 12, and 13. What do you get as a remainder when you divide the largest number by the second largest number?
Question (KO): 4개의 수 10, 11, 12, 13이 있습니다. 그 중에서 가장 큰 수와 2번째로 큰 수로 나눈 나머지는 얼마입니까?

Answer: 1

Solution (Python):
var_a = 10
var_b = 11
var_c = 12
var_d = 13
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 = 1
list_b=list_a.copy()
list_b.sort()
var_f = list_b[-var_e]
var_g = 2
list_c=list_a.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = var_f % var_h
print(int(var_i))
Category: Correspondence

Question (EN): It is said that the train traveled 4.5 kilometers (km) in 15 minutes. How many kilometers (km) did this train travel in 5 minutes?
Question (KO): 기차가 15분에 4.5킬로미터(㎞)를 갔다고 한다. 이 기차가 5분 동안 간 거리는 몇 킬로미터(㎞)인가?

Answer: 1.5

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

Question (EN): There are 95 students in both first and second year classes. If there are 32 first graders, how many more sophomores are there than first graders?
Question (KO): 1학년과 2학년이 모두 95명 있습니다. 1학년이 32명일 때 2학년은 1학년보다 몇 명 더 많습니까?

Answer: 31

Solution (Python):
var_a = 95
var_b = 32
var_c = var_a - var_b
var_d = 32
var_e = var_c - var_d
print(int(var_e))
Category: Correspondence

Question (EN): I made the mistake of adding a number by 3.1 to get 8.9, which was supposed to be multiplied by 3.1. What is the correctly calculated value multiplied by 2.5?
Question (KO): 어떤 수에 3.1을 곱해야 할 것을 잘못하여 3.1을 더했더니 8.9가 되었습니다. 바르게 계산한 값에 2.5를 곱하면 얼마입니까?

Answer: 44.95

Solution (Python):
var_a = 8.9
var_b = 3.1
var_c = var_a - var_b
var_d = 3.1
var_e = var_c * var_d
var_f = 2.5
var_g = var_e * var_f
print('{:.2f}'.format(round(var_g+1e-10,2)))
Category: Comparison

Question (EN): If Hohyeon and Seulgi are 162 centimeters (cm) and 159 centimeters (cm) respectively, who is the tallest person?
Question (KO): 호현, 슬기는 각각 키가 162센티미터(㎝), 159센티미터(㎝)이라면 키가 가장 큰 사람은 누구인가?

Answer: Hohyeon

Solution (Python):
var_a = 'Hohyeon'
var_b = 'Seulgi'
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 = 162
var_d = 159
list_b= []
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = list_b.index(var_f)+1
var_h = list_a[var_g-1]
print(var_h)
Category: Geometry

Question (EN): If you one diagonals from a rectangle, you can made A polygon with B edges. What is the value of A×B ?
Question (KO): 사각형에 대해 하나의 대각선을 그으면, A각형이 B개 만들어집니다. A×B의 값은?

Answer: 6

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

Question (EN): Jungkook has 0.8, Yoongi has 1/2, and Yoojung has 0.9. How many people have number cards greater than or equal to 0.3?
Question (KO): 정국이는 0.8, 윤기는 1/2, 유정이는 0.9의 숫자카드를 갖고 있습니다. 0.3보다 크거나 같은 숫자카드를 가지고 있는 사람은 몇 명입니까?

Answer: 3

Solution (Python):
var_a = 0.8
var_b = 0.5
var_c = 0.9
list_a= []
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 0.3
list_b = []
for i in list_a:
    if i >= var_d:
        list_b.append(i)
var_e = len(list_b)
print(int(var_e))
Category: Comparison

Question (EN): What is the 2nd smallest number among 5, 8, 9, and 7?
Question (KO): 5, 8, 9, 7 중에서 2번째로 작은 수는 무엇인가요?

Answer: 7

Solution (Python):
var_a = 5
var_b = 8
var_c = 9
var_d = 7
list_a= []
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 2
list_b=list_a.copy()
list_b.sort()
var_f = list_b[var_e-1]
print(int(var_f))
Category: Possibility

Question (EN): Five students want to visit one of three locations: school, home, or swimming pool. How many ways are there for students to choose the location?
Question (KO): 5명의 학생들이 학교, 집, 수영장 세 가지 장소 중 한곳을 선택해 방문하려고 합니다. 학생들이 장소를 선택하는 경우는 모두 몇 가지입니까?

Answer: 243

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

Question (EN): There are 95 ducks and chickens in all. If there are 32 ducks, find how many more chickens are there than ducks?
Question (KO): 오리와 닭이 모두 95마리 있습니다. 오리가 32마리일 때 닭은 오리보다 몇 마리 더 많은지 구하시오.

Answer: 31

Solution (Python):
var_a = 95
var_b = 32
var_c = var_a - var_b
var_d = 32
var_e = var_c - var_d
print(int(var_e))
Category: Comparison

Question (EN): Find the smallest number that is greater than 1.1 out of the five numbers 1.4, 9/10, 1.2, 0.5, and 13/10.
Question (KO): 5가지 숫자 1.4, 9/10, 1.2, 0.5, 13/10 중에서 1.1보다 큰 수 중 가장 작은 숫자는 무엇입니까?

Answer: 1.2

Solution (Python):
var_a = 1.4
var_b = 0.9
var_c = 1.2
var_d = 0.5
var_e = 1.3
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 = 1.1
list_b = []
for i in list_a:
    if i > var_f:
        list_b.append(i)
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[var_g-1]
print('{:.2f}'.format(round(var_h+1e-10,2)))
Category: Comparison

Question (EN): There are three numbers in total: 0.8, 1/2, and 0.5. How many of these numbers are less than 3?
Question (KO): 총 3개의 숫자 0.8, 1/2, 0.5이 있습니다. 이 중 3보다 작은 수는 몇 개 일까요?

Answer: 3

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

Question (EN): There are 5 boxes containing tangerines that weigh 200 grams (g) each. There are 3 boxes containing apples that weigh 450 grams (g) each and 4 boxes containing pears that weigh 800 grams (g) each. If a box contains 30 tangerines, 20 apples, and 15 pears, what is the most numerous fruit?
Question (KO): 개당 200그램(g)인 귤이 담겨있는 상자가 5개 있습니다. 450그램(g)짜리 사과가 담겨있는 상자는 3개, 1개의 무게가 800그램(g)인 배가 담겨있는 상자는 4개 있습니다. 한 상자에 귤은 30개씩, 사과는 20개씩, 배는 15개씩 담겨있다고 한다면, 가장 수가 많은 과일은 무엇인지 구하시오.

Answer: tangerines

Solution (Python):
var_a = 'tangerines'
var_b = 'apples'
var_c = 'pears'
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 = 30
var_e = 5
var_f = var_d * var_e
var_g = 20
var_h = 3
var_i = var_g * var_h
var_j = 15
var_k = 4
var_l = var_j * var_k
list_b= []
if "/" in str(var_l):
    var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_i):
    var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
var_m = 1
list_c=list_b.copy()
list_c.sort()
var_n = list_c[-var_m]
var_o = list_b.index(var_n)+1
var_p = list_a[var_o-1]
print(var_p)
Category: Comparison

Question (EN): Choose all the numbers greater than or equal to 1.1 from among 1.4, 9/10, 1.2, 0.5, and 13/10, and find the sum of the selected numbers.
Question (KO): 1.4, 9/10, 1.2, 0.5, 13/10 중에서 1.1보다 크거나 같은 숫자를 고르고, 선택된 숫자들의 합을 구하세요

Answer: 3.9

Solution (Python):
var_a = 1.4
var_b = 0.9
var_c = 1.2
var_d = 0.5
var_e = 1.3
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 = 1.1
list_b = []
for i in list_a:
    if i >= var_f:
        list_b.append(i)
list_b = [float(i) for i in list_b]
var_g = sum(list_b)
print('{:.2f}'.format(round(var_g+1e-10,2)))
Category: Arithmetic calculation

Question (EN): A stone that is 30 meters (m) high from the ground is said to fall at 1 meter (m) per second, and a stone 20 meters (m) high from the ground is said to fall at 0.5 meters (m) per second. Find the height of the two stones when they are at the same height.
Question (KO): 30미터(m)에 있는 돌은 초당 1미터(m)씩 떨어지고, 20미터(m)에 있는 돌은 초당 0.5미터(m)씩 떨어진다고 합니다. 두 돌의 높이가 같아졌을때의 높이를 구하여라

Answer: 10

Solution (Python):
var_a = 30
var_b = 30
var_c = 20
var_d = var_b - var_c
var_e = 1
var_f = 0.5
var_g = var_e - var_f
var_h = var_d / var_g
var_i = var_a - var_h
print(int(var_i))
Category: Possibility

Question (EN): You are trying to create a four-digit number using the four types of numbers: 7, 2, 5, and 9. How many four-digit numbers can you make?
Question (KO): 7, 2, 5, 9라는 4종류의 숫자를 사용하여 네 자리 수를 만드려고 합니다. 만들 수 있는 네 자리 수는 모두 몇 개입니까?

Answer: 24

Solution (Python):
var_a = 7
var_b = 2
var_c = 5
var_d = 9
list_a= []
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = len(list_a)
var_f = 4
var_g = 1
var_e = int(var_e)
var_f = int(var_f)
for i, elem in enumerate(range(var_f)):
    var_g = var_g * (var_e-i)
print(int(var_g))
Category: Geometry

Question (EN): There is a rectangular-shaped field with a length of 3.6 meters (m) and a width 2.5 times its length. If you planted tomatoes in half of this field, what is the area of the field where tomatoes are planted in square meters (m2)?
Question (KO): 세로가 3.6미터(m) 이고 가로가 세로의 2.5 배인 직사각형 모양의 밭이 있습니다. 이 밭의 절반에 토마토를 심었다면 토마토를 심은 밭의 넓이는 몇 제곱미터(㎡)입니까?

Answer: 16.2

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

Question (EN): If A3B-41=591, what number should go in A?
Question (KO): A3B-41=591일 때, A에 들어가야 하는 숫자는 무엇인가요?

Answer: 6

Solution (Python):
var_a = 'A3B-41=591'
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: Comparison

Question (EN): The left button is written as 21/5 and the right button as 4.9. If you have to press the button with the higher number, which button would you choose to press?
Question (KO): 왼쪽 버튼에는 21/5가, 오른쪽 버튼에는 4.9가 적혀 있습니다. 더 큰 수가 적힌 버튼을 누를 때, 어느 쪽 버튼을 눌러야 합니까?

Answer: right

Solution (Python):
var_a = 'left'
var_b = 'right'
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.2
var_d = 4.9
list_b= []
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = list_b.index(var_f)+1
var_h = list_a[var_g-1]
print(var_h)
Category: Possibility

Question (EN): If 6 volleyball teams play with each other once, how many matches will take place?
Question (KO): 6개의 배구팀이 서로 한 번씩 시합을 가진다면 모두 몇 번의 시합이 이루어지는지 모두 구하시오

Answer: 15

Solution (Python):
var_a = 6
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: Arithmetic calculation

Question (EN): I bought 8 bookshelves of the same shape. This bookshelf has 5 layers, and each layer can hold 85 books. How many books can I put in my new bookcase?
Question (KO): 같은 모양의 책장을 8개 샀습니다. 이 책장은 5층으로 되어 있고 각 층마다 책을 85권씩 넣을 수 있습니다. 새로 산 책장에 넣을 수 있는 책은 모두 몇 권입니까?

Answer: 3400

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

Question (EN): A cube with one edge that is 15 centimeters (cm) long is displayed in the exhibition hall. What is the sum of the lengths of all the edges of this cube?
Question (KO): 전시장에 한 모서리의 길이가 15센티미터(㎝)인 정육면체가 전시되어 있습니다. 이 정육면체의 모든 모서리의 길이의 합은?

Answer: 180

Solution (Python):
var_a = 15
var_b = 4
var_c = 3
var_d = var_b * var_c
var_e = var_a * var_d
print(int(var_e))