philschmid/DMath huggingface dataset:
Category: Possibility

Question (EN): You have 2 chances to draw from a basket containing 1 apple, 1 peach, 1 pear, and 1 melon. How many orders of fruit can exist while you draw from the basket?
Question (KO): 사과, 복숭아, 배, 참외가 각각 1개씩 있는 바구니에서 뺄 기회는 2번입니다. 나올 수 있는 과일의 순서는 모두 몇 가지입니까?

Answer: 12

Solution (Python):
var_a = 'apple'
var_b = 'peach'
var_c = 'pear'
var_d = 'melon'
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 = 1
var_e = int(var_e)
var_f = int(var_f)
for i, elem in enumerate(range(var_f)):
    var_g = var_g * (var_e-i)
print(int(var_g))
Category: Correspondence

Question (EN): You made a mistake and  multiplied a certain number by 10 when you should have multiplied it by 1/100, and got 2804. How much is it when you calculate correctly?
Question (KO): 어떤 수를 1/100배 해야 할 것을 잘못하여 10배 하였더니 2804가 되었습니다. 바르게 계산하면 얼마입니까?

Answer: 2.8

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

Question (EN): I need to add 32 to a number, but I mistakenly added 23, and I got 68. Find out this number
Question (KO): 어떤 수에 32를 더해야 하는데 잘못해서 23을 더했더니 68이 되었습니다. 어떤 수를 구하시오.

Answer: 45

Solution (Python):
var_a = 68
var_b = 23
var_c = var_a - var_b
print(int(var_c))
Category: Comparison

Question (EN): Find how many numbers are less than 1.1 among 1.4, 9/10, 1.2, 0.5, and 13/10.
Question (KO): 1.4, 9/10, 1.2, 0.5, 13/10 중에서 1.1보다 작은 수를 고르면 몇 개인지 구하시오.

Answer: 2

Solution (Python):
var_a = 1.4
var_b = 0.9
var_c = 1.2
var_d = 0.5
var_e = 1.3
list_a= []
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 1.1
list_b = []
for i in list_a:
    if i < var_f:
        list_b.append(i)
var_g = len(list_b)
print(int(var_g))
Category: Correspondence

Question (EN): A is a number that consists of 1, 16, and 28 times of 1000, 100, and 10, respectively. B jumps 3 times in increments of 245, the starting point being 355. Find the value of A-B.
Question (KO): A는 1000개, 100개, 10개씩 묶음이 각각 1개, 16개, 28개인 수입니다. B는 245씩 커지게 3번 뛰었는데, 처음 수는 355였습니다. A-B의 값을 구하시오.

Answer: 1790

Solution (Python):
var_a = 1000
var_b = 1
var_c = var_a * var_b
var_d = 100
var_e = 16
var_f = var_d * var_e
var_g = var_c + var_f
var_h = 10
var_i = 28
var_j = var_h * var_i
var_k = var_g + var_j
var_l = 355
var_m = 245
var_n = 3
var_o = var_m * var_n
var_p = var_l + var_o
var_q = var_k - var_p
print(int(var_q))
Category: Possibility

Question (EN): Find the remainder when the number cards 4, 2, 8, 1, 9 are used only once to get the greatest quotient from the expression (three-digit number)/(two-digit number).
Question (KO): 4, 2, 8, 1, 9 수 카드를 한 번씩만 사용하여 몫이 가장 큰 (세 자리 수)/(두 자리 수)를 만들었을 때의 나머지를 구하세요.

Answer: 0

Solution (Python):
var_a = 4
var_b = 2
var_c = 8
var_d = 1
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 = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, 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 = 2
list_d = [str(i) for i in list_a]
list_d = list(itertools.permutations(list_d, var_i))
list_d = [''.join(num_list) for num_list in list_d]
list_d = [str_num for str_num in list_d if str_num[0] != '0']
list_d = [float(i) for i in list_d]
var_j = 1
list_e=list_d.copy()
list_e.sort()
var_k = list_e[var_j-1]
var_l = var_h % var_k
print(int(var_l))
Category: Correspondence

Question (EN): If you put 7 sugar cubes in the coffee, the amount of sugar in the coffee is 9.8 grams (g). Find how many grams (g) are in one sugar cube.
Question (KO): 커피에 각설탕을 7개를 넣었더니 커피에 들어간 설탕의 양이 9.8그램(g)이다. 각설탕 하나에 몇 그램(g)인지 구하시오.

Answer: 1.4

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

Question (EN): There is a prism whose sum of the number of edges and the number of vertices is 40. How many faces does this prism have?
Question (KO): 모서리의 수와 꼭짓점의 수의 합이 40인 각기둥이 있다. 이 각기둥의 면은 모두 몇 개인가?

Answer: 10

Solution (Python):
var_a = 40
var_b = 2
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: Comparison

Question (EN): There are numbers 0.8, 1/2, 0.9, and 1/3. Find the sum of all the numbers less than or equal to 0.3.
Question (KO): 0.8, 1/2, 0.9, 1/3의 숫자가 있다. 이 중 0.3보다 작거나 같은 숫자들의 합을 구하시오.

Answer: 0

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)
list_b = [float(i) for i in list_b]
var_f = sum(list_b)
print(int(var_f))
Category: Geometry

Question (EN): Junyeong's house has a fish tank measuring 50 centimeters (cm) wide, 16 centimeters (cm) long, and 25 centimeters (cm) high. The fishbowl was filled with water to a height of 15 centimeters (cm), and a cube-shaped piece of wood with one corner length of 10 centimeters (cm) was completely submerged in the water. At this time, find the height of the fish tank in centimeters (cm) including the decimal point.
Question (KO): 준영이네 집에는 가로 50센티미터(㎝), 세로 16센티미터(㎝), 높이 25센티미터(㎝)짜리 어항이 있다. 이 어항에 15센티미터(㎝) 높이만큼 물을 채워넣고, 한 모서리의 길이가 10센티미터(㎝)인 정육면체 모양 나무조각을 물에 완전히 잠기게 넣었다. 이 때 어항의 높이는 몇 센티미터(㎝)가 될지 소수점을 포함하여 구하라.

Answer: 16.25

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

Question (EN): At Minyoung's house, there are four times as many chickens as ducks, and 17 fewer rabbits than ducks. If there are 8 rabbits in Minyoung's house, how many chickens, ducks, and rabbits are there in total in Minyoung's house?
Question (KO): 민영이네 집에서 기르는 닭은 오리 수의 4배이고, 토끼는 오리보다 17마리 적습니다. 민영이네 집에서 기르는 토끼가 8마리일 때, 민영이네 집에서 기르는 닭, 오리, 토끼는 모두 몇 마리입니까?

Answer: 133

Solution (Python):
var_a = 8
var_b = 8
var_c = 17
var_d = var_b + var_c
var_e = var_a + var_d
var_f = 4
var_g = 8
var_h = 17
var_i = var_g + var_h
var_j = var_f * var_i
var_k = var_e + var_j
print(int(var_k))
Category: Arithmetic calculation

Question (EN): The dice were thrown 5 times and the values that came out were 2, 4, 4, 1, and 5 in that order. Find how many times 4 came out.
Question (KO): 주사위를 5번 던졌더니 나온 값이 순서대로 2, 4, 4, 1, 5였다. 4는 몇 번 나왔는지 구하시오.

Answer: 2

Solution (Python):
var_a = 2
var_b = 4
var_c = 4
var_d = 1
var_e = 5
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 = 4
var_g = 0
var_f = int(var_f)
for i in list_a:
    i = int(i)
    if i == var_f:
        var_g = var_g + 1
print(int(var_g))
Category: Correspondence

Question (EN): Hoseok multiplied a certain number by 5 and got 100. Find out the value of that certain number divided by 10.
Question (KO): 호석이는 어떤 수에 5를 곱하여 100을 얻었습니다. 어떤 수를 10으로 나누면 얼마입니까?

Answer: 2

Solution (Python):
var_a = 100
var_b = 5
var_c = var_a / var_b
var_d = 10
var_e = var_c / var_d
print(int(var_e))
Category: Comparison

Question (EN): Three classes A, B, and C took part in the reading competition. If the students in class C read more books than the students in class A, and the students in class A read more books than the students in class B, find which class read the fewest books.
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 = len(list_c)
var_k = list_c[var_j-1]
print(var_k)
Category: Comparison

Question (EN): Yuna, Eunji, and Minyoung are playing a rock-paper-scissors game. Yuna beat Minyoung and Eunji lost to Minyoung. Who's in last place?
Question (KO): 유나, 은지, 민영이가 가위바위보게임을 하고 있습니다. 유나는 민영이를 이겼고, 은지는 민영이에게 졌습니다. 꼴찌는 누구일까요?

Answer: Eunji

Solution (Python):
var_a = 'Yuna'
var_b = 'Eunji'
var_c = 'Minyoung'
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 = 'Yuna'
var_e = 'Minyoung'
var_f = '>'
var_g = 'Eunji'
var_h = 'Minyoung'
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 = len(list_c)
var_k = list_c[var_j-1]
print(var_k)
Category: Possibility

Question (EN): I'm trying to make a two-digit number using two different cards among those that have numbers 6, 7, and 8 written on them. How many possible numbers are there?
Question (KO): 6, 7, 8이 적혀있는 숫자카드 중 서로 다른 2가지 카드를 이용하여 두 자리 숫자를 만드려고 합니다. 가능한 수는 모두 몇 가지 인가요?

Answer: 6

Solution (Python):
var_a = 6
var_b = 7
var_c = 8
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 = len(list_b)
print(int(var_e))
Category: Possibility

Question (EN): Find the number of three-digit numbers where each digit is odd.
Question (KO): 각 자리 수가 모두 홀수인 세 자리 수의 개수를 구하시오.

Answer: 125

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 = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=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 = len(list_b)
print(int(var_d))
Category: Correspondence

Question (EN): Subtracting 7 from a number equals 9 multiplied by 8. Find the quotient of the number divided by 6.
Question (KO): 어떤 수에서 7을 뺀 값은 9와 8의 곱과 같다. 어떤 수를 6으로 나눈 몫을 구하시오.

Answer: 13

Solution (Python):
var_a = 8
var_b = 9
var_c = var_a * var_b
var_d = 7
var_e = var_c + var_d
var_f = 6
var_g = var_e // var_f
print(int(var_g))
Category: Comparison

Question (EN): Jungkook has 6 erasers. If Jimin has 4 more erasers than Jungkook and Seokjin has 3 less than Jimin, who has the fewest erasers?
Question (KO): 정국이가 가진 지우개의 개수는 6개입니다. 지민이는 정국이보다는 4개 많고 석진이는 지민이보다 3개 적다면, 누가 가지고 있는 지우개의 수가 가장 적습니까?

Answer: Jungkook

Solution (Python):
var_a = 'Jungkook'
var_b = 'Jimin'
var_c = 'Seokjin'
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 = 6
var_f = 4
var_g = var_e + var_f
var_h = 6
var_i = 4
var_j = var_h + var_i
var_k = 3
var_l = var_j - var_k
list_b= []
if "/" in str(var_l):
    var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
var_m = 1
list_c=list_b.copy()
list_c.sort()
var_n = list_c[var_m-1]
var_o = list_b.index(var_n)+1
var_p = list_a[var_o-1]
print(var_p)
Category: Geometry

Question (EN): The base of a triangular prism is an equilateral triangle with a side of 3 centimeters (cm) and a height of 6 centimeters (cm). Find the sum of the areas of the sides.
Question (KO): 어떤 삼각기둥의 밑면은 한 변이 3인 정삼각형이고 높이는 6이다. 옆면의 넓이의 합을 구하시오.

Answer: 21

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

Question (EN): Jungkook collects the number 6 minus 3, Yoongi collects 4, and Yuna collects 5. Who has the biggest number?
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: Correspondence

Question (EN): I want to find the quotient of a number divided by 3, but I mistakenly divided it by 7, and the quotient became 12 with the remainder 4. Find the correctly calculated value.
Question (KO): 어떤 수를 3으로 나눈 몫을 구해야하는데 잘못하여 7로 나누었더니 몫이 12이고 나머지가 4이다. 바르게 계산한 값을 구하시오.

Answer: 29

Solution (Python):
var_a = 7
var_b = 12
var_c = var_a * var_b
var_d = 4
var_e = var_c + var_d
var_f = 3
var_g = var_e // var_f
print(int(var_g))
Category: Comparison

Question (EN): Yoongi's classmates are queuing up. If there are 15 students in front of Yoongi and 12 students behind him, what is the total number of students in line?
Question (KO): 윤기네 반 학생들이 줄을 서고 있습니다. 윤기의 앞에는 15명, 뒤에는 12명의 학생이 있다면, 줄을 서고 있는 학생은 모두 몇 명입니까?

Answer: 28

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

Question (EN): If you put 6 sweets in bag, there will be 4 left. If you put 8 in a bag, there are 6 left, and if you put 10 in a bag, there are 8 left. Find the smallest number that can be the number of sweets
Question (KO): 사탕을 한 봉지에 6개씩 담으면 4개가 남고, 8개씩 담으면 6개가 남고, 10개씩 담으면 8개가 남는다고 한다. 사탕은 최소 몇 개인지 구하여라.

Answer: 118

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 = 6
var_e = 4
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 = 8
var_g = 6
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 = 10
var_i = 8
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: Correspondence

Question (EN): If Changhyeon spent half of his money on apples at the fruit shop and 300 won on the plastic bag, and then spent half of his remaining money and 400 won on mackerel at the fish shop, how much money did Changhyeon have at the beginning?
Question (KO): 창현이는 과일 가게에서 사과를 사는데 가진 돈의 절반을 사용하고 봉투값으로 300원을 사용한 후, 생선 가게에서 고등어를 사는데 남은 돈의 절반과 400원을 사용했다면 창현이가 처음 가지고 있던 돈은 얼마인지 구하시오.

Answer: 2200

Solution (Python):
var_a = 0
var_b = 400
var_c = var_a + var_b
var_d = 1
var_e = 0.5
var_f = var_d - var_e
var_g = var_c / var_f
var_h = 300
var_i = var_g + var_h
var_j = 1
var_k = 0.5
var_l = var_j - var_k
var_m = var_i / var_l
print(int(var_m))
Category: Arithmetic calculation

Question (EN): There were thirty-four candies divided equally among seven boxes, resulting in one candy shortage. How many candies are there in one box?
Question (KO): 사탕 34개를 7개의 상자에 나누어 담았더니 1개의 사탕이 모자랐습니다. 상자의 개수는 몇 개인가?

Answer: 5

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

Question (EN): Yuna, Eunji, and Minyoung are standing in order of height. Yuna is taller than Eunji and Minyoung is shorter than Eunji. If the shortest student is standing at the front, find out who is standing at the front.
Question (KO): 유나, 은지, 민영이가 키 순서대로 서 있습니다. 유나가 은지보다 키가 크고 민영이가 은지보다 키가 작습니다. 키가 작은 학생이 가장 앞에 서 있다면 맨 앞에 서 있는 학생은 누구인지 구하세요.

Answer: Minyoung

Solution (Python):
var_a = 'Yuna'
var_b = 'Eunji'
var_c = 'Minyoung'
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 = 'Yuna'
var_e = 'Eunji'
var_f = '>'
var_g = 'Minyoung'
var_h = 'Eunji'
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 = len(list_c)
var_k = list_c[var_j-1]
print(var_k)
Category: Arithmetic calculation

Question (EN): How many odd numbers are there between 1 and 6 and between 11 and 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): There are two different natural numbers, A and B. When A is divided by 29, the quotient is 31 and the remainder is B. Find A when the remainder B is the smallest number.
Question (KO): 서로 다른 두 자연수 A, B가 있습니다. A를 29로 나누면 몫은 31이고 나머지는 B가 됩니다. 나머지 B가 가장 작은 수일 때 A를 구하시오.

Answer: 899

Solution (Python):
var_a = 29
var_b = 31
var_c = var_a * var_b
print(int(var_c))
Category: Correspondence

Question (EN): You had to divide a number by 3 and then add 12, but mistakenly multiplied 3 and subtracted 12 instead, which resulted in 60. What is the result of the correct calculation?
Question (KO): 어떤 수를 3 으로 나눈 다음 12 를 더해야 할 것을 잘못하여 3 을 곱한 다음 12 를 뺐더니 60 이 되었습니다. 바르게 계산하면 얼마입니까?

Answer: 20

Solution (Python):
var_a = 60
var_b = 12
var_c = var_a + var_b
var_d = 3
var_e = var_c / var_d
var_f = 3
var_g = var_e / var_f
var_h = 12
var_i = var_g + var_h
print(int(var_i))