philschmid/DMath huggingface dataset:
Category: Comparison

Question (EN): The shop sells gems A, B, C, and D. A is more expensive than D, B is more expensive than A, and C is the cheapest. What is the most expensive jewel?
Question (KO): 상점에서 보석 A, B, C, D를 팔고 있습니다. A는 D보다 비싸고, B는 A보다 비싸며, C가 가장 쌉니다. 가장 비싼 보석은 무엇인가요?

Answer: B

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 = 'A'
var_f = 'D'
var_g = '>'
var_h = 'B'
var_i = 'A'
var_j = '>'
var_k = 'C'
var_l = 'A'
var_m = '<'
var_n = 'C'
var_o = 'B'
var_p = '<'
var_q = 'C'
var_r = 'D'
var_s = '<'
list_b= []
if "/" in str(var_s):
    var_s = eval(str(var_s))
list_b.append(var_s)
if "/" in str(var_r):
    var_r = eval(str(var_r))
list_b.append(var_r)
if "/" in str(var_q):
    var_q = eval(str(var_q))
list_b.append(var_q)
if "/" in str(var_p):
    var_p = eval(str(var_p))
list_b.append(var_p)
if "/" in str(var_o):
    var_o = eval(str(var_o))
list_b.append(var_o)
if "/" in str(var_n):
    var_n = eval(str(var_n))
list_b.append(var_n)
if "/" in str(var_m):
    var_m = eval(str(var_m))
list_b.append(var_m)
if "/" in str(var_l):
    var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
    var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
    var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
    var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
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_t = 1
var_u = list_c[var_t-1]
print(var_u)
Category: Possibility

Question (EN): Find the sum of the third largest number and the third smallest number using all of the given number marbles 7, 6, 8, and 5 once.
Question (KO): 주어진 숫자 구슬 7, 6, 8, 5를 한 번씩 모두 사용하여 만든 수 중 세 번째 큰 수와 세 번째 작은 수의 합을 구하시오.

Answer: 14443

Solution (Python):
var_a = 7
var_b = 6
var_c = 8
var_d = 5
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)
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 = 3
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
var_h = 3
list_d=list_b.copy()
list_d.sort()
var_i = list_d[var_h-1]
var_j = var_g + var_i
print(int(var_j))
Category: Possibility

Question (EN): Find the sum of the largest two-digit number and the third smallest two-digit number when making a two-digit number by allowing the repetition of the five number cards 1, 3, 5, 8, and 9.
Question (KO): 1, 3, 5, 8, 9의 5장의 숫자 카드를 중복을 사용하여 두 자리 수를 만들 때 가장 큰 두 자리 수와 세 번째로 가장 작은 두 자리 수의 합을 구하시오.

Answer: 114

Solution (Python):
var_a = 1
var_b = 3
var_c = 5
var_d = 8
var_e = 9
list_a= []
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 2
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=var_f))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = 3
list_d=list_b.copy()
list_d.sort()
var_j = list_d[var_i-1]
var_k = var_h + var_j
print(int(var_k))
Category: Correspondence

Question (EN): Rounding a number to 2 decimal places gives 1.7. What is the result of subtracting the smallest of these numbers from the largest of these numbers? Please indicate including the decimal point.
Question (KO): 어떤 소수 두 자리 수를 소수 2번째 자리에서 반올림하면 1.7이 됩니다. 이러한 수 중 가장 큰 값에서 가장 작은 값을 빼면 무엇이 되는지 구하시오. 단, 소수점을 포함하여 나타내시오.

Answer: 0.09

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

Question (EN): The length of the tape Jimin used is 26 millimeters (mm) longer than the length of the tape Jungkook used. If Jungkook used 45 centimeters (cm) of tape, how many centimeters (m) did Jimin use?
Question (KO): 지민이가 사용한 테이프 길이는 정국이가 사용한 테이프 길이보다 26밀리미터(㎜)깁니다. 정국이가 테이프를 45센티미터(㎝) 사용했다면 지민이가 사용한 테이프 길이는 몇 센티미터(m)입니까?

Answer: 47.6

Solution (Python):
var_a = 45
var_b = 26
var_c = 10
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): If 6 is the result of subtracting 2 from a number, instead of adding 2, write down what the number is.
Question (KO): 6은 어떤 수에 2를 더해야 할것을 잘못하여 2를 빼서 나온 결과입니다. 어떤 수를 구하세요.

Answer: 8

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

Question (EN): There are three given numbers: 10, 11 and 12. What is the remainder if you divide the largest number by the second largest number?
Question (KO): 3개의 수 10, 11, 12가 있습니다. 그 중에서 가장 큰 수와 2번째로 큰 수로 나눈 나머지는 얼마입니까?

Answer: 1

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

Question (EN): 180 bottles of milk are divided into 3 cartons, and the bottles of milk in each carton are equally divided into 4 bags. How many bottles of milk are in one bag?
Question (KO): 180개의 우유를 3개의 상자에 나누어 담고, 각 상자에 담긴 우유는 4개의 봉투에 똑같이 나누어 담았습니다. 한 개의 봉투에 담긴 우유 개수는 몇 개 입니까?

Answer: 15

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

Question (EN): Find the number of even numbers from 1 to 6 and from 11 to 16.
Question (KO): 1 이상 6 이하, 11 이상 16 이하의 수 중 짝수의 개수를 구하시오.

Answer: 6

Solution (Python):
var_a = 1
var_b = 6
list_a = []
if var_a%2!=0:
    for i in range(var_a+1, var_b+1, 2):
        list_a.append(i)
else:
    for i in range(var_a, var_b+1, 2):
        list_a.append(i)
var_c = len(list_a)
var_d = 11
var_e = 16
list_b = []
if var_d%2!=0:
    for i in range(var_d+1, var_e+1, 2):
        list_b.append(i)
else:
    for i in range(var_d, var_e+1, 2):
        list_b.append(i)
var_f = len(list_b)
var_g = var_c + var_f
print(int(var_g))
Category: Correspondence

Question (EN): 13.26 multiplied by some number is 132.6. Find the value of 0.064 multiplied by that number.
Question (KO): 13.26 에 어떤 수를 곱하였더니 132.6 이 되었습니다. 0.064 에 어떤 수를 곱한 값을 구하시오.

Answer: 0.64

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

Question (EN): When 23 is divided by 6, the quotient and remainder are A and B, respectively. Find A at this time.
Question (KO): 23를 6으로 나누면 몫과 나머지가 각각 A와 B가 됩니다. 이 때 A를 구하시오.

Answer: 3

Solution (Python):
var_a = 23
var_b = 6
var_c = var_a // var_b
print(int(var_c))
Category: Correspondence

Question (EN): When A is divided by 6, the quotient is 3 and the remainder is 2. A is a natural number. Find A at this time.
Question (KO): A를 6으로 나누면 몫은 3이고 나머지는 2가 됩니다. A는 자연수입니다. 이 때 A를 구하시오.

Answer: 20

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

Question (EN): You are given three numbers 4, 2 and 5. How many three-digit numbers can you make by using the given numbers once each?
Question (KO): 3개의 숫자 4, 2, 5가 주어져 있습니다. 주어진 숫자를 한 번씩 사용하여 만들 수 있는 세 자리 수는 모두 몇 개입니까?

Answer: 6

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

Question (EN): The parking fee for this parking lot is 500 won for 30 minutes, and 200 won is added for every 10 minutes after 30 minutes. If Ha-Young's father parked in this parking lot for 1 hour and 20 minutes, what is the parking fee?
Question (KO): 어떤 주차장의 주차 요금은 30 분 동안 500 원이고, 30 분 초과시 10 분마다 200 원씩 추가됩니다. 하영이 아버지께서 이 주차장에 1 시간 20 분 동안 주차를 하 였다면 주차 요금은 얼마입니까?

Answer: 1500

Solution (Python):
var_a = 1
var_b = 60
var_c = var_a * var_b
var_d = 20
var_e = var_c + var_d
var_f = 30
var_g = var_e - var_f
var_h = 10
var_i = var_g // var_h
var_j = 200
var_k = var_i * var_j
var_l = 500
var_m = var_k + var_l
print(int(var_m))
Category: Possibility

Question (EN): What is the second largest three-digit number where each digit is one of the digits 1, 4, 5, or 9 and the tens digit is 9? However, each number is used only once.
Question (KO): 각 자리수가 1, 4, 5, 9 중 하나로 구성되어 있고, 십의 자리수가 9인 두 번째 큰 세 자리수는 얼마입니까? 단, 각 숫자는 한 번씩만 쓰였습니다.

Answer: 591

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

Question (EN): When 32+A7B=705, find B.
Question (KO): 32+A7B=705일 때, B를 구하시오.

Answer: 3

Solution (Python):
var_a = '32+A7B=705'
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): Hyunji gave 7 of the 20 pencils to Hyeonseung and again received 5 from Taewoo. Find how many pencils Hyunji has.
Question (KO): 현지는 20개의 연필 중 7개를 현승이에게 주었고 다시 태우에게 5개를 받았다. 현지가 가지고 있는 연필은 모두 몇 개인지 구하시오.

Answer: 18

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

Question (EN): A stick with a total length of 950 centimeters (cm) was divided in two. If the long bar is 150 centimeters (cm) longer than the short bar, how many centimeters (cm) is the short bar?
Question (KO): 전체 길이가 950센티미터(㎝)인 막대기를 둘로 나눴다. 긴 막대가 짧은 막대보다 150센티미터(㎝) 더 길다면 짧은 막대는 몇 센티미터(㎝)입니까?

Answer: 400

Solution (Python):
var_a = 950
var_b = 150
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e))
Category: Comparison

Question (EN): There are 50 red balloons and 26 yellow balloons. There are 8 more blue ballons than yellow balloons. Which colored balloon is the most?
Question (KO): 빨간 풍선이 50개, 노란 풍선이 26개가 있습니다. 파란 풍선은 노란 풍선보다 8개 많습니다. 가장 많은 색깔의 풍선은 무엇입니까?

Answer: red

Solution (Python):
var_a = 'red'
var_b = 'yellow'
var_c = 'blue'
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 = 50
var_e = 26
var_f = 26
var_g = 8
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)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
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): How many diagonals can you draw in a pentagon?
Question (KO): 오각형 내에 그릴 수 있는 대각선의 개수는?

Answer: 5

Solution (Python):
var_a = 5
var_b = 5
var_c = 3
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: Arithmetic calculation

Question (EN): What is the largest three-digit number divisible by 6?
Question (KO): 6으로 나누어 떨어질 수 있는 세 자리 수 중 가장 큰 수는?

Answer: 996

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 = 6
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 = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
print(int(var_f))
Category: Possibility

Question (EN): Find the number of 3-digit integers that can be made by drawing 3 cards from 4 cards each containing the numbers 0, 1, 2, and 3.
Question (KO): 0, 1, 2, 3의 수가 각각 적힌 4장의 카드에서 3장을 뽑아 만들 수 있는 세 자리의 정수의 개수를 구하시오.

Answer: 18

Solution (Python):
var_a = 0
var_b = 1
var_c = 2
var_d = 3
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 = len(list_b)
print(int(var_f))
Category: Comparison

Question (EN): Nine people are lined up in order from shortest to tallest. Hoseok stands at the very back. If they line up again in order from tallest to shortest, what number will Hoseok be from the front?
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: Arithmetic calculation

Question (EN): After school, Yewon plans to stop by the kindergarten to meet her sister and go home with her. The distance from Yewon's school to the kindergarten is 1 kilometer (km) and 700 meters (m), and the distance from the kindergarten to her house is 900 meters (m). How far is the midpoint of the distance starting from Yewon's school through the kindergarten and to her house, from Yewon's school in meters (m)?
Question (KO): 예원이는 학교가 끝난 후 유치원에 들러서 동생을 만나 집에 함께 가기로 했습니다. 예원이의 학교에서 유치원까지의 거리는 1킬로미터(㎞) 700미터(m)이고, 유치원에서 집까지의 거리는 900미터(m)입니다. 예원이네 학교에서 유치원을 거쳐 집까지 가는 거리의 중간 지점은 학교에서 몇 미터(m)입니까?

Answer: 1300

Solution (Python):
var_a = 1
var_b = 1000
var_c = var_a * var_b
var_d = 700
var_e = var_c + var_d
var_f = 900
var_g = var_e + var_f
var_h = 2
var_i = var_g / var_h
print(int(var_i))
Category: Comparison

Question (EN): You took Korean, Mathematics, English, Science, and History tests in order. Which of the following subjects was the third test taken?
Question (KO): 국어, 수학, 영어, 과학, 사회 시험을 순서대로 봤습니다. 다음 과목들 중 3번째로 치른 시험은 무엇입니까?

Answer: English

Solution (Python):
var_a = 'Korean'
var_b = 'Mathematics'
var_c = 'English'
var_d = 'Science'
var_e = 'History'
list_a= []
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 3
var_g = list_a[var_f-1]
print(var_g)
Category: Geometry

Question (EN): There is a sign in the shape of a square with a side of 90 centimeters (cm). If you decide to hang small light bulbs every 3 centimeters (cm) along the edges of this sign, how many light bulbs will you need in total?
Question (KO): 한 변의 길이가 90센티미터(㎝)인 정사각형 모양의 간판이 있습니다. 이 간판의 가장자리에 3센티미터(㎝) 간격으로 작은 전구를 달기로 했을 때, 전구는 모두 몇 개가 필요합니까?

Answer: 120

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

Question (EN): What is the largest minus the smallest seven-digit number that can be formed by using 3, 9, 6, 0, 5, 1, and 7 only once?
Question (KO): 3, 9, 6, 0, 5, 1, 7을 한 번씩만 사용하여 만들 수 있는 일곱 자리 수 중 가장 큰 수에서 가장 작은 수를 뺀 값은 얼마입니까?

Answer: 8729631

Solution (Python):
var_a = 3
var_b = 9
var_c = 6
var_d = 0
var_e = 5
var_f = 1
var_g = 7
list_a= []
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_h = 7
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_h))
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_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[-var_i]
var_k = 1
list_d=list_b.copy()
list_d.sort()
var_l = list_d[var_k-1]
var_m = var_j - var_l
print(int(var_m))
Category: Correspondence

Question (EN): A, B, C are different numbers from 0 to 9. Find B from the two-digit addition formula AB+CB=CC6.
Question (KO): A, B, C는 0에서 9까지의 서로 다른 숫자입니다. 두 자리 수끼리의 덧셈식 AB+CB=CC6에서 B를 구하시오.

Answer: 8

Solution (Python):
var_a = 'AB+CB=CC6'
var_b = 'B'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
    if v in variable_candi:
        ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
    temp = var_a
    for i, (k, _) in enumerate(ans_dict.items()):
        temp = temp.replace(k, str(c[i]))
    term_list = []
    op_list = []
    temp_c = ''
    for tc in temp:
        if tc not in '+-*/=><().':
            temp_c += tc
        else:
            op_list.append(tc)
            term_list.append(temp_c)
            temp_c = ''
    term_list.append(temp_c)
    new_eq = ''
    for i in range(len(op_list)):
        new_eq += str(int(term_list[i]))+op_list[i]
    new_eq += str(int(term_list[-1]))
    if len(new_eq) == len(var_a):
        new_eq=new_eq.replace('=', '==')
        new_eq=new_eq.replace('>==', '>=')
        new_eq=new_eq.replace('<==', '<=')
        eval_result = False
        try:
            eval_result = eval(new_eq)
        except:
            pass
        if eval_result:
            for i, (k, _) in enumerate(ans_dict.items()):
                ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c))
Category: Geometry

Question (EN): When three points are not on a straight line, find the number of line segments that can be formed from these three points.
Question (KO): 어느 세 점은 한 직선 위에 있지 않습니다. 이 세 점으로 만들 수 있는 선분의 개수를 구하시오.

Answer: 3

Solution (Python):
var_a = 3
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): There are 80 red balls and 40 blue balls. There are 12 fewer red balls than blue and white balls combined. How many white balls are there?
Question (KO): 빨간색 공 80개와 파란색 공 40개가 있습니다. 빨간색 공은 파란색 공과 흰색 공을 합한 것보다 12개 더 적습니다. 흰색 공은 몇 개입니까?

Answer: 52

Solution (Python):
var_a = 80
var_b = 12
var_c = var_a + var_b
var_d = 40
var_e = var_c - var_d
print(int(var_e))
Category: Comparison

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

Answer: 4

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