philschmid/DMath huggingface dataset:
Category: Comparison

Question (EN): Among 1.4, 9/10, 1.2, 0.5, and 13/10, pick a number greater than 1.1 and arrange them in descending order. Which number comes first?
Question (KO): 1.4, 9/10, 1.2, 0.5, 13/10 5개 숫자 중에서 1.1보다 큰 숫자를 골라 작은 순서대로 나열했을 때, 가장 앞에 있는 숫자는 무엇입니까?

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

Question (EN): There are four different numbers A, B, C, and D. Find D from the three-digit addition formula 7A4+B6C=D29.
Question (KO): 서로 다른 네 수 A, B, C, D가 있습니다. 세 자리 수끼리의 덧셈식 7A4+B6C=D29에서 D를 구하시오.

Answer: 9

Solution (Python):
var_a = '7A4+B6C=D29'
var_b = 'D'
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: Comparison

Question (EN): There are boxes A, B, C, and D with different weights. Box B is heavier than Box C, and Box A is lighter than Box C. If box D is heavier than B, which box is the heaviest?
Question (KO): 무게가 다른 상자 A, B, C, D가 있습니다. 상자 B는 상자 C보다 무겁고, 상자 A는 상자 C 보다 가볍습니다. 상자 D는 B보다 무거울 때, 가장 무거운 상자는 무엇일까요?

Answer: D

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 = 'B'
var_f = 'C'
var_g = '>'
var_h = 'A'
var_i = 'C'
var_j = '<'
var_k = 'D'
var_l = 'B'
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: Arithmetic calculation

Question (EN): If 28 students were to form teams of 7 against students who had teams of 5, how many total students did not form teams?
Question (KO): 28명의 학생 중 5명씩 팀을 이룬 학생들을 상대로 다시 7명씩 팀을 이루었다면, 팀을 이루지 못한 학생은 총 몇 명입니까?

Answer: 7

Solution (Python):
var_a = 28
var_b = 5
var_c = var_a % var_b
var_d = 28
var_e = 28
var_f = 5
var_g = var_e % var_f
var_h = var_d - var_g
var_i = 7
var_j = var_h % var_i
var_k = var_c + var_j
print(int(var_k))
Category: Geometry

Question (EN): You created a cube with a volume of 2744 cubic centimeters (cm3) by stacking blocks with a volume of 1 cubic centimeter (cm3). How many blocks are stacked up in this cube?
Question (KO): 부피가 1세제곱센티미터(㎤)인 쌓기나무를 쌓아 부피가 2744세제곱센티미터(㎤)인 정육면체를 만들었습니다. 이 정육면체의 쌓기나무는 몇 층으로 쌓여 있습니까?

Answer: 14

Solution (Python):
var_a = 2744
var_b = 0.3333333333333333
var_c = var_a ** var_b
print(int(eval('{:.2f}'.format(round(var_c+1e-10,2)))))
Category: Possibility

Question (EN): If you throw a die of a regular dodecahedron with numbers from 1 to 12 written on each side, how many times will the number of dice roll be a multiple of 3?
Question (KO): 각 면에 1에서 12까지의 숫자가 적힌 정십이면체의 주사위 1개를 던질 때, 나오는 눈의 수가 3의 배수인 경우의 수는?

Answer: 4

Solution (Python):
var_a = 1
var_b = 12
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 3
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 = len(list_b)
print(int(var_e))
Category: Comparison

Question (EN): A, B, and C villages have vineyards. If B village harvested more bunches of grapes than A village and C village harvested fewer bunches than A village, find which village harvested the fewest bunches of grapes.
Question (KO): (가), (나), (다) 마을에는 포도밭이 있습니다. (나) 마을은 (가) 마을보다 포도 송이를 더 많이 수확하였고 (다) 마을은 (가) 마을보다 더 적은 포도 송이를 수확하였다면 가장 적은 포도 송이를 수확한 마을은 어디인지 구하세요.

Answer: C

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 = 'B'
var_e = 'A'
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: Geometry

Question (EN): The lengths of the two diagonals of the rhombus are 6 centimeters (cm) and 4 centimeters (cm). Find the area in square centimeters (cm2) of the stretched rhombus when each of the two diagonals are tripled.
Question (KO): 마름모의 두 대각선의 길이는 6센티미터(㎝), 4센티미터(㎝)입니다. 두 대각선의 길이를 각각 3 배로 늘였을 때, 늘인 마름모의 넓이는 몇 제곱센티미터(㎠)인지 구하시오.

Answer: 108

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

Question (EN): Find B when 1/5×3/4=3/(A×5)=3/B.
Question (KO): 1/5×3/4=3/(A×5)=3/B일 때 B를 구하시오.

Answer: 20

Solution (Python):
var_a = '1/5×3/4=3/(A×5)=3/B'
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] = 0
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] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c))
Category: Arithmetic calculation

Question (EN): One US dollar is equal to 1178.2 won in Korean money. You are going to change 1.2 million won in Korean currency into 1000 US dollars and 10 US dollars. If you change as many 1000-dollar bills as you can, how many 10-dollar bills can you exchange for?
Question (KO): 미국 돈 1 달러는 우리나라 돈으로 1178.2 원입니다. 우리나라 돈 120 만 원을 미국 돈 1000 달러와 10 달러짜리로 바꾸려고 합니다. 1000 달러짜리를 될 수 있는 대로 많이 바꾼다면 10 달러짜리는 몇 장으로 바꿀 수 있습니까?

Answer: 1

Solution (Python):
var_a = 120
var_b = 10000
var_c = var_a * var_b
var_d = 1178.2
var_e = 1000
var_f = var_d * var_e
var_g = var_c % var_f
var_h = 1178.2
var_i = 10
var_j = var_h * var_i
var_k = var_g // var_j
print(int(var_k))
Category: Comparison

Question (EN): In the running competition, Namjoon placed second and Yoongi placed fourth. Hoseok was better than Yoongi, but worse than Namjoon. What is Hoseok's rank?
Question (KO): 달리기 시합에서 남준이는 2등을 했고, 윤기는 4등을 했습니다. 호석이는 윤기보다 잘했지만 남준이보다는 못했습니다. 호석이의 등수는 몇 등입니까?

Answer: 3

Solution (Python):
var_a = 2
var_b = 4
var_c = var_a + var_b
var_d = 2
var_e = var_c // var_d
print(int(var_e))
Category: Comparison

Question (EN): Yujin's bag weighs 9/25 kilograms (kg), and Seungah's bag weighs 0.41 kilograms (kg). Whose bag is heavier?
Question (KO): 유진이의 가방은 9/25킬로그램(㎏)이고, 승아의 가방은 0.41킬로그램(㎏)입니다. 누구의 가방이 더 무겁습니까?

Answer: Seungah

Solution (Python):
var_a = 'Yujin'
var_b = 'Seungah'
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 = 0.36
var_d = 0.41
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): How many balls are there if you have 3 boxes of 5 balls?
Question (KO): 공이 5개가 담겨져 있는 상자를 3개 가지고 있을 때 공의 개수는 몇 개입니까?

Answer: 15

Solution (Python):
var_a = 5
var_b = 3
var_c = var_a * var_b
print(int(var_c))
Category: Possibility

Question (EN): Among Jungkook, Jimin, Yoongi, YooJeong, and Taehyung, we are going to vote for two people by allowing anonymous and duplicates. How many possible cases are there?
Question (KO): 정국, 지민, 윤기, 유정, 태형이 중에 무기명으로 중복을 허용하여 2명에게 투표를 하려고 합니다. 가능한 경우의 수는 몇 가지 일까요?

Answer: 15

Solution (Python):
var_a = 'Jungkook'
var_b = 'Jimin'
var_c = 'Yoongi'
var_d = 'YooJeong'
var_e = 'Taehyung'
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 = len(list_a)
var_g = 2
var_h = var_f + var_g
var_i = 1
var_j = var_h - var_i
var_k = 2
var_l = 1
var_j = int(var_j)
var_k = int(var_k)
for i, elem in enumerate(range(var_k)):
    var_l = var_l * (var_j-i)
for i, elem in enumerate(range(var_k)):
    var_l = var_l / (i+1)
print(int(var_l))
Category: Arithmetic calculation

Question (EN): Find the number of common multiples of 16 and 24 that are no more than 200.
Question (KO): 16과 24의 공배수 중 200 이하인 것의 개수를 구하시오.

Answer: 4

Solution (Python):
var_a = 1
var_b = 200
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 16
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 = 24
list_c = []
var_e = int(var_e)
for i in list_b:
    i = int(i)
    if i % var_e == 0:
        list_c.append(i)
list_d = list(set(list_b) & set(list_c))
var_f = len(list_d)
print(int(var_f))
Category: Arithmetic calculation

Question (EN): Minjae's class collected clothes they do not wear for donation. If the male student's clothes are 2.6 kilograms (kg) and the female student's clothes are 5.98 kilograms (kg), what is the total weight of the clothes collected?
Question (KO): 민제네 학급에서 기부를 위해 안 입는 옷을 모았습니다. 남학생이 낸 옷은 2.6킬로그램(㎏), 여학생이 낸 옷은 5.98킬로그램(㎏)이라면, 모인 옷의 무게는 총 몇 킬로그램(㎏)입니까?

Answer: 8.58

Solution (Python):
var_a = 2.6
var_b = 5.98
var_c = var_a + var_b
print('{:.2f}'.format(round(var_c+1e-10,2)))
Category: Arithmetic calculation

Question (EN): I handed out some of the 29 roses to people, and there were 12 roses left. How many roses did I hand out to people?
Question (KO): 장미 29송이 중 몇 송이를 사람들에게 나누어주고 12송이가 남았습니다. 사람들에게 나누어준 장미는 몇 송이입니까?

Answer: 17

Solution (Python):
var_a = 29
var_b = 12
var_c = var_a - var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): Jihyo gave 3/5 of the marbles she had to Jaesuk and gave 2/3 of the remaining to Gwangsoo. Find how many times as many marbles are left as there were at the beginning.
Question (KO): 지효는 가진 구슬 중 3/5를 재석이에게 주었고 나머지의 2/3을 광수에게 주었다. 남은 구슬은 처음의 얼마인지 구하시오.

Answer: 0.13

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

Question (EN): When I moved the two points at 20 kilometers per hour (km) in the morning and 10 kilometers per hour (km) in the afternoon, there was a difference of 1 hour. Find the time taken to move in the morning.
Question (KO): 두 지점을 움직일 때 오전에는 시속 20킬로미터(㎞)로, 오후에는 시속 10킬로미터(㎞)로 이동했더니 1시간의 차이가 있었다. 오전에 움직일 때 걸린 시간을 구하시오.

Answer: 1

Solution (Python):
var_a = 10
var_b = 1
var_c = var_a * var_b
var_d = 20
var_e = 10
var_f = var_d - var_e
var_g = var_c / var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): There are 5/6, 19/12, 6/7 and 9.51. What is the sum of them?
Question (KO): 5/6과 19/12, 6/7, 9.51이 있습니다. 이들을 모두 더하면 얼마인가요?

Answer: 12.78

Solution (Python):
var_a = 0.8333333333333334
var_b = 1.5833333333333333
var_c = var_a + var_b
var_d = 0.8571428571428571
var_e = var_c + var_d
var_f = 9.51
var_g = var_e + var_f
print('{:.2f}'.format(round(var_g+1e-10,2)))
Category: Geometry

Question (EN): You marked the halfway point of a 12 centimeters (cm) long wooden stick with a red pen. If you marked with a blue pen halfway from one end of the stick to the point marked with a red pen, find the length in centimeters (cm) between the point marked with a red pen and the point marked with a blue pen.
Question (KO): 길이가 12센티미터(㎝)인 나무막대기의 절반 지점에 빨간 펜으로 표시를 해두었습니다. 나무막대기의 한쪽 끝부터 빨간 펜으로 표시된 부분까지의 절반 지점에는 파란 펜으로 표시를 해두었다면, 빨간 펜으로 표시된 부분과 파란 펜으로 표시된 부분 사이의 길이는 몇 센티미터(㎝)인지 구하시오.

Answer: 3

Solution (Python):
var_a = 12
var_b = 2
var_c = var_a / var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e))
Category: Geometry

Question (EN): There are rectangles and squares. The area of a rectangle is 15.1 square centimeters (cm2) larger than that of a square, and its length and width are each 0.8 times and 5 times the length of one corner of the square. Find the area of the first square.
Question (KO): 직사각형과 정사각형이 있습니다. 직사각형의 넓이는 정사각형보다 15.1제곱센티미터(㎠)더 넓고, 가로와 세로의 길이는 정사각형의 한 모서리의 0.8배, 5배 입니다. 처음 정사각형의 넓이를 구하시오.

Answer: 5.06

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

Question (EN): You divide the number which should be multiplied by 0.4 and get 8. How much would it be if you made it right?
Question (KO): 어떤 수에서 0.4를 곱해야 할 것을 나누었더니 8이 되었습니다. 바르게 계산하면 얼마가 되겠습니까?

Answer: 1.28

Solution (Python):
var_a = 8
var_b = 0.4
var_c = var_a * var_b
var_d = 0.4
var_e = var_c * var_d
print('{:.2f}'.format(round(var_e+1e-10,2)))
Category: Arithmetic calculation

Question (EN): There are 300 grams (g) of 8% sugar water. How many grams (g) of water are added to this sugar water to make 5% sugar water?
Question (KO): 8 %의 설탕물 300 그램(g)이 있습니다. 이 설탕물에 물을 몇 그램(g) 넣으면 5 %의 설탕물이 됩니까?

Answer: 180

Solution (Python):
var_a = 300
var_b = 8
var_c = 100
var_d = var_b / var_c
var_e = var_a * var_d
var_f = 100
var_g = 5
var_h = var_f / var_g
var_i = var_e * var_h
var_j = 300
var_k = var_i - var_j
print(int(var_k))
Category: Possibility

Question (EN): 3 students from Class 1 and 3 students from Class 2 are standing in line together. At this time, find the number of cases where 3 students in Class 1 stand in a row.
Question (KO): 1반 학생 3명과 2반 학생 3명이 함께 줄을 서 있다. 이때 1반 학생 3명이 연속으로 서 있는 경우의 수를 구하시오.

Answer: 144

Solution (Python):
var_a = 3
var_b = 3
var_c = var_a + var_b
var_d = 3
var_e = 1
var_f = var_d - var_e
var_g = var_c - var_f
var_h = 3
var_i = 3
var_j = var_h + var_i
var_k = 3
var_l = 1
var_m = var_k - var_l
var_n = var_j - var_m
var_o = 1
var_g = int(var_g)
var_n = int(var_n)
for i, elem in enumerate(range(var_n)):
    var_o = var_o * (var_g-i)
var_p = 3
var_q = 3
var_r = 1
var_p = int(var_p)
var_q = int(var_q)
for i, elem in enumerate(range(var_q)):
    var_r = var_r * (var_p-i)
var_s = var_o * var_r
print(int(var_s))
Category: Arithmetic calculation

Question (EN): How many kilograms (kg) are in 11 bricks if 5 bricks weigh 15.3 kilograms (kg)?
Question (KO): 5개의 무게가 15.3킬로그램(㎏)인 벽돌의 11개는 몇 킬로그램(㎏)입니까?

Answer: 33.66

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

Question (EN): How many faces does a hexahedron have?
Question (KO): 육면체의 면의 개수는?

Answer: 6

Solution (Python):
var_a = 6
print(int(var_a))
Category: Correspondence

Question (EN): A truck is delivering apples to the store. It delivered 300 more apples than 2/5 of the total to the first store, and delivered 200 less than 1/2 of the remaining apples to the second store. If there are 800 apples left, how many apples were loaded on the truck at the beginning?
Question (KO): 트럭이 사과를 가게에 배달하고 있다. 첫 번째 가게에 전체의 2/5보다 300개 많은 사과를 배달하고 두 번째 가게에 남은 사과의 1/2보다 200개 적은 사과를 배달했다. 남은 사과가 800개라면 처음 트럭에 실은 사과의 개수는 몇 개인지 구하시오.

Answer: 2500

Solution (Python):
var_a = 800
var_b = 200
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.4
var_l = var_j - var_k
var_m = var_i / var_l
print(int(var_m))
Category: Comparison

Question (EN): In the running competition, Hoseok placed 8th and Namjoon placed 6th. Yoojung did better than Hoseok, but worse than Namjoon. What rank is Yoojung in?
Question (KO): 달리기 시합에서 호석이는 8등을 했고, 남준이는 6등을 했습니다. 유정이는 호석이보다 잘했지만 남준이보다는 못했습니다. 유정이는 몇 등입니까?

Answer: 7

Solution (Python):
var_a = 8
var_b = 6
var_c = var_a + var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e))
Category: Correspondence

Question (EN): 45 students from Jiyoung's class lined up on the playground. When a certain number of students lined up in each row, it became 11 rows and 1 remained. How many students lined up in a row?
Question (KO): 지영이네 반 학생 45명이 운동장에 줄을 섰습니다. 한 줄에 몇 명씩 섰더니 11줄이 되고 1명이 남았습니다. 한 줄에 몇 명씩 섰습니까?

Answer: 4

Solution (Python):
var_a = 45
var_b = 1
var_c = var_a - var_b
var_d = 11
var_e = var_c / var_d
print(int(var_e))
Category: Correspondence

Question (EN): While Yoongi was subtracting 57 from the two-digit number, Yoongi misread 9 in the units digit of the two-digit number as 6. If the result Yoongi got is 39, what is the result of the correct calculation?
Question (KO): 윤기는 두 자리 수에 57을 빼던 중, 윤기는 두 자리 수의 일의 자리 숫자 9를 6으로 잘못 봤습니다. 윤기가 구한 차가 39라고 하면, 바르게 계산한 결과는 무엇인가요?

Answer: 42

Solution (Python):
var_a = 39
var_b = 57
var_c = var_a + var_b
var_d = 6
var_e = 9
var_f = var_d - var_e
var_g = var_c - var_f
var_h = 57
var_i = var_g - var_h
print(int(var_i))
Category: Correspondence

Question (EN): Rounding down 11A3 to the tens place gives 1130. Find out A.
Question (KO): 11A3을 버림하여 십의 자리까지 나타내면 1130이 됩니다. A를 구하시오.

Answer: 3

Solution (Python):
var_a = '11A3'
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 = 1130
list_b = []
for i in list_a:
    if i >= var_b:
        list_b.append(i)
var_c = 1130
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 = '11A3'
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))