philschmid/DMath huggingface dataset:
Category: Arithmetic calculation

Question (EN): Minyoung is 7 years old this year. When Minyoung's grandmother turns 65 in the year Minyoung turns 10, how old is her grandmother this year?
Question (KO): 올해 민영이는 7살입니다. 민영이 할머니는 민영이가 10살이 되는 해에 65살이 되십니다. 올해 할머니의 나이는 몇 살입니까?

Answer: 62

Solution (Python):
var_a = 65
var_b = 10
var_c = 7
var_d = var_b - var_c
var_e = var_a - var_d
print(int(var_e))
Category: Correspondence

Question (EN): A, B, C, and D are different numbers. When these numbers satisfy the three-digit addition equation 7A4+B6C=D29, find the value of D.
Question (KO): A, B, C, D는 서로 다른 수입니다. 이 수들이 세 자리 수 덧셈식 7A4+B6C=D29를 만족할 때, D에 들어갈 수 있는 값은 무엇인지 구하시오.

Answer: 9

Solution (Python):
var_a = '7A4+B6C=D29'
var_b = 'D'
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: Possibility

Question (EN): How many two decimal places less than 6 can you make by using 2, 4, 6 and the decimal point only once?
Question (KO): 2, 4, 6과 소수점을 한 번씩만 사용하여 6보다 작은 소수 두 자리 수를 모두 몇 개 만들 수 있습니까?

Answer: 4

Solution (Python):
var_a = 2
var_b = 4
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 = 6
var_f = 10
var_g = 3
var_h = 1
var_i = var_g - var_h
var_j = var_f ** var_i
var_k = var_e * var_j
list_c = []
for i in list_b:
    if i < var_k:
        list_c.append(i)
var_l = len(list_c)
print(int(var_l))
Category: Comparison

Question (EN): Jungkook collects number that adds 3 to 6, and Yoongi collects 4. Who has the bigger number?
Question (KO): 정국에는 6에서 3을 합한 수를 모았고, 윤기는 4를 모았습니다. 누가 더 큰 수를 가지고 있나요?

Answer: Jungkook

Solution (Python):
var_a = 'Jungkook'
var_b = 'Yoongi'
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 = 6
var_d = 3
var_e = var_c + var_d
var_f = 4
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)
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): Wheel A makes 10 revolutions in 2 minutes and Wheel B makes 7 revolutions in 1 minute 30 seconds. Which of the two wheels spins faster?
Question (KO): 2분동안 10바퀴 도는 바퀴 A와 1분 30초 동안 7바퀴를 도는 바퀴 B가 있습니다. 둘 중에 더 빠르게 돌아가는 바퀴는 무엇입니까?

Answer: A

Solution (Python):
var_a = 'A'
var_b = 'B'
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 = 10
var_d = 2
var_e = 60
var_f = var_d * var_e
var_g = var_c / var_f
var_h = 7
var_i = 1
var_j = 60
var_k = var_i * var_j
var_l = 30
var_m = var_k + var_l
var_n = var_h / var_m
list_b= []
if "/" in str(var_n):
    var_n = eval(str(var_n))
list_b.append(var_n)
if "/" in str(var_g):
    var_g = eval(str(var_g))
list_b.append(var_g)
list_b.reverse()
var_o = 1
list_c=list_b.copy()
list_c.sort()
var_p = list_c[-var_o]
var_q = list_b.index(var_p)+1
var_r = list_a[var_q-1]
print(var_r)
Category: Geometry

Question (EN): The area of a quadrilateral whose all four sides are equal is 21.46 square centimeters (cm2). If the length of one diagonal of this rectangle is 7.4 centimeters (cm), how many centimeters (cm) is the other diagonal?
Question (KO): 네 변의 길이가 같은 사각형의 넓이가 21.46제곱센티미터(㎠)라고 합니다. 이 사각형의 한 대각선의 길이가 7.4센티미터(㎝)라면, 다른 대각선은 몇 센티미터(㎝)이겠습니까?

Answer: 5.8

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

Question (EN): There are 4 indistinguishable marbles and 1 eraser. How many ways are there to list these on a single line?
Question (KO): 4개의 구분되지 않은 구슬과 1개의 지우개가 있다. 이것들을 한 줄로 나열하는 방법은 몇 가지인가?

Answer: 5

Solution (Python):
var_a = 4
var_b = 1
var_c = var_a + var_b
var_d = 4
var_e = 1
var_c = int(var_c)
var_d = int(var_d)
for i, elem in enumerate(range(var_d)):
    var_e = var_e * (var_c-i)
for i, elem in enumerate(range(var_d)):
    var_e = var_e / (i+1)
print(int(var_e))
Category: Comparison

Question (EN): Nine people are standing in a line in order from shortest to tallest. Hoseok is standing second from the front, and Yuna is standing right behind Hoseok. If you line up again in order of tallest to shortest, what number will Yuna stand in from the front?
Question (KO): 키가 작은 사람부터 순서대로 9명이 한 줄로 서 있습니다. 호석이는 앞에서부터 2번째에 서 있고, 유나는 호석이 바로 뒤에 서 있습니다. 키가 큰 사람부터 순서대로 다시 줄을 서면 유나는 앞에서부터 몇 번째에 서게 됩니까?

Answer: 7

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

Question (EN): When a number is multiplied by 6, the result is 72. What is the result when the number is added to 8?
Question (KO): 어떤 수에 6을 곱했더니 결과가 72가 되었습니다. 어떤 수에 8을 더하면?

Answer: 20

Solution (Python):
var_a = 72
var_b = 6
var_c = var_a / var_b
var_d = 8
var_e = var_c + var_d
print(int(var_e))
Category: Comparison

Question (EN): There are five numbers 1.4, 9/10, 1, 0.5, and 13/10. How many of these numbers are greater than 1?
Question (KO): 5개의 수 1.4, 9/10, 1, 0.5, 13/10이 있습니다. 이 중에서 1보다 큰 수는 모두 몇 개입니까?

Answer: 2

Solution (Python):
var_a = 1.4
var_b = 0.9
var_c = 1
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
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): If you take a coupon to the mart, there is an event that gives you 3 bottles of soda per coupon. However, while taking the coupon, 3 coupons were blown away, so there are 4 remaining coupons. How many bottles of drinks would you receive if the coupons were not blown away?
Question (KO): 마트에서 쿠폰을 가져가면 쿠폰당 음료수 3병을 주는 이벤트를 진행중이다. 그런데 쿠폰을 가져가다 3장이 날라가버려서 남은 쿠폰이 4장이라고 한다. 쿠폰이 날라가버리지 않았다면 몇 병의 음료수를 받았는지 구하시오.

Answer: 21

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

Question (EN): Minhyun drank 0.41 times as much milk as 6 liters (L) and Jinyoung drank 2.3 liters (L). Who drank more milk?
Question (KO): 우유를 민현이는 6리터(L)의 0.41 배만큼 마셨고 진영이는 2.3리터(L)를 마셨습니다. 우유를 누가 더 많이 마셨습니까?

Answer: Minhyun

Solution (Python):
var_a = 'Minhyun'
var_b = 'Jinyoung'
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 = 6
var_d = 0.41
var_e = var_c * var_d
var_f = 2.3
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)
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: Geometry

Question (EN): A cube is said to have a side length of 8 centimeters (cm). What is the surface area of this cube in square centimeters (cm2)?
Question (KO): 어떤 정육면체는 한 변의 길이가 8센티미터(㎝)라고 합니다. 이 정육면체의 겉넓이는 몇 제곱센티미터(㎠)입니까?

Answer: 384

Solution (Python):
var_a = 8
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): How many vertices are in a pyramid with 10 edges?
Question (KO): 모서리가 10개인 각뿔의 꼭짓점은 몇 개일까요?

Answer: 6

Solution (Python):
var_a = 10
var_b = 2
var_c = var_a / var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e))
Category: Geometry

Question (EN): How many faces does an octahedron have?
Question (KO): 팔면체는 몇 개의 면을 가지고 있습니까?

Answer: 8

Solution (Python):
var_a = 8
print(int(var_a))
Category: Arithmetic calculation

Question (EN): With 10,000 won, Seonwoo bought 2 packets of bubblegum at 600 won each and 9 bags of ramen that costs 1600 won for 2 bags. How much change did Seonwoo receive?
Question (KO): 선우는 10000원을 가지고 한 통에 600원 하는 풍선껌 2통과 2봉지에 1600원 하는 라면 9봉지를 샀습니다. 선우가 받은 거스름돈은 얼마입니까?

Answer: 1600

Solution (Python):
var_a = 10000
var_b = 600
var_c = 2
var_d = var_b * var_c
var_e = 1600
var_f = 2
var_g = var_e / var_f
var_h = 9
var_i = var_g * var_h
var_j = var_d + var_i
var_k = var_a - var_j
print(int(var_k))
Category: Arithmetic calculation

Question (EN): If the sum of three consecutive even numbers is 1194, what is the first even number?
Question (KO): 연속된 짝수 3개의 합이 1194일 때, 첫번째 짝수는 얼마입니까?

Answer: 396

Solution (Python):
var_a = 1194
var_b = 0
var_c = 3
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e * var_f
var_h = 2
list_a = [i for i in range(var_b, var_g + 1, var_h)]
list_a = [float(i) for i in list_a]
var_i = sum(list_a)
var_j = var_a - var_i
var_k = 3
var_l = var_j / var_k
print(int(var_l))
Category: Possibility

Question (EN): I'm trying to put the books in order on the bookshelf. Find the number of cases when there are 1 math book and 1 science book.
Question (KO): 책꽂이에 책을 순서대로 꽂으려고 합니다. 수학책 1권, 과학책 1권이 있을 때 경우의 수를 구하시오.

Answer: 2

Solution (Python):
var_a = 'math'
var_b = 'science'
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 = len(list_a)
var_d = len(list_a)
var_e = 1
var_c = int(var_c)
var_d = int(var_d)
for i, elem in enumerate(range(var_d)):
    var_e = var_e * (var_c-i)
print(int(var_e))
Category: Correspondence

Question (EN): Subtracting 10 from a number gives you 15. What number do you get when you add 5 to it?
Question (KO): 10을 어떤 수에서 뺐더니 15가 되었습니다. 어떤 수에 5를 더하면 얼마가 되는지 구하시오.

Answer: 30

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

Question (EN): Multiples of 4 are written sequentially. Those multiples are greater than 0 and less than 100. How many numbers are there between the 5th from the left and the 8th from the right?
Question (KO): 4의 배수들을 차례로 썼다. 해당 배수들은 0보다 크고 100보다 작다. 왼쪽에서 5번째, 오른쪽에서 8번째 사이에는 모두 몇 개의 수가 있는가?

Answer: 11

Solution (Python):
var_a = 0
var_b = 1
var_c = var_a + var_b
var_d = 100
var_e = 1
var_f = var_d - var_e
var_g = 1
list_a = [i for i in range(var_c, var_f + 1, var_g)]
var_h = 4
list_b = []
var_h = int(var_h)
for i in list_a:
    i = int(i)
    if i % var_h == 0:
        list_b.append(i)
var_i = 5
list_c=list_b.copy()
list_c.sort()
var_j = list_c[var_i-1]
var_k = 8
list_d=list_b.copy()
list_d.sort()
var_l = list_d[-var_k]
list_e = []
for i in list_b:
    if i < var_l:
        list_e.append(i)
list_f = []
for i in list_e:
    if i > var_j:
        list_f.append(i)
var_m = len(list_f)
print(int(var_m))
Category: Arithmetic calculation

Question (EN): Jinhee is looking for multiples of 16, Minjun is looking for multiples of 24, and Minwoo is looking for natural numbers less than 200. How many of the numbers found by the three people are included in common?
Question (KO): 진희는 16의 배수들을 구하고, 민준이는 24의 배수들을 구하고, 민우는 200이하의 자연수들을 구하고 있습니다. 세 사람이 구한 수들 중 공통적으로 포함된 수들은 몇 개입니까?

Answer: 4

Solution (Python):
var_a = 1
var_b = 200
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 16
list_b = []
var_d = int(var_d)
for i in list_a:
    i = int(i)
    if i % var_d == 0:
        list_b.append(i)
var_e = 24
list_c = []
var_e = int(var_e)
for i in list_b:
    i = int(i)
    if i % var_e == 0:
        list_c.append(i)
list_d = list(set(list_b) & set(list_c))
var_f = len(list_d)
print(int(var_f))
Category: Comparison

Question (EN): Figure A is a rectangle measuring 12 centimeters (cm) wide and 5 centimeters (cm) tall. Figure B is a rectangle with a perimeter of 32 centimeters (cm) and a length of 8 centimeters (cm). Which of the two figures has the greater area?
Question (KO): 도형 가는 가로가 12센티미터(㎝), 세로가 5센티미터(㎝)인 직사각형입니다. 도형 나는 둘레가 32센티미터(㎝)이고, 세로가 8센티미터(㎝)인 직사각형입니다. 두 도형 중 넓이가 더 넓은 것은 무엇입니까?

Answer: B

Solution (Python):
var_a = 'A'
var_b = 'B'
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 = 12
var_d = 5
var_e = var_c * var_d
var_f = 32
var_g = 2
var_h = var_f / var_g
var_i = 8
var_j = var_h - var_i
var_k = 8
var_l = var_j * var_k
list_b= []
if "/" in str(var_l):
    var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_e):
    var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_m = 1
list_c=list_b.copy()
list_c.sort()
var_n = list_c[-var_m]
var_o = list_b.index(var_n)+1
var_p = list_a[var_o-1]
print(var_p)
Category: Correspondence

Question (EN): A3B-41=591. How much is B?
Question (KO): A3B-41=591입니다. B는 얼마인가요?

Answer: 2

Solution (Python):
var_a = 'A3B-41=591'
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: Arithmetic calculation

Question (EN): There are 35, 68, 57 and 95. What is the second-largest number minus the smallest number?
Question (KO): 35, 68, 57, 95가 있습니다. 2번째로 큰 수에서 가장 작은 수를 뺀 값은 얼마입니까?

Answer: 33

Solution (Python):
var_a = 35
var_b = 68
var_c = 57
var_d = 95
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=list_a.copy()
list_b.sort()
var_f = list_b[-var_e]
var_g = 1
list_c=list_a.copy()
list_c.sort()
var_h = list_c[var_g-1]
var_i = var_f - var_h
print(int(var_i))
Category: Arithmetic calculation

Question (EN): Jungkook's family picked apples. My father got 8, my mother got 13, Jungkook got 7, and my younger brother got 5. How many more apples did the person who picked the most apples pick than the person who picked the least?
Question (KO): 정국이네 가족이 사과를 땄습니다. 아버지는 8개, 어머니는 13개, 정국이는 7개, 동생은 5개를 땄습니다. 사과를 가장 많이 딴 사람은 가장 적게 딴 사람보다 몇 개 더 많이 땄습니까?

Answer: 8

Solution (Python):
var_a = 8
var_b = 13
var_c = 7
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 = 1
list_b=list_a.copy()
list_b.sort()
var_f = list_b[-var_e]
var_g = 1
list_c=list_a.copy()
list_c.sort()
var_h = list_c[var_g-1]
var_i = var_f - var_h
print(int(var_i))
Category: Correspondence

Question (EN): There are single digit numbers A and B. When five-digit number A835B is a multiple of 12, what is the difference between the largest and smallest possible numbers of A835B?
Question (KO): 한 자리 수 A, B가 있습니다. 어떤 다섯 자리 수 A835B가 12의 배수입니다. A835B로 가능한 수 중에서 가장 큰 수와 가장 작은 수의 차는 무엇입니까?

Answer: 69996

Solution (Python):
var_a = 'A835B'
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 = 12
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 = 1
list_c=list_b.copy()
list_c.sort()
var_d = list_c[-var_c]
var_e = 1
list_d=list_b.copy()
list_d.sort()
var_f = list_d[var_e-1]
var_g = var_d - var_f
print(int(var_g))
Category: Possibility

Question (EN): How many 3-digit numbers are less than 560 and contain all 4, 5, and 6?
Question (KO): 560보다 작고, 4, 5, 6이 모두 사용된 세 자리 수는 몇 개 입니까?

Answer: 3

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

Question (EN): I have two rectangles, one is large and the other is small. The horizontal ratio of these two rectangles is 8:7, and the vertical ratio is 9:4. If the area of the larger rectangle is 108 square centimeters (cm2), how many square centimeters (cm2) is the area of the smaller rectangle?
Question (KO): 크고 작은 두 직사각형이 있습니다. 이 두 직사각형의 가로의 비는 8:7이고, 세로의 비는 9:4입니다. 큰 직사각형의 넓이가 108제곱센티미터(㎠)일 때, 작은 직사각형의 넓이는 몇 제곱센티미터(㎠)입니까?

Answer: 42

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

Question (EN): The total number of students in Changhyeon's school is 32 fewer than eight times the number of fourth-year students. Of the fourth-year students, there are 10 more students who wear glasses than those who do not wear glasses. If the total number of students in Changhyeon's school is 1152, find out the number of 4th graders that do not wear glasses.
Question (KO): 창현이네 학교 전체의 학생 수는 4학년 학생 수의 8배보다 32명 더 적고 4학년 학생 중 안경 쓴 학생은 안경을 쓰지 않은 학생보다 10명 더 많습니다. 창현이네 학교 전체 학생 수가 1152명일 때, 4학년 중 안경을 쓰지 않은 학생은 몇 명입니까?

Answer: 69

Solution (Python):
var_a = 1152
var_b = 32
var_c = var_a + var_b
var_d = 8
var_e = var_c / var_d
var_f = 10
var_g = var_e - var_f
var_h = 2
var_i = var_g / var_h
print(int(var_i))
Category: Geometry

Question (EN): Kiyoung drew a circle with a diameter of 80 centimeters (cm). The radius of the circle drawn by Kiyoung is 4 times longer than the radius of the circle drawn by Gayeong. Find the radius of the circle Gayoung drew.
Question (KO): 기영이는 지름이 80센티미터(㎝)인 원을 그렸습니다. 기영이가 그린 원의 반지름은 가영이가 그린 원의 반지름보다 4배 더 깁니다. 가영이가 그린 원의 반지름을 구하시오.

Answer: 10

Solution (Python):
var_a = 80
var_b = 4
var_c = var_a / var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e))
Category: Correspondence

Question (EN): When 14A+B73=418 is valid, what number should go into B?
Question (KO): 14A+B73=418이 성립할 때, B에 들어가야 하는 숫자는 무엇인가요?

Answer: 2

Solution (Python):
var_a = '14A+B73=418'
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: Arithmetic calculation

Question (EN): When the sum of carrots and cucumbers was 10, the number of carrots was 4. If you bought 2 more cucumbers, how many cucumbers do you have now?
Question (KO): 당근과 오이의 개수를 합치면 10개일 때, 당근의 개수는 4개였습니다. 오이 2개를 더 사왔다면, 오이의 개수는 지금 몇 개인가요?

Answer: 8

Solution (Python):
var_a = 10
var_b = 4
var_c = var_a - var_b
var_d = 2
var_e = var_c + var_d
print(int(var_e))