philschmid/DMath huggingface dataset:
Category: Correspondence

Question (EN): When you divide 48 by a number and add 7 to the quotient of it, you get 15. Figure out what the number is.
Question (KO): 48을 어떤 수로 나눈 몫에 7을 더했더니 15가 되었습니다. 어떤 수를 구하세요.

Answer: 6

Solution (Python):
var_a = 48
var_b = 15
var_c = 7
var_d = var_b - var_c
var_e = var_a / var_d
print(int(var_e))
Category: Comparison

Question (EN): Jiseok's backpack weighs 1.49 kilograms (kg), and Miho's backpack weighs 9/20 kilograms (kg). What is the name of the person whose backpack weighs less?
Question (KO): 지석의 배낭 무게는 1.49킬로그램(㎏), 미호의 배낭 무게는 9/20킬로그램(㎏)이다. 배낭의 무게가 더 가벼운 사람의 이름은?

Answer: Miho

Solution (Python):
var_a = 'Jiseok'
var_b = 'Miho'
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 = 1.49
var_d = 9
var_e = 20
var_f = var_d / var_e
list_b= []
if "/" in str(var_f):
    var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_b.append(var_c)
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): Jinho went to a friend's house to play, so he took the subway for 3 kilometers (km) and 7 meters (m), and then walked a few meters (m). And again, he moved 840 meters (m) by bus, which has a total distance of 6 kilometers (km) and 30 meters (m). Find how many kilometers (km) Jinho walked.
Question (KO): 진호는 친구네 집에 놀러가는데 지하철을 타고 3킬로미터(㎞) 7미터(m)를 가고 나서 몇 미터(m)를 걸었습니다. 그리고 다시 840미터(m)를 버스로 이동하여 전체 6킬로미터(㎞) 30미터(m)만큼 이동했습니다. 진호가 걸은 거리는 몇 킬로미터(㎞)인지 구하시오.

Answer: 2.18

Solution (Python):
var_a = 6
var_b = 1000
var_c = var_a * var_b
var_d = 30
var_e = var_c + var_d
var_f = 840
var_g = var_e - var_f
var_h = 3
var_i = 1000
var_j = var_h * var_i
var_k = 7
var_l = var_j + var_k
var_m = var_g - var_l
var_n = 1000
var_o = var_m / var_n
print('{:.2f}'.format(round(var_o+1e-10,2)))
Category: Geometry

Question (EN): The width and height of a rectangle with an area of 32 are both natural numbers. Find the number of possible rectangles. (However, when the width and height are swapped, the same rectangle is considered identical.)
Question (KO): 넓이가 32인 직사각형의 가로와 세로가 모두 자연수라고 한다. 가능한 직사각형의 개수를 구하시오. (단, 가로와 세로를 바꾸었을 때 같은 직사각형은 같은 것으로 본다.)

Answer: 3

Solution (Python):
var_a = 32
list_a = []
num_sqrt = int(math.sqrt(var_a))
for i in range(1, num_sqrt+1):
    if var_a % i == 0:
        list_a.append(i)
        list_a.append(int(var_a/i))
list_a = sorted(set(list_a))
var_b = len(list_a)
var_c = 2
var_d = var_b / var_c
print(int(var_d))
Category: Possibility

Question (EN): When two of the number cards 4, 3, and 1 are used once to form the largest two-digit number, what is the number on the unused card?
Question (KO): 숫자 카드 4, 3, 1 중 2 장을 한 번씩 사용하여 가장 큰 두 자리 수를 만들 때, 사용하지 않는 카드의 숫자는 무엇입니까?

Answer: 1

Solution (Python):
var_a = 4
var_b = 3
var_c = 1
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 = 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]
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
list_d = []
var_f = int(var_f)
while var_f//10 > 0:
    list_d.append(var_f%10)
    var_f = var_f//10
list_d.append(var_f%10)
list_d = list_d[::-1]
list_e = list(set(list_a) - set(list_d))
var_g = 1
var_h = list_e[var_g-1]
print(int(var_h))
Category: Comparison

Question (EN): Youngbin and Sujeong had a competition to pick up coins faster. If it took Yeongbin 16.23 seconds and Sujeong 16.19 seconds to pick up all the coins, who wins?
Question (KO): 영빈이와 수정이가 동전 빨리 줍기 대결을 하였습니다. 동전을 모두 줍는 데 영빈이는 16.23초 걸렸고 수정이는 16.19초 걸렸다면 누구의 승리입니까?

Answer: Sujeong

Solution (Python):
var_a = 'Youngbin'
var_b = 'Sujeong'
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 = 16.23
var_d = 16.19
list_b= []
if "/" in str(var_d):
    var_d = eval(str(var_d))
list_b.append(var_d)
if "/" in str(var_c):
    var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[var_e-1]
var_g = list_b.index(var_f)+1
var_h = list_a[var_g-1]
print(var_h)
Category: Arithmetic calculation

Question (EN): The proportion of blue tulips is 3/8 of the 56 tulips. If 3/7 of the total are red tulips, and the others pink, how many pink tulips are there?
Question (KO): 튤립 56송이 중 파란색 튤립의 비율은 전체의 3/8입니다. 전체의 3/7이 빨간색 튤립이고 나머지는 분홍색이라면, 분홍색 튤립은 모두 몇 송이입니까?

Answer: 11

Solution (Python):
var_a = 1
var_b = 0.42857142857142855
var_c = var_a - var_b
var_d = 0.375
var_e = var_c - var_d
var_f = 50
var_g = var_e * var_f
print('{:.2f}'.format(round(var_g+1e-10,2)))
Category: Geometry

Question (EN): The length and width of the base of a rectangular cuboid are 7 centimeters (cm) and 6 centimeters (cm) respectively, and the volume is 16 cubic centimeters (cm3). Find the value of the surface area.
Question (KO): 직육면체 밑면의 가로와 세로의 길이가 7센티미터(㎝), 6센티미터(㎝)일 때 부피가 16세제곱센티미터(㎤)이다. 겉넓이는 얼마인지 구하라.

Answer: 93.9

Solution (Python):
var_a = 16
var_b = 7
var_c = var_a / var_b
var_d = 6
var_e = var_c / var_d
var_f = 7
var_g = 6
var_h = var_f + var_g
var_i = var_e * var_h
var_j = 7
var_k = 6
var_l = var_j * var_k
var_m = var_i + var_l
var_n = 2
var_o = var_m * var_n
print('{:.2f}'.format(round(var_o+1e-10,2)))
Category: Possibility

Question (EN): Gahyeon, Nahyeon, and Dahyeon play a game of making a three-digit number using all the numbers 1, 6, and 8 at least once. Gahyeon made the biggest number possible, and Nahyeon made the second largest number. When Dahyun made the third largest number, what is the difference between the number Nahyeon and Dahyun made?
Question (KO): 가현, 나현, 다현은 숫자 1, 6, 8을 한 번씩 모두 사용하여 세 자리 수를 만드는 게임을 한다. 가현이는 만들 수 있는 가장 큰 수를 만들었고 나현이는 두 번째로 큰 수를. 다현이는 세 번째로 큰 수를 만들었을 때 나현이가 만든 수와 다현이가 만든 수의 차이는 얼마인가?

Answer: 135

Solution (Python):
var_a = 1
var_b = 6
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 = 2
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = 3
list_d=list_b.copy()
list_d.sort()
var_h = list_d[-var_g]
var_i = var_f - var_h
var_j = abs(var_i)
print(int(var_j))
Category: Arithmetic calculation

Question (EN): There are 2 bars of different lengths. The length of the long stick is 12 centimeters (cm) longer than the length of the short stick, and the sum of the lengths of the two sticks is 20 centimeters (cm). Find how many sticks the same length as the shorter sticks can be made by cutting the longer sticks.
Question (KO): 길이가 서로 다른 막대 2개가 있습니다. 긴 막대의 길이는 짧은 막대의 길이보다 12센티미터(㎝) 더 길고, 두 막대의 길이의 합은 20센티미터(㎝)입니다. 긴 막대를 잘라 짧은 막대와 길이가 같은 막대를 몇 개 만들 수 있는지 구해보시오.

Answer: 4

Solution (Python):
var_a = 20
var_b = 12
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
var_f = 12
var_g = var_e + var_f
var_h = 20
var_i = 12
var_j = var_h - var_i
var_k = 2
var_l = var_j / var_k
var_m = var_g // var_l
print(int(var_m))
Category: Geometry

Question (EN): If A is the number of diagonals in a heptagon and B is the number of diagonals in an octagon, find the value of B-A.
Question (KO): 어떤 칠각형의 대각선의 개수를 A, 어떤 팔각형의 대각선의 개수를 B라 할 때, B-A의 값을 구하시오.

Answer: 6

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

Question (EN): Using the four number cards 0, 1, 4, and 8 once, find the number of three-digit numbers where the tens digit is zero.
Question (KO): 4개의 숫자 카드 0, 1, 4, 8을 한 번씩 사용하여 십의 자리 숫자가 0인 세 자리 수의 개수를 구하시오.

Answer: 6

Solution (Python):
var_a = 0
var_b = 1
var_c = 4
var_d = 8
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 = 3
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 = 10
var_g = 0
list_c = [] 
var_f = int(var_f)
var_g = int(var_g)
for i in list_b:
    i = int(i)
    if (i//var_f)%10 == var_g:
        list_c.append(i)
var_h = len(list_c)
print(int(var_h))
Category: Geometry

Question (EN): Jungwoo drew a rectangle and a square with the same area during drawing time. The two sides of the rectangle drawn by JungWoo are 9 centimeters (cm) and 16 centimeters (cm), respectively. How many centimeters (cm) is the length of one side of the square?
Question (KO): 정우는 그리기 시간에 같은 넓이를 갖는 직사각형과 정사각형을 그렸습니다. 정우가 그린 직사각형의 두 변은 길이가 각각 9센티미터(㎝), 16센티미터(㎝)입니다. 정사각형의 한 변의 길이는 몇 센티미터(㎝)인가요?

Answer: 12

Solution (Python):
var_a = 9
var_b = 16
var_c = var_a * var_b
var_d = 0.5
var_e = var_c ** var_d
print(int(var_e))
Category: Comparison

Question (EN): Sooae and Seungho had a 100 meters (m) running race. If Sooae took 16.23 seconds and Seungho took 16.19 seconds to run 100 meters (m), who ran faster?
Question (KO): 수애와 승호가 100미터(m) 달리기 시합을 하였습니다. 100미터(m) 를 달리는 데 수애는 16.23 초 걸렸고 승호는 16.19 초 걸렸다면 누가 더 빨리 달렸습니까?

Answer: Seungho

Solution (Python):
var_a = 'Sooae'
var_b = 'Seungho'
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 = 100
var_d = 16.23
var_e = var_c / var_d
var_f = 100
var_g = 16.19
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): Find the difference between the largest proper fraction and the second smallest proper fraction with a denominator of 6.
Question (KO): 분모가 6인 진분수 중에서 가장 큰 진분수와 두 번째로 작은 진분수의 차는 얼마인지 답을 구해 보세요.

Answer: 0.5

Solution (Python):
var_a = 1
var_b = 5
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 1
list_b=list_a.copy()
list_b.sort()
var_e = list_b[-var_d]
var_f = 1
list_c=list_a.copy()
list_c.sort()
var_g = list_c[var_f-1]
var_h = var_e - var_g
var_i = 6
var_j = var_h / var_i
print('{:.2f}'.format(round(var_j+1e-10,2)))
Category: Geometry

Question (EN): For a cuboid, find the number of edges in skewed positions with one edge.
Question (KO): 직육면체에 대하여 한 모서리와 꼬인 위치에 있는 모서리의 개수를 구하시오.

Answer: 4

Solution (Python):
var_a = 4
print(int(var_a))
Category: Possibility

Question (EN): There are 3 pandas in the zoo. Let's say you give these pandas at least 2 bamboos. How many ways are there to distribute 20 bamboos?
Question (KO): 동물원에 3마리의 팬더가 있습니다. 이 팬더들에게 적어도 2개 이상의 대나무를 준다고 할 때 대나무 20개를 나누어 주는 방법은 몇 가지인가요?

Answer: 560

Solution (Python):
var_a = 20
var_b = 3
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 3
var_g = var_e + var_f
var_h = 1
var_i = var_g - var_h
var_j = 3
var_k = 1
var_i = int(var_i)
var_j = int(var_j)
for i, elem in enumerate(range(var_j)):
    var_k = var_k * (var_i-i)
for i, elem in enumerate(range(var_j)):
    var_k = var_k / (i+1)
print(int(var_k))
Category: Geometry

Question (EN): If Dong-min stands on a chair with a height of 53 centimeters (cm) 7 millimeters (mm) and measures his height from the floor, he will be 190 centimeters (cm), and if he stands on a desk and measures his height from the floor, he will be 232 centimeters (cm) and 5 millimeters (mm). How tall is the desk?
Question (KO): 동민이가 높이 53센티미터(㎝) 7밀리미터(㎜)인 의자에 올라서서 바닥에서부터 키를 재어 보면 190센티미터(㎝)가 되고, 책상 위에 올라서서 바닥에서부터 키를 재면 232센티미터(㎝) 5밀리미터(㎜)가 됩니다. 책상의 높이는 몇 센티미터(㎝)입니까?

Answer: 96.2

Solution (Python):
var_a = 232
var_b = 5
var_c = 10
var_d = var_b / var_c
var_e = var_a + var_d
var_f = 190
var_g = var_e - var_f
var_h = 53
var_i = 7
var_j = 10
var_k = var_i / var_j
var_l = var_h + var_k
var_m = var_g + var_l
print('{:.2f}'.format(round(var_m+1e-10,2)))
Category: Arithmetic calculation

Question (EN): There are 156 dureums of gulbis. How many gulbis are there in all? (One dureum equals 20 fish)
Question (KO): 굴비가 156두름 있습니다. 굴비는 모두 몇 마리 있나요? (한 두름은 20마리 입니다)

Answer: 3120

Solution (Python):
var_a = 156
var_b = 20
var_c = var_a * var_b
print(int(var_c))
Category: Correspondence

Question (EN): In A888<5001, you are going to write the numbers 1 through 9 in A. How many digits can you write in A?
Question (KO): A888<5001에서 A에 1부터 9까지의 숫자를 쓰려고 합니다. A에 쓸 수 있는 숫자는 모두 몇 개입니까?

Answer: 4

Solution (Python):
var_a = 'A888<5001'
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] = []
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].append(int(c[i]))
list_a = list(set(ans_dict[var_b]))
var_c = len(list_a)
print(int(var_c))
Category: Geometry

Question (EN): In the truck, there is a cuboid space of 350 centimeters (cm) in width, 260 centimeters (cm) in depth, 165 centimeters (cm) in height, and 5 centimeters (cm) in thickness, respectively. If you receive 1,600 won for shipping a box measuring 1 centimeter (cm) in width, depth, and height, how much would it cost if the truck was shipped full of boxes?
Question (KO): 트럭에 가로, 세로, 높이가 각각 350센티미터(㎝), 260센티미터(㎝), 165센티미터(㎝)이고, 두께가 5센티미터(㎝)인 직육면체 공간이 있다. 가로, 세로, 높이가 각각 1센티미터(㎝)인 박스 하나를 배송하면 1600원을 받는다고 할 때, 트럭을 박스로 가득 채워서 배송하면 얼마입니까?

Answer: 21760000000

Solution (Python):
var_a = 350
var_b = 5
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 260
var_g = 5
var_h = 2
var_i = var_g * var_h
var_j = var_f - var_i
var_k = var_e * var_j
var_l = 165
var_m = 5
var_n = var_l - var_m
var_o = var_k * var_n
var_p = 1600
var_q = var_o * var_p
print(int(var_q))
Category: Arithmetic calculation

Question (EN): When Daehyeon and Donggil cleaned the school for 8 days, an area equivalent to 7/12 of the total area was cleaned. If it took 10 days for Daehyeon to clean the rest of the area by himself, how many days did it take for Donggil to clean the entire area alone?
Question (KO): 대현이와 동길이가 8일 동안 학교 청소를 했더니 전체 면적의 7/12에 해당하는 구역이 깨끗해졌습니다. 나머지 구역을 대현이가 혼자 청소했을 때 10일이 걸렸다면, 전체 구역을 동길이가 혼자 청소했을 때는 며칠이 걸렸을지 구하시오.

Answer: 32

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

Question (EN): Yoongi is 2 years younger than Hoseok, and together, Yoongi and Hoseok are 18 years old. How old is Yoongi?
Question (KO): 윤기는 호석이보다 2살 어리고, 윤기와 호석이의 나이를 합하면 18살이 됩니다. 윤기의 나이는 몇 살입니까?

Answer: 8

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

Question (EN): There are 5 bottles that each contains 242.7 milliliters (ml) of beverage. How many milliliters (ml) of beverage are there?
Question (KO): 한 병에 242.7밀리리터(㎖) 가 담긴 음료수 병이 5병 있다. 음료수는 모두 몇 밀리리터(㎖)가 있는지 구하시오.

Answer: 1213.5

Solution (Python):
var_a = 242.7
var_b = 5
var_c = var_a * var_b
print('{:.2f}'.format(round(var_c+1e-10,2)))
Category: Possibility

Question (EN): You are planning to distribute 7 apples to 2 different monkeys. If the monkey must take at least 1 apple, how many cases are there to share apples?
Question (KO): 사과 7개를 서로 다른 2마리의 원숭이에게 나누어 주려고 합니다. 원숭이는 적어도 사과 1개는 받습니다. 사과를 나누어 주는 방법은 모두 몇 가지입니까?

Answer: 6

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

Question (EN): 20 students stood in a line. Jungkook stood in third place, and Yoongi stood right in front of Jungkook. How many students are standing behind Yoongi?
Question (KO): 20명의 학생들이 한줄로 섰습니다. 정국이는 3등으로 줄을 섰고, 윤기는 정국이 바로 앞에 섰습니다. 윤기 뒤에 서 있는 학생은 몇 명입니까?

Answer: 18

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

Question (EN): There are 23 fewer basketballs at Hoseok's school than soccer balls, and 18 more soccer balls than volleyballs. If there are 40 volleyballs, how many basketballs are there?
Question (KO): 호석이네 학교에 있는 농구공은 축구공보다 23개 더 적고 축구공은 배구공보다 18개 더 많습니다. 배구공이 40개 있을 때, 농구공은 몇 개입니까?

Answer: 35

Solution (Python):
var_a = 40
var_b = 18
var_c = var_a + var_b
var_d = 23
var_e = var_c - var_d
print(int(var_e))
Category: Possibility

Question (EN): When the three numbers 1, 2, and 3 are used repeatedly to form a four-digit number, how many ways can the sum be 10?
Question (KO): 세 개의 숫자 1, 2, 3을 중복 사용하여 네 자리 숫자를 만들 때, 합이 10이 되도록 만들 수 있는 경우는 모두 몇 가지인가?

Answer: 10

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

Question (EN): It is said that four times the number of persimmons Jungkook picked equals the number minus three persimmons picked by Hoseok. When Hoseok picked 35 persimmons, how many persimmons did Jungkook pick?
Question (KO): 정국이가 딴 감의 4배가 호석이가 딴 감에서 3개를 뺀 개수와 같다고 합니다. 호석이가 감을 35개 땄을 때 정국이가 딴 감은 몇 개입니까?

Answer: 8

Solution (Python):
var_a = 35
var_b = 3
var_c = var_a - var_b
var_d = 4
var_e = var_c / var_d
print(int(var_e))
Category: Possibility

Question (EN): Find the sum of the largest and smallest two-digit numbers that can be formed by drawing two different numbers from 0, 3, 5, 7, and 8.
Question (KO): 0, 3, 5, 7, 8 중에서 서로 다른 숫자 2개를 뽑아 만들 수 있는 두 자리 수 중에서 가장 큰 수와 가장 작은 수의 합을 구하시오.

Answer: 117

Solution (Python):
var_a = 0
var_b = 3
var_c = 5
var_d = 7
var_e = 8
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 = 2
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_f))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = 1
list_d=list_b.copy()
list_d.sort()
var_j = list_d[var_i-1]
var_k = var_h + var_j
print(int(var_k))
Category: Possibility

Question (EN): Using the four digits 1, 5, 6, and 9 once, find the second largest three-digit number whose hundreds digit is 5.
Question (KO): 4개의 숫자 1, 5, 6, 9를 한 번씩 사용하여 백의 자리 숫자가 5인 두 번째로 큰 세 자리 수를 구하시오.

Answer: 591

Solution (Python):
var_a = 1
var_b = 5
var_c = 6
var_d = 9
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 = 3
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 = 100
var_g = 5
list_c = [] 
var_f = int(var_f)
var_g = int(var_g)
for i in list_b:
    i = int(i)
    if (i//var_f)%10 == var_g:
        list_c.append(i)
var_h = 2
list_d=list_c.copy()
list_d.sort()
var_i = list_d[-var_h]
print(int(var_i))
Category: Possibility

Question (EN): Two were removed from a basket containing one each of apples, peaches, pears, melons, and strawberries. How many cases of fruit are left in the basket?
Question (KO): 사과, 복숭아, 배, 참외, 딸기가 각각 하나씩 있는 바구니에서 2개를 뺐습니다. 바구니에 남아있는 과일의 경우의 수는 모두 몇 가지입니까?

Answer: 10

Solution (Python):
var_a = 'apples'
var_b = 'peaches'
var_c = 'pears'
var_d = 'melons'
var_e = 'strawberries'
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 = len(list_a)
var_g = 2
var_h = 1
var_f = int(var_f)
var_g = int(var_g)
for i, elem in enumerate(range(var_g)):
    var_h = var_h * (var_f-i)
for i, elem in enumerate(range(var_g)):
    var_h = var_h / (i+1)
print(int(var_h))
Category: Arithmetic calculation

Question (EN): The sum of 4 consecutive odd numbers is 112. Write down the 2nd smallest of these 4 numbers.
Question (KO): 4개의 연속된 홀수의 합이 112입니다. 이 4개의 수 중에서 2번째로 작은 수를 쓰시오.

Answer: 27

Solution (Python):
var_a = 112
var_b = 4
var_c = var_a / var_b
var_d = 4
var_e = 2
var_f = var_d // var_e
var_g = 2
var_h = var_f * var_g
var_i = var_c - var_h
var_j = 1
var_k = var_i + var_j
var_l = 2
var_m = var_k + var_l
print(int(var_m))