philschmid/DMath huggingface dataset:
Category: Correspondence

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

Answer: 1

Solution (Python):
var_a = '6A+B2=77'
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] = 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: Geometry

Question (EN): Find the surface area of a cube whose edges are 11 centimeters (cm) long.
Question (KO): 한 모서리의 길이가 11센티미터(㎝)인 정육면체의 겉넓이를 구하시오.

Answer: 726

Solution (Python):
var_a = 11
var_b = 2
var_c = var_a ** var_b
var_d = 6
var_e = var_c * var_d
print(int(var_e))
Category: Geometry

Question (EN): A triangle has vertices of point A, point B, and point C. In this case, the length of side AB is 4.9 centimeters (cm), and the area of this triangle is 9.31 square centimeters (cm2). If a line is drawn perpendicular to side AB from point C and D is the point where it intersects, how many centimeters (cm) is the length of the line segment CD?
Question (KO): 점 A, 점 B, 점 C를 꼭짓점으로 갖는 삼각형이 있습니다. 이때 변 AB의 길이는 4.9센티미터(㎝)이고, 이 삼각형의 넓이는 9.31제곱센티미터(㎠)입니다. 점 C에서 변 AB에 수직이 되도록 선을 그었을 때 만나는 점을 D라고 한다면, 선분 CD의 길이는 몇 센티미터(㎝)인지 구하시오.

Answer: 3.8

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

Question (EN): When A is divided by B, the quotient is C and the remainder is 2. A, B, and C are natural numbers. If B and C are equal, what is the smallest possible number of A?
Question (KO): A를 B로 나눴더니 몫이 C가 되었고, 나머지는 2가 되었습니다. A, B, C는 자연수 입니다. B와 C가 같을 때, 가능한 A 중 가장 작은 수는 무엇인가요?

Answer: 11

Solution (Python):
var_a = 2
var_b = 1
var_c = var_a + var_b
var_d = 2
var_e = var_c ** var_d
var_f = 2
var_g = var_e + var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): There are 34 bottles of juice in the market, and there are 3/2 times as many bottles of water as juice plus 3 bottles of water. How many bottles of bottled water and juice are there in total in the market?
Question (KO): 마트에 주스는 34병 있고, 생수는 주스의 3/2배보다 3병 더 많이 있습니다. 마트에 있는 생수와 주스를 합하면 모두 몇 병입니까?

Answer: 88

Solution (Python):
var_a = 34
var_b = 34
var_c = 1.5
var_d = var_b * var_c
var_e = 3
var_f = var_d + var_e
var_g = var_a + var_f
print(int(var_g))
Category: Correspondence

Question (EN): 125 is the result when you accidentally add 65 to a certain number that you should add 95 to . Find the result of the correct calculation.
Question (KO): 125는 어떤 수에 95를 더해야 하는데 실수로 65를 더했을 때나오는 결과이다. 바르게 계산한 결과를 구하여라.

Answer: 155

Solution (Python):
var_a = 125
var_b = 65
var_c = var_a - var_b
var_d = 95
var_e = var_c + var_d
print(int(var_e))
Category: Correspondence

Question (EN): Divide a certain number by 1/100 and multiply by 10 to get 2804. Find the number.
Question (KO): 어떤 수를 1/100로 나누고 10배를 하면 2804가 된다. 어떤 수를 구하시오.

Answer: 2.8

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

Question (EN): Rounding down A76 to the nearest hundred gives 700. Find the correct number for A.
Question (KO): 백의 자리에서 A76을 버림하면 700이 됩니다. A에 알맞은 숫자를 구하시오.

Answer: 7

Solution (Python):
var_a = 'A76'
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 = 700
list_b = []
for i in list_a:
    if i >= var_b:
        list_b.append(i)
var_c = 700
var_d = 100
var_e = var_c + var_d
list_c = []
for i in list_b:
    if i < var_e:
        list_c.append(i)
var_f = 'A76'
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))
Category: Arithmetic calculation

Question (EN): When I went up the mountain at 3 kilometers (km) per hour and came down 2 kilometers (km) longer road at 4 kilometers (km) per hour, the total hour of going up and down took 4 hours. Find the distance for coming down.
Question (KO): 산을 올라갈 때는 시속 3킬로미터(㎞), 내려올 때는 2킬로미터(㎞)더 긴 길을 시속 4킬로미터(㎞)로 내려왔더니 걸린 두 시간의 합이 4시간이었다. 내려간 거리를 구하라.

Answer: 8

Solution (Python):
var_a = 4
var_b = 2
var_c = 4
var_d = var_b / var_c
var_e = var_a - var_d
var_f = 1
var_g = 3
var_h = var_f / var_g
var_i = 1
var_j = 4
var_k = var_i / var_j
var_l = var_h + var_k
var_m = var_e / var_l
var_n = 2
var_o = var_m + var_n
print(int(var_o))
Category: Possibility

Question (EN): There is a hotel where every room has 3-digit numbers. You have hidden a treasure in a room with digits 3, 0, and 6 all in the room number. How many treasures have you hidden?
Question (KO): 모든 방의 번호가 3개로 이루어진 호텔이 있습니다. 방 번호에 3, 0, 6이 모두 들어있는 방 안에 보물을 숨겨두었습니다. 몇 개의 보물을 숨겨두었습니까?

Answer: 4

Solution (Python):
var_a = 3
var_b = 0
var_c = 6
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 = len(list_b)
print(int(var_e))
Category: Correspondence

Question (EN): You want to multiply a number by 24. When you accidentally added 42, the result was 50. What is the correct value?
Question (KO): 어떤 수에 24를 곱하려고 합니다. 잘못하여 42를 더했을 때의 답이 50이라면 바르게 계산한 결과는 얼마일까요?

Answer: 192

Solution (Python):
var_a = 50
var_b = 42
var_c = var_a - var_b
var_d = 24
var_e = var_c * var_d
print(int(var_e))
Category: Possibility

Question (EN): Find the number in the tens place of the smallest number that can be made by using all of the given number cards 0, 5, and 8 once.
Question (KO): 주어진 숫자카드 0, 5, 8를 한 번씩 모두 사용하여 만들 수 있는 가장 작은 수에 십의 자리에 오는 숫자를 구하시오.

Answer: 0

Solution (Python):
var_a = 0
var_b = 5
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 = len(list_a)
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[var_e-1]
var_g = 100
var_h = var_f % var_g
var_i = 10
var_j = var_h // var_i
print(int(var_j))
Category: Geometry

Question (EN): There is a box in the shape of a cuboid. The sum of all edges is 224 centimeters (cm), and the box's width is 30 centimeters (cm) and its length is 22 centimeters (cm). How many centimeters (cm) is the height of this box?
Question (KO): 직육면체의 모양의 상자가 있습니다. 모든 모서리의 합이 224센티미터(㎝)이며, 상자의 가로는 30센티미터(㎝), 세로는 22센티미터(㎝) 입니다. 이 상자의 높이는 몇 센티미터(㎝)입니까?

Answer: 4

Solution (Python):
var_a = 224
var_b = 4
var_c = var_a / var_b
var_d = 30
var_e = var_c - var_d
var_f = 22
var_g = var_e - var_f
print(int(var_g))
Category: Comparison

Question (EN): Three classes A, B, and C took a math test. If class B's average is higher than class A's, and class C's average is higher than class A's, find the class with the lowest average.
Question (KO): A, B, C 3개 반이 수학 시험을 봤다. B반의 평균이 A반 보다 높고 C반의 평균이 A반보다 높다고 할 때, 평균이 가장 낮은 반은 어디인지 구하시오.

Answer: A

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: Arithmetic calculation

Question (EN): Minyoung has 24 flowers. The number of flowers that Minyoung has is 4 times the number of flowers that Yoojung has. How many flowers do they have?
Question (KO): 민영이는 꽃 24송이를 가지고 있습니다. 민영이가 가지고 있는 꽃의 수는 유정이가 가진 꽃의 수의 4배입니다. 민영이와 유정이가 가진 꽃은 모두 몇 송이입니까?

Answer: 30

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

Question (EN): Among the 18 flowers, 5 were given to Min-Young and 6 to Yoo-Jeong. How many flowers are left?
Question (KO): 꽃 18송이 중 5송이는 민영이에게 6송이는 유정이에게 주었습니다. 남은 꽃은 몇 송이입니까?

Answer: 7

Solution (Python):
var_a = 18
var_b = 5
var_c = var_a - var_b
var_d = 6
var_e = var_c - var_d
print(int(var_e))
Category: Correspondence

Question (EN): I picked one from 41, 43, 45, and 47, and I got a value greater than 43 and less than 46. What is this number?
Question (KO): 41, 43, 45, 47 중 하나를 골랐더니, 43보다 크고 46보다 작은 값이 나왔습니다. 이 수는 무엇입니까?

Answer: 45

Solution (Python):
var_a = 41
var_b = 43
var_c = 45
var_d = 47
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 = 43
list_b = []
for i in list_a:
    if i > var_e:
        list_b.append(i)
var_f = 46
list_c = []
for i in list_b:
    if i < var_f:
        list_c.append(i)
var_g = 1
var_h = list_c[var_g-1]
print(int(var_h))
Category: Correspondence

Question (EN): Yuna gave 2 apples to Minyoung and 7 persimmons to Yoojung, and the number of fruits left is 0. How many fruits did Yuna have?
Question (KO): 유나가 사과 2개를 민영에게 주고, 감 7개를 유정에게 주었더니 남은 과일의 수가 0개입니다. 유나가 가지고 있던 과일의 수는 몇 개인가요?

Answer: 9

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

Question (EN): Sungjun drinks a little milk every day. If he drank 1/3 bottle yesterday and 1/2 bottle today, how many bottles of milk did he drink in two days?
Question (KO): 성준이는 매일 우유를 조금씩 마십니다. 어제는 1/3병을 마셨고, 오늘은 1/2병을 마셨을 때, 이틀 동안 마신 우유는 몇 병입니까?

Answer: 0.83

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

Question (EN): There is a truck that runs at a constant speed of 2.1 kilometers (km) in 1 minute, and a taxi that runs at 10.5 kilometers (km) in 4 minutes. Find how many times the taxi is faster than the truck.
Question (KO): 일정한 빠르기로 1분에 2.1킬로미터(㎞)를 달리는 트럭과 4분에 10.5킬로미터(㎞)를 달리는 택시가 있습니다. 택시는 트럭보다 몇 배 더 빠른지 구하시오.

Answer: 1.25

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

Question (EN): Divide a number by 9 and subtract 13, then divide by 7 and subtract 8 to get 13. Find the number.
Question (KO): 어떤 수를 9로 나누고 13을 뺀 후, 7로 나누고 8을 빼면 13이 됩니다. 어떤 수를 구하시오.

Answer: 1440

Solution (Python):
var_a = 13
var_b = 8
var_c = var_a + var_b
var_d = 7
var_e = var_c * var_d
var_f = 13
var_g = var_e + var_f
var_h = 9
var_i = var_g * var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): A farm raises 64 rabbits, which are 17 fewer than chickens. How many rabbits and chickens does this farm have?
Question (KO): 농장에서 토끼 64마리를 기르는데 닭보다 17마리가 적습니다. 농장에서 기르는 토끼와 닭은 모두 몇 마리입니까?

Answer: 111

Solution (Python):
var_a = 64
var_b = 17
var_c = var_a - var_b
var_d = 64
var_e = var_c + var_d
print(int(var_e))
Category: Possibility

Question (EN): From the numbers 0, 1, 2, 3, and 4, three different numbers were chosen to make a three-digit number. How many of these numbers are divisible by 2, 3, and 5?
Question (KO): 0, 1, 2, 3, 4의 숫자 중에서 서로 다른 3개의 숫자를 골라 네 자리 수를 만들었다. 이 중에서 2, 3, 5로 나누어 떨어지는 수는 모두 몇 가지인가?

Answer: 4

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
var_h = 3
var_i = var_h * var_g / math.gcd(int(var_h), int(var_g))
var_j = 5
var_k = var_j * var_i / math.gcd(int(var_j), int(var_i))
list_c = []
var_k = int(var_k)
for i in list_b:
    i = int(i)
    if i % var_k == 0:
        list_c.append(i)
var_l = len(list_c)
print(int(var_l))
Category: Geometry

Question (EN): There is a park in the shape of a square. If the length of one side of this park is 5 kilometers (km), what is the circumference of this garden in kilometers (km)?
Question (KO): 정사각형 모양의 공원이 있습니다. 이 공원의 한 변의 길이가 5킬로미터(㎞)라면, 이 정원의 둘레는 몇 킬로미터(㎞)입니까?

Answer: 20

Solution (Python):
var_a = 5
var_b = 4
var_c = var_a * var_b
print(int(var_c))
Category: Correspondence

Question (EN): A and B are single digit numbers. A is 4 greater than 2, and 3 less than B is 1. Find the sum of A and B.
Question (KO): A, B는 한 자리 수입니다. A는 2보다 4 큰 수이고, B보다 3 작은 수는 1입니다. A와 B의 합을 구하시오.

Answer: 10

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

Question (EN): Find the number of four-digit integers that can be made by drawing 4 cards out of 5 cards with the numbers 0, 1, 2, 3, and 4 written on them.
Question (KO): 0, 1, 2, 3, 4의 수가 각각 적힌 5장의 카드에서 4장을 뽑아 만들 수 있는 네 자리의 정수의 개수를 구하시오.

Answer: 96

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 = 4
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: Possibility

Question (EN): You are going to paint the three parts A, B, and C that are continuously attached with five colors: red, orange, blue, yellow, and green. Find the number of cases in which a color can be used only once and adjacent areas are painted with different colors.
Question (KO): 연속적으로 붙어 있는 A, B, C 3개의 부분을 빨강, 주황, 파랑, 노랑, 초록 5가지 색으로 칠하려고 한다. 색을 한 번씩만 쓸 수 있고, 이웃한 영역은 서로 다른 색을 칠하는 경우의 수를 구하시오.

Answer: 60

Solution (Python):
var_a = 5
var_b = 3
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)
print(int(var_c))
Category: Geometry

Question (EN): There is a tray in the shape of a rectangle measuring 81/4 centimeters (cm) wide and 148/9 centimeters (cm) long. What is the area of this tray in square centimeters (cm2)?
Question (KO): 가로가 81/4센티미터(㎝), 세로가 148/9센티미터(㎝)인 직사각형 모양의 쟁반이 있습니다. 이 쟁반의 넓이는 몇 제곱센티미터(㎠)니까?

Answer: 333

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

Question (EN): Find the length of one edge of a square made using all 12/25 meters (m) of wire.
Question (KO): 철사 12/25미터(m)를 모두 사용하여 만든 정사각형의 한 변의 길이를 구하시오.

Answer: 0.12

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

Question (EN): You have a triangle whose base is 4.9 centimeters (cm). If the area of this triangle is 9.31 square centimeters (cm2), how many centimeters (cm) is its height?
Question (KO): 밑변의 길이가 4.9센티미터(㎝)인 삼각형이 있습니다. 이 삼각형의 넓이가 9.31제곱센티미터(㎠)라면 높이는 몇 센티미터(㎝)인지 구하시오.

Answer: 3.8

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

Question (EN): In a subtraction between two-digit numbers, the number 2 in the tens digit of the minuend is mistaken for 5, and the number 6 in the ones digit is mistaken for 9, and the result is 44. Find the result of the correct calculation.
Question (KO): 두 자리 수끼리의 뺄셈에서 빼어지는 수의 십의 자리 숫자 2를 5로 잘못 보고, 일의 자리 숫자 6을 9로 잘못 보고 계산하였더니 그 값이 44가 되었습니다. 바르게 계산한 결과를 구하시오.

Answer: 11

Solution (Python):
var_a = 44
var_b = 10
var_c = 2
var_d = 5
var_e = var_c - var_d
var_f = var_b * var_e
var_g = var_a + var_f
var_h = 1
var_i = 6
var_j = 9
var_k = var_i - var_j
var_l = var_h * var_k
var_m = var_g + var_l
print(int(var_m))
Category: Geometry

Question (EN): You have a triangle with an area of 9.31 square centimeters (cm2) and a base of 4.9 centimeters (cm). What is the height of this triangle in centimeters (cm)?
Question (KO): 넓이가 9.31제곱센티미터(㎠)이고 밑변이 4.9센티미터(㎝)인 삼각형이 있습니다. 이 삼각형의 높이는 몇 센티미터(㎝)입니까?

Answer: 3.8

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

Question (EN): If a cube has a square with a perimeter of 52 centimeters (cm) as one side, what is the surface area of the figure?
Question (KO): 둘레가 52센티미터인 정사각형을 한 면으로 갖는 정육면체가 있다면, 이 도형의 겉넓이는 몇인가?

Answer: 1014

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

Question (EN): There are two one-digit number A and B. Find the sum of A and B in 8AA4-BBB=BBBB.
Question (KO): 서로 다른 두 수 A, B가 있습니다. 8AA4-BBB=BBBB에서 A와 B의 합을 구하시오.

Answer: 12

Solution (Python):
var_a = '8AA4-BBB=BBBB'
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]
var_d = '8AA4-BBB=BBBB'
var_e = 'B'
ans_dict = dict()
var_d = var_d.replace('×','*')
var_d = var_d.replace('x','*')
var_d = var_d.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_d):
    if v in variable_candi:
        ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
    temp = var_d
    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_d):
        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_f = ans_dict[var_e]
var_g = var_c + var_f
print(int(var_g))