philschmid/DMath huggingface dataset:
Category: Correspondence

Question (EN): When you multiply a particular number by 6, you get 72. what is that number?
Question (KO): 어떤 수에 6을 곱했더니 72가 되었습니다. 어떤 수는?

Answer: 12

Solution (Python):
var_a = 72
var_b = 6
var_c = var_a / var_b
print(int(var_c))
Category: Geometry

Question (EN): The Go stones are arranged regulary without gaps to form a square. If the number of stones on one side is 6, what is the number of Go stones are placed around the perimeter of the square?
Question (KO): 바둑돌을 정사각형이 되도록 빈틈없이 규칙적으로 늘어놓았습니다. 한 변에 놓여있는 돌의 개수가 6개라면, 둘레에 놓인 바둑돌의 개수는 몇 개입니까?

Answer: 20

Solution (Python):
var_a = 6
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): Mina is currently 200 meters (m) away from the finish line, and her friend, who is currently in the first place, is exactly halfway between Mina and the finish line. How many more meters (m) must the first-place friend run to reach the finish line?
Question (KO): 민아는 현재 달리기 결승점까지 200미터(m)를 앞두고 있고, 현재 1등인 친구는 민아가 있는 곳부터 결승점 사이의 정확히 중간 지점에 있습니다. 1등인 친구는 결승점에 도착하기 위해 몇 미터(m)를 더 뛰어야 합니까?

Answer: 100

Solution (Python):
var_a = 200
var_b = 2
var_c = var_a / var_b
print(int(var_c))
Category: Correspondence

Question (EN): Dividing a number by 3 gives 10. Find the number.
Question (KO): 3으로 어떤 수를 나누었더니 결과가 10이 나왔습니다. 어떤 수를 구하시오.

Answer: 30

Solution (Python):
var_a = 10
var_b = 3
var_c = var_a * var_b
print(int(var_c))
Category: Comparison

Question (EN): 9 students stood in a line. How many students are standing between 7th from the right and 3rd from the right?
Question (KO): 한줄을 9명의 학생이 섰다. 오른쪽에서 7번째와 오른쪽에서 3번째 사이에 서 있는 학생은 몇 명인가?

Answer: 3

Solution (Python):
var_a = 7
var_b = 3
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e))
Category: Possibility

Question (EN): The red bag contains 3 balls with different numbers inscribed, and the blue bag contains 5 balls with different numbers inscribed. Find the number of ways Taemin picks one ball from each of the two pockets.
Question (KO): 빨간 주머니에는 서로 다른 숫자가 적힌 공 3개가 들어있고 파란 주머니에는 서로 다른 숫자가 적힌 공 5개가 들어있습니다. 태민이가 두 개의 주머니에서 각각 공을 한 개씩 고르는 경우의 수를 구하세요.

Answer: 15

Solution (Python):
var_a = 3
var_b = 1
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)
var_d = 5
var_e = 1
var_f = 1
var_d = int(var_d)
var_e = int(var_e)
for i, elem in enumerate(range(var_e)):
    var_f = var_f * (var_d-i)
for i, elem in enumerate(range(var_e)):
    var_f = var_f / (i+1)
var_g = var_c * var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): It is said that Geun-bae jump ropes twice as many times as he skipped the previous day. If Geun-bae did 15 times on the first day, find out how many times he will do it on the fourth day.
Question (KO): 근배는 매일 전날 줄넘기한 횟수의 두배만큼 줄넘기를 한다고 합니다. 근배가 첫날 15번을 했다면 넷째날에는 몇번을 할 지 구해보세요.

Answer: 120

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

Question (EN): You want to create a five-digit number by using the digits 1, 6, and 9 allowing duplicates. How many two-digit numbers can you make?
Question (KO): 숫자 1, 6, 9를 중복하여 사용하여 다섯 자리 수를 만들려고 합니다. 만들 수 있는 두 자리 수는 모두 몇 개 입니까?

Answer: 243

Solution (Python):
var_a = 1
var_b = 6
var_c = 9
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 = 5
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=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: Arithmetic calculation

Question (EN): Geon-wu and Jia turned in opposite directions at the circular playground and met each other. If the circumference of the field is 18 kilometers (km) and Geon-wu runs at 5 kilometers (km) per hour and Jia runs at 4 kilometers (km) per hour, how far did Gern-wu run?
Question (KO): 원 모양의 운동장을 건우와 예준이가 서로 반대 방향으로 돌아서 만났다. 운동장의 둘레가 18킬로미터(㎞)이며 건우는 시속 5킬로미터(㎞)로 지아는 시속 4킬로미터(㎞)로 뛰었을 때 건우가 뛴 거리는 얼마인가?

Answer: 10

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

Question (EN): There is a polygon where only one diagonal can be drawn from a single vertex. How many edges does this polygon have?
Question (KO): 한 꼭짓점에서 그을 수 있는 대각선의 개수가 1개인 다각형의 변의 개수는?

Answer: 4

Solution (Python):
var_a = 1
var_b = 3
var_c = var_a + var_b
print(int(var_c))
Category: Arithmetic calculation

Question (EN): There are a total of 1500 students at Byul's School, 0.4 of which are male students. If 0.65 of the female students at Byul's School don't like PE, how many girls like PE?
Question (KO): 별이네 학교 학생은 모두 1500명이고, 그중 남학생은 전체의 0.4입니다. 별이네 학교 여학생의 0.65가 체육을 좋아하지 않을 때, 체육을 좋아하는 여학생은 몇 명입니까?

Answer: 315

Solution (Python):
var_a = 1500
var_b = 1
var_c = 0.4
var_d = var_b - var_c
var_e = var_a * var_d
var_f = 1
var_g = 0.65
var_h = var_f - var_g
var_i = var_e * var_h
print(int(var_i))
Category: Possibility

Question (EN): The seven digits 0, 1, 2, 3, 4, 5, and 6 are used once to form a seven-digit number. If the number formed is a multiple of 55, find the largest number that can be made.
Question (KO): 일곱 개의 숫자 0, 1, 2, 3, 4, 5, 6을 한 번씩 사용하여 일곱 자리 수를 만들었다. 이 수가 55의 배수일 때, 가장 큰 수를 구하여라.

Answer: 6431205

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 = 7
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 = 55
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]
print(int(var_k))
Category: Arithmetic calculation

Question (EN): The sum of 3 consecutive odd numbers is 28 greater than the largest number of the 3 odd numbers. Write the smallest of the three odd numbers.
Question (KO): 3개의 연속된 홀수의 합은 3개의 홀수 중 가장 큰 홀수보다 28만큼 큽니다. 3개의 홀수 중에서 가장 작은 수를 쓰시오.

Answer: 13

Solution (Python):
var_a = 28
var_b = 2
var_c = 1
var_d = var_b * var_c
var_e = 2
var_f = 2
var_g = var_e * var_f
var_h = var_d + var_g
var_i = var_a + var_h
var_j = 3
var_k = 1
var_l = var_j - var_k
var_m = var_i / var_l
var_n = 2
var_o = 2
var_p = var_n * var_o
var_q = var_m - var_p
print(int(var_q))
Category: Arithmetic calculation

Question (EN): What is the sum of all even numbers from 1 to 200?
Question (KO): 1부터 200까지의 자연수 중 짝수를 모두 더한 값은 얼마입니까?

Answer: 10100

Solution (Python):
var_a = 1
var_b = 200
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)
list_a = [float(i) for i in list_a]
var_c = sum(list_a)
print(int(var_c))
Category: Possibility

Question (EN): How many natural numbers from 100 to 9999 are multiples of 25 and the sum of each digit is 17?
Question (KO): 100부터 9999까지의 숫자 중 25의 배수이고 각 자리의 숫자의 합이 17인 자연수는 모두 몇 개인가?

Answer: 24

Solution (Python):
var_a = 100
var_b = 9999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 25
list_b = []
var_d = int(var_d)
for i in list_a:
    i = int(i)
    if i % var_d == 0:
        list_b.append(i)
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 = 17
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
print(int(var_g))
Category: Arithmetic calculation

Question (EN): There is a car that consumes 0.08 liters (l) of gasoline to travel 1 kilometer (km). Find the amount of gasoline consumed in liters (L) when this car traveled for 2 hours and 36 minutes at a speed of 80 kilometers (km) per hour.
Question (KO): 1킬로미터(㎞)를 가는 데 0.08리터(L)의 휘발유를 소모하는 자동차가 있습니다. 이 자동차를 이용하여 1시간에 80킬로미터(㎞)를 움직이는 빠르기로 2시간 36분을 이동하였을 때, 소모한 휘발유의 양은 몇 리터(L)인지 구하시오.

Answer: 16.64

Solution (Python):
var_a = 0.08
var_b = 80
var_c = 2
var_d = 36
var_e = 60
var_f = var_d / var_e
var_g = var_c + var_f
var_h = var_b * var_g
var_i = var_a * var_h
print('{:.2f}'.format(round(var_i+1e-10,2)))
Category: Geometry

Question (EN): You are going to make a hula hoop that is 14 centimeters (cm) in diameter. How many centimeters (cm) is the radius of the hula hoop?
Question (KO): 지름이 14 센티미터(㎝)인 훌라후프를 만드려고 합니다. 훌라후프의 반지름의 길이는 몇 센티미터(㎝)인가요?

Answer: 7

Solution (Python):
var_a = 14
var_b = 2
var_c = var_a / var_b
print(int(var_c))
Category: Correspondence

Question (EN): How many three-digit numbers are there that are divisible by 4 and have a 3 in the hundreds?
Question (KO): 4로 나누어 떨어지고 백의 자리 숫자가 3인 세 자리 수는 모두 몇 개입니까?

Answer: 25

Solution (Python):
var_a = 3
var_b = 100
var_c = var_a * var_b
var_d = 3
var_e = 100
var_f = var_d * var_e
var_g = 99
var_h = var_f + var_g
var_i = 1
list_a = [i for i in range(var_c, var_h + 1, var_i)]
var_j = 4
list_b = []
var_j = int(var_j)
for i in list_a:
    i = int(i)
    if i % var_j == 0:
        list_b.append(i)
var_k = len(list_b)
print(int(var_k))
Category: Geometry

Question (EN): There are 27 cubes with a side of 3 centimeters (cm). If you stack these cubes to make another cube, what is the surface area of the stacked cubes?
Question (KO): 한 모서리의 길이가 3센티미터(㎝)인 정육면체가 27개 있습니다. 이 정육면체들을 쌓아서 다시 정육면체를 만든다고 할 때, 쌓여진 정육면체의 겉넓이는 얼마입니까?

Answer: 486

Solution (Python):
var_a = 3
var_b = 27
var_c = 0.3333333333333333
var_d = var_b ** var_c
var_e = var_a * var_d
var_f = 2
var_g = var_e ** var_f
var_h = 6
var_i = var_g * var_h
print(int(var_i))
Category: Possibility

Question (EN): I would like to buy 2 kinds of fruit. If the fruits sold in the fruit shop are Apples, Peaches, Pears, and Melons, how many possible ways are there?
Question (KO): 2가지의 과일을 구매하려고 합니다. 과일 가게에서 판매하는 과일이 사과, 복숭아, 배, 참외라면 가능한 경우의 수는 모두 몇 가지입니까?

Answer: 6

Solution (Python):
var_a = 'Apple'
var_b = 'Peach'
var_c = 'Pear'
var_d = 'Melon'
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 = len(list_a)
var_f = 2
var_g = 1
var_e = int(var_e)
var_f = int(var_f)
for i, elem in enumerate(range(var_f)):
    var_g = var_g * (var_e-i)
for i, elem in enumerate(range(var_f)):
    var_g = var_g / (i+1)
print(int(var_g))
Category: Comparison

Question (EN): Jihoon has 7.8 meters (m) of yarn, Dongjun has 6.9 meters (m), and Chowon has 7.2 meters (m). Find out who has the longest yarn length.
Question (KO): 털실을 지훈이는 7.8 미터(m), 동준이는 6.9 미터(m), 초원이는 7.2 미터(m) 가지고 있습니다. 가지고 있는 털실의 길이가 가장 긴 사람은 누구인지 답을 구해 보세요.

Answer: Jihoon

Solution (Python):
var_a = 'Jihoon'
var_b = 'Dongjun'
var_c = 'Chowon'
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 = 7.8
var_e = 6.9
var_f = 7.2
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: Comparison

Question (EN): The total number of students in Jimin's class is 35. If Jimin is the 10th tallest student in the class, find how many students are shorter than Jimin.
Question (KO): 지민이네 반 전체 학생 수는 35명입니다. 지민이가 반에서 10번째로 키가 크다면 지민이보다 키가 작은 학생은 모두 몇 명인지 구하세요.

Answer: 25

Solution (Python):
var_a = 35
var_b = 10
var_c = var_a - var_b
print(int(var_c))
Category: Comparison

Question (EN): There are 13 students in all. Hoseok stands 9th from the right and Minyoung stands 8th from the left. Find how many people are in between Hoseok and Minyoung.
Question (KO): 학생은 모두 13명입니다. 호석이는 오른쪽에서 9번째에 서있고 민영이는 왼쪽에서 8번째에 서있습니다. 호석이와 민영이 사이에는 모두 몇 명이 서있습니까?

Answer: 2

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

Question (EN): Subtracting this number from 35, and then multiplying it by 2, adding 12, and dividing it by 8 is 9. Find this number.
Question (KO): 35에서 어떤 수를 빼고 2를 곱한 뒤 12를 더하여 8로 나눈 수가 9입니다. 어떤 수를 구하시오.

Answer: 5

Solution (Python):
var_a = 35
var_b = 9
var_c = 8
var_d = var_b * var_c
var_e = 12
var_f = var_d - var_e
var_g = 2
var_h = var_f / var_g
var_i = var_a - var_h
print(int(var_i))
Category: Comparison

Question (EN): Inhyuk and Kyungsoo have a gift wrapping string. The string that Inhyeok has is 97.5 centimeters (cm), and the string that Kyungsoo has is 3 millimeters (mm) longer than 97 centimeters (cm). Who has a shorter string?
Question (KO): 인혁이와 경수는 선물 포장용 끈을 가지고 있습니다. 인혁이가 가지고 있는 끈은 97.5센티미터(㎝)이고, 경수가 가지고 있는 끈은 97센티미터(㎝)보다 3밀리미터(㎜) 더 깁니다. 끈의 길이가 더 짧은 사람은 누구입니까?

Answer: Kyungsoo

Solution (Python):
var_a = 'Inhyuk'
var_b = 'Kyungsoo'
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 = 97.5
var_d = 97
var_e = 3
var_f = 10
var_g = var_e / var_f
var_h = var_d + 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: Geometry

Question (EN): 11 students in Hyeonju's class are standing in a hendecagonal shape. If every student exchanges a high-five once, except for the friend standing next to them, how many high-fives will there be?
Question (KO): 현주네 학급 11명의 학생이 십일각형을 그리고 서 있습니다. 모든 학생이 자신의 양옆에 서 있는 친구를 제외하고 한 번씩 하이파이브를 할 때, 하이파이브는 모두 몇 번 이루어집니까?

Answer: 44

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

Question (EN): Suzy did 247 jump ropes yesterday and 131 more jumps today than yesterday. Find out how many jump ropes Suzy did in two days.
Question (KO): 수지는 어제 줄넘기를 247개 했으며, 오늘은 어제보다 131개 더 많이 했습니다. 수지가 이틀 동안 한 줄넘기는 몇 개인지 구하시오.

Answer: 625

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

Question (EN): Yoojung had several notebooks. Among them, she gave 5 books to her older sister and gave half of the rest to her younger sister. If there are 4 notebooks left, how many notebooks did Yoojung have at first?
Question (KO): 유정이는 공책을 몇 권 가지고 있었습니다. 그 중에서 언니에게 5권을 주고, 남은 것의 절반을 동생에게 주었습니다. 공책이 4권 남았다면 처음에 유정이는 공책을 몇 권 가지고 있었습니까?

Answer: 13

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

Question (EN): When the students are standing in a line, Jimin is behind Seokjin, with 4 in front of Seokjin and 7 behind Jimin. When 3 people are standing between Seokjin and Jimin, how many students are in line?
Question (KO): 학생들이 한 줄로 서 있을 때, 지민이가 석진이보다 뒤에 있으며 석진이의 앞에는 4명이, 지민이의 뒤에는 7명이 서 있습니다. 석진이와 지민이 사이에는 3명이 서 있을 때, 줄을 서 있는 학생은 모두 몇 명입니까?

Answer: 16

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

Question (EN): Subtract 2A from the two-digit number A5 to get B7. If A and B are two different numbers, find the value of A+B.
Question (KO): 두 자리 수 A5-2A=B7이 나옵니다. A, B가 서로 다른 두 수라면 A+B의 값을 구하시오

Answer: 13

Solution (Python):
var_a = 'A5-2A=B7'
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 = 'A5-2A=B7'
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: Correspondence

Question (EN): A and B are two-digit numbers. Find A-B when A is 8 less than 23, and B plus 7 is 18.
Question (KO): A, B는 두 자리 수입니다. 23보다 8작은 A가 있고 B에 7을 더하면 18일때 A-B를 구하시오.

Answer: 4

Solution (Python):
var_a = 23
var_b = 8
var_c = var_a - var_b
var_d = 18
var_e = 7
var_f = var_d - var_e
var_g = var_c - var_f
print(int(var_g))
Category: Arithmetic calculation

Question (EN): You have 45 (A) animals and 32 (B) animals. (B) animals and (C) animals are 8 fewer than (A) animals. How many (C) animals are there?
Question (KO): (가) 동물 45마리와 (나) 동물 32마리를 기릅니다. (나) 동물과 (다) 동물을 합하면 (가) 동물보다 8마리 적습니다. (다) 동물은 몇 마리입니까?

Answer: 5

Solution (Python):
var_a = 45
var_b = 32
var_c = var_a - var_b
var_d = 8
var_e = var_c - var_d
print(int(var_e))
Category: Correspondence

Question (EN): 14 runners participate in the marathon event. It is said that each player needs 5 bottles of water. If you currently have 68 bottles of water, how many more bottles do you need to avoid running out?
Question (KO): 마라톤 대회에 14명의 선수가 참가합니다. 선수당 5병의 물이 필요하다고 합니다. 현재 68병의 물이 있다면 물이 부족하지 않기 위해서 몇 병의 물이 더 필요합니까?

Answer: 2

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

Question (EN): There are three numbers 10, 11, and 12. What is the remainder when divided by the largest number and the next largest number?
Question (KO): 3개의 수 10, 11, 12가 있습니다. 그 중에서 가장 큰 수와 그 다음으로 큰 수로 나눈 나머지는 얼마입니까?

Answer: 1

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 = 1
list_b=list_a.copy()
list_b.sort()
var_e = list_b[-var_d]
var_f = 2
list_c=list_a.copy()
list_c.sort()
var_g = list_c[-var_f]
var_h = var_e % var_g
print(int(var_h))
Category: Arithmetic calculation

Question (EN): If 1256 students are enrolled in a school, the first graders are 408 fewer than the total of students excluding first year. How many students are in first grade?
Question (KO): 어느 학교의 학생 수는 1256명이다. 이 중 1학년은 1학년을 제외한 학생 수보다 408명 적습니다. 1학년은 몇 명입니까?

Answer: 424

Solution (Python):
var_a = 1256
var_b = 408
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e))
Category: Arithmetic calculation

Question (EN): In a two-digit number subtraction, the unit digit of the minuend was originally 3, but it was mistaken for 5. Also, by changing the tens digit and the unit digit of the subtrahend, mistakenly thought that it was 25 and calculated it as 60. Find the result of the correct calculation.
Question (KO): 두 자리 수끼리의 뺄셈에서 빼어지는 수의 일의 자리 숫자 3을 5로 잘못 보았습니다. 또 빼는 수의 십의 자리 숫자와 일의 자리 숫자를 바꾸어 25라고 잘못 보고 계산하였더니 그 값이 60이 되었습니다. 바르게 계산한 결과를 구하시오.

Answer: 31

Solution (Python):
var_a = 60
var_b = 1
var_c = 3
var_d = 5
var_e = var_c - var_d
var_f = var_b * var_e
var_g = var_a + var_f
var_h = 52
var_i = 25
var_j = var_h - var_i
var_k = var_g - var_j
print(int(var_k))
Category: Arithmetic calculation

Question (EN): If you divide the flour into small boxes by 500 grams (g), you have 3 kilograms (kg) left over. Also, 200 grams (g) are left if you divide it into 900 grams (g) each. How many kilograms (kg) is flour in total?
Question (KO): 밀가루를 작은 상자에 500그램(g)씩 나누어 담으면 3킬로그램(㎏)이 남습니다. 또 900그램(g)씩 나누어 담으면 200그램(g)이 남습니다. 밀가루는 모두 몇 킬로그램(㎏)있습니까?

Answer: 6.5

Solution (Python):
var_a = 3
var_b = 1000
var_c = var_a * var_b
var_d = 200
var_e = var_c - var_d
var_f = 900
var_g = 500
var_h = var_f - var_g
var_i = var_e / var_h
var_j = 500
var_k = var_i * var_j
var_l = 3
var_m = 1000
var_n = var_l * var_m
var_o = var_k + var_n
var_p = 1000
var_q = var_o / var_p
print('{:.2f}'.format(round(var_q+1e-10,2)))
Category: Arithmetic calculation

Question (EN): The average of the five numbers is 8. If you take one of these numbers and change it to 8, the average is 9. What is the original number before the change?
Question (KO): 5개의 수의 평균은 8입니다. 이 중 한 개의 수를 골라 8로 바꾸었더니 평균이 9가 되었습니다. 바꾼 수는 원래 얼마입니까?

Answer: 3

Solution (Python):
var_a = 8
var_b = 5
var_c = var_a * var_b
var_d = 9
var_e = 5
var_f = var_d * var_e
var_g = 8
var_h = var_f - var_g
var_i = var_c - var_h
print(int(var_i))