philschmid/DMath huggingface dataset:
Category: Correspondence

Question (EN): There are two different numbers: A and B. Find A from the two-digit addition formula of A7+3B=73.
Question (KO): 서로 다른 두 수 A, B가 있습니다. 두 자리 수끼리의 덧셈식 A7+3B=73에서 A를 구하시오.

Answer: 3

Solution (Python):
var_a = 'A7+3B=73'
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): There are four numbers 0.8, 1/2, 0.9, and 1/3. Which number is the greatest among the numbers that are smaller than or equal to 3?
Question (KO): 4개의 숫자 0.8, 1/2, 0.9, 1/3가 있습니다. 3보다 작거나 같은 수 중 가장 크거나 같은 숫자는 얼마인가요?

Answer: 0.9

Solution (Python):
var_a = 0.8
var_b = 0.5
var_c = 0.9
var_d = 0.3333333333333333
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 = []
for i in list_a:
    if i <= var_e:
        list_b.append(i)
var_f = 1
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
print('{:.2f}'.format(round(var_g+1e-10,2)))
Category: Correspondence

Question (EN): I mistakenly added 267 which should have subtracted from a number, and I got 821. Find out how much it is if you calculate it correctly.
Question (KO): 어떤 수에서 267을 빼야 할 것을 잘못하여 더했더니 821이 되었습니다. 바르게 계산하면 얼마인지 구해 보시오.

Answer: 287

Solution (Python):
var_a = 821
var_b = 267
var_c = var_a - var_b
var_d = 267
var_e = var_c - var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): If a pencil sold at a store is 200 won more expensive than 5,000 won, find the price of the pencil in units of 10,000 won.
Question (KO): 어느 가게에서 파는 연필이 5천원보다 2백원 비쌀 때, 연필의 가격을 만원 단위로 구하시오.

Answer: 0.52

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

Question (EN): There is a pyramid with an octagonal base. How many sides are there?
Question (KO): 밑면이 팔각형인 각뿔이 있습니다. 옆면은 몇 개 일까요?

Answer: 8

Solution (Python):
var_a = 8
print(int(var_a))
Category: Comparison

Question (EN): When 20 students stood in a line, Jungkook is the last, and there are 5 students between Yoongi and Jungkook. How many students are standing behind Yoongi?
Question (KO): 20명의 학생들이 한줄로 섰습니다. 정국이는 꼴지로 줄을 섰고, 윤기와 정국이 사이에는 5명의 학생이 있습니다. 윤기 뒤에 서 있는 학생은 몇 명입니까?

Answer: 6

Solution (Python):
var_a = 20
var_b = 20
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
var_f = 5
var_g = var_e + var_f
print(int(var_g))
Category: Comparison

Question (EN): In the math test, Jungkook placed the 5th, and Kwangsoo placed the 3rd. If Mijoo had a higher score than Jungkook, but a lower score than Kwangsoo, what rank would Mijoo be?
Question (KO): 수학 시험에서 정국이는 5등을 했고, 광수는 3등을 했습니다. 미주는 정국이보다 시험 점수가 높았지만 광수보다는 시험 점수가 낮았습니다. 미주는 몇 등입니까?

Answer: 4

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

Question (EN): What is the value of D among the four different numbers A, B, C, and D that satisfy A+A=6, B-A=4, C+B=9, and D-C=7?
Question (KO): A+A=6, B-A=4, C+B=9, D-C=7을 만족하는 서로 다른 네 수 A, B, C, D 중 D의 값은 무엇인지 구하시오.

Answer: 9

Solution (Python):
var_a = 'A+A=6'
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] = 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]
var_d = 4
var_e = var_c + var_d
var_f = 9
var_g = var_e - var_f
var_h = 7
var_i = var_g - var_h
var_j = -1
var_k = var_i * var_j
print(int(var_k))
Category: Possibility

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

Answer: 240

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

Question (EN): When Minyoung sells 2 tangerines and 7 apples, how many fruits does Minyoung sell?
Question (KO): 민영이가 귤 2개와 사과 7개를 팔았을 때, 민영이가 판 과일의 개수는 몇 개일까요?

Answer: 9

Solution (Python):
var_a = 2
var_b = 7
var_c = var_a + var_b
print(int(var_c))
Category: Comparison

Question (EN): Minsu gave 30 notebooks to Jaehyuk, Kyunghwan, and Jaeho. Jaehyeok received 12 notebooks, Kyunghwan received 3 notebooks, and Jaeho received 15 notebooks. Which friend got the most notebooks?
Question (KO): 민수는 재혁, 경환, 재호에게 공책 30권을 나누어주었습니다. 재혁이는 12개의 공책을, 경환이는 3권의 공책을, 재호는 15권의 공책을 받았습니다. 어떤 친구가 제일 많은 공책을 받았습니까?

Answer: Jaeho

Solution (Python):
var_a = 'Jaehyuk'
var_b = 'Kyunghwan'
var_c = 'Jaeho'
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 = 12
var_e = 3
var_f = 15
list_b= []
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_b.append(var_e)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j)
Category: Possibility

Question (EN): Find the difference between the third largest four-digit number and the fourth largest four-digit number that can be formed by using the numbers 2, 4, 6, and 8 once each.
Question (KO): 숫자 2, 4, 6, 8을 한 번씩 모두 이용하여 만들 수 있는 세 번째로 큰 네 자리 수와 네 번째로 큰 네 자리 수의 차를 구하시오.

Answer: 36

Solution (Python):
var_a = 2
var_b = 4
var_c = 6
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 = 4
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 = 3
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
var_h = 4
list_d=list_b.copy()
list_d.sort()
var_i = list_d[-var_h]
var_j = var_g - var_i
print(int(var_j))
Category: Arithmetic calculation

Question (EN): The average score for Korean and English tests is 92 points, and the average score rises by 2 points when math scores are also considered. What is the score for the math test?
Question (KO): 국어,영어 평균이 92점이며 수학 점수도 고려하면 평균 2점이 오른다. 수학은 몇 점인가?

Answer: 98

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

Question (EN): What is the length of one side of a regular hexagon with a perimeter of 43.56 centimeters (cm)?
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: Geometry

Question (EN): The area of one side of a die is 64 square centimeters (cm2). Find the volume of this die.
Question (KO): 어떤 주사위의 한 면의 넓이는 64제곱센티미터(㎠)입니다. 이 주사위의 부피를 구하시오.

Answer: 512

Solution (Python):
var_a = 64
var_b = 0.5
var_c = var_a ** var_b
var_d = 3
var_e = var_c ** var_d
print(int(var_e))
Category: Possibility

Question (EN): Find the number of numbers less than 500 among three digit numbers where each digit is a odd number.
Question (KO): 각 자리 수가 모두 홀수인 세 자리 수 중 500보다 작은 수의 개수를 구하시오.

Answer: 50

Solution (Python):
var_a = 1
var_b = 9
list_a = []
if var_a%2==0:
    for i in range(var_a+1, var_b+1, 2):
        list_a.append(i)
else:
    for i in range(var_a, var_b+1, 2):
        list_a.append(i)
var_c = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=var_c))
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_d = 500
list_c = []
for i in list_b:
    if i < var_d:
        list_c.append(i)
var_e = len(list_c)
print(int(var_e))
Category: Comparison

Question (EN): Hanul Elementary School has 168 first grade students and 173 second grade students. Find out which grade has more students.
Question (KO): 한울 초등학교의 1학년 학생은 168명이고, 2학년 학생은 173명입니다. 몇 학년 학생이 더 많은지 구하시오.

Answer: 2

Solution (Python):
var_a = 1
var_b = 2
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 = 168
var_d = 173
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(int(var_h))
Category: Geometry

Question (EN): There is a box in the shape of a regular icosahedron. How many edges are there on a face of this box?
Question (KO): 정십이면체 모양의 상자가 있습니다. 이 상장의 면에 있는 변의 개수는?

Answer: 5

Solution (Python):
var_a = 5
print(int(var_a))
Category: Geometry

Question (EN): What is the area of a rectangle with a perimeter of 28 centimeters (cm) and a length of 9 centimeters (cm) in square centimeters (cm2)?
Question (KO): 둘레가 28센티미터(㎝)이고, 가로가 9센티미터(㎝)인 직사각형의 넓이는 몇 제곱센티미터입니까?

Answer: 45

Solution (Python):
var_a = 28
var_b = 9
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 2
var_g = var_e / var_f
var_h = 9
var_i = var_g * var_h
print(int(var_i))
Category: Possibility

Question (EN): Namhee's birthday is on June 18th. He wants to create a three-digit number using all the numbers from his birthday. Find the difference between the second smallest and third smallest possible numbers.
Question (KO): 남희의 생일은 6월 18일이다. 자신의 생일에 나오는 숫자를 모두 이용하여 세 자리 수를 만들고자 한다. 만들 수 있는 수 중 두 번째로 작은 수와 세 번째로 작은 수의 차이를 구하시오.

Answer: 432

Solution (Python):
var_a = 6
var_b = 1
var_c = 8
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 = 3
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 = 2
list_c=list_b.copy()
list_c.sort()
var_f = list_c[var_e-1]
var_g = 3
list_d=list_b.copy()
list_d.sort()
var_h = list_d[var_g-1]
var_i = var_f - var_h
var_j = abs(var_i)
print(int(var_j))
Category: Possibility

Question (EN): I'm trying to put 2 dogs and 2 cats in a line. In how many ways can cats stand in a row?
Question (KO): 강아지 2마리, 고양이 2마리를 한 줄로 세우려고 한다. 고양이끼리 연속으로 서 있는 경우는 모두 몇 가지인가?

Answer: 12

Solution (Python):
var_a = 2
var_b = 1
var_c = var_a + var_b
var_d = 2
var_e = 1
var_f = var_d + var_e
var_g = 1
var_c = int(var_c)
var_f = int(var_f)
for i, elem in enumerate(range(var_f)):
    var_g = var_g * (var_c-i)
var_h = 2
var_i = var_g * var_h
print(int(var_i))
Category: Correspondence

Question (EN): When A5-2B=68, what number should go into A?
Question (KO): A5-2B=68이 성립할 때, A에 들어가야 하는 숫자는 무엇인가요?

Answer: 9

Solution (Python):
var_a = 'A5-2B=68'
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): Subtracting 10 from a certain number results in 15. Hoseok wants to add 5 to the certain number. What value will Hoseok get?
Question (KO): 어떤 수에서 10을 빼면 15가 됩니다. 호석이는 어떤 수에 5를 더하고자 합니다. 호석이가 구한 값은?

Answer: 30

Solution (Python):
var_a = 15
var_b = 10
var_c = var_a + var_b
var_d = 5
var_e = var_c + var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Ten students in Eunji's class were randomly selected and asked about their heights, which were 145 centimeters (cm), 142 centimeters (cm), 138 centimeters (cm), 136 centimeters (cm), 143 centimeters (cm), 146 centimeters (cm), 138 centimeters (cm), 144 centimeters (cm), 137 centimeters (cm), and 141 centimeters (cm). Find the average height of these students in centimeters (cm).
Question (KO): 은지네 반 학생 중 10명을 무작위로 선택해서 키를 물어보았더니, 각각 145센티미터(㎝), 142센티미터(㎝), 138센티미터(㎝), 136센티미터(㎝), 143센티미터(㎝), 146센티미터(㎝), 138센티미터(㎝), 144센티미터(㎝), 137센티미터(㎝), 141센티미터(㎝)였습니다. 이 학생들의 평균 키는 몇 센티미터(㎝)인지 구하시오.

Answer: 141

Solution (Python):
var_a = 145
var_b = 142
var_c = 138
var_d = 136
var_e = 143
var_f = 146
var_g = 138
var_h = 144
var_i = 137
var_j = 141
list_a= []
if "/" in str(var_j):
    var_j = eval(str(var_j))
list_a.append(var_j)
if "/" in str(var_i):
    var_i = eval(str(var_i))
list_a.append(var_i)
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_a.append(var_h)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_a.append(var_g)
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_a.append(var_f)
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
list_a = [float(i) for i in list_a]
var_k = sum(list_a)/len(list_a)
print(int(var_k))
Category: Correspondence

Question (EN): Find A when CD+ACD+ABCD=2967.
Question (KO): CD, ACD, ABCD의 합이 2967일때 A를 구하시오

Answer: 2

Solution (Python):
var_a = 'CD+ACD+ABCD='
var_b = 2967
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=""
for i in list_a:
    i = str(i)
    var_c = var_c + i
var_d = 'A'
ans_dict = dict()
var_c = var_c.replace('×','*')
var_c = var_c.replace('x','*')
var_c = var_c.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_c):
    if v in variable_candi:
        ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
    temp = var_c
    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_c):
        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_e = ans_dict[var_d]
print(int(var_e))
Category: Possibility

Question (EN): Seung-a went on a trip to Gangneung with 5 friends and decided a place to stay. If 1 person sleeps in Room A, 1 person in Room B, and 2 people sleep in Room C, find the number of cases in which Seung-a will sleep in Room A.
Question (KO): 승아는 5명의 친구들과 강릉으로 여행을 가게 되어 숙소를 정하게 되었다. A룸 1명, B룸 1명, C룸에 2명이 자게 되었다고 할 때, 승아가 A룸에서 자게 되는 경우의 수를 구하시오.

Answer: 12

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

Question (EN): There are three numbers 10, 11, and 12. What is the sum of the second-largest number and the smallest number?
Question (KO): 3개의 수 10, 11, 12가 있습니다. 그 중에서 2번째로 큰 수와 가장 작은 수의 합은 얼마입니까?

Answer: 21

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

Question (EN): A rectangular amusement park ticket is 3 centimeters (cm) wide and its area of it is 1.77 square centimeters (cm2). How many centimeters (cm) is the vertical length of this ticket?
Question (KO): 어느 직사각형 모양의 놀이공원 이용권은 넓이가 1.77제곱센티미터(㎠)이고 가로의 길이가 3센티미터(㎝)입니다. 이 이용권의 세로의 길이는 몇 센티미터(㎝) 입니까?

Answer: 0.59

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

Question (EN): 20 students are lined up in a single line. 11 students are standing behind Yoongi, and Hoseok is standing right in front of Yoongi. How many students are standing in front of Hoseok?
Question (KO): 20명의 학생들이 한 줄로 줄을 섰습니다. 윤기의 뒤에는 11명의 학생들이 서 있고, 호석이는 윤기 바로 앞에 서 있습니다. 호석이 앞에 서 있는 학생은 몇 명입니까?

Answer: 7

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

Question (EN): Ji-yeon wants to exchange 170,000 won in Korean money in 1,000 yuan and 10 yuan in Chinese money. After changing all the money that can be exchanged for 1000 yuan bills, if you want to exchange the remaining money for 10 yuan bills, and 161.5 won of Korean money is 1 yuan of Chinese money, how many 10 yuan bills can you get?
Question (KO): 지연이는 우리나라 돈 17만원을 중국 돈 1000위안과 10위안짜리로 바꾸려고 합니다. 1000위안짜리로 바꿀 수 있는 돈을 모두 바꾼 후 남은 돈을 10위안짜리로 바꾸려고 하고 우리나라 돈 161.5원이 중국 돈 1위안이라면, 10위안짜리는 몇 장을 바꿀 수 있습니까?

Answer: 5

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