philschmid/DMath huggingface dataset:
Category: Correspondence

Question (EN): ABC+ABC+ABC=888. If A, B, and C are all different single digit numbers, what is A?
Question (KO): ABC+ABC+ABC=888입니다. A, B, C가 모두 다른 한 자리 수라면, A는 얼마입니까?

Answer: 2

Solution (Python):
var_a = 'ABC+ABC+ABC=888'
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: Arithmetic calculation

Question (EN): You mistakenly distributed colored papers equally to 5 people instead of to 4 people, and each person got 15 papers and 2 papers were left. If you divide these papers equally to 4 people, how many papers will each person recieve at the maximum?
Question (KO): 색종이를 4명에게 똑같이 나누어 주어야 할 것을 잘못하여 5명에게 똑같이 나누어 주었더니 한 사람당 15장씩 주고 2장이 남았습니다. 이 색종이를 4명에게 똑같이 나누어 주면 한 사람당 최대한 몇 장씩 가지게 됩니까?

Answer: 19

Solution (Python):
var_a = 5
var_b = 15
var_c = var_a * var_b
var_d = 2
var_e = var_c + var_d
var_f = 4
var_g = var_e // var_f
print(int(var_g))
Category: Geometry

Question (EN): When the go stones are lined up without gaps to form a large square, there are three go stones left. It is said that 44 more go stones are needed to increase each horizontal and vertical side of the square by 2 columns. How many go stones are there in all?
Question (KO): 바둑돌을 빈틈없이 늘어놓아 큰 정사각형을 만들었더니 3개의 바둑돌이 남았습니다. 만든 정사각형의 가로 한 변과 세로 한 변을 2열씩 늘리려면 44개의 바둑돌이 더 필요하다고 합니다. 바둑돌은 모두 몇 개입니까?

Answer: 103

Solution (Python):
var_a = 44
var_b = 4
var_c = var_a - var_b
var_d = 4
var_e = var_c / var_d
var_f = 2
var_g = var_e ** var_f
var_h = 3
var_i = var_g + var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): There are 445 yellow fish, which is 38 fewer than blue fish. How many yellow and blue fish are there altogether?
Question (KO): 노란색 물고기가 445마리 있고, 노란색 물고기는 파란색 물고기보다 38마리 더 적습니다. 노란색 물고기와 파란색 물고기는 모두 몇 마리입니까?

Answer: 928

Solution (Python):
var_a = 445
var_b = 445
var_c = 38
var_d = var_b + var_c
var_e = var_a + var_d
print(int(var_e))
Category: Possibility

Question (EN): Find the difference between the largest even number and the smallest odd number when forming a four-digit number using each of the four numbers 0, 1, 2, 3, 4, 5, and 6 only once.
Question (KO): 0, 1, 2, 3, 4, 5, 6의 숫자 중 서로 다른 4개의 숫자를 한 번씩만 사용하여 네 자리 수를 만들 때, 가장 큰 짝수와 가장 작은 홀수의 차를 구하시오.

Answer: 5519

Solution (Python):
var_a = 0
var_b = 1
var_c = 2
var_d = 3
var_e = 4
var_f = 5
var_g = 6
list_a= []
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()
var_h = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_h))
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_i = 2
list_c = []
var_i = int(var_i)
for i in list_b:
    i = int(i)
    if i % var_i == 0:
        list_c.append(i)
var_j = 1
list_d=list_c.copy()
list_d.sort()
var_k = list_d[-var_j]
list_e = list(set(list_b) - set(list_c))
var_l = 1
list_f=list_e.copy()
list_f.sort()
var_m = list_f[var_l-1]
var_n = var_k - var_m
print(int(var_n))
Category: Correspondence

Question (EN): When this number is divided by 9, the result came out as 8. What do you get when you add 11 to this number?
Question (KO): 9를 어떤 수에서 나누었더니 8이 되었습니다. 11을 어떤 수에 더하면 얼마가 되는지 구하시오.

Answer: 83

Solution (Python):
var_a = 8
var_b = 9
var_c = var_a * var_b
var_d = 11
var_e = var_c + var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): There are 5 boxes of 14 red marbles per box and 9 boxes of 14 blue marbles per box. How many more blue marbles are there than red marbles?
Question (KO): 빨간색 구슬이 한 상자에 14개씩 5상자 있고, 파란색 구슬이 한 상자에 14개씩 9상자 있습니다. 파란색 구슬은 빨간색 구슬보다 몇 개 더 많습니까?

Answer: 56

Solution (Python):
var_a = 14
var_b = 9
var_c = var_a * var_b
var_d = 14
var_e = 5
var_f = var_d * var_e
var_g = var_c - var_f
print(int(var_g))
Category: Comparison

Question (EN): Students are standing in a line at the bus stop. When Minseok is standing 12th from the front and Junho is standing 9th from the back, Junho is standing right behind Minseok. Find the total number of students standing in line at the bus stop.
Question (KO): 버스 정류장에 학생들이 한 줄로 서있습니다. 민석이는 앞에서 12번째에 서 있고 준호는 뒤에서 9번째에 서 있을 때, 민석이 바로 뒤에 준호가 서 있습니다. 버스 정류장에 줄을 서 있는 학생은 총 몇 명인지 구하시오.

Answer: 21

Solution (Python):
var_a = 12
var_b = 9
var_c = var_a + var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): There were 8 marbles before, but only 6 are in the bag now. How many marbles are lost?
Question (KO): 구슬이 8개 있었는데 주머니에 6개만 들어있었습니다. 잃어버린 구슬은 몇 개입니까?

Answer: 2

Solution (Python):
var_a = 8
var_b = 6
var_c = var_a - var_b
print(int(var_c))
Category: Geometry

Question (EN): How many boxes are needed to make a cube by stacking cuboid-shaped boxes with a width of 18 centimeters (cm), a length of 12 centimeters (cm), and a height of 9 centimeters (cm), in minimum?
Question (KO): 가로의 길이가 18센티미터(㎝), 세로의 길이가 12센티미터(㎝), 높이가 9센티미터(㎝)인 직육면체 모양의 상자를 쌓아 정육면체를 만들려고 할 때 필요한 상자의 개수는 최소 몇 개인지 구하시오.

Answer: 24

Solution (Python):
var_a = 18
var_b = 12
var_c = var_b * var_a / math.gcd(int(var_b), int(var_a))
var_d = 9
var_e = var_d * var_c / math.gcd(int(var_d), int(var_c))
var_f = 18
var_g = var_e / var_f
var_h = 18
var_i = 12
var_j = var_i * var_h / math.gcd(int(var_i), int(var_h))
var_k = 9
var_l = var_k * var_j / math.gcd(int(var_k), int(var_j))
var_m = 12
var_n = var_l / var_m
var_o = 18
var_p = 12
var_q = var_p * var_o / math.gcd(int(var_p), int(var_o))
var_r = 9
var_s = var_r * var_q / math.gcd(int(var_r), int(var_q))
var_t = 9
var_u = var_s / var_t
var_v = var_n * var_u
var_w = var_g * var_v
print(int(var_w))
Category: Arithmetic calculation

Question (EN): There are 15 cucumbers in the mart. There are three times as many radishes as there are cucumbers. There are 9 carrots. How many times the number of radishes is equal to the number of carrots?
Question (KO): 마트에 오이가 15개 있습니다. 오이 수의 3배만큼 무가 있습니다. 당근은 9개 있습니다. 무의 수는 당근 수의 몇 배입니까?

Answer: 5

Solution (Python):
var_a = 15
var_b = 3
var_c = var_a * var_b
var_d = 9
var_e = var_c / var_d
print(int(var_e))
Category: Possibility

Question (EN): How many ways are there to line up 5 students?
Question (KO): 5명의 학생을 한 줄로 세우는 방법은 모두 몇 가지입니까?

Answer: 120

Solution (Python):
var_a = 5
var_b = 5
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: Correspondence

Question (EN): A is a number from 1 to 9, and B is a number from 0 to 9, and AB40C is a multiple of 45. How many five-digit numbers like this can you think of?
Question (KO): A는 1에서 9까지의 수, B는 0에서 9까지의 수이고, AB40C는 45의 배수입니다. 이러한 다섯 자리 수는 모두 몇 개입니까?

Answer: 20

Solution (Python):
var_a = 'AB40C'
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 = 45
list_b = []
var_b = int(var_b)
for i in list_a:
    i = int(i)
    if i % var_b == 0:
        list_b.append(i)
var_c = len(list_b)
print(int(var_c))
Category: Arithmetic calculation

Question (EN): There are five numbers 10, 11, 12, 13, and 14. What is the quotient of the largest number divided by the second largest number?
Question (KO): 5개의 수 10, 11, 12, 13, 14가 있습니다. 그 중에서 가장 큰 수와 2번째로 큰 수로 나눈 몫은 얼마입니까?

Answer: 1

Solution (Python):
var_a = 10
var_b = 11
var_c = 12
var_d = 13
var_e = 14
list_a= []
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
    var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
    var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 1
list_b=list_a.copy()
list_b.sort()
var_g = list_b[-var_f]
var_h = 2
list_c=list_a.copy()
list_c.sort()
var_i = list_c[-var_h]
var_j = var_g // var_i
print(int(var_j))
Category: Arithmetic calculation

Question (EN): It takes 6.64 kg (kg) of glutinous rice flour to make one glutinous rice cake. How many glutinous rice cakes can you make with 212.48 kg (kg) of glutinous rice flour?
Question (KO): 찹쌀떡 1개를 만드는 데 찹쌀가루가 6.64킬로그램(㎏) 필요합니다. 찹쌀가루 212.48킬로그램(㎏)으로 만들 수 있는 찹쌀떡은 모두 몇 개입니까?

Answer: 32

Solution (Python):
var_a = 212.48
var_b = 6.64
var_c = var_a // var_b
print(int(var_c))
Category: Comparison

Question (EN): The distance from Ahyeon's house to grandma's house is 7150 meters (m), and the distance to aunt's house is 6 kilometers (km) and 720 meters (m). Find out which of grandmother's house or aunt's house is closer to Ahyeon's house.
Question (KO): 아현이네 집에서 할머니댁까지의 거리는 7150미터(m)이고, 이모댁까지의 거리는 6킬로미터(㎞) 720미터(m)입니다. 할머니 댁과 이모 댁 중 아현이네 집에서 더 가까운 곳은 어디인지 구하시오.

Answer: aunt

Solution (Python):
var_a = 'grandma'
var_b = 'aunt'
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 = 7150
var_d = 6
var_e = 1000
var_f = var_d * var_e
var_g = 720
var_h = var_f + var_g
list_b= []
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[var_i-1]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l)
Category: Arithmetic calculation

Question (EN): Joonyoung jumped rope 56 times a month for 3 months and Namyoung did 35 times a month for 4 months. How many times did Junyoung and Namyeong jump rope?
Question (KO): 준영이는 줄넘기를 한달에 56번씩 3달 동안 했고 남영이는 한달에 35번씩 4달 동안 했습니다. 준영이와 남영이가 한 줄넘기의 횟수는 모두 몇 번입니까?

Answer: 308

Solution (Python):
var_a = 56
var_b = 3
var_c = var_a * var_b
var_d = 35
var_e = 4
var_f = var_d * var_e
var_g = var_c + var_f
print(int(var_g))
Category: Comparison

Question (EN): Suppose there are seven numbers 1.7, 1/5, 1/5, 1, 3/5, 3/8, and 1.4. Which of these numbers is the fourth largest?
Question (KO): 일곱 개의 수 1.7, 1/5, 1/5, 1, 3/5, 3/8, 1.4가 있습니다. 이 중 네 번째로 큰 수는 무엇입니까?

Answer: 0.6

Solution (Python):
var_a = 1.7
var_b = 0.2
var_c = 0.2
var_d = 1
var_e = 0.6
var_f = 0.375
var_g = 1.4
list_a= []
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()
var_h = 4
list_b=list_a.copy()
list_b.sort()
var_i = list_b[-var_h]
print('{:.2f}'.format(round(var_i+1e-10,2)))
Category: Geometry

Question (EN): Five rows of eight square tiles each measuring 30 centimeters (cm) in width and 30 centimeters (cm) in length were attached to the floor. How many square meters (m2) is the tiled floor?
Question (KO): 바닥에 가로가 30센티미터(㎝), 세로가 30센티미터(㎝)인 정사각형 모양의 타일을 8개씩 5줄 붙였습니다. 타일을 붙인 바닥의 넓이는 몇 제곱미터(㎡)입니까?

Answer: 3.6

Solution (Python):
var_a = 30
var_b = 100
var_c = var_a / var_b
var_d = 2
var_e = var_c ** var_d
var_f = 8
var_g = var_e * var_f
var_h = 5
var_i = var_g * var_h
print('{:.2f}'.format(round(var_i+1e-10,2)))
Category: Possibility

Question (EN): You are to pick 2 cards at the same time out of 9 cards numbered 1 through 9. Find how many ways there are the sum of the two cards is 3.
Question (KO): 1부터 9까지가 적혀 있는 카드 9장 중 2장을 동시에 뽑을 때, 두 장의 합이 3이 나오는 경우의 수를 구하시오.

Answer: 1

Solution (Python):
var_a = 1
var_b = 9
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
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]
list_c=[]
for i in list_b:
    var_e = 0
    i = int(i)
    while i//10 > 0:
        var_e = var_e + i%10
        i = i//10
    var_e = var_e + i%10
    list_c.append(var_e)
var_f = 3
var_g = 0
var_f = int(var_f)
for i in list_c:
    i = int(i)
    if i == var_f:
        var_g = var_g + 1
var_h = 2
var_i = var_g / var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): Twelve students are about to line up on the playground. The total length of the playground is 200 meters (m) and students must keep 20 meters (m) apart. How many students can line up in total?
Question (KO): 20미터(m)간격으로 운동장에 깃발을 설치하려고 합니다. 깃발이 총 12개있으며 운동장의 둘레는 200미터(m)일때 깃발은 몇 개 남습니까?

Answer: 2

Solution (Python):
var_a = 12
var_b = 200
var_c = 20
var_d = var_b / var_c
var_e = var_a - var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): Ho-seok and Min-yeong ran 34 laps around the playground. How many more laps does Min-yeong have to make to equal the number of times Hoseok ran?
Question (KO): 운동장을 호석이는 51바퀴, 민영이는 34바퀴 돌았습니다. 민영이가 몇 바퀴를 더 돌아야 호석이가 돈 횟수와 같아집니까?

Answer: 17

Solution (Python):
var_a = 51
var_b = 34
var_c = var_a - var_b
print(int(var_c))
Category: Geometry

Question (EN): Mijin made a regular pentagon with a side of 16 centimeters (cm) long using wire. When she stretches out this wire again and uses all of it to make a regular octagon, find the length of one side of this regular octagon.
Question (KO): 미진이는 철사를 사용하여 한 변의 길이가 16센티미터(㎝)인 정오각형을 만들었습니다. 이 철사를 다시 펴서 남김없이 모두 사용하여 정팔각형을 만들 때, 이 정팔각형의 한 변의 길이를 구하시오.

Answer: 10

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

Question (EN): Find the number between 4 and 9 that is less than 6.
Question (KO): 6보다 작은 수 중 4와 9 사이에 있는 수를 구하시오.

Answer: 4

Solution (Python):
var_a = 4
var_b = 9
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 6
list_b = []
for i in list_a:
    if i < var_d:
        list_b.append(i)
var_e = 1
var_f = list_b[var_e-1]
print(int(var_f))
Category: Comparison

Question (EN): Jinho and Youngsu have a pencil respectively. Jinho lost 3 out of 9 pencils, and Youngsu gave 7 out of 14 pencils to his younger brother. Who has more pencils between Jinho and Youngsu?
Question (KO): 진호와 영수가 각자 연필을 가지고 있습니다. 진호가 연필 9자루 중 3자루를 잃어버렸고, 영수는 연필 14자루 중 7자루를 동생에게 주었습니다. 진호와 영수 중 누가 더 많은 연필을 가지고 있습니까?

Answer: Youngsu

Solution (Python):
var_a = 'Jinho'
var_b = 'Youngsu'
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 = 9
var_d = 3
var_e = var_c - var_d
var_f = 14
var_g = 7
var_h = var_f - var_g
list_b= []
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[-var_i]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l)
Category: Arithmetic calculation

Question (EN): Yuna went to the stationery store and bought a notebook with half of the money she took, and a pencil with half of the rest, and she had 800 won left. How much money did Yuna take with her in the beginning?
Question (KO): 문구점에 간 유나는 가지고 간 돈의 절반으로 공책을 사고, 나머지 돈의 절반으로 연필을 구매했더니 800원이 남았습니다. 처음에 유나가 가지고 간 돈은 얼마입니까?

Answer: 3200

Solution (Python):
var_a = 800
var_b = 2
var_c = var_a * var_b
var_d = 2
var_e = var_c * var_d
print(int(var_e))
Category: Comparison

Question (EN): Several children are sitting in a circle equally spaced. The 15th child sitting clockwise from a standard child is facing the child who is the standard. How many children are there in total?
Question (KO): 여러 명의 아이들이 같은 간격으로 둥글게 앉아 있습니다. 한 아이를 기준으로 시계 방향으로 15번째 아이는 기준인 아이와 마주 보고 앉아 있습니다. 아이들은 모두 몇 명입니까?

Answer: 30

Solution (Python):
var_a = 15
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: Correspondence

Question (EN): Given two different numbers A and B that satisfy 6A-B2=36, what is the value of subtracting B from A?
Question (KO): 6A-B2=36을 만족하는 서로 다른 두 수 A와 B가 있다고 할 때, A에서 B를 뺀 값은 무엇인지 구하시오.

Answer: 5

Solution (Python):
var_a = '6A-B2=36'
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 = '6A-B2=36'
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))
Category: Possibility

Question (EN): There are 4 balls numbered 1, 2, 3 and 5. Find the sum of the numbers divisible by 7 when you pick two balls and use them only once to form a two-digit number.
Question (KO): 숫자가 적힌 4개의 공 1, 2, 3, 5이 있습니다. 공 중에서 2개를 골라 한 번씩만 사용하여 두 자리 수를 만들었을 때 7로 나눠지는 수들의 합을 구하세요.

Answer: 56

Solution (Python):
var_a = 1
var_b = 2
var_c = 3
var_d = 5
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 = 2
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 = 7
list_c = []
var_f = int(var_f)
for i in list_b:
    i = int(i)
    if i % var_f == 0:
        list_c.append(i)
list_c = [float(i) for i in list_c]
var_g = sum(list_c)
print(int(var_g))