philschmid/DMath huggingface dataset:
Category: Arithmetic calculation

Question (EN): It is said that the average of the four classes of Korean exams is 64, 73, 69, and 82, respectively. Find the sum of the average scores of the classes whose average was less than 70.
Question (KO): 4개 반의 국어 시험 평균이 각각 64, 73, 69, 82라고 한다. 평균이 70점을 못 넘는 반의 평균 점수의 합을 구하시오.

Answer: 133

Solution (Python):
var_a = 64
var_b = 73
var_c = 69
var_d = 82
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 = 70
list_b = []
for i in list_a:
    if i < var_e:
        list_b.append(i)
list_b = [float(i) for i in list_b]
var_f = sum(list_b)
print(int(var_f))
Category: Possibility

Question (EN):  Find the number of three-digit numbers greater than 550, when all 4, 5, and 8 figures are used once.
Question (KO): 4, 5, 8 숫자카드를 한 번씩 모두 사용하였을 때, 550보다 큰 세 자리 수의 개수를 구하시오.

Answer: 3

Solution (Python):
var_a = 4
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 = 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 = 550
list_c = []
for i in list_b:
    if i > var_e:
        list_c.append(i)
var_f = len(list_c)
print(int(var_f))
Category: Arithmetic calculation

Question (EN): Gamin is doing an activity to express a three-digit number by arranging robots with numbers written on them in a row. The robots with 2, 3, and 5 made the largest possible number, and the robots with 4, 0, and 6 made the smallest possible number. Find the value of difference between the two numbers.
Question (KO): 가민이는 숫자가 적힌 로봇을 일렬로 배열해 세 자리의 수를 표현하는 활동을 하고 있다. 2, 3, 5가 적힌 로봇으로는 만들 수 있는 가장 큰 수를 만들었고, 4, 0, 6이 적힌 로봇을 사용해서는 가장 작은 수를 만들었다. 두 수의 차이는 얼마인지 구하시오.

Answer: 126

Solution (Python):
var_a = 2
var_b = 3
var_c = 5
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 = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = 4
var_h = 0
var_i = 6
list_d= []
if "/" in str(var_i):
    var_i = eval(str(var_i))
list_d.append(var_i)
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_d.append(var_h)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_d.append(var_g)
list_d.reverse()
var_j = 3
list_e = [str(i) for i in list_d]
list_e = list(itertools.permutations(list_e, var_j))
list_e = [''.join(num_list) for num_list in list_e]
list_e = [str_num for str_num in list_e if str_num[0] != '0']
list_e = [float(i) for i in list_e]
var_k = 1
list_f=list_e.copy()
list_f.sort()
var_l = list_f[var_k-1]
var_m = var_f - var_l
print(int(var_m))
Category: Correspondence

Question (EN): Yoongi wants to add a two-digit number to 57. Yoongi misread 9 in the units digit of the two-digit number as 6. When Yoongi got a result of 123, find the two-digit number.
Question (KO): 윤기는 두 자리 수와 57의 덧셈을 하려 합니다. 윤기는 두 자리 수의 일의 자리 숫자 9를 6으로 잘못 보았습니다. 윤기가 구한 합은 123 일 때, 두 자리 수를 구하시오.

Answer: 69

Solution (Python):
var_a = 123
var_b = 57
var_c = var_a - var_b
var_d = 6
var_e = 9
var_f = var_d - var_e
var_g = var_c - var_f
print(int(var_g))
Category: Comparison

Question (EN): How many numbers are less than 1.1 in 1.4, 9/10, 1.2, 0.5, 13/10?
Question (KO): 1.4, 9/10, 1.2, 0.5, 13/10에서 1.1보다 작은 숫자는 몇 개 일까요?

Answer: 2

Solution (Python):
var_a = 1.4
var_b = 0.9
var_c = 1.2
var_d = 0.5
var_e = 1.3
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.1
list_b = []
for i in list_a:
    if i < var_f:
        list_b.append(i)
var_g = len(list_b)
print(int(var_g))
Category: Correspondence

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

Answer: 4

Solution (Python):
var_a = 'A4+3B=79'
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: Geometry

Question (EN): A diagonal line is drawn from one side of the cuboid. How many line segments skew to this diagonal are there?
Question (KO): 직육면체의 어느 한 면에서의 대각선을 그었습니다. 이 대각선과 꼬인 위치에 있는 선분은 모두 몇 개일까요?

Answer: 6

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

Question (EN): Miran has 6 pieces of colored paper, Junga has 13 pieces of colored paper, and Minsu has 10 pieces of colored paper. Who has the fewest colored paper?
Question (KO): 미란이는 색종이를 6장 가지고 있고, 정아는 색종이를 13장 가지고 있고, 민수는 색종이를 10장 가지고 있습니다. 색종이를 가장 적게 가지고 있는 사람은 누구입니까?

Answer: Miran

Solution (Python):
var_a = 'Miran'
var_b = 'Junga'
var_c = 'Minsu'
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 = 6
var_e = 13
var_f = 10
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-1]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j)
Category: Correspondence

Question (EN): If you subtract 5 from a number and mulitpy 4 to that value, it equals this number again. Find this number. 
Question (KO): 어떤 수에서 5를 뺀 것의 4배는 다시 어떤 수와 같아집니다. 어떤 수를 구하시오.

Answer: 6.67

Solution (Python):
var_a = 5
var_b = 4
var_c = var_a * var_b
var_d = 4
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: Geometry

Question (EN): Ki-min has a cube with one edge 1 meter (m) long, and Ki-young has a cuboid with a width of 50 centimeters (cm), a length of 50 centimeters (cm) and a height of 20 centimeters (cm). How many times the volume of Ki-min's cube is the volume of Ki-yeong's cuboid?
Question (KO): 기민이는 한 모서리의 길이가 1미터(m)인 정육면체를 가지고 있고, 기영이는 가로 50센티미터(㎝), 세로 50센티미터(㎝), 높이 20센티미터(㎝)인 직육면체를 가지고 있습니다. 기민이가 가진 정육면체의 부피는 기영이가 가진 직육면체의 부피의 몇 배입니까?

Answer: 20

Solution (Python):
var_a = 1
var_b = 100
var_c = var_a * var_b
var_d = 3
var_e = var_c ** var_d
var_f = 50
var_g = 50
var_h = var_f * var_g
var_i = 20
var_j = var_h * var_i
var_k = var_e / var_j
print(int(var_k))
Category: Arithmetic calculation

Question (EN): Donghwan took out 11 marbles from a box of 100 marbles. Express how many marbles Donghwan took out of all the marbles as a decimal number.
Question (KO): 동환이는 100개가 들어있는 구슬 상자에서 11개의 구슬을 꺼냈습니다. 동환이가 꺼낸 구슬 전체 구슬의 얼마인지 소수로 나타내시오.

Answer: 0.11

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

Question (EN): When riding a bicycle at a constant speed, Hyemi travels 1.25 kilometers (km) in 20 minutes and Taesu travels 0.96 kilometers (km) in 15 minutes. If two people ride a bicycle in opposite directions starting at the same place and same time, find the distance in kilometers (km) between them after 1 hour.
Question (KO): 자전거를 타고 일정한 빠르기로 혜미는 20분에 1.25킬로미터(㎞)를 가고 태수는 15분에 0.96킬로미터(㎞)를 갑니다. 두 사람이 같은 곳에서 서로 반대 방향으로 동시에 출발하면 1시간 후에 두 사람 사이의 거리는 몇 킬로미터(㎞)인지 구해 보시오.

Answer: 7.59

Solution (Python):
var_a = 1.25
var_b = 20
var_c = 60
var_d = var_b / var_c
var_e = var_a / var_d
var_f = 0.96
var_g = 15
var_h = 60
var_i = var_g / var_h
var_j = var_f / var_i
var_k = var_e + var_j
print('{:.2f}'.format(round(var_k+1e-10,2)))
Category: Arithmetic calculation

Question (EN): Find the sum of all three-digit numbers.
Question (KO): 모든 세 자리 수의 합을 구하시오

Answer: 494550

Solution (Python):
var_a = 100
var_b = 999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
list_a = [float(i) for i in list_a]
var_d = sum(list_a)
print(int(var_d))
Category: Correspondence

Question (EN): Among 2, 3, 4, and 5, find the number less than 4 that is not 3.
Question (KO): 2, 3, 4, 5, 중 3이 아닌 4보다 작은 수를 구하시오.

Answer: 2

Solution (Python):
var_a = 2
var_b = 3
var_c = 4
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 = 4
list_b = []
for i in list_a:
    if i < var_e:
        list_b.append(i)
var_f = 3
list_c= []
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_c.append(var_f)
list_c.reverse()
list_d = list(set(list_b) - set(list_c))
var_g = 1
var_h = list_d[var_g-1]
print(int(var_h))
Category: Correspondence

Question (EN): There are two different numbers, A and B. Find the sum of A and B in the two-digit subtraction equation 7A-B6=23.
Question (KO): 서로 다른 두 수 A, B가 있습니다. 두 자리 수끼리의 뺄셈식 7A-B6=23에서 A와 B의 합을 구하시오.

Answer: 14

Solution (Python):
var_a = '7A-B6=23'
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 = '7A-B6=23'
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): The three-digit number 7AB is divisible by 3. If A and B are different numbers from 0 to 9, how many possible ways are there to be 7AB?
Question (KO): 세 자리 수 7AB는 3으로 나누어떨어지는 수입니다. A, B는 0부터 9까지의 서로 다른 수일 때 7AB가 될 수 있는 수는 모두 몇 개입니까?

Answer: 33

Solution (Python):
var_a = '7AB'
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 = 3
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): A bottle of orange juice contains 1 liter (L) of juice. Three friends decided to share one bottle, but Youngin drank only 0.1 liters (L), and Narin drank 0.2 liters (L) more than Youngin. The moment Narin was about to hand the bottle to Dongwoo, the juice spilled out. If there are 0.3 liters (L) of orange juice left, how many liters (L) of juice was spilled?
Question (KO): 오렌지 주스 한 병에는 1리터(L)가 들어있습니다. 한 병으로 세 친구가 나눠 먹기로 했는데, 영인이가 0.1리터(L)를 마셨고 나린이가 영인이보다 0.2리터(L)를 더 마셨습니다. 나린이가 동우에게 병을 건네주려는 순간 주스를 쏟고 말았습니다. 남은 오렌지 주스가 0.3리터(L)라면 쏟아진 주스는 몇 리터(L)입니까?

Answer: 0.3

Solution (Python):
var_a = 1
var_b = 0.1
var_c = var_a - var_b
var_d = 0.1
var_e = 0.2
var_f = var_d + var_e
var_g = var_c - var_f
var_h = 0.3
var_i = var_g - var_h
print('{:.2f}'.format(round(var_i+1e-10,2)))
Category: Comparison

Question (EN): Sangwon's handspan is 19 centimeters (cm) 8 millimeters (mm), Doyoon's handspan is 18.9 centimeters (cm), and Changhyeok's handspan is 19.3 centimeters (cm). Whose handspan is shortest?
Question (KO): 상원이의 한 뼘은 19센티미터(㎝) 8밀리미터(㎜)이고, 도윤이의 한 뼘은 18.9센티미터(㎝)이며, 창혁이의 한 뼘은 19.3센티미터(㎝)입니다. 한 뼘의 길이가 가장 짧은 사람은 누구입니까?

Answer: Doyoon

Solution (Python):
var_a = 'Sangwon'
var_b = 'Doyoon'
var_c = 'Changhyeok'
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 = 19
var_e = 8
var_f = 10
var_g = var_e / var_f
var_h = var_d + var_g
var_i = 18.9
var_j = 19.3
list_b= []
if "/" in str(var_j):
    var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
    var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_b.append(var_h)
list_b.reverse()
var_k = 1
list_c=list_b.copy()
list_c.sort()
var_l = list_c[var_k-1]
var_m = list_b.index(var_l)+1
var_n = list_a[var_m-1]
print(var_n)
Category: Correspondence

Question (EN): When 24 can be divided by A, the quotient is B, and the remainder is 4. A and B are both natural numbers. Find the possible largest value of A.
Question (KO): 24를 A로 나누면 몫이 B가 되고, 나머지는 4가 됩니다. A와 B는 모두 자연수입니다. 가능한 A 중 가장 큰 수의 값을 구하시오.

Answer: 20

Solution (Python):
var_a = 24
var_b = 4
var_c = var_a - var_b
print(int(var_c))
Category: Comparison

Question (EN): The difference in height between the brothers is 12 centimeters (cm), and the sum is 3 meters (m) and 8 centimeters (cm). What is the younger brother's height when the younger brother is shorter?
Question (KO): 형제의 키 차이는 12센티미터(㎝)이고, 합은 3미터(m) 8센티미터(㎝)입니다. 동생의 키가 더 작을 때, 동생의 키는 얼마입니까?

Answer: 148

Solution (Python):
var_a = 3
var_b = 100
var_c = var_a * var_b
var_d = 8
var_e = var_c + var_d
var_f = 12
var_g = var_e - var_f
var_h = 2
var_i = var_g / var_h
print(int(var_i))
Category: Possibility

Question (EN): Find the smallest number that can be made by using 1, 4, and 5 once.
Question (KO): 1, 4, 5을 한 번씩 모두 사용하여 만들 수 있는 가장 작은 수를 구하시오.

Answer: 145

Solution (Python):
var_a = 1
var_b = 4
var_c = 5
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]
print(int(var_f))
Category: Correspondence

Question (EN): Find the 20th smallest number that leaves a remainder of 2 when divided by 3 and a remainder of 5 when divided by 8.
Question (KO): 3으로 나누면 2가 남고, 8로 나누면 5가 남는 수 중에서 20째로 작은 수를 구하여라.

Answer: 461

Solution (Python):
var_a = 0
var_b = 9999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 3
var_e = 2
list_b = [] 
var_d = int(var_d)
var_e = int(var_e)
if var_e < 0:
    var_e = var_e + var_d
for i in list_a:
    i = int(i)
    if i%var_d == var_e:
        list_b.append(i)
var_f = 8
var_g = 5
list_c = [] 
var_f = int(var_f)
var_g = int(var_g)
if var_g < 0:
    var_g = var_g + var_f
for i in list_b:
    i = int(i)
    if i%var_f == var_g:
        list_c.append(i)
var_h = 20
list_d=list_c.copy()
list_d.sort()
var_i = list_d[var_h-1]
print(int(var_i))
Category: Correspondence

Question (EN): When you multiply a number by 4 and subtract 23, you get 33. Find a number.
Question (KO): 어떤 수에 4를 곱하고 23을 뺐더니 33이 되었습니다. 어떤 수를 구하시오.

Answer: 14

Solution (Python):
var_a = 33
var_b = 23
var_c = var_a + var_b
var_d = 4
var_e = var_c / var_d
print(int(var_e))
Category: Correspondence

Question (EN): Yoongi wants to subtract 37 from some number. But when he accidentally divided by 9, the result was 30. Find the correct calculation result.
Question (KO): 윤기는 어떤 수에 37을 빼려고 합니다. 하지만 실수로 9를 나누었더니 결과는 30이 되었습니다. 바르게 계산한 결과를 구하세요.

Answer: 233

Solution (Python):
var_a = 30
var_b = 9
var_c = var_a * var_b
var_d = 37
var_e = var_c - var_d
print(int(var_e))
Category: Correspondence

Question (EN): The single digit numbers A and B make the six digit number 7ABABA. If this number is a multiple of 6, what is the number of all possible cases that this number can be?
Question (KO): 한 자리 수 A, B로 여섯 자리 수 7ABABA를 만들었습니다. 이 수가 6의 배수일 때 이 수가 될 수 있는 모든 수의 개수는 무엇입니까?

Answer: 15

Solution (Python):
var_a = '7ABABA'
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 = 6
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: Comparison

Question (EN): Fish A, B, C, and D are feeding. A ate more food than D, and C ate less food than A. If B ate more food than A, which fish ate the most?
Question (KO): 물고기 A, B, C, D가 먹이를 먹고 있습니다. A는 D보다 많은 먹이를 먹었고, C는 A보다 적은 먹이를 먹었습니다. B는 A보다 많은 먹이를 먹었을 때, 가장 많은 먹이를 먹은 물고기는 무엇인가요?

Answer: B

Solution (Python):
var_a = 'A'
var_b = 'B'
var_c = 'C'
var_d = 'D'
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 = 'A'
var_f = 'D'
var_g = '>'
var_h = 'C'
var_i = 'A'
var_j = '<'
var_k = 'B'
var_l = 'A'
var_m = '>'
list_b= []
if "/" in str(var_m):
    var_m = eval(str(var_m))
list_b.append(var_m)
if "/" in str(var_l):
    var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
    var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
    var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
    var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
    var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_b.append(var_e)
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_n = 1
var_o = list_c[var_n-1]
print(var_o)
Category: Arithmetic calculation

Question (EN): In a box containing 2 kilograms (kg) of cherry tomatoes, 560 grams (g) of extra cherry tomatoes were added. How many grams (g) do all the cherry tomatoes weigh?
Question (KO): 2킬로그램(㎏)의 방울토마토가 들어있는 상자에 560그램(g)의 방울토마토를 더 넣었습니다. 방울토마토의 무게는 모두 몇 그램(g)입니까?

Answer: 2560

Solution (Python):
var_a = 2
var_b = 1000
var_c = var_a * var_b
var_d = 560
var_e = var_c + var_d
print(int(var_e))