philschmid/DMath huggingface dataset:
Category: Comparison

Question (EN): There are 6 and 7 rows each of cars parked in the front and back of the father's car parked in the parking lot, and 5 and 6 rows each of cars parked on either side and the number of cars in each row is the same. How many are there in all?
Question (KO): 주차장에 세워진 아빠의 차의 앞뒤에는 각각 6, 7줄의 차들이 주차되어 있고, 양옆에는 각각 5, 6줄의 차들이 주차되어 있고,각 줄마다 있는 자동차의 수가 같다고 할 때, 주차장에 세워진 차들은 모두 몇 대입니까?

Answer: 168

Solution (Python):
var_a = 6
var_b = 7
var_c = var_a + var_b
var_d = 1
var_e = var_c + var_d
var_f = 5
var_g = 6
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): You are trying to solve all the problems in the workbook in 4 days. You solved 1/2 of the problems were solved on the first day, 1/4 of the problems on the second day, 1/6 of the problems on the third day, and 20 problems left on the fourth day. How many problems are there in the workbook?
Question (KO): 4일동안 문제집에 있는 문제를 모두 풀려고 한다. 첫 날에 문제의 1/2개를 풀고 두번째 날에는 1/4을 풀고 세번째 날에 1/6을 풀었고 네번째 날에는 20문제가 남았습니다. 문제집에는 모두 몇 문제가 있나요?

Answer: 240

Solution (Python):
var_a = 20
var_b = 1
var_c = 0.5
var_d = 0.25
var_e = var_c + var_d
var_f = 0.16666666666666666
var_g = var_e + var_f
var_h = var_b - var_g
var_i = var_a / var_h
print(int(eval('{:.2f}'.format(round(var_i+1e-10,2)))))
Category: Geometry

Question (EN): Hyungjin and Kyujun have been making a cube statue. The length of one side of the statue of Hyungjin is 100 centimeters (cm), and the length of one side of the statue of Gyujun is 2 meters (m). How many times the volume of the statue is different between the two?
Question (KO): 형진이와 규준이가 정육면체의 조각상을 만들어 왔다. 형진이의 조각상 한 변의 길이는 100센티미터(㎝), 규준이 조각상의 한 변의 길이는 2미터(m)이다. 두 사람의 조각상 부피는 몇 배 차이인가?

Answer: 8

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

Question (EN): There are 5 boxes of apples of the same weight in the supermarket. After removing 30 kilograms (kg) of apples from each box, the weight of the remaining apples in the five boxes was equal to the weight of the apples in the original two boxes. How many kilograms (kg) of apples were originally in each box?
Question (KO): 마트에 같은 무게의 사과를 담은 상자가 5개 있습니다. 각 상자에서 사과를 30킬로그램(㎏)씩 꺼낸 후, 5개의 상자에 남은 사과의 무게를 재어 보니 원래 상자 2개의 사과의 무게와 같았습니다. 원래 각 상자에 들어 있던 사과는 몇 킬로그램(㎏)입니까?

Answer: 50

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

Question (EN): You are going to subtract the diameter of the smallest circle from the diameter of the largest circle among three circles (a), (b), and (c) with areas of 48 square centimeters (cm2), 108 square centimeters (cm2), and 75 square centimeters (cm2), respectively. Find the value in centimeter (cm) if pi is 3.

Question (KO): 넓이가 각각 48제곱센티미터(㎠), 108제곱센티미터(㎠), 75제곱센티미터(㎠)인 세 원 (가), (나), (다)에서 가장 큰 원의 지름에서 가장 작은 원의 지름을 빼려고 합니다. 원주율을 3으로 계산하면 몇 센티미터(cm)인지 구하시오.

Answer: 4

Solution (Python):
var_a = 48
var_b = 3
var_c = var_a / var_b
var_d = 1
var_e = 2
var_f = var_d / var_e
var_g = var_c ** var_f
var_h = 108
var_i = 3
var_j = var_h / var_i
var_k = 1
var_l = 2
var_m = var_k / var_l
var_n = var_j ** var_m
var_o = 75
var_p = 3
var_q = var_o / var_p
var_r = 1
var_s = 2
var_t = var_r / var_s
var_u = var_q ** var_t
list_a= []
if "/" in str(var_u):
    var_u = eval(str(var_u))
list_a.append(var_u)
if "/" in str(var_n):
    var_n = eval(str(var_n))
list_a.append(var_n)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_a.append(var_g)
list_a.reverse()
var_v = 1
list_b=list_a.copy()
list_b.sort()
var_w = list_b[-var_v]
var_x = 1
list_c=list_a.copy()
list_c.sort()
var_y = list_c[var_x-1]
var_z = var_w - var_y
var_A = 2
var_B = var_z * var_A
print(int(var_B))
Category: Arithmetic calculation

Question (EN): There are 2 sticks of different lengths. The length of the long stick is 18 centimeters (cm) longer than the length of the short stick, and the sum of the lengths of the two sticks is 30 centimeters (cm). Find how many sticks with the same length as the shorter sticks can be made by cutting the longer sticks.
Question (KO): 길이가 서로 다른 막대 2개가 있습니다. 긴 막대의 길이는 짧은 막대의 길이보다 18센티미터(㎝) 더 길고, 두 막대의 길이의 합은 30센티미터(㎝)입니다. 긴 막대를 잘라 짧은 막대와 길이가 같은 막대를 몇 개 만들 수 있는지 구해 보시오.

Answer: 4

Solution (Python):
var_a = 30
var_b = 18
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
var_f = 18
var_g = var_e + var_f
var_h = 30
var_i = 18
var_j = var_h - var_i
var_k = 2
var_l = var_j / var_k
var_m = var_g / var_l
print(int(var_m))
Category: Arithmetic calculation

Question (EN): The number of (a) trees is twice the number of (b) trees, and there are 15 more (c) trees than (a) trees. If there are 47 (c) trees, how many (a), (b), (c) trees are there in total?
Question (KO): (가) 나무 수는 (나) 나무 수의 2배이고, (다) 나무는 (가) 나무보다 15그루 더 많습니다. (다) 나무가 47그루 있을 때, (가), (나), (다) 나무는 모두 몇 그루입니까?

Answer: 95

Solution (Python):
var_a = 47
var_b = 15
var_c = var_a - var_b
var_d = 47
var_e = 15
var_f = var_d - var_e
var_g = 2
var_h = var_f / var_g
var_i = var_c + var_h
var_j = 47
var_k = var_i + var_j
print(int(var_k))
Category: Arithmetic calculation

Question (EN): On the train, Yoojeong moved 3 stops and Namjoon moved 2 stops. How many stops did Yoojung and Namjoon travel by train?
Question (KO): 기차를 타고 유정이는 3정거장, 남준이는 2정거장을 이동하였습니다. 유정이와 남준이가 기차로 이동한 정거장 수는 얼마인가요?

Answer: 5

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

Question (EN): I decided to share 1 liter (L) of milk with my friends. Of these, Myeongseok drank 0.1 liters (L), and Mingu drank 0.2 liters (L) more than Myeongseok. After a while, if Min-jae came and drank 0.3 liters (L) of milk, how many liters (L) of milk could I drink?
Question (KO): 1리터(L)의 우유를 친구들과 나눠 마시기로 했습니다. 이 중에서 명석이가 0.1리터(L)를 마셨고, 민구는 명석이보다 0.2리터(L)를 더 마셨습니다. 잠시 후 민재가 와서 0.3리터(L)의 우유를 마셨다면, 내가 마실 수 있는 우유는 몇 리터(L)입니까?

Answer: 0.3

Solution (Python):
var_a = 1
var_b = 0.1
var_c = var_a - var_b
var_d = 0.1
var_e = 0.2
var_f = var_d + var_e
var_g = var_c - var_f
var_h = 0.3
var_i = var_g - var_h
print('{:.2f}'.format(round(var_i+1e-10,2)))
Category: Comparison

Question (EN): Mina drank 0.3 liters (l) of Coke twice. Seokhyung drank 3/2 liter (l). If Songhwa drank 0.6 liters (l) less than Seokhyung, who drank the most cola?
Question (KO): 미나는 콜라를 0.3리터(L)씩 2번 마셨습니다. 석형이는 3/2리터(L) 마셨습니다. 송화는 석형이보다 0.6리터(L) 적게 마셨다면 콜라를 가장 많이 마신 사람은 누구입니까?

Answer: Seokhyung

Solution (Python):
var_a = 'Mina'
var_b = 'Seokhyung'
var_c = 'Songhwa'
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 = 0.3
var_e = 2
var_f = var_d * var_e
var_g = 3
var_h = 2
var_i = var_g / var_h
var_j = 3
var_k = 2
var_l = var_j / var_k
var_m = 0.6
var_n = var_l - var_m
list_b= []
if "/" in str(var_n):
    var_n = eval(str(var_n))
list_b.append(var_n)
if "/" in str(var_i):
    var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
var_o = 1
list_c=list_b.copy()
list_c.sort()
var_p = list_c[-var_o]
var_q = list_b.index(var_p)+1
var_r = list_a[var_q-1]
print(var_r)
Category: Correspondence

Question (EN): A number that is a multiple of 7, when divided by 2, 3, 4, 5, or 6, has a remainder of 1. Find the third smallest of these numbers.
Question (KO): 7의 배수이면서 2, 3, 4, 5, 6으로 나누면 나머지가 모두 1인 수가 있다. 이러한 수 중에서 셋째로 작은 수를 구하여라.

Answer: 1141

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 = 2
var_e = 1
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 = 3
var_g = 1
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 = 4
var_i = 1
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 = 5
var_k = 1
list_e = [] 
var_j = int(var_j)
var_k = int(var_k)
if var_k < 0:
    var_k = var_k + var_j
for i in list_d:
    i = int(i)
    if i%var_j == var_k:
        list_e.append(i)
var_l = 6
var_m = 1
list_f = [] 
var_l = int(var_l)
var_m = int(var_m)
if var_m < 0:
    var_m = var_m + var_l
for i in list_e:
    i = int(i)
    if i%var_l == var_m:
        list_f.append(i)
var_n = 7
list_g = []
var_n = int(var_n)
for i in list_f:
    i = int(i)
    if i % var_n == 0:
        list_g.append(i)
var_o = 3
list_h=list_g.copy()
list_h.sort()
var_p = list_h[var_o-1]
print(int(var_p))
Category: Arithmetic calculation

Question (EN): We have a machine that produces 370 pencils a day. How many days will it take to produce 1000 dozen pencils on this machine?
Question (KO): 하루에 연필을 370자루씩 생산하는 기계가 있습니다. 이 기계로 연필 1000타를 생산하려면 며칠이 걸립니까?

Answer: 33

Solution (Python):
var_a = 1000
var_b = 12
var_c = var_a * var_b
var_d = 370
var_e = var_c / var_d
var_f = 1
var_g=int(((var_e+9*10**(var_f-2))//(10**(var_f-1)))*10**(var_f-1))

print(int(var_g))
Category: Arithmetic calculation

Question (EN): Bacteria split into two in one minute. If after 1 minute it becomes 2, and after 2 minutes it becomes 4, and so on, how many will there be after 8 minutes?
Question (KO): 세균은 1분에 2마리로 갈라집니다. 1분 후에는 2마리가 되고, 2분 후에는 4마리가 되는 식으로 늘어난다면, 8분 후에는 몇 마리가 되어있겠습니까?

Answer: 256

Solution (Python):
var_a = 2
var_b = 8
var_c = var_a ** var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): There are four numbers 10, 11, 12, and 13. What is the remainder when divided by the 3rd largest number and the 2nd largest number?
Question (KO): 4개의 수 10, 11, 12, 13이 있습니다. 그 중에서 3번째로 큰 수와 2번째로 큰 수로 나눈 나머지는 얼마입니까?

Answer: 11

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

Question (EN): How many circles with a radius of 4 centimeters (cm) can be drawn on a line segment of 24 centimeters (cm) without overlapping?
Question (KO): 24센티미터(㎝)의 선분 위에 반지름의 길이가 4센티미터(㎝)인 원을 겹치지 않고 몇 개까지 그릴 수 있습니까?

Answer: 3

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

Question (EN): There are two goblins, Pongpong and Longlong. Pongpong adds 300 each day to 8000, and Longlong adds 500 each day to 5000. It is said that the treasure will be given on the same day as the number of Pongpong and Longlong. How many days can they get the treasure?
Question (KO): 두 도깨비 퐁퐁이와 롱롱이가 있다. 퐁퐁이는 8000에 매일 300씩을 더하고, 롱롱이는 5000에 매일 500씩 더한다. 퐁퐁이와 롱롱이의 숫자가 같은 날 보물을 준다고 한다. 보물은 며칠 후에 받을 수 있는가?

Answer: 15

Solution (Python):
var_a = 8000
var_b = 5000
var_c = var_a - var_b
var_d = 500
var_e = 300
var_f = var_d - var_e
var_g = var_c / var_f
print(int(var_g))
Category: Comparison

Question (EN): Three classes A, B, and C participated in the reading competition. If the students in class A read more than the students in class B, and the students in class C read more than the students in class A, find which class read the fewest books.
Question (KO): 독서대회에 A, B, C 3개의 반이 참가하였습니다. A 반 학생들이 B 반 학생들보다 책을 많이 읽었고 C 반 학생들이 A 반 학생들보다 책을 많이 읽었다면 가장 적은 책을 읽은 반은 어떤 반인지 구하세요.

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: Correspondence

Question (EN): The fishmonger sold half of the fish he had for lunch and 1/3 of the rest for dinner, leaving 12 fish. How many fish did they originally have in the shop?
Question (KO): 생선가게에서 점심에 가지고 있던 생선의 절반을 팔았고, 그 나머지의 1/3을 저녁에 팔았더니 12마리가 남았습니다. 생선가게에서 처음 가지고 있던 생선은 모두 몇마리 입니까?

Answer: 36

Solution (Python):
var_a = 12
var_b = 1
var_c = 0.3333333333333333
var_d = var_b - var_c
var_e = var_a / var_d
var_f = 1
var_g = 0.5
var_h = var_f - var_g
var_i = var_e / var_h
print(int(eval('{:.2f}'.format(round(var_i+1e-10,2)))))
Category: Comparison

Question (EN): I'm trying to put 22 people in order of height. When everyone's height is different, (a) is 13th from the back. If you start with the shortest person, what number does (a) stand in?
Question (KO): 22명을 키가 큰 순서대로 세우려고합니다. 모두의 키가 다를 때 (가)는 뒤에서 13번째이다. 키가 작은 사람부터 다시 세우면 (가)는 몇 번째인가?

Answer: 10

Solution (Python):
var_a = 22
var_b = 13
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e))
Category: Correspondence

Question (EN): Each bag of jellies contains 3 strawberry-flavored jellies and 4 grape-flavored jellies. If you get 25 bags of new jellies today and the total number of strawberry-flavored jellies is 150, how many grape-flavored jellies will there be?
Question (KO): 젤리는 한 봉지에 딸기맛이 3개, 포도맛이 4개가 들어있다고 한다. 오늘 새로운 젤리를 25 봉지 받아서 딸기맛 젤리가 총 150개가 되었을 때, 포도맛 젤리는 몇 개인지 구하시오.

Answer: 100

Solution (Python):
var_a = 150
var_b = 3
var_c = var_a / var_b
var_d = 25
var_e = var_c - var_d
var_f = 4
var_g = var_e * var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): Seokgi and Jihae shared 2 liters (L) and 100 milliliters (㎖) of milk. How many milliliters (ml) of milk must Seokgi drink if he is to drink 200 milliliters (ml) more than Jihae?
Question (KO): 2리터(L) 100밀리리터(㎖)의 우유를 석기와 지혜가 나누어 마시려고 합니다. 석기가 지혜보다 200밀리리터(㎖) 더 많이 마시려면 석기는 몇 밀리리터(㎖)의 우유를 마셔야 합니까?

Answer: 1150

Solution (Python):
var_a = 2
var_b = 1000
var_c = var_a * var_b
var_d = 100
var_e = var_c + var_d
var_f = 200
var_g = var_e + var_f
var_h = 2
var_i = var_g / var_h
print(int(var_i))
Category: Possibility

Question (EN): Jiyeon wants to make the biggest number by using the number cards in front of her once. Given the number cards 1, 4, and 5, what natural number should she create?
Question (KO): 지연이는 앞에 놓인 숫자 카드를 한 번씩 이용해 가장 큰 수를 만들고자 합니다. 숫자 카드 1, 4, 5를 가지고 있을 때, 지연이는 어떤 자연수를 만들어야 합니까?

Answer: 541

Solution (Python):
var_a = 1
var_b = 4
var_c = 5
list_a= []
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = len(list_a)
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 = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
print(int(var_f))
Category: Comparison

Question (EN): Hohyun is 162 centimeters (cm) tall and Seulgi is 159 centimeters (cm) tall. Who is taller?
Question (KO): 호현이는 키가 162센티미터(㎝)이고 슬기는 키가 159센티미터(㎝)입니다. 키가 더 큰 사람은 누구입니까?

Answer: Hohyun

Solution (Python):
var_a = 'Hohyun'
var_b = 'Seulgi'
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 = 162
var_d = 159
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]
var_g = list_b.index(var_f)+1
var_h = list_a[var_g-1]
print(var_h)
Category: Arithmetic calculation

Question (EN): The length of the wooden block of Yoojung is 30 centimeters (cm) shorter from 31 meters (m). Write the length of the wooden block that she has in centimeters (cm).
Question (KO): 유정이 가진 나무도막의 길이는 31미터(m)보다 30센티미터(㎝) 짧습니다. 유정이가 가진 나무도막의 길이를 센티미터(㎝)로 써보시오

Answer: 3070

Solution (Python):
var_a = 31
var_b = 100
var_c = var_a * var_b
var_d = 30
var_e = var_c - var_d
print(int(var_e))
Category: Possibility

Question (EN): Find the sum of the largest and the third largest three-digit number which has 3 in the tens and that can be made by using 1, 7, 4, and 3 once.
Question (KO): 1, 7, 4, 3을 한 번씩 사용하여 십의 자리 숫자가 3인 가장 큰 세 자리 수와 세 번째 큰 세 자리 수의 합을 구하시오.

Answer: 1465

Solution (Python):
var_a = 1
var_b = 7
var_c = 4
var_d = 3
list_a= []
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_e))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_f = 10
var_g = 3
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]
var_j = 3
var_k = list_c[var_j-1]
var_l = var_i + var_k
print(int(var_l))
Category: Comparison

Question (EN): The playground of Dongmin's School is 1105 square meters (m2) and has 650 students. The playground at Yonghee's school is 1440 square meters (m2) and has 960 students. Whose school has the largest playground area per student?
Question (KO): 동민이네 학교의 운동장은 1105제곱미터(㎡)이며 학생 수는 650명입니다. 용희네 학교의 운동장은 1440제곱미터(㎡)이며 학생 수는 960 명입니다. 한 명당 사용하는 운동장의 넓이는 누구의 학교가 더 넓습니까?

Answer: Dongmin

Solution (Python):
var_a = 'Dongmin'
var_b = 'Yonghee'
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 = 1105
var_d = 650
var_e = var_c / var_d
var_f = 1440
var_g = 960
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: Geometry

Question (EN): There is a parallelogram with an area of 44 square centimeters (cm2) and a height of 11 centimeters (cm). What is the length of the base of this parallelogram in centimeters (cm)?
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: Geometry

Question (EN): There are cards in the shape of a rectangle. If the sum of the lengths of the four sides of this card is 46 centimeters (cm) and the length of the width is 7 centimeters (cm) longer than the length of the length, find the length in centimeters (cm) of the width of this card.
Question (KO): 직사각형 모양의 카드가 있습니다. 이 카드의 네 변의 길이의 합은 46센티미터(㎝)이고, 가로의 길이는 세로의 길이보다 7센티미터(㎝) 길다고 할 때, 이 카드의 가로의 길이는 몇 센티미터(㎝)인지 구하시오.

Answer: 15

Solution (Python):
var_a = 46
var_b = 2
var_c = var_a / var_b
var_d = 7
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
var_h = 7
var_i = var_g + var_h
print(int(var_i))
Category: Correspondence

Question (EN): Find the smallest natural number B such that 360÷(A×A×A/B)=5
Question (KO): 360÷(A×A×A/B)=5 를 만족하는 가장 작은 자연수 B를 구하시오

Answer: 3

Solution (Python):
var_a = '360÷(A×A×A/B)=5'
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] = []
candidate_num = [i for i in range(51)]
candi = list(itertools.product(candidate_num, 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)):
        if term_list[i] == '':
            new_eq += str(term_list[i])+op_list[i]
        else:
            new_eq += str(int(term_list[i]))+op_list[i]
    new_eq += str(int(term_list[-1]))
    new_eq=new_eq.replace('=', '==')
    new_eq=new_eq.replace('>==', '>=')
    new_eq=new_eq.replace('<==', '<=')
    eval_result = False
    try:
        if '=' in new_eq and '>' not in new_eq and '<' not in new_eq:
            new_eq=new_eq.replace('==','=')
            new_eq=new_eq.replace('>','')
            new_eq=new_eq.replace('<','')
            new_eq=new_eq.split('=')
            for i in range(len(new_eq)-1):
                eval_result = math.isclose(eval(new_eq[i]), eval(new_eq[i+1]))
                if not eval_result:
                    break
        else:
            eval_result = eval(new_eq)
    except:
        eval_result = False
        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 = 1
list_b=list_a.copy()
list_b.sort()
var_d = list_b[var_c-1]
print(int(var_d))
Category: Arithmetic calculation

Question (EN): There are 9/5, 1/10, 1/2, and 1/6. What do you get if you add them all together?
Question (KO): 9/5과 1/10, 1/2, 1/6이 있습니다. 이들의 총합은 얼마인가요?

Answer: 2.57

Solution (Python):
var_a = 1.8
var_b = 0.1
var_c = var_a + var_b
var_d = 0.5
var_e = var_c + var_d
var_f = 0.16666666666666666
var_g = var_e + var_f
print('{:.2f}'.format(round(var_g+1e-10,2)))