philschmid/DMath huggingface dataset:
Category: Correspondence

Question (EN): If A4+B82=216, what number should go in A?
Question (KO): A4+B82=216일 때, A에 들어가야 하는 숫자는 무엇인가요?

Answer: 3

Solution (Python):
var_a = 'A4+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: Possibility

Question (EN): Find the number of cases of selecting one pencil and one eraser out of 3 types of pencils and 2 types of erasers.
Question (KO): 연필 3종류와 지우개 2종류 중 연필과 지우개를 각각 하나씩 선택할 때, 경우의 수를 구하시오.

Answer: 6

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

Question (EN): You are trying to choose 6 out of 7 tangerines. Find the number of all possible cases.
Question (KO): 귤 7개 중에서 6개를 고르려고 한다. 가능한 모든 경우의 수를 구하시오.

Answer: 7

Solution (Python):
var_a = 7
var_b = 6
var_c = 1
var_a = int(var_a)
var_b = int(var_b)
for i, elem in enumerate(range(var_b)):
    var_c = var_c * (var_a-i)
for i, elem in enumerate(range(var_b)):
    var_c = var_c / (i+1)
print(int(var_c))
Category: Geometry

Question (EN): If A is the number of diagonals in an octagon and B is the number of diagonals in a heptagon, what is the value of A-B?
Question (KO): 팔각형의 대각선의 개수를 A, 칠각형의 대각선의 개수를 B라 할 때, A-B의 값은?

Answer: 6

Solution (Python):
var_a = 8
var_b = 8
var_c = 3
var_d = var_b - var_c
var_e = var_a * var_d
var_f = 2
var_g = var_e / var_f
var_h = 7
var_i = 7
var_j = 3
var_k = var_i - var_j
var_l = var_h * var_k
var_m = 2
var_n = var_l / var_m
var_o = var_g - var_n
print(int(var_o))
Category: Correspondence

Question (EN): 70 is the result of adding 24, multiplying by 5, and dividing by 7 by mistake instead of multiplying by 5, adding 24, and dividing by 7 to a certain number. What is the value if it is correctly calculated?
Question (KO): 70은 어떤수에 5를 곱하고 24를 더한 뒤 7로 나눠야 하는 것을 실수로 24를 더한 뒤 5로 나눈 다음 7을 곱해서 나온 결과입니다. 바르게 계산하면 얼마입니까?

Answer: 22

Solution (Python):
var_a = 70
var_b = 7
var_c = var_a / var_b
var_d = 5
var_e = var_c * var_d
var_f = 24
var_g = var_e - var_f
var_h = 5
var_i = var_g * var_h
var_j = 24
var_k = var_i + var_j
var_l = 7
var_m = var_k / var_l
print(int(var_m))
Category: Geometry

Question (EN): Jaewoong drew the diamond-shaped roof on the drawing paper whose area is 80 square centimeters (cm2). If one diagonal of this roof is 16 centimeters (cm), how long is the other diagonal in centimeters (cm)?
Question (KO): 재웅이가 도화지에 그린 마름모 모양의 지붕은 넓이가 80제곱센티미터(㎠) 였습니다. 이 지붕의 한 대각선의 길이가 16 센티미터(㎝)일 때 다른 대각선의 길이는 몇 센티미터(㎝)일까요?

Answer: 10

Solution (Python):
var_a = 80
var_b = 2
var_c = var_a * var_b
var_d = 16
var_e = var_c / var_d
print(int(var_e))
Category: Correspondence

Question (EN): While Yoongi was adding 57 to the two-digit number, he mistook the 9 in the units digit of the two-digit number for 6. If the sum obtained by Yoongi is 123, what is the correct calculation result?
Question (KO): 윤기는 두 자리 수에 57을 더하던 중, 윤기는 두 자리 수의 일의 자리 숫자 9를 6으로 잘못 봤습니다. 윤기가 구한 합이 123이라고 하면, 바르게 계산한 결과는 무엇인가요?

Answer: 126

Solution (Python):
var_a = 123
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: Arithmetic calculation

Question (EN): Yeonjoo decided to share 18 of the 138 chocolates with her friends and eat the rest herself. If Yeonjoo ate less chocolate than one friend received, find how many chocolates she ate.
Question (KO): 연주는 초콜렛 138개를 친구들에게 18개씩 나눠주고, 남은 것은 본인이 먹기로 하였습니다. 연주가 먹은 초콜릿이 친구 한 명이 받은 초콜릿보다 적을 때, 연주는 몇 개의 초콜릿을 먹었는지 구하시오.

Answer: 12

Solution (Python):
var_a = 138
var_b = 18
var_c = var_a % var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): The total weight of the apples in the basket is 52 kilograms (kg). If it was 28 kg (kg) after removing half of it and weighing it again, how much kg (kg) were the apples alone?
Question (KO): 바구니에 들어있는 사과 전체의 무게는 52킬로그램(㎏)입니다. 절반을 덜어내고 다시 무게를 재니 28킬로그램(㎏)였다면, 기존에 들어있던 사과만의 무게는 몇 킬로그램(㎏)입니까?

Answer: 48

Solution (Python):
var_a = 52
var_b = 28
var_c = var_a - var_b
var_d = 2
var_e = var_c * var_d
print(int(var_e))
Category: Correspondence

Question (EN): Subtract 29 from the original number of candies and divide by 13, leaving only 15 candies. What is the initial number of candies?
Question (KO): 처음 사탕 개수에서 29만큼 빼고 또 13으로 나눠주면 15개밖에 안 남습니다. 처음 사탕 개수는 얼마입니까?

Answer: 224

Solution (Python):
var_a = 15
var_b = 13
var_c = var_a * var_b
var_d = 29
var_e = var_c + var_d
print(int(var_e))
Category: Geometry

Question (EN): There is a box in the shape of a regular dodecahedron. How many edges?
Question (KO): 정십이면체 모양의 상자가 있습니다. 모서리의 개수는?

Answer: 30

Solution (Python):
var_a = 30
print(int(var_a))
Category: Possibility

Question (EN): You are going to buy 17 fruits. If you buy more than one of five types of fruit and allow duplicates, how many ways to buy fruit in total?
Question (KO): 17개의 과일을 구매하려 한다. 다섯 종류의 과일을 1개 이상 구매하고 중복을 허용하여 구매한다면 과일을 사는 방법은 총 몇 가지인가?

Answer: 1820

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

Question (EN): Eunji read 18 pages of the book on Tuesday, and read more on Wednesday as well. Then she read 23 pages of this book on Thursday, thus reading 60 pages in total for 3 days. How many pages did Eunji read on Wednesday?
Question (KO): 은지는 화요일에 책을 18쪽 읽었고, 수요일에도 읽었습니다. 이 책을 목요일에 23쪽 읽어서 3일 동안 모두 60쪽 읽었습니다. 은지는 수요일에 책을 몇 쪽 읽었습니까?

Answer: 19

Solution (Python):
var_a = 60
var_b = 18
var_c = var_a - var_b
var_d = 23
var_e = var_c - var_d
print(int(var_e))
Category: Possibility

Question (EN): I want to create a two-digit number by drawing two different numbers from 0, 1, 3, 5, 7. How many possible two-digit numbers are there?
Question (KO): 0, 1, 3, 5, 7, 중 서로 다른 숫자 2개를 뽑아 두 자리 수를 만들려고 합니다. 가능한 두 자리 수는 모두 몇 개 일까요?

Answer: 16

Solution (Python):
var_a = 0
var_b = 1
var_c = 3
var_d = 5
var_e = 7
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 = 2
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 = len(list_b)
print(int(var_g))
Category: Arithmetic calculation

Question (EN): There are 40 students in Jimin's class. Jimin and Jungkook's math scores are 98 and 100, respectively. Excluding these two students, the average score in math is 79. What is the average math score of Jimin's class?
Question (KO): 지민이네 반 학생 수는 40명입니다. 지민, 정국이의 수학 점수는 각각 98점, 100점입니다. 이 2명을 제외한 학생들의 수학 평균 점수는 79점입니다. 지민이네 반 수학 평균 점수는 몇 점입니까?

Answer: 80

Solution (Python):
var_a = 40
var_b = 2
var_c = var_a - var_b
var_d = 79
var_e = var_c * var_d
var_f = 98
var_g = var_e + var_f
var_h = 100
var_i = var_g + var_h
var_j = 40
var_k = var_i / var_j
print(int(var_k))
Category: Geometry

Question (EN): The bee hive is shaped like a regular hexagon. If the circumference of the bee hive is 43.56 millimeters (mm), what is the length of one side?
Question (KO): 꿀벌의 집은 정육각형 모양입니다. 꿀벌의 집의 둘레가 43.56밀리미터(㎜)일 때 한 변의 길이는 얼마일지 구하시오.

Answer: 7.26

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

Question (EN): While Jimin tried to subtract a number from 34, he subtracted a number from 20 by mistake and got 60. Write down the result of the correct calculation.
Question (KO): 지민이는 34에 어떤 수를 빼려고 합니다. 실수로 20에 어떤 수를 뺐을 때의 결과가 60이라면 바르게 계산한 결과를 구하세요.

Answer: 74

Solution (Python):
var_a = 34
var_b = 20
var_c = 60
var_d = var_b - var_c
var_e = var_a - var_d
print(int(var_e))
Category: Correspondence

Question (EN): Moving a decimal point of a prime number to the right by one place makes it 5.4 more than the original value. What was the original prime number?
Question (KO): 어떤 소수의 소수점을 오른쪽으로 한 칸 옮겼더니 원래의 값보다 5.4 커졌습니다. 원래 소수는 무엇이었는지 구하시오.

Answer: 0.6

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

Question (EN): There are 4 pockets. If there are 16 coins in each pocket, what is the total number of coins?
Question (KO): 4개의 주머니가 있습니다. 각 주머니에는 16개의 동전이 있을 때 동전의 개수는 모두 몇 개인가요?

Answer: 64

Solution (Python):
var_a = 16
var_b = 4
var_c = var_a * var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): Given that 5 times the number of students in first grade who participated in a running competition is the same as the number of students in second grade participating in the match. If only 8 students were from the first grade, how many students participated in the running race in total?
Question (KO): 달리기 시합에 참가한 1학년 학생 수의 5배가 달리기 시합에 참가한 2학년 학생 수와 같습니다. 1학년 학생이 8명 참가하였다면 달리기 시합에 참가한 1학년과 2학년 학생은 모두 몇 명입니까?

Answer: 48

Solution (Python):
var_a = 8
var_b = 5
var_c = var_a * var_b
var_d = 8
var_e = var_c + var_d
print(int(var_e))
Category: Geometry

Question (EN): The stones are laid out in a tight, regular row to form a square with 5 stones at the sides. What is the number of stones laid out on the perimeter?
Question (KO): 바둑돌을 한 변의 개수가 5개인 정사각형이 되도록 빈틈없이 규칙적으로 늘어 놓았습니다. 둘레에 놓인 바둑돌의 개수는 몇 개입니까?

Answer: 16

Solution (Python):
var_a = 5
var_b = 4
var_c = var_a * var_b
var_d = 4
var_e = var_c - var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Yuna had 60 candies. She ate 6 pieces everyday for a week, and she plan to eat 3 pieces a day from now on. How many more days she can eat candy?
Question (KO): 유나는 사탕을 60개 가지고 있었습니다. 일주일 동안 하루에 6개씩 먹었고, 앞으로는 하루에 3개씩 먹으려고 합니다. 유나는 앞으로 사탕을 며칠 더 먹을 수 있는지 구하시오.

Answer: 6

Solution (Python):
var_a = 60
var_b = 6
var_c = 7
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 3
var_g = var_e / var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): A bag containing 14 identical books weighs 11.14 kilograms (kg). If the empty bag weighs 0.5 kilograms (kg), how much does one book weigh in kilograms (kg)?
Question (KO): 똑같은 책 14 권이 들어 있는 가방의 무게는 11.14킬로그램(㎏) 입니다. 빈 가방의 무게가 0.5킬로그램(㎏) 이라면 책 한 권의 무게는 몇 킬로그램(㎏)입니까?

Answer: 0.76

Solution (Python):
var_a = 11.14
var_b = 0.5
var_c = var_a - var_b
var_d = 14
var_e = var_c / var_d
print('{:.2f}'.format(round(var_e+1e-10,2)))
Category: Possibility

Question (EN): We are going to divide the students into 2 groups. How many ways can you divide Jungkook, Jimin, Yoongi, Yuna, and Taehyung? The difference in the number of students in each group is 1 student.
Question (KO): 학생들을 2그룹으로 나누려고 합니다. 정국, 지민, 윤기, 유나, 태형을 나누는 경우는 모두 몇 가지입니까? 각 그룹의 학생 수 차이는 1명 입니다.

Answer: 10

Solution (Python):
var_a = 'Jungkook'
var_b = 'Jimin'
var_c = 'Yoongi'
var_d = 'Yuna'
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 = 1
var_f = int(var_f)
var_g = int(var_g)
for i, elem in enumerate(range(var_g)):
    var_h = var_h * (var_f-i)
for i, elem in enumerate(range(var_g)):
    var_h = var_h / (i+1)
print(int(var_h))
Category: Comparison

Question (EN): Jungkook, Jimin, Seokjin, Taehyung, and Namjoon are lined up in a row. Jungkook is standing to the right of Jimin, and Seokjin is standing to the left of Jimin. When Jeongguk is standing next to Taehyung's left and Seokjin is standing next to Namjoon's left, who is standing to the far right?
Question (KO): 정국, 지민, 석진, 태형, 남준이가 일렬로 줄을 서 있습니다. 정국이는 지민이의 오른쪽 옆에 서 있고, 석진이는 지민이의 왼쪽 옆에 서 있습니다. 태형이의 왼쪽 옆에서는 정국이가, 남준이는 석진이 왼쪽 옆에 서 있을 때, 가장 오른 쪽에 서 있는 사람은 누구 입니까?

Answer: Taehyung

Solution (Python):
var_a = 'Jungkook'
var_b = 'Jimin'
var_c = 'Seokjin'
var_d = 'Taehyung'
var_e = 'Namjoon'
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 = 'Jungkook'
var_g = 'Jimin'
var_h = '>'
var_i = 'Seokjin'
var_j = 'Jimin'
var_k = '<'
var_l = 'Namjoon'
var_m = 'Seokjin'
var_n = '<'
var_o = 'Jungkook'
var_p = 'Taehyung'
var_q = '<'
list_b= []
if "/" in str(var_q):
    var_q = eval(str(var_q))
list_b.append(var_q)
if "/" in str(var_p):
    var_p = eval(str(var_p))
list_b.append(var_p)
if "/" in str(var_o):
    var_o = eval(str(var_o))
list_b.append(var_o)
if "/" in str(var_n):
    var_n = eval(str(var_n))
list_b.append(var_n)
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)
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_r = 1
var_s = list_c[var_r-1]
print(var_s)
Category: Geometry

Question (EN): Including the decimal point, find the sum of the lengths of the four sides of a square with a side length of 14 meters (m), in meters (m).
Question (KO): 한 변의 길이가 14미터(m)인 정사각형의 네 변의 길이의 합은 몇 미터(m)인지 소수점을 포함하여 구하시오.

Answer: 5.6

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

Question (EN): Jungkook has 5 red balls, 4 blue balls, and 3 yellow balls. When Jungkook gives Yoongi 1 blue ball, how many yellow balls does Jungkook have?
Question (KO): 정국이는 빨간 공 5개, 파란 공 4개, 노란 공 3개를 가지고 있습니다. 정국이가 윤기에게 파란 공 1개를 주었을 때, 정국이는 노란 공을 몇 개 가지고 있습니까?

Answer: 3

Solution (Python):
var_a = 3
print(int(var_a))
Category: Arithmetic calculation

Question (EN): How many natural numbers greater than 15 and less than 40 are divisible by 3?
Question (KO): 15 초과 40 미만인 자연수 중에서 3 으로 나누어 떨어지는 수는 모두 몇 개입니까?

Answer: 8

Solution (Python):
var_a = 15
var_b = 1
var_c = var_a + var_b
var_d = 40
var_e = 1
var_f = var_d - var_e
var_g = 1
list_a = [i for i in range(var_c, var_f + 1, var_g)]
var_h = 3
list_b = []
var_h = int(var_h)
for i in list_a:
    i = int(i)
    if i % var_h == 0:
        list_b.append(i)
var_i = len(list_b)
print(int(var_i))
Category: Arithmetic calculation

Question (EN): Jungkook has 3 balls and Yoongi has 2 balls. How many balls do Jungkook and Yoongi have?
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: Geometry

Question (EN): The perimeter of the square is 17.8 centimeters (cm). Find the length of one side of this square.
Question (KO): 정사각형의 둘레가 17.8센티미터(㎝)입니다. 이 정사각형의 한 변 길이를 구하시오.

Answer: 4.45

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

Question (EN): The total number of students in Yoongi's class is 32. Among them, male students account for 5/8 of the total. Among male students, 3/4 of all male students wear glasses. How many male students in Yoongi's class do not wear glasses?
Question (KO): 윤기네 반 전체 학생 수는 32명입니다. 그중에서 남학생은 전체의 5/8입니다. 남학생 중에서 안경을 낀 학생은 남학생 전체의 3/4입니다. 윤기네 반에서 안경을 끼지 않은 남학생은 몇 명입니까?

Answer: 5

Solution (Python):
var_a = 32
var_b = 0.625
var_c = var_a * var_b
var_d = 1
var_e = 0.75
var_f = var_d - var_e
var_g = var_c * var_f
print(int(var_g))
Category: Geometry

Question (EN): I measured the circumference of a hula hoop with a diameter of 100 centimeters (cm) and it was 314 centimeters(cm). How many times bigger is the circumference of this hula hoop compared to its diameter?
Question (KO): 지름이 100 센티미터(㎝) 인 훌라후프의 둘레를 재어 보니 314 센티미터(㎝) 였습니다. 훌라후프의 둘레는 지름의 몇 배입니까?

Answer: 3.14

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

Question (EN): The sum of all the edges of the toy pyramid is 14.8 meters (m). What is the length of one edge of the pyramid if all edges are made the same? Find in meters (m).
Question (KO): 장난감 피라미드의 모든 모서리의 합이 14.8미터(m)입니다. 피라미드는 모든 모서리가 같도록 만들어졌을 때, 한 모서리의 길이는 얼마입니까? 미터(m)로 구하시오.

Answer: 1.85

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

Question (EN): We are trying to create a subtraction equation between two digits using 2, 4, 5, and 8 all at once. Find the result when the difference is largest.
Question (KO): 2, 4, 5, 8을 한 번씩 모두 사용하여 두 자리 수끼리의 뺄셈식을 만들려고 합니다. 차가 가장 클 때의 결과값을 구하시오.

Answer: 61

Solution (Python):
var_a = 2
var_b = 4
var_c = 5
var_d = 8
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 = 1
list_b=list_a.copy()
list_b.sort()
var_f = list_b[-var_e]
var_g = 1
list_c=list_a.copy()
list_c.sort()
var_h = list_c[var_g-1]
var_i = var_f - var_h
var_j = 10
var_k = var_i * var_j
var_l = 2
list_d=list_a.copy()
list_d.sort()
var_m = list_d[-var_l]
var_n = 2
list_e=list_a.copy()
list_e.sort()
var_o = list_e[var_n-1]
var_p = var_m - var_o
var_q = var_k + var_p
print(int(var_q))
Category: Comparison

Question (EN): Nine people stand in a line in order from the shortest to the tallest. Hoseok stands at the 2nd from the front, and Yuna stands the 3rd behind Hoseok. If you organize the line again in order from the tallest people, what place will Yuna stand from the front?
Question (KO): 키가 작은 사람부터 순서대로 9명이 한 줄로 서 있습니다. 호석이는 앞에서부터 2번째에 서 있고, 유나는 호석이로부터 3번째 뒤에 서 있습니다. 키가 큰 사람부터 순서대로 다시 줄을 서면 유나는 앞에서부터 몇 번째에 서게 됩니까?

Answer: 5

Solution (Python):
var_a = 9
var_b = 2
var_c = var_a - var_b
var_d = 3
var_e = var_c - var_d
var_f = 1
var_g = var_e + var_f
print(int(var_g))
Category: Correspondence

Question (EN): Find A when AB+BC=BCB
Question (KO): AB+BC=BCB를 만족하는 A를 구하시오

Answer: 9

Solution (Python):
var_a = 'AB+BC=BCB'
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: Correspondence

Question (EN): A is 238. A is greater than B by 143. B is lesser than C by 304. Find the value of A+C.
Question (KO): A는 238입니다. A는 B보다 143만큼 큽니다. B는 C보다 304만큼 작습니다. A+C의 값을 구하시오.

Answer: 637

Solution (Python):
var_a = 238
var_b = 238
var_c = 143
var_d = var_b - var_c
var_e = 304
var_f = var_d + var_e
var_g = var_a + var_f
print(int(var_g))
Category: Geometry

Question (EN): There are several square-shaped cards. When I laid out these cards to form a square, there were 36 cards left outside the square, so I increased one horizontal and one vertical side by one column, and there were still 3 cards left. How many cards are there in all?
Question (KO): 정사각형 모양의 카드가 여러 장 있습니다. 이 카드를 빈틈없이 늘어놓아 정사각형을 만들고 보니 36장이 남아서, 가로 한 변과 세로 한 변을 1열씩 늘렸더니 아직도 3장이 남았습니다. 카드는 모두 몇 장입니까?

Answer: 292

Solution (Python):
var_a = 36
var_b = 3
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
var_h = 2
var_i = var_g ** var_h
var_j = 36
var_k = var_i + var_j
print(int(var_k))
Category: Geometry

Question (EN): Find the number of diagonals that can be drawn from one vertex of the icosahedron.
Question (KO): 이십각형의 한 꼭짓점에서 그을 수 있는 대각선의 개수를 구하시오.

Answer: 17

Solution (Python):
var_a = 20
var_b = 3
var_c = var_a - var_b
print(int(var_c))