philschmid/DMath huggingface dataset:
Category: Arithmetic calculation

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

Answer: 110

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 = 2
list_b=list_a.copy()
list_b.sort()
var_e = list_b[-var_d]
var_f = 1
list_c=list_a.copy()
list_c.sort()
var_g = list_c[var_f-1]
var_h = var_e * var_g
print(int(var_h))
Category: Geometry

Question (EN): Se-hee has a box in the shape of a cube with 1 meter (m) long, and Se-rin has a cuboid-shaped box with a width of 50 centimeters (cm), a depth of 50 centimeters (cm) and a height of 20 centimeters (cm). How many times larger is the volume of Se-hee's box than the volume of Serin's box?
Question (KO): 세희는 한 모서리의 길이가 1미터(m)인 정육면체 모양의 상자를 가지고 있고, 세린이는 가로 50센티미터(㎝), 세로 50센티미터(㎝), 높이 20센티미터(㎝)인 직육면체 모양의 상자를 가지고 있습니다. 세희가 가진 상자의 부피는 세린이가 가진 상자의 부피의 몇 배입니까?

Answer: 20

Solution (Python):
var_a = 1
var_b = 100
var_c = var_a * var_b
var_d = 3
var_e = var_c ** var_d
var_f = 50
var_g = 50
var_h = var_f * var_g
var_i = 20
var_j = var_h * var_i
var_k = var_e / var_j
print(int(var_k))
Category: Comparison

Question (EN): Four whales are swimming. (a) Whales are faster than (b) whales, and both (b) whales and (d) whales are faster than (c) whales. (d) Whales are faster than (a) whales. Which of these whales is the slowest?
Question (KO): 4마리의 고래가 헤엄치고 있습니다. (가) 고래는 (나) 고래보다 빠르고 (나) 고래와 (라) 고래는 모두 (다) 고래보다 빠릅니다. (라) 고래는 (가) 고래보다 빠릅니다. 이 중 가장 느린 고래는 어느 고래입니까?

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 = '(a)'
var_f = '(b)'
var_g = '>'
var_h = '(b)'
var_i = '(c)'
var_j = '>'
var_k = '(c)'
var_l = '(d)'
var_m = '<'
var_n = '(d)'
var_o = '(a)'
var_p = '>'
list_b= []
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_q = len(list_c)
var_r = list_c[var_q-1]
print(var_r)
Category: Correspondence

Question (EN): The two-digit number 6A+B2=77. How much is B?
Question (KO): 두 자리 수 6A+B2=77입니다. B는 얼마입니까?

Answer: 1

Solution (Python):
var_a = '6A+B2=77'
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): There is a rhombic playground. Find the area of the playground if one diagonal of the playground is 14 meters (m) and the other diagonal is 24 meters (m).
Question (KO): 마름모 모양의 운동장이 있습니다. 운동장의 한 대각선은 14미터(m), 다른 대각선은 24미터(m)일 때 운동장의 넓이를 구하시오.

Answer: 168

Solution (Python):
var_a = 14
var_b = 24
var_c = var_a * var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e))
Category: Correspondence

Question (EN): A and B are single-digit numbers. If A15B94 is a multiple of 99, find A+B.
Question (KO): A, B는 한 자리 수입니다. A15B94가 99의 배수라고 할 때 A+B를 구하시오.

Answer: 8

Solution (Python):
var_a = 'A15B94'
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 = 99
list_b = []
var_b = int(var_b)
for i in list_a:
    i = int(i)
    if i % var_b == 0:
        list_b.append(i)
var_c = 'A15B94'
var_d = 'A'
var_c = str(var_c)
var_d = str(var_d)
unk_idx = var_c.index(var_d)
var_e = 0
for elem in list_b:
    elem = str(elem)
    var_e = int(elem[unk_idx])
var_f = 'A15B94'
var_g = 'B'
var_f = str(var_f)
var_g = str(var_g)
unk_idx = var_f.index(var_g)
var_h = 0
for elem in list_b:
    elem = str(elem)
    var_h = int(elem[unk_idx])
var_i = var_e + var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): Eunji has 35 candies. If Jimin has 6 more candies than Eunji and Jihyun has 3 fewer candies than Eunji, what is the average number of candies the three of them have?
Question (KO): 은지는 35개의 사탕을 가지고 있습니다. 지민이는 은지보다 사탕을 6개 더 가지고 있고 지현이는 은지보다 사탕을 3개 덜 가지고 있을 때 세 명이 가진 평균 사탕의 개수는 몇 개입니까?

Answer: 36

Solution (Python):
var_a = 35
var_b = 35
var_c = 6
var_d = var_b + var_c
var_e = var_a + var_d
var_f = 35
var_g = 3
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): When Beomjin tries to put 2 Math books and 2 English books on the bookshelf, how many times can he put the math books side by side?
Question (KO): 범진이가 수학책 2권, 영어책 2권을 책꽂이에 꽂으려고 할 때, 수학책끼리 나란히 꽂는 경우의 수는?

Answer: 12

Solution (Python):
var_a = 'Math'
var_b = 'English'
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 = len(list_a)
var_d = 2
var_e = var_c * var_d
var_f = 1
var_g = var_e - var_f
var_h = len(list_a)
var_i = 2
var_j = var_h * var_i
var_k = 1
var_l = var_j - var_k
var_m = 1
var_g = int(var_g)
var_l = int(var_l)
for i, elem in enumerate(range(var_l)):
    var_m = var_m * (var_g-i)
var_n = 2
var_o = var_m * var_n
print(int(var_o))
Category: Geometry

Question (EN): The sum of the lengths of all the edges of a hexagonal prism is 81 centimeters (cm), and all edges are the same length. In a quadrangular pyramid, all edges are the same length, and one edge is equal to the length of the edges of a hexagonal prism. Find the sum of the lengths of all the edges of the quadrangular pyramid.
Question (KO): 어떤 육각기둥의 모든 모서리의 길이의 합은 81센티미터(㎝)이고, 모든 모서리의 길이가 같습니다. 어떤 사각뿔은 모든 모서리의 길이가 같고, 한 모서리의 길이가 육각기둥의 모서리의 길이와 같습니다. 사각뿔의 모든 모서리의 길이의 합을 구하시오.

Answer: 36

Solution (Python):
var_a = 81
var_b = 6
var_c = 3
var_d = var_b * var_c
var_e = var_a / var_d
var_f = 4
var_g = 2
var_h = var_f * var_g
var_i = var_e * var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): Jungkook has 3 bundles of 10 pieces of colored paper each and 8 individual pieces. How many pieces of colored paper does Jungkook have?
Question (KO): 정국이는 색종이를 10장씩 3묶음과 낱개 8장 가지고 있습니다. 정국이가 가지고 있는 색종이는 모두 몇 장입니까?

Answer: 38

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

Question (EN): There are 6/5 and 1/10. What is their sum?
Question (KO): 6/5과 1/10이 있습니다. 이들의 합은 얼마인가요?

Answer: 1.3

Solution (Python):
var_a = 1.2
var_b = 0.1
var_c = var_a + var_b
print('{:.2f}'.format(round(var_c+1e-10,2)))
Category: Correspondence

Question (EN): Divide a number by 2.5, divide by 3.1, add 3.1, and you get 8.9. Find out what the number is.
Question (KO): 어떤 수를 2.5로 나누고 3.1로 나눈 후 3.1을 더했더니 8.9가 되었습니다. 어떤 수는 얼마인지 구하시오.

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): Yoongi stands in the 7th row from the left, the 13th row from the right, the 8th row from the front, and the 14th row from the back to receive the gift being handed out. If the number of people in each line is the same and each person gets 2 gifts, how many gifts will everyone in the line get?
Question (KO): 윤기는 왼쪽에서 7번째 열, 오른쪽에서 13번째 열, 앞에서 8번째 줄, 뒤에서 14번째 줄에 서서 나눠주는 선물을 받으려고 합니다. 각 줄마다 서 있는 사람 수가 같고, 한 사람 당 선물을 2개씩 받는다고 할 때, 줄을 선 모든 사람이 받는 선물은 모두 몇 개입니까?

Answer: 798

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

Question (EN): The yellow toy is 10th from the left and 7th from the right. How many toys are there if they are placed in a row?
Question (KO): 노란색 장난감의 위치는 왼쪽으로부터 10번째이고 오른쪽에서 세면 7번째입니다. 장난감이 한 줄로 놓아져 있다면 장난감의 수는 모두 몇 개입니까?

Answer: 16

Solution (Python):
var_a = 10
var_b = 7
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e))
Category: Possibility

Question (EN): A can be a natural number from 1 to 9. If 57×7>65×A, what is the sum of the numbers that can be A?
Question (KO): A에는 1부터 9까지의 자연수가 들어갈 수 있습니다. 57×7>65×A일 때, A에 들어갈 수 있는 수의 합은 얼마입니까?

Answer: 21

Solution (Python):
var_a = 1
var_b = 9
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 57
var_e = 7
var_f = var_d * var_e
var_g = 65
var_h = var_f / var_g
list_b = []
for i in list_a:
    if i < var_h:
        list_b.append(i)
list_b = [float(i) for i in list_b]
var_i = sum(list_b)
print(int(var_i))
Category: Arithmetic calculation

Question (EN): In a park with a perimeter of 18 kilometers (km), Soyun and Jia started off at the same time from the same place, but in opposite directions, and met on the way. It is said that Soyun ran at 5 kilometers (km) per hour and Jia ran at 4 kilometers (km) per hour. How far did Soyun run?
Question (KO): 둘레의 길이가 18 킬로미터(㎞)인 공원을 소윤이와 지아가 같은 장소에서 동시에 출발하여 서로 반대 방향으로 돌아서 도중에 만났다. 소윤이는 시속 5 킬로미터(㎞)로 뛰었고 지아는 시속 4 킬로미터(㎞)로 뛰었다고 한다. 소윤이가 뛴 거리는 얼마인가?

Answer: 10

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

Question (EN): What is the sum of odd numbers more than 1 and not more than 9 that are less than 6?
Question (KO): 1이상 9이하의 홀수 중 6미만인 수들의 총합은 얼마입니까?

Answer: 9

Solution (Python):
var_a = 1
var_b = 9
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 = 6
list_b = []
for i in list_a:
    if i < var_c:
        list_b.append(i)
list_b = [float(i) for i in list_b]
var_d = sum(list_b)
print(int(var_d))
Category: Possibility

Question (EN): Of the 4 cards with the numbers 6, 7, 8, and 9 written on them, we want to select two cards by allowing duplicates. How many possible cases are there?
Question (KO): 6, 7, 8, 9가 적혀있는 4장의 카드 중 중복을 허락하여 2가지 카드를 고르려고 합니다. 가능한 경우의 수는 모두 몇 가지 인가요?

Answer: 10

Solution (Python):
var_a = 6
var_b = 7
var_c = 8
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 = 2
var_g = var_e + var_f
var_h = 1
var_i = var_g - var_h
var_j = 2
var_k = 1
var_i = int(var_i)
var_j = int(var_j)
for i, elem in enumerate(range(var_j)):
    var_k = var_k * (var_i-i)
for i, elem in enumerate(range(var_j)):
    var_k = var_k / (i+1)
print(int(var_k))
Category: Arithmetic calculation

Question (EN): There is a car that can travel 20.57 kilometers (km) with 1.7 liters (L) of gasoline. If the price of gasoline is 1600 won per liter (L), how much gasoline does this car need to travel 91.66 kilometers (km)?
Question (KO): 휘발유 1.7리터(L)로 20.57킬로미터(㎞)를 갈 수 있는 자동차가 있습니다. 휘발유 1리터(L)의 값이 1600원이라면 이 자동차가 91.66킬로미터(㎞)를 가는 데 필요한 휘발유의 값은 얼마입니까?

Answer: 12120.33

Solution (Python):
var_a = 1.7
var_b = 20.57
var_c = var_a / var_b
var_d = 91.66
var_e = var_c * var_d
var_f = 1600
var_g = var_e * var_f
print('{:.2f}'.format(round(var_g+1e-10,2)))
Category: Arithmetic calculation

Question (EN): You are going to make a long wire by splicing 15 pieces of wire together that are 25 centimeters (cm) long. If 0.5 centimeters (cm) of wire is overlapped to join the wires together, find how many meters (m) the length of the wire is spliced together.
Question (KO): 길이가 25센티미터(㎝)인 철사 15개를 이어붙여서 긴 철사를 만드려고 한다. 철사를 이어붙이는데 0.5센티미터(㎝)의 철사가 사용될 때, 이어붙힌 철사의 길이는 몇 미터(m)인지 구하시오.

Answer: 3.68

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

Question (EN): You mistakenly divided a number by 21 instead of by 12, and it was divisible by 4. Find the quotient when calculated correctly.
Question (KO): 어떤 수를 12로 나누어야 할 것을 잘못하여 21로 나누었더니 4로 나누어떨어졌습니다. 바르게 계산했을 때의 몫을 구하시오.

Answer: 7

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

Question (EN): There were 9 volleyballs. You lent 5 of them to other schools. How many volleyballs are currently there?
Question (KO): 배구공이 9개 있었습니다. 그중에서 5개를 다른 학교에 빌려주었습니다. 현재 남아있는 배구공은 몇 개입니까?

Answer: 4

Solution (Python):
var_a = 9
var_b = 5
var_c = var_a - var_b
print(int(var_c))
Category: Geometry

Question (EN): How many vertices are there in a pyramid whose base is a regular polygon made up of six equal angles?
Question (KO): 밑면이 여섯 개의 크기가 같은 각으로 이루어진 정다각형인 각뿔의 꼭짓점은 모두 몇 개입니까?

Answer: 7

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

Question (EN): You want to plant 24 trees equally spaced on one side of a road that is 239.66 meters (m) long. If one tree is planted at the beginning and one at the end of the road, how many meters (m) should be spaced between the trees?
Question (KO): 길이가 239.66미터(m)인 도로의 한쪽에 같은 간격으로 24그루의 나무를 심으려고 합니다. 도로의 처음과 끝에 각각 한 그루씩 심는다면 나무 사이의 거리는 몇 미터(m)로 심어야 하는지 구하시오.

Answer: 10.42

Solution (Python):
var_a = 239.66
var_b = 24
var_c = 1
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): Yonghee stood on the scale holding a bag weighing 1 kilogram (kg) and 750 grams (g), and the scale indicated 35 kilograms (kg) and 500 grams (g). How many kilograms (kg) will the scale show if Yonghee stands on the scale carrying his younger brother who weighs 27 kilograms (kg) and 200 grams (g) on his back?
Question (KO): 용희가 무게 1킬로그램(㎏) 750그램(g)인 가방을 들고 저울에 올라섰더니 저울의 눈금이 35킬로그램(㎏) 500그램(g)을 가리켰습니다. 용희가 27킬로그램(㎏) 200그램(g)인 동생을 업고 저울에 올라서면 저울의 눈금은 몇 킬로그램(㎏)을 나타내겠습니까?

Answer: 60.95

Solution (Python):
var_a = 35
var_b = 500
var_c = 1000
var_d = var_b / var_c
var_e = var_a + var_d
var_f = 1
var_g = 750
var_h = 1000
var_i = var_g / var_h
var_j = var_f + var_i
var_k = var_e - var_j
var_l = 27
var_m = 200
var_n = 1000
var_o = var_m / var_n
var_p = var_l + var_o
var_q = var_k + var_p
print('{:.2f}'.format(round(var_q+1e-10,2)))
Category: Comparison

Question (EN): There are four numbers A, B, C, and D. A is 3 times 3. B is 15 less than C. C is a number four times A. D is 19 greater than A. Which of A, B, C, and D is the 2nd largest number?
Question (KO): 네 수 A, B, C, D가 있습니다. A는 3의 3배인 수입니다. B는 C보다 15 작은 수입니다. C는 A의 4배인 수입니다. D는 A보다 19 큰 수입니다. A, B, C, D 중 2번째로 큰 수는 어느 것입니까?

Answer: D

Solution (Python):
var_a = 'A'
var_b = 'C'
var_c = 'B'
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 = 3
var_f = 3
var_g = var_e * var_f
var_h = 3
var_i = 3
var_j = 4
var_k = var_i * var_j
var_l = var_h * var_k
var_m = 9
var_n = 4
var_o = 19
var_p = var_n * var_o
var_q = var_m - var_p
var_r = 3
var_s = 3
var_t = 19
var_u = var_s * var_t
var_v = var_r + var_u
list_b= []
if "/" in str(var_v):
    var_v = eval(str(var_v))
list_b.append(var_v)
if "/" in str(var_q):
    var_q = eval(str(var_q))
list_b.append(var_q)
if "/" in str(var_l):
    var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_b.append(var_g)
list_b.reverse()
var_w = 1
list_c=list_b.copy()
list_c.sort()
var_x = list_c[-var_w]
var_y = list_b.index(var_x)+1
var_z = list_a[var_y-1]
print(var_z)
Category: Correspondence

Question (EN): There are fruits in the basket. If you divide this fruit equally to 30 people, you will have 14 fruits left over, if you share it equally with 50 people, you will have 24 fruits left over, and if you share it equally with 70 people, you will have 34 fruits left over. Find the minimum number of fruits in the basket.
Question (KO): 바구니 안에 과일이 있다. 이 과일을 30명에게 똑같이 나누어 주면 14개가 남고 50명에게 똑같이 나누어 주면 24개가 남고 70명에게 똑같이 나누어 주면 34개가 남는다고 한다. 최소 몇 개의 과일이 바구니안에 있는지 구하여라.

Answer: 524

Solution (Python):
var_a = 0
var_b = 9999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 30
var_e = 14
list_b = [] 
var_d = int(var_d)
var_e = int(var_e)
if var_e < 0:
    var_e = var_e + var_d
for i in list_a:
    i = int(i)
    if i%var_d == var_e:
        list_b.append(i)
var_f = 50
var_g = 24
list_c = [] 
var_f = int(var_f)
var_g = int(var_g)
if var_g < 0:
    var_g = var_g + var_f
for i in list_b:
    i = int(i)
    if i%var_f == var_g:
        list_c.append(i)
var_h = 70
var_i = 34
list_d = [] 
var_h = int(var_h)
var_i = int(var_i)
if var_i < 0:
    var_i = var_i + var_h
for i in list_c:
    i = int(i)
    if i%var_h == var_i:
        list_d.append(i)
var_j = 1
list_e=list_d.copy()
list_e.sort()
var_k = list_e[var_j-1]
print(int(var_k))
Category: Comparison

Question (EN): Eunmi solved 288 questions in 12 days, and Junhyeok solved 243 questions in 9 days. Who solved more problems in one day?
Question (KO): 은미는 12일 동안 288문제를 풀었고, 준혁이는 9일 동안 243문제를 풀었습니다. 하루 동안 더 많은 문제를 푼 친구는 누구입니까?

Answer: Junhyeok

Solution (Python):
var_a = 'Eunmi'
var_b = 'Junhyeok'
list_a= []
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 288
var_d = 12
var_e = var_c / var_d
var_f = 243
var_g = 9
var_h = var_f / var_g
list_b= []
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[-var_i]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l)
Category: Correspondence

Question (EN): 7A7 rounded up to the tens place is 730. Find A
Question (KO): 7A7을 올림하여 십의 자리까지 나타내면 730이 됩니다. A를 구하시오.

Answer: 2

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

Question (EN): Find the length of a side of an equilateral triangle that has the same perimeter as a square with a side length of 21 centimeters (cm) in centimeters (cm).
Question (KO): 한 변의 길이가 21센티미터(㎝)인 정사각형과 둘레의 길이가 같은 정삼각형의 한 변의 길이는 몇 센티미터(㎝)인지 구하시오.

Answer: 28

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

Question (EN): There is a paper strip with press nails inserted at 3 centimeters (cm) intervals. Pressing nails are inserted at both ends of the paper strip, and how many pressing nails are there when the length of the paper strip is 114 centimeters (cm)?
Question (KO): 3센티미터(㎝) 간격으로 누름 못이 꽂혀진 종이띠가 있습니다. 종이띠 양끝에도 누름 못이 꽂혀져 있으며 종이띠의 길이는 114센티미터(㎝)일 때 누름 못은 모두 몇 개 있나요?

Answer: 39

Solution (Python):
var_a = 114
var_b = 3
var_c = var_a / var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e))
Category: Correspondence

Question (EN): When a certain number is divided by 37, the quotient is 23 and the remainder is 16. What is the certain number?
Question (KO): 어떤 수를 37로 나누면 몫은 23이고 나머지는 16입니다. 어떤 수는 얼마일까요?

Answer: 867

Solution (Python):
var_a = 23
var_b = 37
var_c = var_a * var_b
var_d = 16
var_e = var_c + var_d
print(int(var_e))