philschmid/DMath huggingface dataset:
Category: Correspondence

Question (EN): 5A8-21B=364. How much is A?
Question (KO): 5A8-21B=364입니다. A는 얼마인가요?

Answer: 7

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

Question (EN): I put 25 apples each in boxes, but there are 24 left. If the number of apples is greater than 300, find the minimum number of apples.
Question (KO): 사과를 박스에 25개씩 나누어 담았는데 24개가 남았다. 사과의 개수는 300개 보다 많다고 할 때, 사과는 최소 몇 개인지 구하시오.

Answer: 324

Solution (Python):
var_a = 300
var_b = 24
var_c = var_a + var_b
print(int(var_c))
Category: Correspondence

Question (EN): A particular number should have been multiplied by 40, but when I accidentally subtracted 21 from that number, the result was 52. Find the correct calculation result.
Question (KO): 40을 어떤 수에 곱해야 할 것을 잘못하여 21을 어떤 수에 뺀 결과는 52가 나옵니다. 바르게 계산하면 얼마인가요?

Answer: 2920

Solution (Python):
var_a = 52
var_b = 21
var_c = var_a + var_b
var_d = 40
var_e = var_c * var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): What is the value if you jump 4 times reducing 10 each jump from 320?
Question (KO): 320에서 10씩 작아지게 4번 뛰어서 세면 얼마입니까?

Answer: 280

Solution (Python):
var_a = 320
var_b = 10
var_c = 4
var_d = var_b * var_c
var_e = var_a - var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): There are five numbers 10, 11, 12, 13, and 14. What is the sum of the second largest number and the smallest number?
Question (KO): 5개의 수 10, 11, 12, 13, 14가 있습니다. 그 중에서 2번째로 큰 수와 가장 작은 수의 합은 얼마입니까?

Answer: 23

Solution (Python):
var_a = 10
var_b = 11
var_c = 12
var_d = 13
var_e = 14
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]
var_h = 1
list_c=list_a.copy()
list_c.sort()
var_i = list_c[var_h-1]
var_j = var_g + var_i
print(int(var_j))
Category: Arithmetic calculation

Question (EN): What is the smallest three-digit number divisible by the four numbers 6, 5, 8, and 9?
Question (KO): 4개의 수 6, 5, 8, 9로 나누어 떨어질 수 있는 수 중 가장 작은 세 자리 수는 무엇입니까?

Answer: 360

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 = 5
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 = 8
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 = 9
list_e = []
var_g = int(var_g)
for i in list_d:
    i = int(i)
    if i % var_g == 0:
        list_e.append(i)
var_h = 1
list_f=list_e.copy()
list_f.sort()
var_i = list_f[var_h-1]
print(int(var_i))
Category: Arithmetic calculation

Question (EN): There are 7 pieces of paper and 15 straws. How many more straws are there than paper?
Question (KO): 종이가 7개, 빨대가 15개 있습니다. 빨대는 종이보다 몇 개 더 많습니까?

Answer: 8

Solution (Python):
var_a = 15
var_b = 7
var_c = var_a - var_b
print(int(var_c))
Category: Correspondence

Question (EN): Subtracting 50 from a certain number and dividing it by 4, multiplying by 3 plus 28 equals 73. Find the certain number.
Question (KO): 어떤 수에서 50을 뺀 후 4로 나누고, 3을 곱한 값에 28을 더한 값이 73입니다. 어떤 수를 구하시오.

Answer: 110

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

Question (EN): When only even numbers are selected among all natural numbers, find the sum up to the 123rd in descending order.
Question (KO): 모든 자연수들 중 짝수만을 골랐을 때, 작은 순서대로 123번째까지의 합을 구하시오.

Answer: 15252

Solution (Python):
var_a = 2
var_b = 2
var_c = 123
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e * var_f
var_h = var_b + var_g
var_i = 2
list_a = [i for i in range(var_a, var_h + 1, var_i)]
list_a = [float(i) for i in list_a]
var_j = sum(list_a)
print(int(var_j))
Category: Arithmetic calculation

Question (EN): Lettuce, which was sold at a store for 2,500 won per kilogram (kg), is being sold at a discount of 0.3 of the initial price. Find how much money you need to buy 1.8 kilograms (kg) of lettuce at a discounted price.
Question (KO): 어느 가게에서 1킬로그램(㎏)에 2500원을 받고 팔던 상추를 파는 가격의 0.3만큼 할인하여 팔고 있습니다. 상추 1.8킬로그램(㎏)을 할인된 가격으로 사려면 얼마가 필요한지 구하시오.

Answer: 3150

Solution (Python):
var_a = 2500
var_b = 1
var_c = 0.3
var_d = var_b - var_c
var_e = var_a * var_d
var_f = 1.8
var_g = var_e * var_f
print(int(var_g))
Category: Possibility

Question (EN): What is the smallest number that can be formed by using all odd numbers less than 10 once?
Question (KO): 10이하 홀수를 한 번씩 모두 이용하여 만들 수 있는 가장 작은 수는 얼마인가?

Answer: 13579

Solution (Python):
var_a = 0
var_b = 10
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)
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_c))
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_d = 1
list_c=list_b.copy()
list_c.sort()
var_e = list_c[var_d-1]
print(int(var_e))
Category: Arithmetic calculation

Question (EN): How many cars are left in the parking lot after 8 out of 24 cars went out and another 6 went out?
Question (KO): 24대의 자동차 중 8대가 나가고 6대가 또 나간 후 주차장에 남아있는 자동차는 몇 대입니까?

Answer: 10

Solution (Python):
var_a = 24
var_b = 8
var_c = var_a - var_b
var_d = 6
var_e = var_c - var_d
print(int(var_e))
Category: Geometry

Question (EN): If you put 3 cubes with each side 8cm long in a row, you will get 1 cuboid. What is the surface area of the cuboid you created, in square centimeters (cm2)?
Question (KO): 한 모서리의 길이가 8㎝인 정육면체 3개를 한 줄로 놓으면 1개의 직육면체가 만들어집니다. 만들어진 직육면체의 겉넓이는 몇 제곱센티미터입니까?

Answer: 896

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

Question (EN): If the lengths of the two diagonals of a rhombus with an area of 3 square centimeters (cm2) are each multiplied by 5, how many square centimeters (cm2) will be the area?
Question (KO): 넓이가 3제곱센티미터(㎠)인 마름모의 두 대각선의 길이를 각각 5배로 늘리면 넓이는 몇 제곱센티미터(㎠)가 되는지 구하시오.

Answer: 75

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

Question (EN): Customers stand in line at the restaurant. If 11 people are standing behind the person in line at the front, how many customers are in line?
Question (KO): 식당에 손님들이 한 줄로 서 있습니다. 맨 앞에 줄을 선 사람 뒤에 11명이 서 있을 때, 줄을 서 있는 손님은 모두 몇 명입니까?

Answer: 12

Solution (Python):
var_a = 11
var_b = 1
var_c = var_a + var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): If the sum of three consecutive even numbers is 1194, what is the smallest even number?
Question (KO): 연속된 짝수 3개의 합이 1194일 때, 가장 작은 짝수는 얼마입니까?

Answer: 396

Solution (Python):
var_a = 1194
var_b = 0
var_c = 3
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e * var_f
var_h = 2
list_a = [i for i in range(var_b, var_g + 1, var_h)]
list_a = [float(i) for i in list_a]
var_i = sum(list_a)
var_j = var_a - var_i
var_k = 3
var_l = var_j / var_k
print(int(var_l))
Category: Arithmetic calculation

Question (EN): I went up the stairs at 2 kilometers per hour (km), but when I came down, I walked 2 kilometers (km) further at 3 kilometers per hour (km), and it took 4 hours. What is the distance of coming down the stairs?
Question (KO): 계단을 올라갈때는 시속 2킬로미터(㎞)로, 내려올때는 올라갈때 보다 2킬로미터(㎞) 더 먼 길을 시속 3킬로미터(㎞)로 걸어내려 왔더니, 4시간이 걸렸다. 내려온 거리는 얼마인가?

Answer: 6

Solution (Python):
var_a = 2
var_b = 4
var_c = var_a * var_b
var_d = 2
var_e = var_c + var_d
var_f = 3
var_g = 2
var_h = var_f + var_g
var_i = var_e / var_h
var_j = 3
var_k = var_i * var_j
print(int(var_k))
Category: Possibility

Question (EN): What is the smallest number with the units digit of 5 using 3 of 4, 6, 5, and 0?
Question (KO): 4, 6, 5, 0 중 3개를 사용하여 일의 자리 숫자가 5인 가장 작은 수는 무엇입니까?

Answer: 405

Solution (Python):
var_a = 4
var_b = 6
var_c = 5
var_d = 0
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 = 1
var_g = 5
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 = 1
list_d=list_c.copy()
list_d.sort()
var_i = list_d[var_h-1]
print(int(var_i))
Category: Geometry

Question (EN): You lined up Jaewoong's classmates in a square. When 10 students are lined up horizontally and vertically, how many students are inside the circumference?
Question (KO): 재웅이 반 학생들을 정사각형으로 줄세웠습니다. 가로와 세로 모두 10명 씩 줄섰을 때, 둘레를 제외한 안쪽의 학생들은 모두 몇 명일까요?

Answer: 64

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

Question (EN): To make a particular number equal to 102, it should be divided by 23, subtracted from 67, and multiplied by 2. Find the particular number.
Question (KO): 어떤 수가 102가 되기 위해서는 23으로 나누고 67을 뺀 후 2를 곱해주어야 합니다. 어떤 수를 구하시오.

Answer: 2714

Solution (Python):
var_a = 102
var_b = 2
var_c = var_a / var_b
var_d = 67
var_e = var_c + var_d
var_f = 23
var_g = var_e * var_f
print(int(var_g))
Category: Comparison

Question (EN): Jungkook ate 3 out of 6 apples. If Yoongi has 4 apples and Yuna has 5 apples, who has the most apples?
Question (KO): 정국이는 6개의 사과에서 3개를 먹었습니다. 윤기가 가진 사과가 4개, 유나가 가진 사과가 5개라면 누가 가장 많은 사과를 가지고 있나요?

Answer: Yuna

Solution (Python):
var_a = 'Jungkook'
var_b = 'Yoongi'
var_c = 'Yuna'
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 = 6
var_e = 3
var_f = var_d - var_e
var_g = 4
var_h = 5
list_b= []
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)
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): Students are standing in 8 rows of 4 each. Find the number of students standing 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): After the same number of boys and girls had left, there were 30 students left in the auditorium. How many girls left the auditorium when there were initially 24 boys and 14 girls in the auditorium?
Question (KO): 같은 수의 남학생과 여학생이 나간 뒤 강당에 30명의 학생이 남았습니다. 처음에 강당에 남학생 24명과 여학생 14명이 있었을 때 강당에서 나간 여학생은 몇명입니까?

Answer: 4

Solution (Python):
var_a = 24
var_b = 14
var_c = var_a + var_b
var_d = 30
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
print(int(var_g))
Category: Comparison

Question (EN): Jimin and Yoojeong each have a strap. If Jimin has a 59 centimeters (cm) strap and Yoojeong has a 53 centimeters (cm) strap, who has the shorter strap?
Question (KO): 지민, 유정이 각자 끈을 가지고 있습니다. 지민이는 59센티미터(cm) 유정이는 53센티미터(cm)의 끈을 가지고 있다면 누가 더 짧은 끈을 가지고 있습니까?

Answer: Yoojeong

Solution (Python):
var_a = 'Jimin'
var_b = 'Yoojeong'
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 = 59
var_d = 53
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-1]
var_g = list_b.index(var_f)+1
var_h = list_a[var_g-1]
print(var_h)
Category: Comparison

Question (EN): Which figure has a longer perimeter, a square with a side length of 3 centimeters (cm) or an equilateral-triangle with a side length of 5 centimeters (cm)?
Question (KO): 한 변의 길이가 3센티미터(㎝)인 정사각형과 한 변의 길이가 5센티미터(㎝)인 정삼각형 중에서 둘레의 길이가 더 긴 도형은 어느 것입니까?

Answer: equilateral-triangle

Solution (Python):
var_a = 'square'
var_b = 'equilateral-triangle'
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 = 3
var_d = 4
var_e = var_c * var_d
var_f = 5
var_g = 3
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): You want to load three cargoes, A, B, and C, into the compartment. Cargo C is smaller than Cargo A, and Cargo A is smaller than Cargo B. If you want to load the biggest cargo first, which cargo should be loaded first?
Question (KO): 화물칸에 A, B, C 3개의 화물을 실으려고 합니다. C 화물은 A 화물보다 작고, A 화물은 B 화물보다 작습니다. 가장 큰 화물을 먼저 실으려고 할 때, 가장 먼저 실어야 하는 화물은 무엇일까요?

Answer: B

Solution (Python):
var_a = 'A'
var_b = 'B'
var_c = 'C'
list_a= []
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 'A'
var_e = 'B'
var_f = '<'
var_g = 'C'
var_h = 'A'
var_i = '<'
list_b= []
if "/" in str(var_i):
    var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_b.append(var_e)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
    if cond_ in ("<", ">", "="):
        operand_right = temp_stack.pop()
        operand_left = temp_stack.pop()
        if cond_ == "=":
            cond_ = "=="
        conditions.append(f"{operand_left} {cond_} {operand_right}")
    else:
        if not cond_.isdigit():
            cond_ = "{" + cond_ + "}"
        temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
    item_name_index_dict = dict(zip(items_name_list, perm))
    formatted_conditions = \
        [condition.format_map(item_name_index_dict) for condition in conditions]
    if all(map(eval, formatted_conditions)):
        break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_j = 1
var_k = list_c[var_j-1]
print(var_k)
Category: Correspondence

Question (EN): Taehyung wants to divide a number by 6. But when he accidentally multiplied it by 5, the result was 30. Find the correctly calculated value.
Question (KO): 태형이는 어떤 수에 6을 나누어 주려고 합니다. 하지만 실수로 5를 곱했더니 결과는 30이 되었습니다. 바르게 계산한 결과를 구하세요.

Answer: 1

Solution (Python):
var_a = 30
var_b = 5
var_c = var_a / var_b
var_d = 6
var_e = var_c / var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Eunji is 7 years old this year. Yuna is 5 years older than Eunji. What is the sum of Eunji and Yuna's ages this year?
Question (KO): 올해 은지의 나이는 7살입니다. 유나는 은지보다 5살 더 많습니다. 올해 은지와 유나의 나이의 합은 몇 살입니까?

Answer: 19

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

Question (EN): Yewon and Dongju had a fast reading competition. If it took Yewon 16.23 seconds and Dongju 16.19 seconds to read the given sentence, who read faster?
Question (KO): 예원이와 동주가 문장 빨리 읽기 대결을 하였습니다. 정해진 문장을 읽는 데 예원이는 16.23초 걸렸고 동주는 16.19초 걸렸다면 누가 더 빨리 읽었습니까?

Answer: Dongju

Solution (Python):
var_a = 'Yewon'
var_b = 'Dongju'
list_a= []
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 100
var_d = 16.23
var_e = var_c / var_d
var_f = 100
var_g = 16.19
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: Correspondence

Question (EN): We have an expression of 6AB-41=591. Find the number that must go into A.
Question (KO): 식 6AB-41=591이 있습니다. A에 들어가야 하는 숫자를 구하시오

Answer: 3

Solution (Python):
var_a = '6AB-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: Correspondence

Question (EN): When you multiply the number by 7 by mistake, which should be divided by 5, you got 5 and 4/9. Write down the result of the correct calculation indicating two decimal places.
Question (KO): 어떤 수를 5로 나누어야 할 것을 잘못하여 7을 곱했더니 5와 4/9가 되었습니다. 바르게 계산하면 얼마인지 소수 2번째 자리까지 나타내어보세요.

Answer: 7.62

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

Question (EN): If the area of a trapezoid with a base of 23 centimeters (cm) and a height of 12 centimeters (cm) is 222 square cm (cm2), what is the length of the upper side?
Question (KO): 밑변의 길이가 23센티미터(㎝)이고 높이가 12센티미터(㎝)인 사다리꼴의 넓이가 222제곱센티미터(㎠)일 때, 윗변의 길이는 얼마인가요?

Answer: 14

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

Question (EN): There are 144 pencils. How many dozen pencils are there if one dozen is 12?
Question (KO): 연필이 144자루 있습니다. 한 다스가 12자루라면 연필은 몇 다스 있습니까?

Answer: 12

Solution (Python):
var_a = 144
var_b = 12
var_c = var_a / var_b
print(int(var_c))
Category: Correspondence

Question (EN): When you divide 23 by 13, the quotient is A and the remainder is 10. What is A in this case?
Question (KO): 23을 13으로 나눴더니 몫이 A가 되었고 나머지가 10이 되었습니다. 이 때 A는 무엇일까요?

Answer: 1

Solution (Python):
var_a = 23
var_b = 10
var_c = var_a - var_b
var_d = 13
var_e = var_c / var_d
print(int(var_e))
Category: Geometry

Question (EN): A cube has one edge 8 centimeters (cm) long. Find the surface area of this cube.
Question (KO): 어떤 정육면체는 한 모서리의 길이가 8센티미터(㎝)입니다. 이 정육면체의 겉넓이를 구하시오.

Answer: 384

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

Question (EN): Some parks are square with sides measuring 11 meters (m), and others are square with sides measuring 5 meters (m). Find the sum of the areas of the two parks.
Question (KO): 어떤 공원은 한 변의 길이가 11미터(m)인 정사각형 모양이고, 다른 공원은 한 변의 길이가 5미터(m)인 정사각형 모양입니다. 두 공원의 넓이의 합을 구하시오.

Answer: 146

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

Question (EN): You are trying to attach every square tile to a wall measuring 24 meters (m) wide and 18 meters (m) long. If you use a minimum number of tiles, find how many meters (m) each side of the tile is.
Question (KO): 가로 24미터(m), 세로 18미터(m)인 벽에 정사각형 타일을 빠짐없이 붙히려고 한다. 타일을 최소한으로 사용한다면 타일의 한 변의 길이는 몇 미터(m)인지 구하시오.

Answer: 6

Solution (Python):
var_a = 24
var_b = 18
var_c = math.gcd(int(var_b), int(var_a))
print(int(var_c))
Category: Comparison

Question (EN): Mom, Dad and Grandpa bought clothes at the department store. Dad bought more clothes than Mom, and Grandpa bought more clothes than Dad. In what place did grandpa rank for buying the least amount of clothes?
Question (KO): 엄마, 아빠, 할아버지가 백화점에서 옷을 구매했습니다. 엄마보다 아빠가 옷을 더 많이 샀고, 아빠보다 할아버지가 옷을 더 많이 샀습니다. 할아버지는 몇 번째로 옷을 적게 샀습니까?

Answer: 3

Solution (Python):
var_a = 'Mom'
var_b = 'Dad'
var_c = 'Grandpa'
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 = 'Grandpa'
var_e = list_a.index(var_d)+1
print(int(var_e))