philschmid/DMath huggingface dataset:
Category: Arithmetic calculation

Question (EN): There are 7/10 of the air left in the 10 liter (L) bag. How many liters (liters) of air would we need to put in each bag if we wanted to divide this air equally among 4 bags?
Question (KO): 10리터(L) 봉지에 공기가 7/10만큼 남아 있습니다. 이 공기를 4개의 가방에 똑같이 나누려고 할때 각 가방에 몇 리터(L)의 공기를 넣어야 할까요?

Answer: 1.75

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

Question (EN): There is a shape consisting of 8 angles of the same size. If the side of this figure is 12 centimeters (cm), how many centimeters (cm) is the perimeter?
Question (KO): 크기가 같은 각 8개로 이루어진 도형이 있습니다. 이 도형의 한 변의 길이가 12센티미터(㎝)라면 둘레의 길이는 몇 센티미터(㎝)입니까?

Answer: 96

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

Question (EN): I made the mistake of adding this number to 63, when I should have divided 36 by this number. The result of this miscalculation was 69. How much is it if I calculate it right?
Question (KO): 36에 어떤 수를 나누어야 할 것을 잘못하여 63에 어떤 수를 더했더니 69가 되었습니다. 바르게 계산하면 얼마인지 구하시오.

Answer: 6

Solution (Python):
var_a = 36
var_b = 69
var_c = 63
var_d = var_b - var_c
var_e = var_a / var_d
print(int(var_e))
Category: Possibility

Question (EN): Find how many odd numbers there are when you draw 3 cards from 5 cards each with the numbers 0, 1, 2, 3, 4 written on them to make a three-digit integer.
Question (KO): 0, 1, 2, 3, 4의 수가 각각 적힌 5장의 카드에서 3장을 뽑아 세 자리 정수를 만들 때 홀수는 모두 몇 개인지 구하시오

Answer: 18

Solution (Python):
var_a = 0
var_b = 1
var_c = 2
var_d = 3
var_e = 4
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 = 2
list_c = []
var_g = int(var_g)
for i in list_b:
    i = int(i)
    if i % var_g == 0:
        list_c.append(i)
list_d = list(set(list_b) - set(list_c))
var_h = len(list_d)
print(int(var_h))
Category: Comparison

Question (EN): Minyoung, Yoojung, Yuna, and Jimin went to volunteer in the countryside during summer vacation. Jimin planted more cabbages than Minyoung, and Minyoung planted more cabbages than Yoojung. If Yuna planted fewer cabbages than Yoojung, who planted the fewest cabbages?
Question (KO): 민영, 유정, 유나, 지민이는 여름 방학이 되어 농촌으로 봉사활동을 갔습니다. 지민이가 민영이보다 배추를 많이 심었고, 민영이는 유정이보다 배추를 많이 심었습니다. 유나는 유정이보다 배추를 적게 심었다면, 가장 배추를 적게 심은 사람은 누구입니까?

Answer: Yuna

Solution (Python):
var_a = 'Minyoung'
var_b = 'Yoojung'
var_c = 'Yuna'
var_d = 'Jimin'
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 = 'Minyoung'
var_f = 'Yoojung'
var_g = '>'
var_h = 'Yuna'
var_i = 'Yoojung'
var_j = '<'
var_k = 'Jimin'
var_l = 'Minyoung'
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 = len(list_c)
var_o = list_c[var_n-1]
print(var_o)
Category: Possibility

Question (EN): You want to create three-digit numbers that are less than 550 and greater than 850 by using three numbers from 5, 2, 8, and 0. How many can you make?
Question (KO): 5, 2, 8, 0 중에서 3개의 숫자를 사용하여 550보다 작고 850보다 큰 세 자리 수를 모두 만들려고 합니다. 총 몇 개의 수를 만들 수 있습니까?

Answer: 6

Solution (Python):
var_a = 5
var_b = 2
var_c = 8
var_d = 0
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 = 550
list_c = []
for i in list_b:
    if i > var_f:
        list_c.append(i)
var_g = 850
list_d = []
for i in list_c:
    if i < var_g:
        list_d.append(i)
var_h = len(list_d)
print(int(var_h))
Category: Possibility

Question (EN): How many two-digit natural numbers can be formed by drawing and placing two of the number cards 0, 1, and 5?
Question (KO): 숫자 카드 0, 1, 5 중 두 가지를 뽑아 배치하여 만들 수 있는 두 자리 자연수의 경우는 모두 몇 가지입니까?

Answer: 4

Solution (Python):
var_a = 0
var_b = 1
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 = 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): Numbers are written on the dolls the three people have. The average of the numbers written on the first and second person's dolls is 23 greater than the sum of the numbers written on all the dolls and divided by 3. The average of the numbers on the second and third person's dolls was 17 less than the numbers written on all the dolls and divided by 3. If the number written on the second person's doll is 66, find the average of the numbers written on the three people dolls.
Question (KO): 세 사람이 가진 인형에 숫자가 적혀 있다. 모든 인형에 적힌 숫자를 더한 후, 3으로 나눈 값보다 첫 번째, 두 번째 사람이 가진 인형의 평균이 23만큼 더 컸고, 두 번째, 세 번째 사람의 인형에 적힌 수의 평균이 17 더 작았다. 두 번째 사람의 인형에 적힌 수가 66일 때, 세 사람 인형에 적힌 수의 평균을 구하여라.

Answer: 44

Solution (Python):
var_a = 66
var_b = 17
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 3
var_g = var_e * var_f
var_h = 17
var_i = 23
var_j = var_h + var_i
var_k = 2
var_l = var_j * var_k
var_m = var_g + var_l
var_n = 66
var_o = 2
var_p = var_n * var_o
var_q = var_m - var_p
var_r = 2
var_s = 2
var_t = var_r + var_s
var_u = 3
var_v = var_t - var_u
var_w = var_q / var_v
print(int(var_w))
Category: Geometry

Question (EN): The width of the rectangle-shaped tulip flower field was measured with a tape measure of 2 meters (m) and 50 centimeters (cm) in length. If the length of the flower field is 80 centimeters (cm) longer than 5 times the tape measure, how many centimeters (cm) is the length of the tulip flower field?
Question (KO): 길이가 2미터(m) 50센티미터(㎝)인 줄자로 직사각형 모양의 튤립 꽃밭의 가로의 길이를 재었습니다. 꽃밭의 세로의 길이가 줄자의 5배보다 80센티미터(㎝) 더 길다면, 튤립 꽃밭의 세로 길이는 몇 센티미터(㎝)입니까?

Answer: 1330

Solution (Python):
var_a = 2
var_b = 100
var_c = var_a * var_b
var_d = 50
var_e = var_c + var_d
var_f = 5
var_g = var_e * var_f
var_h = 80
var_i = var_g + var_h
print(int(var_i))
Category: Correspondence

Question (EN): 3A+B82=216. How much is A?
Question (KO): 3A+B82=216입니다. A는 얼마인가요?

Answer: 4

Solution (Python):
var_a = '3A+B82=216'
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] = 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): Yoojeong has fewer marbles than Taehyung. Yoojeong has fewer marbles than Seokjin. Seokjin has more marbles than Taehyung. Who has the most marbles?
Question (KO): 유정이는 태형이보다 구슬을 더 적게 가지고 있습니다. 유정이는 석진이보다 구슬을 더 적게 가지고 있습니다. 석진이는 태형이보다 구슬을 더 많이 가지고 있습니다. 구슬을 가장 많이 가지고 있는 사람은 누구입니까?

Answer: Seokjin

Solution (Python):
var_a = 'Yoojeong'
var_b = 'Taehyung'
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 = 'Yoojeong'
var_e = 'Taehyung'
var_f = '<'
var_g = 'Yoojeong'
var_h = 'Seokjin'
var_i = '<'
var_j = 'Seokjin'
var_k = 'Taehyung'
var_l = '>'
list_b= []
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)
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_m = 1
var_n = list_c[var_m-1]
print(var_n)
Category: Correspondence

Question (EN): When you multiply a number by 7 and then add 21.28, you get 50.68. Find a number.
Question (KO): 어떤 수에 7를 곱한 다음 21.28을 더했더니 50.68이 되었습니다. 어떤 수를 구하시오.

Answer: 4.2

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

Question (EN): One bag in the classroom has 6 compartments and can hold 8 writing instruments in each compartment. Of the 16 bags in the classroom, 5 compartments have no writing utensils, one compartment has 6 writing instruments, and all other compartments contain 8 writing instruments. Find how many writing instruments are in the classroom.
Question (KO): 교실에 있는 가방 한 개에는 6칸이 있고 한 칸에 필기구 8개를 넣을 수 있습니다. 교실에 있는 가방 16개 중에서 필기구가 있지 않는 칸은 5칸이고, 한칸에는 필기구가 6개 있으며 나머지 칸에는 모두 필기구 8개가 들어있습니다. 교실에 있는 필기구는 모두 몇 개인지 구해보시오.

Answer: 726

Solution (Python):
var_a = 16
var_b = 6
var_c = var_a * var_b
var_d = 5
var_e = var_c - var_d
var_f = 1
var_g = var_e - var_f
var_h = 8
var_i = var_g * var_h
var_j = 6
var_k = var_i + var_j
print(int(var_k))
Category: Geometry

Question (EN): There is a rectangular piece of paper measuring 36 centimeters (cm) and 72 centimeters (cm) in width and length. I am going to cut this paper to make a rectangle with the width and length of 3 centimeters (cm) and 4 centimeters (cm) respectively. How many can you make in all?
Question (KO): 가로와 세로의 길이가 각각 36센티미터(㎝), 72센티미터(㎝)인 직사각형 모양의 종이가 있습니다. 이 종이를 잘라서 가로와 세로의 길이가 각각 3센티미터(㎝), 4센티미터(㎝)인 직사각형을 만들려고 합니다. 모두 몇 개를 만들 수 있겠습니까?

Answer: 216

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

Question (EN): I wrote the numbers from 1000 to 2000 sequentially. Find the average of the numbers in each written digit.
Question (KO): 1000부터 2000까지의 수를 차례로 적었다. 쓰여진 각 자리의 숫자의 평균을 구하면 얼마가 되는지 구하시오.

Answer: 14.49

Solution (Python):
var_a = 1000
var_b = 2000
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
list_b=[]
for i in list_a:
    var_d = 0
    i = int(i)
    while i//10 > 0:
        var_d = var_d + i%10
        i = i//10
    var_d = var_d + i%10
    list_b.append(var_d)
list_b = [float(i) for i in list_b]
var_e = sum(list_b)/len(list_b)
print('{:.2f}'.format(round(var_e+1e-10,2)))
Category: Arithmetic calculation

Question (EN): Streetlights are standing on one side of the road at intervals of 34.1 meters (m). If the length of the road is 852.5 meters (m), find how many streetlights are on one side of the road. The thickness of the streetlight is not considered.
Question (KO): 도로 한쪽에 가로등이 34.1미터(m) 간격으로 세워져 있습니다. 도로의 길이가 852.5미터(m)일 때, 도로 한쪽에 세워진 가로등은 모두 몇 개인지 구하시오. 단, 가로등의 두께는 생각하지 않습니다.

Answer: 25

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

Question (EN): JungKook took the elevator from the entrance of the apartment and arrived on the third floor. At this time, Jimin was going up the stairs from the entrance of the same apartment building and passing by the 5th floor. Who climbed higher?
Question (KO): 정국이가 아파트 입구에서 엘리베이터를 타고 올라가서 3층에 도착했습니다. 이때 지민이는 같은 아파트 입구에서 계단을 올라 5층을 지나가고 있었습니다. 더 높이 올라간 사람은 누구입니까?

Answer: Jimin

Solution (Python):
var_a = 'Jungkook'
var_b = 'Jimin'
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 = 3
var_d = 5
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): There are 247 first-year students at Junseo's school, and 131 more sophomores than first-year students. If you are going to distribute one loaf to each first grader and second grader, how many loaves do you need to prepare in total?
Question (KO): 준서네 학교의 1학년 학생은 247명이며, 2학년 학생은 1학년 학생보다 131명 더 많습니다. 1학년 학생과 2학년 학생에게 한 명당 하나씩 빵을 나누어주려고 할 때, 빵은 모두 몇 개 준비해야 합니까?

Answer: 625

Solution (Python):
var_a = 247
var_b = 247
var_c = 131
var_d = var_b + var_c
var_e = var_a + var_d
print(int(var_e))
Category: Comparison

Question (EN): Shinyoung read 1/3, Seokgi 1/4, and Woong 1/5. Who has read the most children's books?
Question (KO): 신영은 1/3, 석기는 1/4, 웅이는 1/5을 읽었다. 어린이 책을 가장 많이 읽은 사람은 누구입니까?

Answer: Shinyoung

Solution (Python):
var_a = 'Shinyoung'
var_b = 'Seokgi'
var_c = 'Woong'
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 = 1
var_e = 3
var_f = var_d / var_e
var_g = 1
var_h = 4
var_i = var_g / var_h
var_j = 1
var_k = 5
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_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_m = 1
list_c=list_b.copy()
list_c.sort()
var_n = list_c[-var_m]
var_o = list_b.index(var_n)+1
var_p = list_a[var_o-1]
print(var_p)
Category: Correspondence

Question (EN): When A is divided by 7, the quotient is 5 and the remainder is 3. Find A here.
Question (KO): A는 7로 나누었을때 몫이 5 나머지가 3인 수이다. 이때 A를 구하여라.

Answer: 38

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

Question (EN): If Jihye walked 1/5 of the distance to her grandmother's house and took the bus for the rest of the distance, find how many times the total distance was taken by bus.
Question (KO): 지혜가 할머니 댁에 가기 위해 전체 거리의 1/5는 걷고, 나머지 거리는 버스를 타고 갔다면, 버스를 타고 간 거리는 전체 거리의 몇 배인지 구하시오.

Answer: 0.8

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

Question (EN): There are 12 cards with 12 numbers from 1 to 12. When one of these cards is drawn, checked, and then put back in to draw another card, find the number of times a multiple of 3 comes out the first time and a multiple of 4 comes out the second time.
Question (KO): 1에서 12까지 총 12개의 숫자가 적힌 12개의 카드가 있다. 이 중 하나를 뽑아 확인하고 다시 집어넣어 한 장을 다시 뽑는 행동을 할 때, 처음에 3의 배수가 나오고 두 번째에 4의 배수가 나오는 경우의 수를 구하시오.

Answer: 12

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)
var_f = 4
list_c = []
var_f = int(var_f)
for i in list_a:
    i = int(i)
    if i % var_f == 0:
        list_c.append(i)
var_g = len(list_c)
var_h = var_e * var_g
print(int(var_h))
Category: Arithmetic calculation

Question (EN): Yoonhyuk is going to wrap a gift box with his friends. One gift box can hold 30 chocolates, and Yoonhyuk has 254 chocolates. After filling the gift box with these chocolates, find out how many more chocolates he will need so that there is no space left in the gift box.
Question (KO): 윤혁이는 친구들과 선물상자를 포장하려고 합니다. 선물상자 하나에는 초콜릿 30개를 넣을 수 있고 윤혁이가 가지고 있는 초콜릿은 254개입니다. 이 초콜릿을 선물상자를 가득채워 나눈 후 선물상자에 남는 공간이 없도록 포장하려면 초콜릿 몇 개가 더 필요한 지 구하세요.

Answer: 16

Solution (Python):
var_a = 30
var_b = 254
var_c = 30
var_d = var_b % var_c
var_e = var_a - var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): There are 41 students in Minji's class, and there are 3 more students living on the south side of the school than students living on the north side of the school. How many students live on the south side of the school?
Question (KO): 민지네 학급의 학생 수는 41명이고, 학교의 남쪽에 사는 학생은 학교의 북쪽에 사는 학생보다 3명 많습니다. 학교의 남쪽에 사는 학생은 몇 명입니까?

Answer: 22

Solution (Python):
var_a = 41
var_b = 3
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
var_f = 3
var_g = var_e + var_f
print(int(var_g))
Category: Comparison

Question (EN): Each of the three people has one card with a number on it. The average of the three number cards is 143, and A's card plus 4.5 is the average of B and C's. If the number on C's card is 3 less than B's, what is the number on C's number card?
Question (KO): 세 사람은 각각 한 장씩 숫자가 적힌 카드를 가지고 있다. 숫자 카드 3개의 평균은 143이며, A의 카드에 4.5를 더한 것이 B와 C 카드의 평균이다. C의 카드에 적힌 수가 B보다 3 작으면, C 숫자 카드에 적힌 수는 얼마인가?

Answer: 143

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

Question (EN): There are 135.1 liters (L) of water. If this is divided into 7 liters (L) buckets of water, how many buckets can be filled?
Question (KO): 물 135.1리터(L) 가 있습니다. 이것을 7리터(L) 들이 물통에 가득 나누어 담는다면 가득 담을 수 있는 물통은 몇 개입니까?

Answer: 19

Solution (Python):
var_a = 135.1
var_b = 7
var_c = var_a // var_b
print(int(var_c))
Category: Comparison

Question (EN): You going to hand out marbles to students. If you hand out 9 for each, it is 1 short, and if you hand out 10 for each, you cannot hand out to a student. How many marbles are there in total?
Question (KO): 구슬을 학생들에게 나누어 주려고 합니다. 9개씩 나누어 주려고 하니 한 개가 부족하고, 10개씩 나누어 주려고 하니 한 학생에게 줄 수 없습니다. 구슬은 총 몇 개입니까?

Answer: 100

Solution (Python):
var_a = 1
var_b = 10
var_c = var_a + var_b
var_d = 10
var_e = 9
var_f = var_d - var_e
var_g = var_c / var_f
var_h = 9
var_i = var_g * var_h
var_j = 1
var_k = var_i + var_j
print(int(var_k))
Category: Correspondence

Question (EN): A and B are two different numbers. Find A in A7-3B=55.
Question (KO): A, B는 서로 다른 두 수입니다. A7-3B=55일때 A를 구하시오.

Answer: 8

Solution (Python):
var_a = 'A7-3B=55'
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] = 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))