philschmid/DMath huggingface dataset:
Category: Possibility

Question (EN): You want to create a two-digit natural number by drawing two from three erasers with the numbers 1, 2, and 3 written on them. How many can you make?
Question (KO): 1, 2, 3이 적힌 지우개 중 2개를 뽑아 거기에 적힌 수를 이용해 두 자리 자연수를 만들고자 한다. 몇개를 만들 수 있는가?

Answer: 6

Solution (Python):
var_a = 1
var_b = 2
var_c = 3
list_a= []
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 2
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = len(list_b)
print(int(var_e))
Category: Comparison

Question (EN): Hyunju and Seungah have the same amount of water. If Hyunju drank 0.41 times 6 liters (L) and Seungah poured 2.3 liters (L), whose remaining water is less?
Question (KO): 현주와 승아에게는 같은 양의 물이 있습니다. 현주는 6리터(L)의 0.41배만큼 마셨고, 승아는 2.3리터(L)를 쏟았다면 남아있는 물이 더 적은 사람은 누구입니까?

Answer: Hyunju

Solution (Python):
var_a = 'Hyunju'
var_b = 'Seunga'
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 = 6
var_d = 0.41
var_e = var_c * var_d
var_f = 2.3
list_b= []
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()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j)
Category: Arithmetic calculation

Question (EN): 63 people were equally divided into 9 cars. How many people were in one car?
Question (KO): 63명이 자동차 9대에 똑같이 나누어 탔습니다. 자동차 한 대에는 몇 명이 탔습니까?

Answer: 7

Solution (Python):
var_a = 63
var_b = 9
var_c = var_a / var_b
print(int(var_c))
Category: Geometry

Question (EN): If the area of the parallelogram is 44 square centimeters (cm2) and the height is 11 centimeters (cm), find the length of the base.
Question (KO): 평행사변형의 넓이가 44제곱센티미터(㎠)이고 높이가 11센티미터(㎝) 일 때, 밑변의 길이를 구하시오.

Answer: 4

Solution (Python):
var_a = 44
var_b = 11
var_c = var_a / var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): Which five-digit number is the largest common multiple of 2, 3, 8, and 9?
Question (KO): 다섯 자리 수 중 2, 3, 8, 9의 공배수 중 가장 큰 수는?

Answer: 99936

Solution (Python):
var_a = 10000
var_b = 99999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 2
list_b = []
var_d = int(var_d)
for i in list_a:
    i = int(i)
    if i % var_d == 0:
        list_b.append(i)
var_e = 3
list_c = []
var_e = int(var_e)
for i in list_b:
    i = int(i)
    if i % var_e == 0:
        list_c.append(i)
var_f = 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]
print(int(var_i))
Category: Possibility

Question (EN): How many two-digit numbers can be made using only once each of 0, 1, 2, and 3?
Question (KO): 0, 1, 2, 3을 하나씩 이용하여 만들 수 있는 두 자리 수는 모두 몇개인가?

Answer: 9

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 = 2
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: Arithmetic calculation

Question (EN): Find the largest number whose hundreds digit is 7, the unit digit is 3, and the remainder when divided by 3 is 1.
Question (KO): 백의 자리 숫자가 7, 일의 자리 숫자가 3이면서 3으로 나눈 나머지가 1인 수 중 가장 큰 값을 구하시오.

Answer: 793

Solution (Python):
var_a = '7A3'
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 = 3
var_c = 1
list_b = [] 
var_b = int(var_b)
var_c = int(var_c)
if var_c < 0:
    var_c = var_c + var_b
for i in list_a:
    i = int(i)
    if i%var_b == var_c:
        list_b.append(i)
var_d = 1
list_c=list_b.copy()
list_c.sort()
var_e = list_c[-var_d]
print(int(var_e))
Category: Arithmetic calculation

Question (EN): There are 135.1 liters (L) of water. If this is divided into 7 liter (L) buckets, how many liters (L) are left after the buckets are filled with water?
Question (KO): 물 135.1리터(L)가 있습니다. 이것을 7리터(L)들이 물통으로 나누어 담는다면 물통들을 가득 채우고 남는 양은 몇 리터(L)입니까?

Answer: 2.1

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

Question (EN): Nana is 1.618 meters (m) tall and Gaeun is 162.3 centimeters (cm) tall. Find out who is taller.
Question (KO): 나나의 키는 1.618미터(m)이고, 가은이의 키는 162.3센티미터(㎝)입니다. 키가 더 큰 사람은 누구인지 구하시오.

Answer: Gaeun

Solution (Python):
var_a = 'Nana'
var_b = 'Gaeun'
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 = 1.618
var_d = 100
var_e = var_c * var_d
var_f = 162.3
list_b= []
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()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j)
Category: Correspondence

Question (EN): A56B is a four-digit number divisible by 36. What is the number of all numbers that can be A?
Question (KO): A56B는 36으로 나누어 떨어지는 네 자리 수입니다. A가 될 수 있는 모든 숫자의 개수는 무엇입니까?

Answer: 3

Solution (Python):
var_a = 'A56B'
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 = 36
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 = 'A56B'
var_d = 'A'
var_c = str(var_c)
var_d = str(var_d)
unk_idx = var_c.index(var_d)
list_c = []
for elem in list_b:
    elem = str(elem)
    list_c.append(int(elem[unk_idx]))
list_c = list(set(list_c))
var_e = len(list_c)
print(int(var_e))
Category: Possibility

Question (EN): When 6 people including A, B, and C are lined up, in how many ways can A, B, and C line up next to each other?
Question (KO): A, B, C를 포함한 6명의 사람을 일렬로 세울 때, A, B, C가 이웃하도록 일렬로 세우는 경우의 수는?

Answer: 144

Solution (Python):
var_a = 6
var_b = 'A'
var_c = 'B'
var_d = 'C'
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)
list_a.reverse()
var_e = len(list_a)
var_f = 1
var_g = var_e - var_f
var_h = var_a - var_g
var_i = 6
var_j = len(list_a)
var_k = 1
var_l = var_j - var_k
var_m = var_i - var_l
var_n = 1
var_h = int(var_h)
var_m = int(var_m)
for i, elem in enumerate(range(var_m)):
    var_n = var_n * (var_h-i)
var_o = len(list_a)
var_p = len(list_a)
var_q = 1
var_o = int(var_o)
var_p = int(var_p)
for i, elem in enumerate(range(var_p)):
    var_q = var_q * (var_o-i)
var_r = var_n * var_q
print(int(var_r))
Category: Comparison

Question (EN): A pumpkin weighs two and nine-tenths of a kilogram (kg) and a watermelon weighs forty-one-tenths of a kilogram (kg). Which one is heavier, pumpkin or watermelon?
Question (KO): 호박의 무게는 2와 9/10킬로그램(㎏)이고 수박의 무게는 41/10킬로그램(㎏)입니다. 호박과 수박 중 어느 것이 더 무겁습니까?

Answer: watermelon

Solution (Python):
var_a = 'pumpkin'
var_b = 'watermelon'
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 = 2
var_d = 9
var_e = 10
var_f = var_d / var_e
var_g = var_c + var_f
var_h = 41
var_i = 10
var_j = var_h / var_i
list_b= []
if "/" in str(var_j):
    var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_b.append(var_g)
list_b.reverse()
var_k = 1
list_c=list_b.copy()
list_c.sort()
var_l = list_c[-var_k]
var_m = list_b.index(var_l)+1
var_n = list_a[var_m-1]
print(var_n)
Category: Comparison

Question (EN): Seokjin's classroom has desks arranged in a square shape. When the number of desks in each row is the same, Seokjin's seat is 3rd from the front, 5th from the back, 4th from the right, and 2nd from the left. Find the total number of desks in Seokjin's classroom.
Question (KO): 석진이네 교실은 사각형 모양으로 책상이 배치되어 있습니다. 각 줄의 책상의 개수가 같을 때, 석진이의 자리는 앞에서 3번째 뒤에서 5번째이고, 오른쪽에서 4번째, 왼쪽에서는 2번째 자리입니다. 석진이네 교실에 배치된 책상은 모두 몇 개입니까?

Answer: 35

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

Question (EN): Hoseok has 138 pieces of purple-colored paper. Hoseok has 119 fewer pieces of blue-colored paper than yellow-colored paper and 185 more yellow-colored paper than purple-colored paper. How many purple, yellow, and blue-colored paper does Hoseok have in total?
Question (KO): 호석이는 보라색 색종이를 138장 가지고 있습니다. 호석이가 가지고 있는 파란색 색종이는 노란색 색종이보다 119장 더 적고, 노란색 색종이는 보라색 색종이보다 185장 더 많습니다. 호석이가 가지고 있는 보라색, 노란색, 파란색 색종이는 모두 몇 장입니까?

Answer: 467

Solution (Python):
var_a = 138
var_b = 138
var_c = 119
var_d = var_b + var_c
var_e = var_a + var_d
var_f = 138
var_g = 119
var_h = var_f + var_g
var_i = 185
var_j = var_h - var_i
var_k = var_e + var_j
print(int(var_k))
Category: Comparison

Question (EN): Choose the smaller number between 5 and 8.
Question (KO): 5과 8 중에서 작은 숫자를 고르세요.

Answer: 5

Solution (Python):
var_a = 5
var_b = 8
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 = 1
list_b=list_a.copy()
list_b.sort()
var_d = list_b[var_c-1]
print(int(var_d))
Category: Comparison

Question (EN): What is the greatest number among the five numbers 5, 8, 4, 3, and 2?
Question (KO): 5개의 숫자 5, 8, 4, 3, 2 중 가장 큰 수는 무엇인가요?

Answer: 8

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

Question (EN): There are 4 boxes of 6 ballpoint pens. If you pack 3 ballpoint pens in a box, how many boxes are needed?
Question (KO): 6개의 볼펜을 가진 상자가 4상자 있다. 볼펜을 한 상자에 3개씩 넣어 포장한다면 몇 상자가 필요한가?

Answer: 8

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

Question (EN): Giyoon received 80 points in Korean, 94 points in mathematics, 82 points in social studies, 76 points in English, and 100 points in science in the midterm exam. How many subjects did he do better than the average points?
Question (KO): 기윤이는 중간고사에서 국어 80점, 수학 94점, 사회 82점, 영어 76점, 과학 100점을 받았습니다. 평균보다 잘 본 과목은 몇 과목입니까?

Answer: 2

Solution (Python):
var_a = 80
var_b = 94
var_c = 82
var_d = 76
var_e = 100
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()
list_a = [float(i) for i in list_a]
var_f = sum(list_a)/len(list_a)
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: Arithmetic calculation

Question (EN): Find the sum of the quotients of the two divisions 4610 / 133 and 618 / 886
Question (KO): 두 나눗셈 46.1 / 1.33, 61.8 / 88.6의 몫의 합을 구해보세요

Answer: 34

Solution (Python):
var_a = 46.1
var_b = 1.33
var_c = var_a // var_b
var_d = 61.8
var_e = 88.6
var_f = var_d // var_e
var_g = var_c + var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): After solving 12 problems of Korean, Seokjin solved 7 more. What is a total number of problems he solved?
Question (KO): 국어 문제 12개를 푼 석진이가 7개를 더 풀었습니다. 석진이는 몇 개의 국어 문제를 풀었나요?

Answer: 19

Solution (Python):
var_a = 12
var_b = 7
var_c = var_a + var_b
print(int(var_c))
Category: Possibility

Question (EN): If you are to form a three-digit number by selecting three from 0, 2, 4, and 6 and using them only once, what is the sum of the largest and smallest possible numbers?
Question (KO): 0, 2, 4, 6 중에서 3개 뽑아 한 번씩만 사용하여 세 자리 수를 만들려고 합니다. 만들 수 있는 가장 큰 수와 가장 작은 수의 합을 구하시오.

Answer: 846

Solution (Python):
var_a = 0
var_b = 2
var_c = 4
var_d = 6
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
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
var_h = 1
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: Arithmetic calculation

Question (EN): After filling a 250 milliliters (ml) cup with water and pouring it 20 times in a water bottle, and then filling a 600 milliliters (ml) cup with water and pouring it 13 times, the water bottle was full. How many liters (L) does this water bottle hold?
Question (KO): 어떤 물통에 250밀리리터(㎖) 들이의 컵으로 물을 가득 담아 20번을 부은 후, 600밀리리터(㎖) 들이의 컵으로 물을 가득 담아 13번 부었더니 이 물통이 가득 찼습니다. 이 물통의 들이는 몇 리터(L)입니까?

Answer: 12.8

Solution (Python):
var_a = 250
var_b = 20
var_c = var_a * var_b
var_d = 600
var_e = 13
var_f = var_d * var_e
var_g = var_c + var_f
var_h = 1000
var_i = var_g / var_h
print('{:.2f}'.format(round(var_i+1e-10,2)))
Category: Possibility

Question (EN): When three different coins are tossed, find the number of ways in which the first coin will come up heads.
Question (KO): 모두 다른 동전 3개를 던졌을 때, 첫 번째 동전이 앞면이 나오는 경우의 수를 구하시오.

Answer: 4

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

Question (EN): When a number is divided by 7, the quotient is 12 and the remainder is 5. What is the quotient when this number is divided by 8?
Question (KO): 어떤 수를 7로 나누었더니 몫이 12이고 나머지가 5였습니다. 이 수를 8로 나누었을 때 몫은 얼마입니까?

Answer: 11

Solution (Python):
var_a = 12
var_b = 7
var_c = var_a * var_b
var_d = 5
var_e = var_c + var_d
var_f = 8
var_g = var_e // var_f
print(int(var_g))
Category: Correspondence

Question (EN): 9A5 is a three digit number. Find all possible numbers for A that make division 9A5÷5<197 possible.
Question (KO): 9A5는 세 자리 수입니다. 나눗셈 9A5÷5<197을 가능하게 하는 A가 될 수 있는 모든 수를 구하시오.

Answer: 8

Solution (Python):
var_a = '9A5÷5<197'
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] = []
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].append(int(c[i]))
list_a = list(set(ans_dict[var_b]))
var_c = len(list_a)
print(int(var_c))
Category: Comparison

Question (EN): 19 different toys are placed in order from the smallest. (a) Toy is 9th from the left and (b) Toy is 15th from the left. Find the number of toys between the two toys.
Question (KO): 서로 다른 장난감 19개를 크기가 작은 것부터 순서대로 놓았습니다. (가) 장난감은 왼쪽에서 9번째에, (나) 장난감은 왼쪽에서 15번째에 있습니다. 두 장난감 사이에 있는 장난감의 수를 구하시오.

Answer: 5

Solution (Python):
var_a = 15
var_b = 9
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e))
Category: Comparison

Question (EN): Hoseok made a fraction less than 1 with 5 and 6, and Jungkook made a fraction. that is smaller than 1 using 4 and 3. Whose fraction is bigger?
Question (KO): 호석이는 5와 6으로 1보다 작은 분수를 만들었고, 정국이는 4와 3으로 1보다 작은 분수를 만들었습니다. 누가 만든 분수가 더 큽니까?

Answer: Hoseok

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

Question (EN): Of the 90 centimeters (cm) long string, 30 centimeters (cm) was given to Yoojung, and 8/15 of the remaining was used to tie the box. Find the length of the string used to tie the box.
Question (KO): 길이가 90센티미터(㎝)인 끝 중 30센티미터(㎝)는 유정이에게 주고 나머지의 8/15은 상자를 묶는데 사용했다. 상자를 묶는데 사용한 끈의 길이는 얼마인지 구하시오.

Answer: 32

Solution (Python):
var_a = 90
var_b = 30
var_c = var_a - var_b
var_d = 0.5333333333333333
var_e = var_c * var_d
print(int(var_e))
Category: Comparison

Question (EN): Choose a number or numbers less than 1.1 from 1.4, 9/10, 1.2, 0.5, and 13/10, then find the largest number among them.
Question (KO): 1.4, 9/10, 1.2, 0.5, 13/10 중에서 1.1보다 작은 숫자를 고르고, 다시 그 중에서 가장 큰 숫자를 구하세요

Answer: 0.9

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 = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
print('{:.2f}'.format(round(var_h+1e-10,2)))
Category: Comparison

Question (EN): Fish A, B, C, and D are feeding. A ate more feed than D, and B ate more feed than A. If C ate less feed than A, which fish ate the most?
Question (KO): 물고기 A, B, C, D가 먹이를 먹고 있습니다. A는 D보다 많은 먹이를 먹었고, B는 A보다 많은 먹이를 먹었습니다. C는 A보다 적은 먹이를 먹었을 때, 가장 많은 먹이를 먹은 물고기는 무엇인가요?

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

Question (EN): Three water tanks A, B, and C contain water. Water tank A contains 29 liters (L) of water, water tank B contains 2700 milliliters (㎖) less than the water contained in water tank A, and water tank C contains 4750 milliliters (ml) more water than the sum of water of water tank A and B. How many liters (L) of water is in the water tank C?
Question (KO): A, B, C 3개의 물탱크에 물이 들어 있습니다. A 물탱크에는 물이 29리터(L) 들어있고, B 물탱크에는 A 물탱크에 들어 있는 물보다 2700밀리리터(㎖) 더 적게 들어 있고, C 물탱크에는 A 물탱크와 B 물탱크에 들어 있는 물의 합보다 4750밀리리터(㎖) 더 많이 들어 있습니다. C 물탱크에 들어 있는 물은 몇 리터(L)입니까?

Answer: 60.05

Solution (Python):
var_a = 29
var_b = 29
var_c = 2700
var_d = 1000
var_e = var_c / var_d
var_f = var_b - var_e
var_g = var_a + var_f
var_h = 4750
var_i = 1000
var_j = var_h / var_i
var_k = var_g + var_j
print('{:.2f}'.format(round(var_k+1e-10,2)))