philschmid/DMath huggingface dataset:
Category: Comparison

Question (EN): Factory A made 40,680 toys with 60 machines, and Factory B made 37,510 toys with 55 machines. Which factory made more toys per machine on average?
Question (KO): A 공장에선 60대의 기계로 장난간 40680개를 만들었고, B 공장에선 55대의 기계로 장난감 37510개를 만들었습니다. 기계 한 대당 평균적으로 만든 장난감의 개수가 더 많은 공장은 어디입니까?

Answer: B

Solution (Python):
var_a = 'A'
var_b = 'B'
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 = 40680
var_d = 60
var_e = var_c / var_d
var_f = 37510
var_g = 55
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: Arithmetic calculation

Question (EN): Of the 13 animals, 6 are black and all others are white. How many white animals are there?
Question (KO): 13마리의 동물 중 6마리는 검은색 동물이고 나머지는 모두 하얀색 동물입니다. 하얀색 동물은 몇 마리입니까?

Answer: 7

Solution (Python):
var_a = 13
var_b = 6
var_c = var_a - var_b
print(int(var_c))
Category: Possibility

Question (EN): There are three number cards 1, 7 and 3. When two of these are used to form the largest two-digit number, find the unused number.
Question (KO): 세 장의 숫자카드 1, 7, 3이 있다. 이 중 2개를 사용하여 가장 큰 2자리수를 만들 때, 사용되지 않은 수를 구하여라.

Answer: 1

Solution (Python):
var_a = 1
var_b = 7
var_c = 3
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 = 2
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]
list_d = []
var_f = int(var_f)
while var_f//10 > 0:
    list_d.append(var_f%10)
    var_f = var_f//10
list_d.append(var_f%10)
list_d = list_d[::-1]
list_e = list(set(list_a) - set(list_d))
var_g = 1
var_h = list_e[var_g-1]
print(int(var_h))
Category: Possibility

Question (EN): Make a three-digit number by drawing the number cards from 0 to 9 once. Then, find the sum of the 2nd largest and the 2nd smallest of these numbers.
Question (KO): 0부터 9까지의 숫자 카드를 한 번씩 사용하여 세 자리 수를 만듭니다. 이 수 중 2번째 큰 수와 2번째 작은 수의 합를 구하시오.

Answer: 1089

Solution (Python):
var_a = 0
var_b = 9
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.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 2
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = 2
list_d=list_b.copy()
list_d.sort()
var_h = list_d[var_g-1]
var_i = var_f + var_h
print(int(var_i))
Category: Geometry

Question (EN): After arranging several pencil cases into a square shape, there were 6 pencil cases left. So, I tried to increase the width and length by one row, but 11 pencil cases was not enough. If the pencil cases are lined up in 7 rows, how many pencil cases are there in one row?
Question (KO): 필통 여러개를 정사각형 모양으로 빈틈없이 정렬하고 보니 6개의 필통이 남았습니다. 그래서 가로 한 변과 세로 한 변을 1열씩 늘리려 하였지만 11개의 필통이 부족하였습니다. 필통을 7열로 줄세운다면 1열에 몇 개의 필통이 있을까요?

Answer: 10

Solution (Python):
var_a = 6
var_b = 11
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
var_h = 2
var_i = var_g ** var_h
var_j = 6
var_k = var_i + var_j
var_l = 7
var_m = var_k / var_l
print(int(var_m))
Category: Comparison

Question (EN): What is the second largest number among 5, 8, 4, 3, and 7?
Question (KO): 5, 8, 4, 3, 7중 2번째로 큰 숫자는 무엇입니까?

Answer: 7

Solution (Python):
var_a = 5
var_b = 8
var_c = 4
var_d = 3
var_e = 7
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 = 2
list_b=list_a.copy()
list_b.sort()
var_g = list_b[-var_f]
print(int(var_g))
Category: Arithmetic calculation

Question (EN): Donghyeon's class teacher gives away compliment stickers to classmates whenever they do a good deed. If 10 students each received 5, 6, 5, 5, 6, 4, 5, 5, 6, 7 compliment stickers, how many students received 5 compliment stickers?
Question (KO): 동현이네 반 담임선생님은 반 학생들이 선행을 할 때마다 칭찬 스티커를 나눠줍니다. 10명의 학생이 받은 칭찬 스티커가 각각 5, 6, 5, 5, 6, 4, 5, 5, 6, 7장일 때, 칭찬 스티커를 5장 받은 학생은 몇 명입니까?

Answer: 5

Solution (Python):
var_a = 5
var_b = 6
var_c = 5
var_d = 5
var_e = 6
var_f = 4
var_g = 5
var_h = 5
var_i = 6
var_j = 7
list_a= []
if "/" in str(var_j):
    var_j = eval(str(var_j))
list_a.append(var_j)
if "/" in str(var_i):
    var_i = eval(str(var_i))
list_a.append(var_i)
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_a.append(var_h)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_a.append(var_g)
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_a.append(var_f)
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_k = 5
var_l = 0
var_k = int(var_k)
for i in list_a:
    i = int(i)
    if i == var_k:
        var_l = var_l + 1
print(int(var_l))
Category: Possibility

Question (EN): Find the sum of the smallest and largest numbers that are made up of 1, 2, and 5 and are greater than 100 and less than 1000.
Question (KO): 1000보다 작고 100보다 큰 수 중 1, 2, 5 모두로 이루어진 가장 작은 수와 큰 수의 합을 구하시오.

Answer: 646

Solution (Python):
var_a = 1
var_b = 2
var_c = 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 = [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]
var_g = 1
list_d=list_b.copy()
list_d.sort()
var_h = list_d[var_g-1]
var_i = var_f + var_h
print(int(var_i))
Category: Geometry

Question (EN): If the area of the remaining paper is 13 square centimeters (cm2) after a cube is cut from a rectangular piece of paper measuring 40 centimeters (cm) long and 25 centimeters (cm) wide, how many centimeters (cm) is one edge of the cube?
Question (KO): 가로 40 센티미터(㎝) , 세로 25센티미터(㎝) 인 직사각형 모양의 종이에서 정육면체의 전개도를 오리고 남은 종이의 넓이가 13제곱센티미터(㎠)일 때, 정육면체의 한 모서리는 몇 센티미터(㎝) 입니까?

Answer: 12

Solution (Python):
var_a = 40
var_b = 25
var_c = var_a * var_b
var_d = 136
var_e = var_c - var_d
var_f = 6
var_g = var_e / var_f
var_h = 0.5
var_i = var_g ** var_h
print(int(var_i))
Category: Correspondence

Question (EN): A club has 52 members. If 37 of them are men, how many of them are women?
Question (KO): 어느 동아리의 부원 수는 52명이다. 이 중 37명이 남자일 때, 여자인 부원은 몇 명인가?

Answer: 15

Solution (Python):
var_a = 52
var_b = 37
var_c = var_a - var_b
print(int(var_c))
Category: Geometry

Question (EN): There is a rhombus-shaped key holder. If the length of one diagonal of the key holder is 7.4 centimeters (cm) and the area is 21.46 square centimeters (cm2), how long is the other diagonal in centimeters (cm?)
Question (KO): 마름모 모양의 키 홀더가 있습니다. 키 홀더의 한 대각선의 길이가 7.4센티미터(㎝)이고, 넓이가 21.46제곱센티미터(㎠)라면 다른 대각선은 몇 센티미터(㎝)인지 구하시오.

Answer: 5.8

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

Question (EN): I multiplied a particular number by 4 and then multiplied again by 25 and I got 812. Find that particular number.
Question (KO): 어떤 수를 4배 한 다음 25을 곱하였더니 812가 되었습니다. 어떤 수를 구하시오.

Answer: 8.12

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

Question (EN): What is the average of the natural numbers greater than 12 and less than 53?
Question (KO): 12이상 53이하의 자연수의 평균은 얼마입니까?

Answer: 32.5

Solution (Python):
var_a = 12
var_b = 53
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)/len(list_a)
print('{:.2f}'.format(round(var_d+1e-10,2)))
Category: Arithmetic calculation

Question (EN): Hyorim's 6th graders decided to go on a field trip ahead of graduation. If 252 students and 8 teachers go together, the cost of renting a 41-seater bus is 300,000 won and the highway toll per bus is 7,500. How much does it cost to rent the bus and pay the toll?
Question (KO): 효림이네 학급 6학년 학생들은 졸업을 앞두고 수학여행을 떠나기로 했습니다. 학생 252명과 선생님 8명이 함께 갈 때, 41인승 버스를 한 대 빌리는 값은 300000원이고, 버스 한 대당 고속도로 통행료는 7500이라면 버스를 빌리고 통행료를 내는 데 모두 얼마가 필요합니까?

Answer: 2152500

Solution (Python):
var_a = 252
var_b = 8
var_c = var_a + var_b
var_d = 41
var_e = var_c / var_d
var_f = 1
var_g=int(((var_e+9*10**(var_f-2))//(10**(var_f-1)))*10**(var_f-1))

var_h = 300000
var_i = 7500
var_j = var_h + var_i
var_k = var_g * var_j
print(int(var_k))
Category: Correspondence

Question (EN): 9 is a number that 2 subtracted from the number and added with 4. Find what the number is. 
Question (KO): 9는 어떤 수에 2를 빼고 4를 더한 수 입니다. 어떤 수를 구하시오

Answer: 7

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

Question (EN): The older brother and younger brother are going to share 25 stamps. If the older brother has 1 more stamp than twice the number of stamps the younger brother has, find how many stamps the older brother has.
Question (KO): 우표 25장을 형과 동생이 나누어 가지려고 합니다. 형은 동생이 가지는 우표의 수의 2배보다 1장 더 가진다면 형이 가지는 우표는 몇 장인지 구하시오.

Answer: 17

Solution (Python):
var_a = 25
var_b = 1
var_c = var_a - var_b
var_d = 2
var_e = 1
var_f = var_d + var_e
var_g = var_c / var_f
var_h = 2
var_i = var_g * var_h
var_j = 1
var_k = var_i + var_j
print(int(var_k))
Category: Arithmetic calculation

Question (EN): There are 8 red apples, 5 green apples, and 9 tangerines. How many fewer tangerines than apples?
Question (KO): 빨간색 사과 8개, 초록색 사과 5개, 귤 9개가 있습니다. 귤은 사과보다 몇 개 더 적습니까?

Answer: 4

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

Question (EN): If the gap between a certain number and 5.46 is 3.97 and the number is less than 5.46, find the sum of the number and 5.46.
Question (KO): 어떤 수와 5.46의 차이가 3.97이고 어떤 수가 5.46보다 작다고 할 때, 어떤 수와 5.46의 합을 구하시오.

Answer: 6.95

Solution (Python):
var_a = 5.46
var_b = 5.46
var_c = 3.97
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): When there is an equation, A72-23=549, find the number A.
Question (KO): A72-23=549입니다. A는 얼마인가요?

Answer: 5

Solution (Python):
var_a = 'A72-23=549'
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): I'm going to connect 20 masks, each 15.25 centimeters (cm) long. How many centimeters (cm) do I need to attach the masks so that the total is 248 centimeters (cm)?
Question (KO): 길이가 15.25 센티미터(㎝) 인 마스크 20 장을 겹치게 이어 붙이려고 합니다. 이어 붙인 마스크의 전체 길이가 248 센티미터(㎝) 가 되도록 하려면 모두 몇 센티미터(㎝) 씩 겹치게 이어 붙여야 합니까?

Answer: 3

Solution (Python):
var_a = 15.25
var_b = 248
var_c = 15.25
var_d = var_b - var_c
var_e = 20
var_f = 1
var_g = var_e - var_f
var_h = var_d / var_g
var_i = var_a - var_h
print(int(var_i))
Category: Correspondence

Question (EN): There are four-digit numbers that are divisible by 12. If the thousands digit is 2, how many of the four-digit numbers are there?
Question (KO): 12로 나누어 떨어지는 네 자리 수가 있습니다. 천의 자리 숫자가 2일때 이러한 네 자리 수는 모두 몇 개인가요?

Answer: 83

Solution (Python):
var_a = 2
var_b = 1000
var_c = var_a * var_b
var_d = 2
var_e = 1000
var_f = var_d * var_e
var_g = 999
var_h = var_f + var_g
var_i = 1
list_a = [i for i in range(var_c, var_h + 1, var_i)]
var_j = 12
list_b = []
var_j = int(var_j)
for i in list_a:
    i = int(i)
    if i % var_j == 0:
        list_b.append(i)
var_k = len(list_b)
print(int(var_k))
Category: Arithmetic calculation

Question (EN): How many three-digit numbers are divisible by the three numbers 2, 3, and 9?
Question (KO): 3개의 수 2, 3, 9로 나누어떨어질 수 있는 세 자리 수는 모두 몇 개 있습니까?

Answer: 50

Solution (Python):
var_a = 100
var_b = 999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 2
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 = 3
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 = 9
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 = len(list_d)
print(int(var_g))
Category: Correspondence

Question (EN): I mistakenly subtracted a certain number from 63 when I had to subtract this number from 36, and it became 70. How much is it if calculated correctly?
Question (KO): 36에 어떤 수를 빼야 할 것을 잘못하여 63에 어떤 수를 뺐더니 70이 되었습니다. 바르게 계산하면 얼마인지 구하시오.

Answer: 43

Solution (Python):
var_a = 36
var_b = 63
var_c = 70
var_d = var_b - var_c
var_e = var_a - var_d
print(int(var_e))
Category: Geometry

Question (EN): There is a box with a base in the shape of an equilateral triangular prism with a side of 13/12 meters (m). What are the minimum meters (m) of ribbon required to wrap the ribbon around the perimeter of this box?
Question (KO): 밑면의 한 변의 길이가 13/12미터(m)이며 정삼각기둥 모양인 상자가 있습니다. 이 상자의 둘레를 따라 리본을 두를 때 리본은 최소 몇 미터(m) 필요합니까?

Answer: 3.25

Solution (Python):
var_a = 1.0833333333333333
var_b = 3
var_c = var_a * var_b
print('{:.2f}'.format(round(var_c+1e-10,2)))
Category: Geometry

Question (EN): Find the area of a rectangle whose width is 25 centimeters (cm) and its length is 20 centimeters (cm).
Question (KO): 가로의 길이가 25센티미터(㎝)이고, 세로의 길이가 20센티미터(㎝)인 직사각형의 넓이를 구하시오.

Answer: 500

Solution (Python):
var_a = 25
var_b = 20
var_c = var_a * var_b
print(int(var_c))
Category: Comparison

Question (EN): Jiwoo drank 1100 milliliters (ml) of milk, 3 liters (l) and 400 milliliters (ml) of juice. When Jungkook drank 4 liters (l) and 800 milliliters (ml) of water, who drank more?
Question (KO): 지우는 1100밀리리터(㎖) 우유와 3리터(L) 400밀리리터(㎖)의 주스를 마셨습니다. 정국이는 4리터(L) 800밀리리터(㎖)의 물을 마셨을 때 누가 더 많이 마셨을까요?

Answer: Jungkook

Solution (Python):
var_a = 'Jungkook'
var_b = 'Jiwoo'
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: Comparison

Question (EN): When students standing in a line, Yoojung was at the very back. And there are 8 students standing between Eunjeong and Yoojung. If Eunjeong was at 5th place from the front, how many students were there?
Question (KO): 학생들이 한 줄로 서 있습니다. 유정이는 맨 뒤에 서 있습니다. 은정이는 앞에서 5번째에 서 있습니다. 은정이와 유정이 사이에 8명이 서 있을 때, 줄을 서 있는 학생은 모두 몇 명입니까?

Answer: 14

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

Question (EN): After arranging several cans of soda in a square shape, there were 6 cans left. So, I tried to increase the width and length by one row, but 11 cans were inadequate. If you arrange these cans in 7 rows, how many cans are there in one row?
Question (KO): 음료수 여러 캔을 정사각형 모양으로 빈틈없이 정렬하니 6개의 캔이 남았습니다. 그래서 가로 한 변과 세로 한 변을 1열씩 늘리려 하였지만 11개의 캔이 부족하였습니다. 이 캔들을 7열로 세운다면 1열에 몇 캔씩 있을까요?

Answer: 10

Solution (Python):
var_a = 6
var_b = 11
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
var_h = 2
var_i = var_g ** var_h
var_j = 6
var_k = var_i + var_j
var_l = 7
var_m = var_k / var_l
print(int(var_m))
Category: Comparison

Question (EN): Jungkook is taller than Yoongi. Namjoon is taller than Jungkook and shorter than Yuna. Which of the 4 people is the shortest?
Question (KO): 정국이는 윤기보다 키가 큽니다. 남준이는 정국이보다 키가 크고 유나보다 키가 작습니다. 4명 중 키가 가장 작은 사람은 누구입니까?

Answer: Yoongi

Solution (Python):
var_a = 'Jungkook'
var_b = 'Yoongi'
var_c = 'Namjoon'
var_d = 'Yuna'
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 = 'Jungkook'
var_f = 'Yoongi'
var_g = '>'
var_h = 'Namjoon'
var_i = 'Jungkook'
var_j = '>'
var_k = 'Namjoon'
var_l = 'Yuna'
var_m = '<'
list_b= []
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)
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_b.append(var_e)
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_n = len(list_c)
var_o = list_c[var_n-1]
print(var_o)
Category: Correspondence

Question (EN): I have a three-digit A27. When I round down this number from the hundreds place, I get 200. Find A.
Question (KO): 세 자리 수 A27이 있습니다. 이 수를 백의 자리에서 버림했을 때 200을 얻을 수 있습니다. A를 구하시오.

Answer: 2

Solution (Python):
var_a = 'A27'
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 = 200
list_b = []
for i in list_a:
    if i >= var_b:
        list_b.append(i)
var_c = 200
var_d = 100
var_e = var_c + var_d
list_c = []
for i in list_b:
    if i < var_e:
        list_c.append(i)
var_f = 'A'
var_a = str(var_a)
var_f = str(var_f)
unk_idx = var_a.index(var_f)
var_g = 0
for elem in list_c:
    elem = str(elem)
    var_g = int(elem[unk_idx])
print(int(var_g))
Category: Possibility

Question (EN): You are trying to create a three-digit number by drawing 3 of the 4 number cards 1, 3, 4, 7, and using them only once. How many possible numbers are greater than 360 and less than or equal to 455?
Question (KO): 4 장의 숫자 카드 1, 3, 4, 7 중 3 장을 뽑아 한 번씩만 사용하여 세 자리 수를 만들려고 합니다. 만들 수 있는 수 중에서 360 초과 455 이하인 수는 모두 몇 개입니까?

Answer: 6

Solution (Python):
var_a = 1
var_b = 3
var_c = 4
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 = 3
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 = 360
list_c = []
for i in list_b:
    if i > var_f:
        list_c.append(i)
var_g = 455
list_d = []
for i in list_c:
    if i <= var_g:
        list_d.append(i)
var_h = len(list_d)
print(int(var_h))
Category: Correspondence

Question (EN): Subtracting 7 from a number gives 9. What is the product of multiplying a number by 5?
Question (KO): 어떤 수에서 7을 뺐더니 9가 되었습니다. 어떤 수를 5에 곱한 결과값은 얼마일까요?

Answer: 80

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

Question (EN): There are three numbers 0.8, 1/2, and 9. Which of the numbers greater than or equal to 2?
Question (KO): 3개의 숫자 0.8, 1/2, 9가 있습니다. 2보다 크거나 같은 수 중 가장 작거나 같은 수는 얼마인가요?

Answer: 9

Solution (Python):
var_a = 0.8
var_b = 0.5
var_c = 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 = 2
list_b = []
for i in list_a:
    if i >= var_d:
        list_b.append(i)
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[var_e-1]
print(int(var_f))