category
stringclasses 5
values | question
stringlengths 20
555
| answer
stringlengths 1
20
| solution_abst
stringlengths 1
287
| solution_code
stringlengths 27
5.97k
|
---|---|---|---|---|
Arithmetic calculation | The average score on Jungkook's math test in April and May is 89 points. If Jungkook's average score on the math test in April, May, and June is 88, how many points did Jungkook take on the math test in June? | 86 | 88 3 [OP_MUL] 89 [OP_SUB] 89 [OP_SUB] | var_a = 88
var_b = 3
var_c = var_a * var_b
var_d = 89
var_e = var_c - var_d
var_f = 89
var_g = var_e - var_f
print(int(var_g)) |
Correspondence | A friend drank 300 milliliters (ml) more than 2/5 of the water Hyun-ji brought while climbing the mountain, and Hyun-ji drank 200 milliliters (ml) more than 1/2 of the remaining water. If the remaining water is 800 milliliters (ml), how many liters (l) is the amount of water Hyun-ji brought first? | 2.5 | 800 200 [OP_SUB] 1 1/2 [OP_SUB] [OP_DIV] 300 [OP_ADD] 1 2/5 [OP_SUB] [OP_DIV] 1000 [OP_DIV] | var_a = 800
var_b = 200
var_c = var_a - var_b
var_d = 1
var_e = 0.5
var_f = var_d - var_e
var_g = var_c / var_f
var_h = 300
var_i = var_g + var_h
var_j = 1
var_k = 0.4
var_l = var_j - var_k
var_m = var_i / var_l
var_n = 1000
var_o = var_m / var_n
print('{:.2f}'.format(round(var_o+1e-10,2))) |
Geometry | You are trying to draw a diagonal line within a hexagon. Find the number of diagonals in this case. | 9 | 6 6 3 [OP_SUB] [OP_MUL] 2 [OP_DIV] | var_a = 6
var_b = 6
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)) |
Possibility | Find the number of multiples of 9 in numbers less than 80. | 8 | 1 80 1 [OP_SUB] 1 [OP_LIST_ARANGE] 9 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 1
var_b = 80
var_c = 1
var_d = var_b - var_c
var_e = 1
list_a = [i for i in range(var_a, var_d + 1, var_e)]
var_f = 9
list_b = []
var_f = int(var_f)
for i in list_a:
i = int(i)
if i % var_f == 0:
list_b.append(i)
var_g = len(list_b)
print(int(var_g)) |
Arithmetic calculation | A set of three bulgogi burgers and chicken burgers costs 21,000 won. If a bulgogi burger is 300 won more expensive than a chicken burger, how much does a chicken burger cost? | 3350 | 21000 3 [OP_DIV] 300 [OP_SUB] 2 [OP_DIV] | var_a = 21000
var_b = 3
var_c = var_a / var_b
var_d = 300
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
print(int(var_g)) |
Correspondence | If the six-digit number A15B94 is a multiple of 99, find B | 3 | A15B94 [OP_GEN_POSSIBLE_LIST] 99 [OP_LIST_DIVISIBLE] A15B94 B [OP_LIST_FIND_UNK] | var_a = 'A15B94'
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 = 99
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 = 'A15B94'
var_d = 'B'
var_c = str(var_c)
var_d = str(var_d)
unk_idx = var_c.index(var_d)
var_e = 0
for elem in list_b:
elem = str(elem)
var_e = int(elem[unk_idx])
print(int(var_e)) |
Geometry | There is a cube with one edge 3 centimeters (cm) long. If you cut a cube with one edge of 1 centimeters (cm) at each vertex, what is the volume in cubic centimeters (cm3) of the remaining part? | 19 | 3 3 [OP_POW] 1 3 [OP_POW] 8 [OP_MUL] [OP_SUB] | var_a = 3
var_b = 3
var_c = var_a ** var_b
var_d = 1
var_e = 3
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)) |
Correspondence | When you multiply a number by 7, you get 50.68. find this number. | 7.24 | 50.68 7 [OP_DIV] | var_a = 50.68
var_b = 7
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Correspondence | The seven-digit number 25AB33C is said to be a multiple of 8, a multiple of 9, and a multiple of 11. Find the sum of A, B, and C | 14 | 25AB33C [OP_GEN_POSSIBLE_LIST] 8 [OP_LIST_DIVISIBLE] 9 [OP_LIST_DIVISIBLE] 11 [OP_LIST_DIVISIBLE] 25AB33C A [OP_LIST_FIND_UNK] 25AB33C B [OP_LIST_FIND_UNK] [OP_ADD] 25AB33C C [OP_LIST_FIND_UNK] [OP_ADD] | var_a = '25AB33C'
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 = 8
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 = 9
list_c = []
var_c = int(var_c)
for i in list_b:
i = int(i)
if i % var_c == 0:
list_c.append(i)
var_d = 11
list_d = []
var_d = int(var_d)
for i in list_c:
i = int(i)
if i % var_d == 0:
list_d.append(i)
var_e = '25AB33C'
var_f = 'A'
var_e = str(var_e)
var_f = str(var_f)
unk_idx = var_e.index(var_f)
var_g = 0
for elem in list_d:
elem = str(elem)
var_g = int(elem[unk_idx])
var_h = '25AB33C'
var_i = 'B'
var_h = str(var_h)
var_i = str(var_i)
unk_idx = var_h.index(var_i)
var_j = 0
for elem in list_d:
elem = str(elem)
var_j = int(elem[unk_idx])
var_k = var_g + var_j
var_l = '25AB33C'
var_m = 'C'
var_l = str(var_l)
var_m = str(var_m)
unk_idx = var_l.index(var_m)
var_n = 0
for elem in list_d:
elem = str(elem)
var_n = int(elem[unk_idx])
var_o = var_k + var_n
print(int(var_o)) |
Possibility | What is the value of adding the second largest number to the sum of the largest and smallest three-digit number that can be formed by using the number cards 2, 5, and 8 only once? | 1935 | [OP_LIST_SOL] 2 5 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD] 2 [OP_LIST_MAX] [OP_ADD] | var_a = 2
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 = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = 1
list_d=list_b.copy()
list_d.sort()
var_h = list_d[var_g-1]
var_i = var_f + var_h
var_j = 2
list_e=list_b.copy()
list_e.sort()
var_k = list_e[-var_j]
var_l = var_i + var_k
print(int(var_l)) |
Geometry | You laid out four 100-won coins on a piece of paper and drew the smallest square containing the coins. The perimeter of the square was 56 centimeters (cm). Find the perimeter in centimeters (cm) of the smallest square containing 441 100-won coins. | 588 | 56 4 [OP_DIV] 4 1/2 [OP_POW] [OP_DIV] 441 1/2 [OP_POW] [OP_MUL] 4 [OP_MUL] | var_a = 56
var_b = 4
var_c = var_a / var_b
var_d = 4
var_e = 0.5
var_f = var_d ** var_e
var_g = var_c / var_f
var_h = 441
var_i = 0.5
var_j = var_h ** var_i
var_k = var_g * var_j
var_l = 4
var_m = var_k * var_l
print(int(var_m)) |
Comparison | Hohyeon, Seulgi, and Hyunjeong are competing in kicking jegi. Hohyeon kicked 23 times in the first and 28 times in the second. Hyunjeong kicked 32 times in the first and 17 times in the second. Seulgi kicked 27 times in the first. At least how many times does Seulgi need to kick in the 2nd to win first alone? | 25 | [OP_LIST_SOL] Hohyeon Seulgi Hyunjeong [OP_LIST_EOL] [OP_LIST_SOL] 23 28 [OP_ADD] 32 17 [OP_ADD] 27 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] 1 [OP_ADD] | var_a = 'Hohyeon'
var_b = 'Seulgi'
var_c = 'Hyunjeong'
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 = 23
var_e = 28
var_f = var_d + var_e
var_g = 32
var_h = 17
var_i = var_g + var_h
var_j = 27
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_f):
var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
var_k = 1
list_c=list_b.copy()
list_c.sort()
var_l = list_c[-var_k]
var_m = 1
list_d=list_b.copy()
list_d.sort()
var_n = list_d[var_m-1]
var_o = var_l - var_n
var_p = 1
var_q = var_o + var_p
print(int(var_q)) |
Arithmetic calculation | What is the largest four-digit number divisible by 5, 6, and 2? | 9990 | 1000 9999 1 [OP_LIST_ARANGE] 5 [OP_LIST_DIVISIBLE] 6 [OP_LIST_DIVISIBLE] 2 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX] | var_a = 1000
var_b = 9999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 5
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 = 6
list_c = []
var_e = int(var_e)
for i in list_b:
i = int(i)
if i % var_e == 0:
list_c.append(i)
var_f = 2
list_d = []
var_f = int(var_f)
for i in list_c:
i = int(i)
if i % var_f == 0:
list_d.append(i)
var_g = 1
list_e=list_d.copy()
list_e.sort()
var_h = list_e[-var_g]
print(int(var_h)) |
Possibility | All possible three-digit natural numbers were made by picking three out of the ten digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 and arranging them in a row. Among these, find the largest even number of no more than 300. | 298 | [OP_LIST_SOL] 0 1 2 3 4 5 6 7 8 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 300 [OP_LIST_LESS_EQUAL] 2 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX] | var_a = 0
var_b = 1
var_c = 2
var_d = 3
var_e = 4
var_f = 5
var_g = 6
var_h = 7
var_i = 8
var_j = 9
list_a= []
if "/" in str(var_j):
var_j = eval(str(var_j))
list_a.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_a.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_a.append(var_h)
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_k = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_k))
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_l = 300
list_c = []
for i in list_b:
if i <= var_l:
list_c.append(i)
var_m = 2
list_d = []
var_m = int(var_m)
for i in list_c:
i = int(i)
if i % var_m == 0:
list_d.append(i)
var_n = 1
list_e=list_d.copy()
list_e.sort()
var_o = list_e[-var_n]
print(int(var_o)) |
Arithmetic calculation | We plan to build six houses at regular intervals in a city of 11.5 kilometers (km). If you build houses at both ends of the city, how many kilometers (km) apart should the houses be? | 2.3 | 11.5 6 1 [OP_SUB] [OP_DIV] | var_a = 11.5
var_b = 6
var_c = 1
var_d = var_b - var_c
var_e = var_a / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Possibility | Use the number cards 1 through 9 once each to create three-digit numbers. If these numbers are arranged from the largest to smallest, in what place would 964 come? | 18 | 7 7 [OP_ADD] 4 [OP_ADD] | var_a = 7
var_b = 7
var_c = var_a + var_b
var_d = 4
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | An elephant train with a length of 15 meters (m) is running at 275 centimeters (cm) per second. If it took 48 seconds for this train to pass completely through the bridge, find the length in meters (m) of the bridge. | 117 | 275 100 [OP_DIV] 48 [OP_MUL] 15 [OP_SUB] | var_a = 275
var_b = 100
var_c = var_a / var_b
var_d = 48
var_e = var_c * var_d
var_f = 15
var_g = var_e - var_f
print(int(var_g)) |
Arithmetic calculation | The warehouse received 318 boxes on the first day, 312 boxes on the second day, and 180 and 162 boxes separately on the third day. What is the average number of boxes received per day by the third day? | 324 | 318 312 [OP_ADD] 180 162 [OP_ADD] [OP_ADD] 3 [OP_DIV] | var_a = 318
var_b = 312
var_c = var_a + var_b
var_d = 180
var_e = 162
var_f = var_d + var_e
var_g = var_c + var_f
var_h = 3
var_i = var_g / var_h
print(int(var_i)) |
Arithmetic calculation | To make confetti, you are going to cut a strip of paper 0.3 cm (cm) at a time. How many centimeters (cm) of paper strips are left after making confetti from a 15.7 cm (cm) paper strip? | 0.1 | 15.7 0.3 [OP_MOD] | var_a = 15.7
var_b = 0.3
var_c = var_a % var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Comparison | There are 4 boxes (A), (B), (C), and (D). Box (B) is smaller than box (D). Box is (A) larger than box (D). Box (B) is larger than box (C). Which box is the smallest in size? | (C) | [OP_LIST_SOL] (A) (B) (C) (D) [OP_LIST_EOL] [OP_LIST_SOL] (B) (D) < (A) (D) > (B) (C) > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | 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 = '(B)'
var_f = '(D)'
var_g = '<'
var_h = '(A)'
var_i = '(D)'
var_j = '>'
var_k = '(B)'
var_l = '(C)'
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 = len(list_c)
var_o = list_c[var_n-1]
print(var_o) |
Geometry | The length of the base of the trapezoid is 25 centimeters (cm), and the length of the top side is (a) centimeters (cm). If the distance between the two sides is 13 centimeters (cm), and the area of this trapezoid is 286 square centimeters (cm2), what is the correct number for (a)? | 19 | 286 13 [OP_DIV] 2 [OP_MUL] 25 [OP_SUB] | var_a = 286
var_b = 13
var_c = var_a / var_b
var_d = 2
var_e = var_c * var_d
var_f = 25
var_g = var_e - var_f
print(int(var_g)) |
Comparison | Hyunjeong stacked up 15 red boxes and Seulgi stacked up 20 yellow boxes. When the heights of one red box and one yellow box are 4.2 cm and 3.3 cm respectively, find out who stacked up the box the highest. | Seulgi | [OP_LIST_SOL] Hyunjeong Seulgi [OP_LIST_EOL] [OP_LIST_SOL] 4.2 15 [OP_MUL] 3.3 20 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Hyunjeong'
var_b = 'Seulgi'
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 = 4.2
var_d = 15
var_e = var_c * var_d
var_f = 3.3
var_g = 20
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) |
Arithmetic calculation | 7/10 of the water remains in the 10 liter (L) bucket. How many liters (liters) of water do you need to fill in one bottle to divide the remaining water equally into 4 bottles? | 1.75 | 10 7/10 [OP_MUL] 4 [OP_DIV] | var_a = 10
var_b = 0.7
var_c = var_a * var_b
var_d = 4
var_e = var_c / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Comparison | 20 students lined up in a single line. Eleven students are standing in front of Yoongi. How many students are standing behind Yoongi? | 8 | 20 11 [OP_SUB] 1 [OP_SUB] | var_a = 20
var_b = 11
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | If 5 basketball teams play each other twice, how many games are there altogether? | 20 | 5 5 1 [OP_SUB] [OP_MUL] | var_a = 5
var_b = 5
var_c = 1
var_d = var_b - var_c
var_e = var_a * var_d
print(int(var_e)) |
Arithmetic calculation | Find the sum of the factors of 32. | 63 | 32 [OP_LIST_GET_DIVISOR] [OP_LIST_SUM] | 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))
list_a = [float(i) for i in list_a]
var_b = sum(list_a)
print(int(var_b)) |
Possibility | There are nine number cards with numbers from 1 to 9 written on them. How many ways can you draw 3 of these cards so that the sum is 17? | 42 | 1 9 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] 17 [OP_LIST_FIND_NUM] | var_a = 1
var_b = 9
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 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]
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)) |
Arithmetic calculation | Five years ago, the mother was four times the daughter's age. Eight years from this year, the sum of the ages of mother and daughter will be 71. How old is the mother this year? | 41 | 71 8 2 [OP_MUL] [OP_SUB] 5 2 [OP_MUL] [OP_SUB] 4 1 [OP_ADD] [OP_FDIV] 4 [OP_MUL] 5 [OP_ADD] | var_a = 71
var_b = 8
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 5
var_g = 2
var_h = var_f * var_g
var_i = var_e - var_h
var_j = 4
var_k = 1
var_l = var_j + var_k
var_m = var_i // var_l
var_n = 4
var_o = var_m * var_n
var_p = 5
var_q = var_o + var_p
print(int(var_q)) |
Correspondence | When Hoseok bought 2 persimmons and 7 apples, how many fruits did Hoseok buy? | 9 | 2 7 [OP_ADD] | var_a = 2
var_b = 7
var_c = var_a + var_b
print(int(var_c)) |
Possibility | Find how many numbers from 1 to 12 are multiples of 3. | 4 | 1 12 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 1
var_b = 12
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 3
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 = len(list_b)
print(int(var_e)) |
Possibility | Find the number of cases of selecting 9 balls using at least 1 of each of the 3 different balls and allowing duplicates. | 28 | 3 9 [OP_ADD] 3 1 [OP_MUL] [OP_SUB] 1 [OP_SUB] 9 3 1 [OP_MUL] [OP_SUB] [OP_COMB] | var_a = 3
var_b = 9
var_c = var_a + var_b
var_d = 3
var_e = 1
var_f = var_d * var_e
var_g = var_c - var_f
var_h = 1
var_i = var_g - var_h
var_j = 9
var_k = 3
var_l = 1
var_m = var_k * var_l
var_n = var_j - var_m
var_o = 1
var_i = int(var_i)
var_n = int(var_n)
for i, elem in enumerate(range(var_n)):
var_o = var_o * (var_i-i)
for i, elem in enumerate(range(var_n)):
var_o = var_o / (i+1)
print(int(var_o)) |
Arithmetic calculation | There was juice in the fridge. Of this, the father drank 1/6 of the total, and the mother drank the remaining 2/5. After Hyo-geun drank 2/3 of the remaining juice from father and mother, if the amount of juice remaining was 120 milliliters (ml), how many milliliters (ml) of juice was initially in the refrigerator? | 720 | 120 1 1/6 [OP_SUB] [OP_DIV] 1 2/5 [OP_SUB] [OP_DIV] 1 2/3 [OP_SUB] [OP_DIV] | var_a = 120
var_b = 1
var_c = 0.16666666666666666
var_d = var_b - var_c
var_e = var_a / var_d
var_f = 1
var_g = 0.4
var_h = var_f - var_g
var_i = var_e / var_h
var_j = 1
var_k = 0.6666666666666666
var_l = var_j - var_k
var_m = var_i / var_l
print(int(eval('{:.2f}'.format(round(var_m+1e-10,2))))) |
Correspondence | The five-digit number AB40C is a multiple of 45. Think of five-digit numbers like this. How many can you find? | 20 | AB40C [OP_GEN_POSSIBLE_LIST] 45 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 'AB40C'
ans_dict = dict()
var_a = str(var_a)
list_a = []
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 0
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
if len(var_a) == len(str(int(temp))):
new_elem = int(temp)
list_a.append(new_elem)
var_b = 45
list_b = []
var_b = int(var_b)
for i in list_a:
i = int(i)
if i % var_b == 0:
list_b.append(i)
var_c = len(list_b)
print(int(var_c)) |
Correspondence | I'm going to pack 90 beads, but there should be no beads left after packing them. Find how many can fit in one package. | 12 | 90 [OP_LIST_GET_DIVISOR] [OP_LIST_LEN] | var_a = 90
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)
print(int(var_b)) |
Geometry | Seokjun drew a rhombus by connecting the dots in the middle of each side of a square with a circumference of 96 centimeters (cm). What is the area, in square centimeters (cm2), of the rhombus you drew? | 288 | 96 4 [OP_DIV] 2 [OP_POW] 2 [OP_DIV] | var_a = 96
var_b = 4
var_c = var_a / var_b
var_d = 2
var_e = var_c ** var_d
var_f = 2
var_g = var_e / var_f
print(int(var_g)) |
Arithmetic calculation | Streetlights are to be erected at intervals of 4 meters (m) from start to finish on both sides of a road that is 260 meters (m) long. Find how many streetlights you need. | 132 | 260 4 [OP_DIV] 1 [OP_ADD] 2 [OP_MUL] | var_a = 260
var_b = 4
var_c = var_a / var_b
var_d = 1
var_e = var_c + var_d
var_f = 2
var_g = var_e * var_f
print(int(var_g)) |
Arithmetic calculation | Seongjae's class is made up of 7 groups, with 6 students in each group. 14 bundles of 105 sheets of colored paper were distributed equally to Seongjae's classmates, and there were 84 sheets left. How many pieces of colored paper were handed out to each person? | 33 | 105 14 [OP_MUL] 84 [OP_SUB] 6 7 [OP_MUL] [OP_DIV] | var_a = 105
var_b = 14
var_c = var_a * var_b
var_d = 84
var_e = var_c - var_d
var_f = 6
var_g = 7
var_h = var_f * var_g
var_i = var_e / var_h
print(int(var_i)) |
Arithmetic calculation | Street trees are to be planted every 6.4 meters (m) on one side of a road with a length of 268.8 meters (m). Find the number of trees needed if you plant trees at both the beginning and end of the road. | 43 | 268.8 6.4 [OP_DIV] 1 [OP_ADD] | var_a = 268.8
var_b = 6.4
var_c = var_a / var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Geometry | There is a rectangular prism that has all its edges the same length. If the sum of the lengths of all the edges of this square prism is 72 centimeters (cm), how many centimeters (cm) is the length of one edge? | 6 | 72 4 3 [OP_MUL] [OP_DIV] | var_a = 72
var_b = 4
var_c = 3
var_d = var_b * var_c
var_e = var_a / var_d
print(int(var_e)) |
Arithmetic calculation | If the length of the long rod is 14/15 meters (m), and it is 1/10 meter (m) longer than the short rod, how many meters (m) is the sum of the lengths of the long rod and the short rod? | 1.77 | 14/15 2 [OP_MUL] 1/10 [OP_SUB] | var_a = 0.9333333333333333
var_b = 2
var_c = var_a * var_b
var_d = 0.1
var_e = var_c - var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Comparison | How many numbers between 0.8, 1/2 are less than or equal to 0.4? | 0 | [OP_LIST_SOL] 0.8 1/2 [OP_LIST_EOL] 0.4 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN] | var_a = 0.8
var_b = 0.5
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 = 0.4
list_b = []
for i in list_a:
if i <= var_c:
list_b.append(i)
var_d = len(list_b)
print(int(var_d)) |
Comparison | The vase is placed 5th from the right and 4th from the left on one level of a shelf. The number of vases on each floor is the same, and there are 10 shelves. If the flower shop has a total of 1600 vases, how many shelves are there in total? | 20 | 1600 5 4 [OP_ADD] 1 [OP_SUB] 10 [OP_MUL] [OP_FDIV] | var_a = 1600
var_b = 5
var_c = 4
var_d = var_b + var_c
var_e = 1
var_f = var_d - var_e
var_g = 10
var_h = var_f * var_g
var_i = var_a // var_h
print(int(var_i)) |
Comparison | 20 students are waiting for the bus. If 11 people came before Yoongi, how many people came later than Yoongi? | 8 | 20 11 [OP_SUB] 1 [OP_SUB] | var_a = 20
var_b = 11
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | There are 7 packs of pencils. There are 3 fewer pencils than colored pencils. If there are 10 pencils in a pack of pencils, how many colored pencils are there? | 73 | 7 10 [OP_MUL] 3 [OP_ADD] | var_a = 7
var_b = 10
var_c = var_a * var_b
var_d = 3
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | Su-hee's height is 1 meter (m) 35 centimeters (cm), and when Su-hee grows by 9 centimeters (cm), she will be the same height as her brother. Express the height in meters (m) of Su-hee's brother as a decimal number. | 1.44 | 1 35 100 [OP_DIV] [OP_ADD] 9 100 [OP_DIV] [OP_ADD] | var_a = 1
var_b = 35
var_c = 100
var_d = var_b / var_c
var_e = var_a + var_d
var_f = 9
var_g = 100
var_h = var_f / var_g
var_i = var_e + var_h
print('{:.2f}'.format(round(var_i+1e-10,2))) |
Geometry | You have a rectangle with a perimeter of 54 centimeters (cm). At this time, the horizontal length is 3 centimeters (cm) longer than the vertical length. Find the horizontal length. | 15 | 54 2 [OP_DIV] 3 [OP_SUB] 2 [OP_DIV] 3 [OP_ADD] | var_a = 54
var_b = 2
var_c = var_a / var_b
var_d = 3
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
var_h = 3
var_i = var_g + var_h
print(int(var_i)) |
Geometry | You have a cookie in the shape of a regular hexagon with an area of 81.12 square centimeters (cm2). If 6 friends divide the cookie into equal parts and eat it, find the area in square centimeters (cm2) of the cookie eaten by one person. | 13.52 | 81.12 6 [OP_DIV] | var_a = 81.12
var_b = 6
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Arithmetic calculation | I climbed the mountain at 2 kilometers per hour (km), and when I came down, I walked 2 kilometers (km) further than when I went up, at 3 kilometers (km) per hour, and it took 4 hours. What is the distance of climbing down the mountain? | 6 | 2 4 [OP_MUL] 2 [OP_ADD] 3 2 [OP_ADD] [OP_DIV] 3 [OP_MUL] | var_a = 2
var_b = 4
var_c = var_a * var_b
var_d = 2
var_e = var_c + var_d
var_f = 3
var_g = 2
var_h = var_f + var_g
var_i = var_e / var_h
var_j = 3
var_k = var_i * var_j
print(int(var_k)) |
Geometry | There is a square with a side of 6 centimeters (cm). By how many square centimeters (cm2) does the area of the square increase if the length of each side of the square is increased by 1 centimeter (cm)? | 13 | 6 1 [OP_ADD] 2 [OP_POW] 6 2 [OP_POW] [OP_SUB] | var_a = 6
var_b = 1
var_c = var_a + var_b
var_d = 2
var_e = var_c ** var_d
var_f = 6
var_g = 2
var_h = var_f ** var_g
var_i = var_e - var_h
print(int(var_i)) |
Arithmetic calculation | Using 0.14 liters (L) of gasoline, you can travel 1 kilometer (km). How many liters (l) of gasoline do you need to travel 2 hours 30 minutes at 93.6 kilometers (km) in 1 hour? | 32.76 | 0.14 93.6 [OP_MUL] 2 30 60 [OP_DIV] [OP_ADD] [OP_MUL] | var_a = 0.14
var_b = 93.6
var_c = var_a * var_b
var_d = 2
var_e = 30
var_f = 60
var_g = var_e / var_f
var_h = var_d + var_g
var_i = var_c * var_h
print('{:.2f}'.format(round(var_i+1e-10,2))) |
Arithmetic calculation | Hyuna walks 7000 meters (m) in an hour. Express as an integer of how many hours Hyuna must walk to reach 100000 meters (m). | 15 | 100000 7000 [OP_DIV] 1 [OP_CEIL] | var_a = 100000
var_b = 7000
var_c = var_a / var_b
var_d = 1
var_e=int(((var_c+9*10**(var_d-2))//(10**(var_d-1)))*10**(var_d-1))
print(int(var_e)) |
Correspondence | If 34 plus a certain number minus 53 is 28, what number is that? | 47 | 28 53 [OP_ADD] 34 [OP_SUB] | var_a = 28
var_b = 53
var_c = var_a + var_b
var_d = 34
var_e = var_c - var_d
print(int(var_e)) |
Geometry | The red confetti is a square shape whose side is 8 centimeters (cm), and the yellow confetti is a rectangle shape whose side is 10 centimeters (cm) and 5 centimeters (cm). Find the difference between the areas of the red confetti and the yellow confetti. | 14 | 8 2 [OP_POW] 10 5 [OP_MUL] [OP_SUB] [OP_ABS] | var_a = 8
var_b = 2
var_c = var_a ** var_b
var_d = 10
var_e = 5
var_f = var_d * var_e
var_g = var_c - var_f
var_h = abs(var_g)
print(int(var_h)) |
Arithmetic calculation | There are 19 white marbles and some black marbles in a bag. How many black marbles are there if the total number of white and black marbles is 37 in the bag? | 18 | 37 19 [OP_SUB] | var_a = 37
var_b = 19
var_c = var_a - var_b
print(int(var_c)) |
Geometry | You have a room with a rectangular floor with a length of 3.6 meters (m) and a width 2.5 times its length. If half of the floor in this room is tiled in yellow, what is the area of the yellow tiled floor in square meters (m2)? | 16.2 | 3.6 3.6 2.5 [OP_MUL] [OP_MUL] 2 [OP_DIV] | var_a = 3.6
var_b = 3.6
var_c = 2.5
var_d = var_b * var_c
var_e = var_a * var_d
var_f = 2
var_g = var_e / var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Possibility | We want to create a new number by moving each digit of 234. How many cases are there where you make a new number that is greater than 340? | 3 | 234 [OP_NUM2LIST] [OP_LIST_LEN] [OP_LIST_GET_PERM] 340 [OP_LIST_MORE] [OP_LIST_LEN] | var_a = 234
list_a = []
var_a = int(var_a)
while var_a//10 > 0:
list_a.append(var_a%10)
var_a = var_a//10
list_a.append(var_a%10)
list_a = list_a[::-1]
var_b = len(list_a)
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_b))
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_c = 340
list_c = []
for i in list_b:
if i > var_c:
list_c.append(i)
var_d = len(list_c)
print(int(var_d)) |
Correspondence | Among the dolls made in a factory per day, the number of dolls excluding the defective ones is 4800, and the number of the total dolls made per day is 1.33 times the number of normal products. Find how many dolls the factory makes per day. | 6384 | 4800 1.33 [OP_MUL] | var_a = 4800
var_b = 1.33
var_c = var_a * var_b
print(int(var_c)) |
Comparison | Jungkook has 6 erasers. Jimin has 4 more erasers than Jungkook, and Seokjin has 3 fewer than Jimin. Who has the fewest erasers? | Jungkook | [OP_LIST_SOL] Jungkook Jimin Seokjin [OP_LIST_EOL] [OP_LIST_SOL] 6 6 4 [OP_ADD] 6 4 [OP_ADD] 3 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Jungkook'
var_b = 'Jimin'
var_c = 'Seokjin'
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 = 6
var_f = 4
var_g = var_e + var_f
var_h = 6
var_i = 4
var_j = var_h + var_i
var_k = 3
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_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
var_m = 1
list_c=list_b.copy()
list_c.sort()
var_n = list_c[var_m-1]
var_o = list_b.index(var_n)+1
var_p = list_a[var_o-1]
print(var_p) |
Comparison | Students are standing in a line. There are 9 people in front of Taehyung and 16 people behind him. How many students are standing in a line? | 26 | 9 16 [OP_ADD] 1 [OP_ADD] | var_a = 9
var_b = 16
var_c = var_a + var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Correspondence | Given two natural numbers A and B, if B is the number obtained when A is multiplied by 9 and then added to 13, what is the remainder when you divide B by 9? | 4 | 13 9 [OP_MOD] | var_a = 13
var_b = 9
var_c = var_a % var_b
print(int(var_c)) |
Geometry | You have a cube-shaped box with one edge measuring 11 centimeters (cm). What is the surface area of the box in square centimeters (cm2)? | 726 | 11 2 [OP_POW] 6 [OP_MUL] | var_a = 11
var_b = 2
var_c = var_a ** var_b
var_d = 6
var_e = var_c * var_d
print(int(var_e)) |
Arithmetic calculation | If you pour water into a 200 ml (㎖) cup 3 times to fill a 2 liter (L) pot with water, find the maximum number of times you need to pour water in the future. | 7 | 2 1000 [OP_MUL] 200 3 [OP_MUL] [OP_SUB] 200 [OP_DIV] 1 [OP_CEIL] | var_a = 2
var_b = 1000
var_c = var_a * var_b
var_d = 200
var_e = 3
var_f = var_d * var_e
var_g = var_c - var_f
var_h = 200
var_i = var_g / var_h
var_j = 1
var_k=int(((var_i+9*10**(var_j-2))//(10**(var_j-1)))*10**(var_j-1))
print(int(var_k)) |
Arithmetic calculation | Grandpa's age this year is 6 times the age of his grandson. After 4 years, the sum of the ages of the grandfather and grandson will be 78. How old is the grandson this year? | 10 | 78 4 2 [OP_MUL] [OP_SUB] 1 6 [OP_ADD] [OP_DIV] | var_a = 78
var_b = 4
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 1
var_g = 6
var_h = var_f + var_g
var_i = var_e / var_h
print(int(var_i)) |
Arithmetic calculation | There are 17 apples and 9 pears. How many more apples than pears? | 8 | 17 9 [OP_SUB] | var_a = 17
var_b = 9
var_c = var_a - var_b
print(int(var_c)) |
Arithmetic calculation | Given that the age of the son and father is each 5 and 35 this year, how long will it take for the sum of their ages become 60? | 10 | 60 35 5 [OP_ADD] [OP_SUB] 2 [OP_DIV] | var_a = 60
var_b = 35
var_c = 5
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)) |
Possibility | Four friends met and everyone shook hands with each other once. Find the total number of handshakes. | 6 | 4 4 1 [OP_SUB] [OP_MUL] 2 [OP_DIV] | var_a = 4
var_b = 4
var_c = 1
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)) |
Correspondence | We have an expression of 31+6A2=683. Find the number that must go into A. | 5 | 31+6A2=683 A [OP_DIGIT_UNK_SOLVER] | var_a = '31+6A2=683'
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)) |
Comparison | Namjoon, Yoongi, and Hoseok stood in a line at the supermarket. Namjoon stood at the 33rd, and Hoseok stood at the 35th. What about Yoongi? | 34 | 33 35 [OP_ADD] 2 [OP_FDIV] | var_a = 33
var_b = 35
var_c = var_a + var_b
var_d = 2
var_e = var_c // var_d
print(int(var_e)) |
Arithmetic calculation | There are 19 baskets of plums with 46 in each basket and several baskets of blueberries with 170 in each basket. If the total number of fruits in the basket is 1894, how many baskets of blueberries are there? | 6 | 1894 46 19 [OP_MUL] [OP_SUB] 170 [OP_FDIV] | var_a = 1894
var_b = 46
var_c = 19
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 170
var_g = var_e // var_f
print(int(var_g)) |
Arithmetic calculation | It takes 3 days for Yunkyung to complete a certain task by herself. What is the total amount of work Yunkyung can do in a day? | 0.33 | 1 3 [OP_DIV] | var_a = 1
var_b = 3
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Geometry | The horizontal ratio of the two rectangles is 8:7, and the vertical ratio is 9:4. If the area of the larger rectangle is 108 square centimeters (cm2), find the area of the smaller rectangle. | 42 | 108 8 [OP_DIV] 7 [OP_MUL] 9 [OP_DIV] 4 [OP_MUL] | 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)) |
Comparison | Miyoung is ranked 12th from the front and 12th from the back in math scores of her class. Miyoung's school has a total of 3 grades, each grade has 12 classes, and each class has the same number of students. How many students are there in this school? | 828 | 12 12 [OP_ADD] 1 [OP_SUB] 12 [OP_MUL] 3 [OP_MUL] | var_a = 12
var_b = 12
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 12
var_g = var_e * var_f
var_h = 3
var_i = var_g * var_h
print(int(var_i)) |
Geometry | Coins of the same size are arranged in a regular pattern without gaps to form a square. If the number of coins on the circumference was 36, how many coins were on the outermost of one side? | 10 | 36 4 [OP_DIV] 1 [OP_ADD] | var_a = 36
var_b = 4
var_c = var_a / var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Geometry | I painted a trapezoid on drawing paper. The lower side is 3.6 centimeters (cm) shorter than the upper side, the height is 5.2 centimeters (cm), and the area of the roof is 96.98 square cm (cm2). How many centimeters (cm) is the lower edge of this trapezoid? | 16.85 | 96.98 2 [OP_MUL] 5.2 [OP_DIV] 3.6 [OP_SUB] 2 [OP_DIV] | var_a = 96.98
var_b = 2
var_c = var_a * var_b
var_d = 5.2
var_e = var_c / var_d
var_f = 3.6
var_g = var_e - var_f
var_h = 2
var_i = var_g / var_h
print('{:.2f}'.format(round(var_i+1e-10,2))) |
Arithmetic calculation | There are 4 boxes of 5 persimmons in Jungkook's house. How many persimmons are there in Jungkook's house? | 20 | 5 4 [OP_MUL] | var_a = 5
var_b = 4
var_c = var_a * var_b
print(int(var_c)) |
Arithmetic calculation | Namjoon had 250 pieces of colored paper. Namjoon gave Yuna 60 pieces of colored paper, resulting Namjoon had 20 fewer than Yuna. How many pieces of colored paper did Yuna have at first? | 150 | 250 60 [OP_SUB] 60 [OP_SUB] 20 [OP_ADD] | var_a = 250
var_b = 60
var_c = var_a - var_b
var_d = 60
var_e = var_c - var_d
var_f = 20
var_g = var_e + var_f
print(int(var_g)) |
Correspondence | Siwoo gave 3/10 of the cookies he had to his friend, and there are 12 cookies left. Find how much is 1/5 of the cookies Siwoo had at the beginning. | 8 | 12 3/10 [OP_DIV] 1/5 [OP_MUL] | var_a = 12
var_b = 0.3
var_c = var_a / var_b
var_d = 0.2
var_e = var_c * var_d
print(int(var_e)) |
Arithmetic calculation | Find the sum of all natural numbers from 1 to 100 that are multiples of 2 and are also multiples of 3. | 816 | 1 100 1 [OP_LIST_ARANGE] 2 [OP_LIST_DIVISIBLE] 3 [OP_LIST_DIVISIBLE] [OP_LIST_SUM] | var_a = 1
var_b = 100
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 2
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 = 3
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_c = [float(i) for i in list_c]
var_f = sum(list_c)
print(int(var_f)) |
Comparison | In the morning, Jimin jumped rope 20 times and Eunji 18 times. If Jimin jumped rope 14 times in the evening, how many times should Eunji jump rope at least to do more than Jimin? | 17 | 20 14 [OP_ADD] 18 [OP_SUB] 1 [OP_ADD] | var_a = 20
var_b = 14
var_c = var_a + var_b
var_d = 18
var_e = var_c - var_d
var_f = 1
var_g = var_e + var_f
print(int(var_g)) |
Geometry | Three cubes with a corner length of 6 centimeters (cm) are attached to form a single cuboid. What is the volume of this cuboid in cubic centimeters (cm3)? | 648 | 6 3 [OP_POW] 3 [OP_MUL] | var_a = 6
var_b = 3
var_c = var_a ** var_b
var_d = 3
var_e = var_c * var_d
print(int(var_e)) |
Possibility | Write the largest five-digit number that can be formed by using 0, 3, 4, 8, and 9 only once. | 98430 | [OP_LIST_SOL] 0 3 4 8 9 [OP_LIST_EOL] 5 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] | var_a = 0
var_b = 3
var_c = 4
var_d = 8
var_e = 9
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 = 5
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]
print(int(var_h)) |
Correspondence | When you multiply a number by 5, the result is 100. What number is divided by 10? | 2 | 100 5 [OP_DIV] 10 [OP_DIV] | var_a = 100
var_b = 5
var_c = var_a / var_b
var_d = 10
var_e = var_c / var_d
print(int(var_e)) |
Possibility | How many different weights can you make with 1g (g), 2g (g), 4g (g), and 8g (g) weights? | 16 | 2 4 [OP_POW] | var_a = 2
var_b = 4
var_c = var_a ** var_b
print(int(var_c)) |
Correspondence | The fish Seongjun caught was 21.52 centimeters (cm) larger than the fish Jiwoon caught, and the fish Jiwoon caught was 12.64 centimeters (cm) smaller than the fish Sungwoo caught. Find the size difference in centimeters (cm) between the Seongjun's fish and the Sungwoo's fish. | 8.88 | 21.52 12.64 [OP_SUB] | var_a = 21.52
var_b = 12.64
var_c = var_a - var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Geometry | How many centimeters (cm) is the sum of all the side lengths of a regular octagon with a side length of 2.3 meters (m)? | 1840 | 2.3 8 [OP_MUL] 100 [OP_MUL] | var_a = 2.3
var_b = 8
var_c = var_a * var_b
var_d = 100
var_e = var_c * var_d
print(int(eval('{:.2f}'.format(round(var_e+1e-10,2))))) |
Correspondence | You added 63 to a number by mistake when you should have subtracted 36, and the result was 8. What is the correct result? | 91 | 8 63 [OP_SUB] 36 [OP_SUB] | var_a = 8
var_b = 63
var_c = var_a - var_b
var_d = 36
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | Kyunghoon walked at 3 kilometers (km) per hour on the way up to the mountain and then took a 2 kilometer (km) longer route down than the one he took up, walking at 4 km per hour for a total of 4 hours. How long did it take Kyunghoon to go down? | 2 | 4 2 4 [OP_DIV] [OP_SUB] 1 3 [OP_DIV] 1 4 [OP_DIV] [OP_ADD] [OP_DIV] 2 [OP_ADD] 4 [OP_DIV] | var_a = 4
var_b = 2
var_c = 4
var_d = var_b / var_c
var_e = var_a - var_d
var_f = 1
var_g = 3
var_h = var_f / var_g
var_i = 1
var_j = 4
var_k = var_i / var_j
var_l = var_h + var_k
var_m = var_e / var_l
var_n = 2
var_o = var_m + var_n
var_p = 4
var_q = var_o / var_p
print(int(var_q)) |
Correspondence | Given single-digit numbers A and B, the five-digit number A375B is divisible by 24. Find the number of digits that can be A. | 3 | A375B [OP_GEN_POSSIBLE_LIST] 24 [OP_LIST_DIVISIBLE] A375B A [OP_LIST_FIND_UNK] [OP_LIST_LEN] | var_a = 'A375B'
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 = 24
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 = 'A375B'
var_d = 'A'
var_c = str(var_c)
var_d = str(var_d)
unk_idx = var_c.index(var_d)
list_c = []
for elem in list_b:
elem = str(elem)
list_c.append(int(elem[unk_idx]))
list_c = list(set(list_c))
var_e = len(list_c)
print(int(var_e)) |
Arithmetic calculation | There are three different numbers. If the averages of two different numbers are 26.5, 34.5, and 29, find the average of the three numbers. | 30 | 26.5 34.5 [OP_ADD] 29 [OP_ADD] 3 [OP_DIV] | var_a = 26.5
var_b = 34.5
var_c = var_a + var_b
var_d = 29
var_e = var_c + var_d
var_f = 3
var_g = var_e / var_f
print(int(var_g)) |
Correspondence | Divide 2804 by a number to get 10. What is the number multiplied by 1/100? | 2.8 | 2804 10 [OP_DIV] 1/100 [OP_MUL] | var_a = 2804
var_b = 10
var_c = var_a / var_b
var_d = 0.01
var_e = var_c * var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Arithmetic calculation | Jungkook has 3 red balls and Yoonki has 2 blue balls. If Jungkook gives 1 red ball to Yoonki, how many blue balls does Jungkook have? | 2 | 2 | var_a = 2
print(int(var_a)) |
Comparison | There are three numbers 0.8, 1/2, and 0.9. What is the sum of the numbers greater than 0.7? | 1.7 | [OP_LIST_SOL] 0.8 1/2 0.9 [OP_LIST_EOL] 0.7 [OP_LIST_MORE] [OP_LIST_SUM] | var_a = 0.8
var_b = 0.5
var_c = 0.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 = 0.7
list_b = []
for i in list_a:
if i > var_d:
list_b.append(i)
list_b = [float(i) for i in list_b]
var_e = sum(list_b)
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Arithmetic calculation | Jiwon took 13 times of 90 steps at a time. If Jiwon can move 0.45 meters (m) per step, how long did she walk in meters (m)? | 526.5 | 0.45 90 [OP_MUL] 13 [OP_MUL] | var_a = 0.45
var_b = 90
var_c = var_a * var_b
var_d = 13
var_e = var_c * var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Geometry | The perimeter of a square whose side length is a natural number shall not exceed 35 centimeters (cm). Calculate the difference between the perimeter of the square and 35 centimeters (cm). | 3 | 35 4 [OP_MOD] | var_a = 35
var_b = 4
var_c = var_a % var_b
print(int(var_c)) |
Arithmetic calculation | Last year, Yoongi was 6 years old and his grandfather was 62 years old. How many times is his grandfather as old as Yoongi this year? | 9 | 62 1 [OP_ADD] 6 1 [OP_ADD] [OP_DIV] | var_a = 62
var_b = 1
var_c = var_a + var_b
var_d = 6
var_e = 1
var_f = var_d + var_e
var_g = var_c / var_f
print(int(var_g)) |
Comparison | Dongkyun, Youngtak, and Seunghwan have snacks. If Dongkyun has more than Youngtak and Seunghwan has more than Dongkyun, who has the most cookies? | Seunghwan | [OP_LIST_SOL] Dongkyun Youngtak Seunghwan [OP_LIST_EOL] [OP_LIST_SOL] Dongkyun Youngtak > Seunghwan Dongkyun > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET] | var_a = 'Dongkyun'
var_b = 'Youngtak'
var_c = 'Seunghwan'
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 = 'Dongkyun'
var_e = 'Youngtak'
var_f = '>'
var_g = 'Seunghwan'
var_h = 'Dongkyun'
var_i = '>'
list_b= []
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)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
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_j = 1
var_k = list_c[var_j-1]
print(var_k) |
Geometry | If the volume of the cuboid is 36.48 cubic centimeters (cm3) and the area of the base is 6.0 square centimeters (cm2), what is the height? | 6 | 36.48 6.08 [OP_DIV] | var_a = 36.48
var_b = 6.08
var_c = var_a / var_b
print(int(eval('{:.2f}'.format(round(var_c+1e-10,2))))) |
Correspondence | 13+AB=58 is true. How much is A? | 4 | 13+AB=58 A [OP_DIGIT_UNK_SOLVER] | var_a = '13+AB=58'
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)) |
Correspondence | AB-21=14. How much is B, where AB is twe-digit number? | 5 | AB-21=14 B [OP_DIGIT_UNK_SOLVER] | var_a = 'AB-21=14'
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)) |
Possibility | Dayoon is trying to make a four-digit number by rearranging the position of each digit in 2596. Including the initial number, how many numbers can he make? | 24 | 2596 [OP_NUM2LIST] 4 [OP_LIST_GET_PERM] [OP_LIST_LEN] | var_a = 2596
list_a = []
var_a = int(var_a)
while var_a//10 > 0:
list_a.append(var_a%10)
var_a = var_a//10
list_a.append(var_a%10)
list_a = list_a[::-1]
var_b = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_b))
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_c = len(list_b)
print(int(var_c)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.