category
stringclasses 5
values | question
stringlengths 20
555
| answer
stringlengths 1
20
| solution_abst
stringlengths 1
287
| solution_code
stringlengths 27
5.97k
|
---|---|---|---|---|
Comparison | There are four numbers 0.8, 1/2, 0.9, and1/3. What is the largest number less than 3? | 0.9 | [OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 3 [OP_LIST_LESS] 1 [OP_LIST_MAX] | var_a = 0.8
var_b = 0.5
var_c = 0.9
var_d = 0.3333333333333333
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 = []
for i in list_a:
if i < var_e:
list_b.append(i)
var_f = 1
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Comparison | There are bags weighing 1.2 kilograms (kg), 3.1 kilograms (kg), 2.4 kilograms (kg), 3.0 kilograms (kg), and 1.8 kilograms (kg), respectively. How many bags are there weighing more than 2 kilograms (kg)? | 3 | [OP_LIST_SOL] 1.2 3.1 2.4 3.0 1.8 [OP_LIST_EOL] 2 [OP_LIST_MORE] [OP_LIST_LEN] | var_a = 1.2
var_b = 3.1
var_c = 2.4
var_d = 3
var_e = 1.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 = []
for i in list_a:
if i > var_f:
list_b.append(i)
var_g = len(list_b)
print(int(var_g)) |
Geometry | The radius of a circle is 2 centimeters (cm). What is the other radius of this circle in centimeters (cm)? | 2 | 2 | var_a = 2
print(int(var_a)) |
Arithmetic calculation | What is the largest three-digit number with 7 in the hundreds place? | 799 | 7AB [OP_GEN_POSSIBLE_LIST] 1 [OP_LIST_MAX] | var_a = '7AB'
ans_dict = dict()
var_a = str(var_a)
list_a = []
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 0
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
if len(var_a) == len(str(int(temp))):
new_elem = int(temp)
list_a.append(new_elem)
var_b = 1
list_b=list_a.copy()
list_b.sort()
var_c = list_b[-var_b]
print(int(var_c)) |
Arithmetic calculation | Seokjin, Taehyung, and Eunji's math test average score is 92. Also, Min-young and Hoseok's scores are 90 and 95, respectively. Find the average score of these five students on the math test, including decimal points. | 92.2 | 92 3 [OP_MUL] 90 [OP_ADD] 95 [OP_ADD] 5 [OP_DIV] | var_a = 92
var_b = 3
var_c = var_a * var_b
var_d = 90
var_e = var_c + var_d
var_f = 95
var_g = var_e + var_f
var_h = 5
var_i = var_g / var_h
print('{:.2f}'.format(round(var_i+1e-10,2))) |
Arithmetic calculation | Suna traveled 7/15 of the total distance by train, 5/8 of the remaining distance by bus, and 2/3 of the remaining distance by taxi. The rest of the distance was 2.6 kilometers (km) on foot. How many kilometers (km) did Suna travel? | 39 | 2.6 1 7/15 [OP_SUB] 1 5/8 [OP_SUB] [OP_MUL] 1 2/3 [OP_SUB] [OP_MUL] [OP_DIV] | var_a = 2.6
var_b = 1
var_c = 0.4666666666666667
var_d = var_b - var_c
var_e = 1
var_f = 0.625
var_g = var_e - var_f
var_h = var_d * var_g
var_i = 1
var_j = 0.6666666666666666
var_k = var_i - var_j
var_l = var_h * var_k
var_m = var_a / var_l
print(int(eval('{:.2f}'.format(round(var_m+1e-10,2))))) |
Geometry | When there are several cuboids, the sum of the number of faces and the number of edges of all the cuboids is 216. Find the sum of the number of vertices of all the cuboids. | 96 | 216 12 6 [OP_ADD] [OP_DIV] 8 [OP_MUL] | var_a = 216
var_b = 12
var_c = 6
var_d = var_b + var_c
var_e = var_a / var_d
var_f = 8
var_g = var_e * var_f
print(int(var_g)) |
Geometry | Kyuhyung has several square-shaped cards. The cards are laid out neatly to form a large square, and there are 3 cards left. It is said that 44 more cards are needed to increase to fill the outer perimeter with cards. How many cards does Kyuhyung have? | 103 | 44 4 [OP_SUB] 4 [OP_DIV] 2 [OP_POW] 3 [OP_ADD] | var_a = 44
var_b = 4
var_c = var_a - var_b
var_d = 4
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)) |
Arithmetic calculation | The remainder when a certain three-digit number is divided by 20 is the same as the remainder when divided by 25. If the remainder is 7, what is the possible largest number of the certain number? | 907 | 100 999 1 [OP_LIST_ARANGE] 20 7 [OP_LIST_DIVIDE_AND_REMAIN] 25 7 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_MAX] | var_a = 100
var_b = 999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 20
var_e = 7
list_b = []
var_d = int(var_d)
var_e = int(var_e)
if var_e < 0:
var_e = var_e + var_d
for i in list_a:
i = int(i)
if i%var_d == var_e:
list_b.append(i)
var_f = 25
var_g = 7
list_c = []
var_f = int(var_f)
var_g = int(var_g)
if var_g < 0:
var_g = var_g + var_f
for i in list_b:
i = int(i)
if i%var_f == var_g:
list_c.append(i)
var_h = 1
list_d=list_c.copy()
list_d.sort()
var_i = list_d[-var_h]
print(int(var_i)) |
Comparison | 9 people are standing in a line in order from the shortest to the tallest. Hoseok is standing in the middle. If you line them up again in order from the tallest to the shortest, what number will Hoseok stand from the back? | 5 | 9 2 [OP_FDIV] 1 [OP_ADD] | var_a = 9
var_b = 2
var_c = var_a // var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | After 6 years, the father's age plus the son's age is 68 years old. This year, the father ages six times the son does. How old is the son this year? | 8 | 68 6 2 [OP_MUL] [OP_SUB] 1 6 [OP_ADD] [OP_DIV] | var_a = 68
var_b = 6
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 | A dozen of pencils means 12 pencils. Taehyung bought 2 dozen pencils and shared them with Namjoon, but Namjoon got 4 more than Taehyung. How many pencils does Namjoon have? | 14 | 12 2 [OP_MUL] 4 [OP_SUB] 2 [OP_DIV] 4 [OP_ADD] | var_a = 12
var_b = 2
var_c = var_a * var_b
var_d = 4
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
var_h = 4
var_i = var_g + var_h
print(int(var_i)) |
Comparison | Hyeonsoo's car travels 17.28 kilometers (km) in 16 minutes at a constant speed, and Yejun's car travels 8.52 kilometers (km) in 6 minutes at a constant speed. If Hyeonsoo and Yejun started from the same place by car, who is further away 15 minutes later? | Yejun | [OP_LIST_SOL] Hyeonsoo Yejun [OP_LIST_EOL] [OP_LIST_SOL] 17.28 16 [OP_DIV] 15 [OP_MUL] 8.52 6 [OP_DIV] 15 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Hyeonsoo'
var_b = 'Yejun'
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 = 17.28
var_d = 16
var_e = var_c / var_d
var_f = 15
var_g = var_e * var_f
var_h = 8.52
var_i = 6
var_j = var_h / var_i
var_k = 15
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)
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) |
Geometry | You are trying to draw a diagonal from one vertex of an icosahedron. How many diagonal lines can you draw? | 17 | 20 3 [OP_SUB] | var_a = 20
var_b = 3
var_c = var_a - var_b
print(int(var_c)) |
Geometry | Dice with an edge of 2 centimeters (cm) are stacked to form a cube with an edge of 10 centimeters (cm). I put confetti on all sides of the cube. How many dices have confetti on one side? | 54 | 10 2 [OP_DIV] 2 [OP_SUB] 2 [OP_POW] 6 [OP_MUL] | var_a = 10
var_b = 2
var_c = var_a / var_b
var_d = 2
var_e = var_c - var_d
var_f = 2
var_g = var_e ** var_f
var_h = 6
var_i = var_g * var_h
print(int(var_i)) |
Geometry | If a triangle is divided in two by a median line of the base from one vertex, and the area of a divided triangle is 7 square centimeters (cm2), find the area of the entire triangle. | 14 | 7 2 [OP_MUL] | var_a = 7
var_b = 2
var_c = var_a * var_b
print(int(var_c)) |
Comparison | There are numbers 0.8, 1/2, 0.9, 0.2 and 1/3. Find the sum of all numbers less than 0.3. | 0.2 | [OP_LIST_SOL] 0.2 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 0.3 [OP_LIST_LESS] [OP_LIST_SUM] | var_a = 0.2
var_b = 0.8
var_c = 0.5
var_d = 0.9
var_e = 0.3333333333333333
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 = 0.3
list_b = []
for i in list_a:
if i < var_f:
list_b.append(i)
list_b = [float(i) for i in list_b]
var_g = sum(list_b)
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Arithmetic calculation | At a constant speed, a bus travels a distance of 17.28 kilometers (km) in 16 minutes, and a car travels a distance of 8.52 kilometers (km) in 6 minutes. If a bus and a car start at the same time from the same place, which one and how farther will it go after 15 minutes? | 5.1 | 17.28 16 [OP_DIV] 15 [OP_MUL] 8.52 6 [OP_DIV] 15 [OP_MUL] [OP_SUB] [OP_ABS] | var_a = 17.28
var_b = 16
var_c = var_a / var_b
var_d = 15
var_e = var_c * var_d
var_f = 8.52
var_g = 6
var_h = var_f / var_g
var_i = 15
var_j = var_h * var_i
var_k = var_e - var_j
var_l = abs(var_k)
print('{:.2f}'.format(round(var_l+1e-10,2))) |
Comparison | Taehyung is heavier than Yoojung. Yoojung is heavier than Jimin. Taehyung is lighter than Hoseok. Which of the 4 is the lightest? | Jimin | [OP_LIST_SOL] Taehyung Yoojung Jimin Hoseok [OP_LIST_EOL] [OP_LIST_SOL] Taehyung Yoojung > Yoojung Jimin > Taehyung Hoseok < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | var_a = 'Taehyung'
var_b = 'Yoojung'
var_c = 'Jimin'
var_d = 'Hoseok'
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 = 'Taehyung'
var_f = 'Yoojung'
var_g = '>'
var_h = 'Yoojung'
var_i = 'Jimin'
var_j = '>'
var_k = 'Taehyung'
var_l = 'Hoseok'
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) |
Possibility | If there are 9 number cards written from 1 to 9, how many ways can you make the sum of cards as 17 by drawing 3 of them? | 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)) |
Comparison | There are 9/10 liters (L) of milk. Suyeon drank 1/3 of the total, and Hyunwoo drank 4/9 of the total. Who drank more milk, Suyeon or Hyunwoo? | Hyunwoo | [OP_LIST_SOL] Suyeon Hyunwoo [OP_LIST_EOL] [OP_LIST_SOL] 1/3 4/9 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Suyeon'
var_b = 'Hyunwoo'
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.3333333333333333
var_d = 0.4444444444444444
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]
var_g = list_b.index(var_f)+1
var_h = list_a[var_g-1]
print(var_h) |
Comparison | You are trying to find the three letters (a), (b), and (c) in the dictionary. When (b) is behind (a) and (b) is behind (c), what is the last letter in the dictionary? | (b) | [OP_LIST_SOL] (a) (b) (c) [OP_LIST_EOL] [OP_LIST_SOL] (a) (b) < (c) (b) < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET] | var_a = '(a)'
var_b = '(b)'
var_c = '(c)'
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 = '(a)'
var_e = '(b)'
var_f = '<'
var_g = '(c)'
var_h = '(b)'
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) |
Comparison | There are 4 animals A, B, C and D. D animals are smaller than A animals and larger than B animals. Which animal is the largest when C animals are larger than A animals? | C | [OP_LIST_SOL] A B C D [OP_LIST_EOL] [OP_LIST_SOL] A C < D B > D A < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [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 = 'A'
var_f = 'C'
var_g = '<'
var_h = 'D'
var_i = 'B'
var_j = '>'
var_k = 'D'
var_l = 'A'
var_m = '<'
list_b= []
if "/" in str(var_m):
var_m = eval(str(var_m))
list_b.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
if cond_ in ("<", ">", "="):
operand_right = temp_stack.pop()
operand_left = temp_stack.pop()
if cond_ == "=":
cond_ = "=="
conditions.append(f"{operand_left} {cond_} {operand_right}")
else:
if not cond_.isdigit():
cond_ = "{" + cond_ + "}"
temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
item_name_index_dict = dict(zip(items_name_list, perm))
formatted_conditions = \
[condition.format_map(item_name_index_dict) for condition in conditions]
if all(map(eval, formatted_conditions)):
break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_n = 1
var_o = list_c[var_n-1]
print(var_o) |
Correspondence | You subtracted 7 from a number and got 9. What is the value of the number multiplied by 5? | 80 | 9 7 [OP_ADD] 5 [OP_MUL] | var_a = 9
var_b = 7
var_c = var_a + var_b
var_d = 5
var_e = var_c * var_d
print(int(var_e)) |
Correspondence | A two-digit decimal 3.A7 is greater than 3.27. Write how many numbers can fit in A. However, A can contain any number from 0 to 9. | 7 | 3.A7>3.27 A [OP_DIGIT_UNK_SOLVER] [OP_LIST_LEN] | var_a = '3.A7>3.27'
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)) |
Arithmetic calculation | We want to distribute 43 baseballs equally among 6 classes, with the fewest remaining baseballs. How many baseballs should be left? | 1 | 43 6 [OP_MOD] | var_a = 43
var_b = 6
var_c = var_a % var_b
print(int(var_c)) |
Correspondence | When 1/4×1/8=1/(4×A)=1/B, what is the sum of A and B? | 40 | 1/4×1/8=1/(4×A)=1/B A [OP_NUM_UNK_SOLVER] 1/4×1/8=1/(4×A)=1/B B [OP_NUM_UNK_SOLVER] [OP_ADD] | var_a = '1/4×1/8=1/(4×A)=1/B'
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] = 0
candidate_num = [i for i in range(51)]
candi = list(itertools.product(candidate_num, 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)):
if term_list[i] == '':
new_eq += str(term_list[i])+op_list[i]
else:
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
if '=' in new_eq and '>' not in new_eq and '<' not in new_eq:
new_eq=new_eq.replace('==','=')
new_eq=new_eq.replace('>','')
new_eq=new_eq.replace('<','')
new_eq=new_eq.split('=')
for i in range(len(new_eq)-1):
eval_result = math.isclose(eval(new_eq[i]), eval(new_eq[i+1]))
if not eval_result:
break
else:
eval_result = eval(new_eq)
except:
eval_result = False
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
var_d = '1/4×1/8=1/(4×A)=1/B'
var_e = 'B'
ans_dict = dict()
var_d = var_d.replace('×','*')
var_d = var_d.replace('x','*')
var_d = var_d.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_d):
if v in variable_candi:
ans_dict[v] = 0
candidate_num = [i for i in range(51)]
candi = list(itertools.product(candidate_num, repeat=len(ans_dict)))
for c in candi:
temp = var_d
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
if term_list[i] == '':
new_eq += str(term_list[i])+op_list[i]
else:
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
if '=' in new_eq and '>' not in new_eq and '<' not in new_eq:
new_eq=new_eq.replace('==','=')
new_eq=new_eq.replace('>','')
new_eq=new_eq.replace('<','')
new_eq=new_eq.split('=')
for i in range(len(new_eq)-1):
eval_result = math.isclose(eval(new_eq[i]), eval(new_eq[i+1]))
if not eval_result:
break
else:
eval_result = eval(new_eq)
except:
eval_result = False
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_f = ans_dict[var_e]
var_g = var_c + var_f
print(int(var_g)) |
Possibility | A can contain natural numbers from 1 to 9. If 44×A<55×4, find the sum of all the numbers that can be A. | 10 | 1 9 1 [OP_LIST_ARANGE] 55 4 [OP_MUL] 44 [OP_DIV] [OP_LIST_LESS] [OP_LIST_SUM] | 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 = 55
var_e = 4
var_f = var_d * var_e
var_g = 44
var_h = var_f / var_g
list_b = []
for i in list_a:
if i < var_h:
list_b.append(i)
list_b = [float(i) for i in list_b]
var_i = sum(list_b)
print(int(var_i)) |
Arithmetic calculation | Minji spends 0.6 hours cleaning her room every day. Find how many hours Minji spent cleaning her room in 3 weeks. | 12.6 | 0.6 7 [OP_MUL] 3 [OP_MUL] | var_a = 0.6
var_b = 7
var_c = var_a * var_b
var_d = 3
var_e = var_c * var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Arithmetic calculation | How many three-digit numbers are common multiples of 6, 5, 8, and 9? | 2 | 100 999 1 [OP_LIST_ARANGE] 6 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 8 [OP_LIST_DIVISIBLE] 9 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 100
var_b = 999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 6
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 = 5
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 = 8
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 = 9
list_e = []
var_g = int(var_g)
for i in list_d:
i = int(i)
if i % var_g == 0:
list_e.append(i)
var_h = len(list_e)
print(int(var_h)) |
Geometry | Minjin made a square shape with one side length of 80 centimeters (cm) using wire. If you use the same length of wire to make a rectangular shape with a vertical length of 100 centimeters (cm), find the horizontal length of this rectangle. | 60 | 80 4 [OP_MUL] 2 [OP_DIV] 100 [OP_SUB] | var_a = 80
var_b = 4
var_c = var_a * var_b
var_d = 2
var_e = var_c / var_d
var_f = 100
var_g = var_e - var_f
print(int(var_g)) |
Possibility | You want to buy 2 different school supplies: a notebook, a pencil, and an eraser. If you choose different ones, how many ways are there? | 3 | [OP_LIST_SOL] notebook pencil eraser [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_COMB] | var_a = 'notebook'
var_b = 'pencil'
var_c = 'eraser'
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = len(list_a)
var_e = 2
var_f = 1
var_d = int(var_d)
var_e = int(var_e)
for i, elem in enumerate(range(var_e)):
var_f = var_f * (var_d-i)
for i, elem in enumerate(range(var_e)):
var_f = var_f / (i+1)
print(int(var_f)) |
Geometry | How many faces does a pentahedron have? | 5 | 5 | var_a = 5
print(int(var_a)) |
Geometry | I doubled the length of each corner of a cube-shaped box. How many times bigger will the surface area of this box become? | 4 | 2 2 [OP_POW] | var_a = 2
var_b = 2
var_c = var_a ** var_b
print(int(var_c)) |
Correspondence | A number divided by 4 is 12. Hoseok wants to divide a number by 3. What is the expected result value? | 16 | 12 4 [OP_MUL] 3 [OP_DIV] | var_a = 12
var_b = 4
var_c = var_a * var_b
var_d = 3
var_e = var_c / var_d
print(int(var_e)) |
Correspondence | If 5A8-21B=364, what number should go in B? | 4 | 5A8-21B=364 B [OP_DIGIT_UNK_SOLVER] | var_a = '5A8-21B=364'
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)) |
Correspondence | A15B94 is a six-digit number divisible by 99. If 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)) |
Comparison | There are 30 sweets. Minsu received 12, Jaeyoung 3, and Heesu 15. Who received the most sweets? | Heesu | [OP_LIST_SOL] Minsu Jaeyoung Heesu [OP_LIST_EOL] [OP_LIST_SOL] 12 3 15 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Minsu'
var_b = 'Jaeyoung'
var_c = 'Heesu'
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 = 12
var_e = 3
var_f = 15
list_b= []
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j) |
Geometry | Twenty-seven cubes with each edge being 4 centimeters (cm) long were glued together to form a one large cube. What is the surface area of this large cube in cm2 (cm2)? | 864 | 4 27 1 3 [OP_DIV] [OP_POW] [OP_MUL] 2 [OP_POW] 6 [OP_MUL] | var_a = 4
var_b = 27
var_c = 1
var_d = 3
var_e = var_c / var_d
var_f = var_b ** var_e
var_g = var_a * var_f
var_h = 2
var_i = var_g ** var_h
var_j = 6
var_k = var_i * var_j
print(int(var_k)) |
Geometry | How many diagonals can be drawn from a vertex in a figure with 10 sides equal in length and 10 angles equal in measure? | 7 | 10 3 [OP_SUB] | var_a = 10
var_b = 3
var_c = var_a - var_b
print(int(var_c)) |
Correspondence | When you add 124, each digit is the same number. The sum of the hundreds and ones digits of this number is 5, and the tens digit is 3. If each of these three digit numbers is different, find the three digit number. | 431 | [OP_LIST_SOL] [OP_LIST_SOL] A 3 B + 124 = C C C [OP_LIST_EOL] [OP_LIST2NUM] A [OP_DIGIT_UNK_SOLVER] 3 [OP_LIST_SOL] A 3 B + 124 = C C C [OP_LIST_EOL] [OP_LIST2NUM] B [OP_DIGIT_UNK_SOLVER] [OP_LIST_EOL] [OP_LIST2NUM] | var_a = 'A'
var_b = 3
var_c = 'B'
var_d = '+'
var_e = 124
var_f = '='
var_g = 'C'
var_h = 'C'
var_i = 'C'
list_a= []
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_j=""
for i in list_a:
i = str(i)
var_j = var_j + i
var_k = 'A'
ans_dict = dict()
var_j = var_j.replace('×','*')
var_j = var_j.replace('x','*')
var_j = var_j.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_j):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_j
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_j):
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_l = ans_dict[var_k]
var_m = 3
var_n = 'A'
var_o = 3
var_p = 'B'
var_q = '+'
var_r = 124
var_s = '='
var_t = 'C'
var_u = 'C'
var_v = 'C'
list_b= []
if "/" in str(var_v):
var_v = eval(str(var_v))
list_b.append(var_v)
if "/" in str(var_u):
var_u = eval(str(var_u))
list_b.append(var_u)
if "/" in str(var_t):
var_t = eval(str(var_t))
list_b.append(var_t)
if "/" in str(var_s):
var_s = eval(str(var_s))
list_b.append(var_s)
if "/" in str(var_r):
var_r = eval(str(var_r))
list_b.append(var_r)
if "/" in str(var_q):
var_q = eval(str(var_q))
list_b.append(var_q)
if "/" in str(var_p):
var_p = eval(str(var_p))
list_b.append(var_p)
if "/" in str(var_o):
var_o = eval(str(var_o))
list_b.append(var_o)
if "/" in str(var_n):
var_n = eval(str(var_n))
list_b.append(var_n)
list_b.reverse()
var_w=""
for i in list_b:
i = str(i)
var_w = var_w + i
var_x = 'B'
ans_dict = dict()
var_w = var_w.replace('×','*')
var_w = var_w.replace('x','*')
var_w = var_w.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_w):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_w
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_w):
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_y = ans_dict[var_x]
list_c= []
if "/" in str(var_y):
var_y = eval(str(var_y))
list_c.append(var_y)
if "/" in str(var_m):
var_m = eval(str(var_m))
list_c.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_c.append(var_l)
list_c.reverse()
var_z=""
for i in list_c:
i = str(i)
var_z = var_z + i
print(int(var_z)) |
Arithmetic calculation | Find the second smallest natural number that is greater than 500, and that has 3 as a remainder when divided by 7. | 514 | 1 9999 1 [OP_LIST_ARANGE] 500 [OP_LIST_MORE] 7 3 [OP_LIST_DIVIDE_AND_REMAIN] 2 [OP_LIST_MIN] | var_a = 1
var_b = 9999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 500
list_b = []
for i in list_a:
if i > var_d:
list_b.append(i)
var_e = 7
var_f = 3
list_c = []
var_e = int(var_e)
var_f = int(var_f)
if var_f < 0:
var_f = var_f + var_e
for i in list_b:
i = int(i)
if i%var_e == var_f:
list_c.append(i)
var_g = 2
list_d=list_c.copy()
list_d.sort()
var_h = list_d[var_g-1]
print(int(var_h)) |
Arithmetic calculation | Seokgi and Yeseul are trying to share a wire with a length of 1 meter (m) and 50 centimeters (cm). How many centimeters (cm) of wire must Seokgi take in order for Seokgi's wire to be 16 centimeters (cm) shorter than Yeseul's? | 67 | 1 100 [OP_MUL] 50 [OP_ADD] 16 [OP_SUB] 2 [OP_DIV] | var_a = 1
var_b = 100
var_c = var_a * var_b
var_d = 50
var_e = var_c + var_d
var_f = 16
var_g = var_e - var_f
var_h = 2
var_i = var_g / var_h
print(int(var_i)) |
Geometry | There is an equilateral triangle with a side length of 13/12 meters (m). What is the perimeter of this triangle? | 3.25 | 13/12 3 [OP_MUL] | var_a = 1.0833333333333333
var_b = 3
var_c = var_a * var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Comparison | There are 4 pizzas in the shape of a circle. When the pi is 3.1, the area of pizza (a) is 314 cm2 (cm2), and the circumference of pizza (b) is 99.2 cm (cm). Also, the diameter of pizza (c) is 16 cm (cm), and the radius of pizza (d) is 12 centimeters (cm). When 4 pizzas are arranged in order from smallest to largest, which pizza is second from the right? | (a) | [OP_LIST_SOL] (a) (b) (c) (d) [OP_LIST_EOL] [OP_LIST_SOL] 314 99.2 3.1 [OP_DIV] 2 [OP_DIV] 2 [OP_POW] 3.1 [OP_MUL] 16 2 [OP_DIV] 2 [OP_POW] 3.1 [OP_MUL] 12 2 [OP_POW] 3.1 [OP_MUL] [OP_LIST_EOL] 2 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [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 = 314
var_f = 99.2
var_g = 3.1
var_h = var_f / var_g
var_i = 2
var_j = var_h / var_i
var_k = 2
var_l = var_j ** var_k
var_m = 3.1
var_n = var_l * var_m
var_o = 16
var_p = 2
var_q = var_o / var_p
var_r = 2
var_s = var_q ** var_r
var_t = 3.1
var_u = var_s * var_t
var_v = 12
var_w = 2
var_x = var_v ** var_w
var_y = 3.1
var_z = var_x * var_y
list_b= []
if "/" in str(var_z):
var_z = eval(str(var_z))
list_b.append(var_z)
if "/" in str(var_u):
var_u = eval(str(var_u))
list_b.append(var_u)
if "/" in str(var_n):
var_n = eval(str(var_n))
list_b.append(var_n)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_A = 2
list_c=list_b.copy()
list_c.sort()
var_B = list_c[var_A-1]
var_C = list_b.index(var_B)+1
var_D = list_a[var_C-1]
print(var_D) |
Correspondence | A number added by 18 divided by 3 added by 10 divided by 5 subtracted by 3 equals 1. Find the number. | 12 | 1 3 [OP_ADD] 5 [OP_MUL] 10 [OP_SUB] 3 [OP_MUL] 18 [OP_SUB] | var_a = 1
var_b = 3
var_c = var_a + var_b
var_d = 5
var_e = var_c * var_d
var_f = 10
var_g = var_e - var_f
var_h = 3
var_i = var_g * var_h
var_j = 18
var_k = var_i - var_j
print(int(var_k)) |
Comparison | Namjoon was the 43th customer to buy the book at the bookstore, and there were 10 people in front of Namjoon when Taehyung bought the book. In this order, in which position did Taehyung buy the book? | 32 | 43 10 [OP_SUB] 1 [OP_SUB] | var_a = 43
var_b = 10
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | What is the smallest natural number B that makes the following expression 360÷(A×A×A/B)=5 possible? | 3 | 360÷(A×A×A/B)=5 B [OP_NUM_UNK_SOLVER] 1 [OP_LIST_MIN] | var_a = '360÷(A×A×A/B)=5'
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] = []
candidate_num = [i for i in range(51)]
candi = list(itertools.product(candidate_num, 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)):
if term_list[i] == '':
new_eq += str(term_list[i])+op_list[i]
else:
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
if '=' in new_eq and '>' not in new_eq and '<' not in new_eq:
new_eq=new_eq.replace('==','=')
new_eq=new_eq.replace('>','')
new_eq=new_eq.replace('<','')
new_eq=new_eq.split('=')
for i in range(len(new_eq)-1):
eval_result = math.isclose(eval(new_eq[i]), eval(new_eq[i+1]))
if not eval_result:
break
else:
eval_result = eval(new_eq)
except:
eval_result = False
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 = 1
list_b=list_a.copy()
list_b.sort()
var_d = list_b[var_c-1]
print(int(var_d)) |
Geometry | When I arranged a few small square tiles without gaps to make a large square, there were 20 tiles left, so I tried to extend each horizontal and vertical side by 1 row to make a larger square, an there were 9 tiles short. How many tiles are there? | 216 | 20 9 [OP_ADD] 1 [OP_SUB] 2 [OP_DIV] 2 [OP_POW] 20 [OP_ADD] | var_a = 20
var_b = 9
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
var_h = 2
var_i = var_g ** var_h
var_j = 20
var_k = var_i + var_j
print(int(var_k)) |
Arithmetic calculation | I want to install traffic lights on the road. If traffic lights are installed from the beginning to the end by dividing them into 4 sections equally from the 0.35 kilometer (km) point to the 0.37 kilometer (km) point, indicate the kilometers (km) of the location of the traffic light installed at the fourth point as a decimal number. | 0.37 | 0.35 0.37 0.35 [OP_SUB] 4 [OP_DIV] 4 1 [OP_SUB] [OP_MUL] [OP_ADD] | var_a = 0.35
var_b = 0.37
var_c = 0.35
var_d = var_b - var_c
var_e = 4
var_f = var_d / var_e
var_g = 4
var_h = 1
var_i = var_g - var_h
var_j = var_f * var_i
var_k = var_a + var_j
print('{:.2f}'.format(round(var_k+1e-10,2))) |
Geometry | When the small square-shaped notebooks were arranged to form a large square, there were 20 notebooks left. When I tried to increase the width and height by one row each, 9 notebooks were short. How many notebooks are there in total? | 216 | 20 9 [OP_ADD] 1 [OP_SUB] 2 [OP_DIV] 2 [OP_POW] 20 [OP_ADD] | var_a = 20
var_b = 9
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
var_h = 2
var_i = var_g ** var_h
var_j = 20
var_k = var_i + var_j
print(int(var_k)) |
Correspondence | 33 is the result of subtracting 32 from a number by mistake instead of adding it. Find the result of the correct calculation. | 97 | 33 32 [OP_ADD] 32 [OP_ADD] | var_a = 33
var_b = 32
var_c = var_a + var_b
var_d = 32
var_e = var_c + var_d
print(int(var_e)) |
Geometry | A rectangle was created by arranging 6 100-won coins horizontally and 4 vertically. How much amount of money is when you sum up the coins placed around the circumference? | 1600 | 6 4 [OP_ADD] 2 [OP_MUL] 4 [OP_SUB] 100 [OP_MUL] | var_a = 6
var_b = 4
var_c = var_a + var_b
var_d = 2
var_e = var_c * var_d
var_f = 4
var_g = var_e - var_f
var_h = 100
var_i = var_g * var_h
print(int(var_i)) |
Correspondence | When A is divided by 5, the quotient is B and the remainder is C. A, B, and C is natural numbers. If B and C are equal, find the largest possible number of A. | 24 | 5 1 [OP_SUB] 5 [OP_MUL] 5 1 [OP_SUB] [OP_ADD] | var_a = 5
var_b = 1
var_c = var_a - var_b
var_d = 5
var_e = var_c * var_d
var_f = 5
var_g = 1
var_h = var_f - var_g
var_i = var_e + var_h
print(int(var_i)) |
Arithmetic calculation | In winter, you saw a family of hungry squirrels and you are to give the acorns in your pocket. If you give them 4 acorns each, 3 acorns will be left, and if you gave them 5 acrons each, you will need 6 acorns more. How many acorns are there in your pocket? | 39 | 3 6 [OP_ADD] 5 4 [OP_SUB] [OP_DIV] 4 [OP_MUL] 3 [OP_ADD] | var_a = 3
var_b = 6
var_c = var_a + var_b
var_d = 5
var_e = 4
var_f = var_d - var_e
var_g = var_c / var_f
var_h = 4
var_i = var_g * var_h
var_j = 3
var_k = var_i + var_j
print(int(var_k)) |
Geometry | There is a rectangle with a width of 4 centimeters (cm) and a length of 8 centimeters (cm). What is the value of the perimeter of the rectangle subtracted by 4? | 20 | 4 8 [OP_ADD] 2 [OP_MUL] 4 [OP_SUB] | var_a = 4
var_b = 8
var_c = var_a + var_b
var_d = 2
var_e = var_c * var_d
var_f = 4
var_g = var_e - var_f
print(int(var_g)) |
Correspondence | I made the mistake of dividing a number by 6, when I should multiply a number by 6, and the quotient was 9. How much do you get when you calculate correctly? | 324 | 9 6 [OP_MUL] 6 [OP_MUL] | var_a = 9
var_b = 6
var_c = var_a * var_b
var_d = 6
var_e = var_c * var_d
print(int(var_e)) |
Possibility | You want to take 2 balls out of a box that contains a red ball, a blue ball, and a black ball. What is the total number of cases of balls you can take out, allowing for duplicates? | 6 | [OP_LIST_SOL] red blue black [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_ADD] 1 [OP_SUB] 2 [OP_COMB] | var_a = 'red'
var_b = 'blue'
var_c = 'black'
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = len(list_a)
var_e = 2
var_f = var_d + var_e
var_g = 1
var_h = var_f - var_g
var_i = 2
var_j = 1
var_h = int(var_h)
var_i = int(var_i)
for i, elem in enumerate(range(var_i)):
var_j = var_j * (var_h-i)
for i, elem in enumerate(range(var_i)):
var_j = var_j / (i+1)
print(int(var_j)) |
Arithmetic calculation | When 0.4 of the total rope was used, the remaining length was 0.69 m (m). Find the length of the first rope in meters (m). | 1.15 | 0.69 1 0.4 [OP_SUB] [OP_DIV] | var_a = 0.69
var_b = 1
var_c = 0.4
var_d = var_b - var_c
var_e = var_a / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Geometry | The volume of a cube is 1000 cubic centimeters (cm3). When this cube is divided into 8 cubes, find the length of one edge of the divided cube. | 5 | 1000 8 [OP_DIV] 1/3 [OP_POW] | var_a = 1000
var_b = 8
var_c = var_a / var_b
var_d = 0.3333333333333333
var_e = var_c ** var_d
print(int(eval('{:.2f}'.format(round(var_e+1e-10,2))))) |
Geometry | A rectangular parallelepiped has three distinct sides with each surface area of 4 square centimeters (cm2), 3 square centimeters (cm2), and 6 square centimeters (cm2). What is the surface area of this cuboid in square centimeters (cm2)? | 26 | 4 3 6 [OP_ADD] [OP_ADD] 2 [OP_MUL] | var_a = 4
var_b = 3
var_c = 6
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)) |
Comparison | Jimin jumped rope 80, 75, and 85 times during the three sets, respectively. If Seokjin jumped rope 78 times in the first set and 74 times in the second set, then how many times does Seokjin need to jump rope in the third set in order to jump rope more than Jimin? | 89 | 80 75 [OP_ADD] 85 [OP_ADD] 78 74 [OP_ADD] [OP_SUB] 1 [OP_ADD] | var_a = 80
var_b = 75
var_c = var_a + var_b
var_d = 85
var_e = var_c + var_d
var_f = 78
var_g = 74
var_h = var_f + var_g
var_i = var_e - var_h
var_j = 1
var_k = var_i + var_j
print(int(var_k)) |
Correspondence | A85-B1=364 is true. How much is A? | 3 | A85-B1=364 A [OP_DIGIT_UNK_SOLVER] | var_a = 'A85-B1=364'
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)) |
Arithmetic calculation | At the first station where the train stops, 17 people got on and 29 got off. At the next station, after 27 people got off and 35 got on, I counted the number of people on the train, which was 116. How many people were on the train at first? | 120 | 116 29 [OP_ADD] 17 [OP_SUB] 27 [OP_ADD] 35 [OP_SUB] | var_a = 116
var_b = 29
var_c = var_a + var_b
var_d = 17
var_e = var_c - var_d
var_f = 27
var_g = var_e + var_f
var_h = 35
var_i = var_g - var_h
print(int(var_i)) |
Geometry | There is a playground in the shape of an equilateral triangle with a side length of 10 meters (m). If street lights are installed at intervals of 3 meters (m) around the playground, find how many street lights have to be installed in all. | 10 | 10 3 [OP_MUL] 3 [OP_FDIV] | var_a = 10
var_b = 3
var_c = var_a * var_b
var_d = 3
var_e = var_c // var_d
print(int(var_e)) |
Correspondence | If we round down the number A567 to the nearest tens, we get a value of 2560. What value is A? | 2 | A567 [OP_GEN_POSSIBLE_LIST] 2560 [OP_LIST_MORE_EQUAL] 2560 10 [OP_ADD] [OP_LIST_LESS] A567 A [OP_LIST_FIND_UNK] | var_a = 'A567'
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 = 2560
list_b = []
for i in list_a:
if i >= var_b:
list_b.append(i)
var_c = 2560
var_d = 10
var_e = var_c + var_d
list_c = []
for i in list_b:
if i < var_e:
list_c.append(i)
var_f = 'A567'
var_g = 'A'
var_f = str(var_f)
var_g = str(var_g)
unk_idx = var_f.index(var_g)
var_h = 0
for elem in list_c:
elem = str(elem)
var_h = int(elem[unk_idx])
print(int(var_h)) |
Comparison | Dongkyun is taller than Jungkook and Dongwook is taller than Jungkook. If you compared the heights of Dongwook and Dongkyun, and Dongwook was shorter, who was the tallest? | Dongkyun | [OP_LIST_SOL] Dongkyun Jungkook Dongwook [OP_LIST_EOL] [OP_LIST_SOL] Dongkyun Jungkook > Dongwook Jungkook > Dongwook Dongkyun < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET] | var_a = 'Dongkyun'
var_b = 'Jungkook'
var_c = 'Dongwook'
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 = 'Jungkook'
var_f = '>'
var_g = 'Dongwook'
var_h = 'Jungkook'
var_i = '>'
var_j = 'Dongwook'
var_k = 'Dongkyun'
var_l = '<'
list_b= []
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)
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_m = 1
var_n = list_c[var_m-1]
print(var_n) |
Arithmetic calculation | You want to give dolls to students in a class. There were 3 dolls left when 4 dolls were distributed to each person, and 6 were in short when 5 dolls were given to each one. What is the total number of students in this class? | 9 | 3 6 [OP_ADD] 5 4 [OP_SUB] [OP_DIV] | var_a = 3
var_b = 6
var_c = var_a + var_b
var_d = 5
var_e = 4
var_f = var_d - var_e
var_g = var_c / var_f
print(int(var_g)) |
Geometry | There are 10 balls in the box. When Yoongi takes 3 balls from the box, how many balls are left? | 7 | 10 3 [OP_SUB] | var_a = 10
var_b = 3
var_c = var_a - var_b
print(int(var_c)) |
Possibility | Ohyoung bought a total of 5 serial magazines from January to May. Find the number of cases in which 5 books are placed in a row on the shelf when the January, March, and May issues are placed on the rightmost shelf in that order. (However, there is only one row of bookshelves.) | 2 | 5 [OP_LIST_SOL] 1 3 5 [OP_LIST_EOL] [OP_LIST_LEN] [OP_SUB] 5 [OP_LIST_SOL] 1 3 5 [OP_LIST_EOL] [OP_LIST_LEN] [OP_SUB] [OP_PERM] | var_a = 5
var_b = 1
var_c = 3
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)
list_a.reverse()
var_e = len(list_a)
var_f = var_a - var_e
var_g = 5
var_h = 1
var_i = 3
var_j = 5
list_b= []
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
list_b.reverse()
var_k = len(list_b)
var_l = var_g - var_k
var_m = 1
var_f = int(var_f)
var_l = int(var_l)
for i, elem in enumerate(range(var_l)):
var_m = var_m * (var_f-i)
print(int(var_m)) |
Correspondence | The four digit number 5716 is greater than 571A. Given that A is the ones digit and can contain any number from 0 to 9, how many digits can be written in A? | 6 | 571A [OP_GEN_POSSIBLE_LIST] 5716 [OP_LIST_LESS] [OP_LIST_LEN] | var_a = '571A'
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 = 5716
list_b = []
for i in list_a:
if i < var_b:
list_b.append(i)
var_c = len(list_b)
print(int(var_c)) |
Arithmetic calculation | 7 bundles of 2 ping-pong balls are put into one box and stored. If there are 182 ping-pong balls, how many boxes are needed? | 13 | 182 7 2 [OP_MUL] [OP_DIV] | var_a = 182
var_b = 7
var_c = 2
var_d = var_b * var_c
var_e = var_a / var_d
print(int(var_e)) |
Comparison | Kyung-seok studies Korean 7 times a week for 2/3 hours and Math 5 times a week for 3/4 hours. Find out which subject Kyung-seok studies more during the week, Korean or Math. | Korean | [OP_LIST_SOL] Korean Math [OP_LIST_EOL] [OP_LIST_SOL] 2/3 7 [OP_MUL] 3/4 5 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Korean'
var_b = 'Math'
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.6666666666666666
var_d = 7
var_e = var_c * var_d
var_f = 0.75
var_g = 5
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 | Find out how many two-digit numbers exist that are less than 36 and greater than 29. | 6 | 29 1 [OP_ADD] 36 1 [OP_SUB] 1 [OP_LIST_ARANGE] [OP_LIST_LEN] | var_a = 29
var_b = 1
var_c = var_a + var_b
var_d = 36
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 = len(list_a)
print(int(var_h)) |
Geometry | You want to find the length of the diameter of a circle. If the length of the radius is 7 centimeters (cm), what is the length of the diameter in centimeters (cm)? | 14 | 7 2 [OP_MUL] | var_a = 7
var_b = 2
var_c = var_a * var_b
print(int(var_c)) |
Possibility | Using the number cards 1, 6, and 8 all once, find the sum of the second smallest three-digit number and the third smallest three-digit number. | 804 | [OP_LIST_SOL] 1 6 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 2 [OP_LIST_MIN] 3 [OP_LIST_GET] [OP_ADD] | 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-1]
var_g = 3
var_h = list_b[var_g-1]
var_i = var_f + var_h
print(int(var_i)) |
Possibility | How many two-digit numbers can be formed by selecting two different numbers from 1, 3, and 4? | 6 | [OP_LIST_SOL] 1 3 4 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN] | var_a = 1
var_b = 3
var_c = 4
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 = len(list_b)
print(int(var_e)) |
Correspondence | There are 901 Go stones. If a total of 53 Go stones are required to play a round of Gomok, how many rounds of Gomok can be played at the same time? | 17 | 901 53 [OP_DIV] | var_a = 901
var_b = 53
var_c = var_a / var_b
print(int(var_c)) |
Possibility | How many four-digit numbers that contain all digits of 3, 4, 9, 8 and with 3 in the thousands digit are there? | 6 | [OP_LIST_SOL] 3 4 9 8 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 1000 3 [OP_LIST_SEARCH_FIXED_DIGIT] [OP_LIST_LEN] | var_a = 3
var_b = 4
var_c = 9
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 = 4
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 = 1000
var_g = 3
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)) |
Comparison | Yoongi has 4, and Jungkook has the number that is calculated by 6 divided by 3. Who got the smaller number? | Jungkook | [OP_LIST_SOL] Yoongi Jungkook [OP_LIST_EOL] [OP_LIST_SOL] 4 6 3 [OP_FDIV] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Yoongi'
var_b = 'Jungkook'
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
var_d = 6
var_e = 3
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) |
Correspondence | A and B are single digit numbers, and five-digit number of A835B is a multiple of 12. What is the difference between the largest and smallest of the possible numbers of A835B? | 69996 | A835B [OP_GEN_POSSIBLE_LIST] 12 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] | 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)) |
Geometry | There is a rectangular room with an area of 215.6 square meters (m2). When I measured the width of this room, it came out to be 14 meters (m), and the moment I tried to measure the length, the tape measure broke. If you use the information that the area of the room is 215.6 square meters (m2), how much is the vertical length? | 15.4 | 215.6 14 [OP_DIV] | var_a = 215.6
var_b = 14
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Geometry | Miyoung has a square-shaped piece of chocolate with a side measuring 10 centimeters (cm). She is going to cut this chocolate into right triangle-shaped pieces with a width of 1 centimeter (cm) and a height of 3 centimeters (cm) and hand them out to her friends. How many right triangle-shaped chocolate pieces can she hand out? | 66 | 10 2 [OP_POW] 1 3 [OP_MUL] [OP_FDIV] 2 [OP_MUL] | var_a = 10
var_b = 2
var_c = var_a ** var_b
var_d = 1
var_e = 3
var_f = var_d * var_e
var_g = var_c // var_f
var_h = 2
var_i = var_g * var_h
print(int(var_i)) |
Arithmetic calculation | People lined up in front of the store to buy ice cream. Five people stand between the person standing at the front and the person standing at the last. How many people are in line? | 7 | 5 2 [OP_ADD] | var_a = 5
var_b = 2
var_c = var_a + var_b
print(int(var_c)) |
Correspondence | If you distribute 160 bottles of milk, 197 apples, and 229 bread equally to the villagers, you will have 4 bottles of milk left, 2 apples left, and 5 bread short. How many villagers are there at this time? | 39 | 197 2 [OP_SUB] 160 4 [OP_SUB] [OP_GCD] 229 5 [OP_ADD] [OP_GCD] | var_a = 197
var_b = 2
var_c = var_a - var_b
var_d = 160
var_e = 4
var_f = var_d - var_e
var_g = math.gcd(int(var_f), int(var_c))
var_h = 229
var_i = 5
var_j = var_h + var_i
var_k = math.gcd(int(var_j), int(var_g))
print(int(var_k)) |
Arithmetic calculation | When you buy fish at the market, if you buy 8,000 won worth of fish, you get a 1,200 won discount. How much discount can I get if I buy 15,000 won worth of fish? | 2250 | 1200 8000 [OP_DIV] 15000 [OP_MUL] | var_a = 1200
var_b = 8000
var_c = var_a / var_b
var_d = 15000
var_e = var_c * var_d
print(int(var_e)) |
Correspondence | Moving a decimal point two places to the right equals 138.6 added to the original decimal. Find the original prime number. | 1.4 | 138.6 10 2 [OP_POW] 1 [OP_SUB] [OP_DIV] | var_a = 138.6
var_b = 10
var_c = 2
var_d = var_b ** var_c
var_e = 1
var_f = var_d - var_e
var_g = var_a / var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Arithmetic calculation | If a watermelon sold at a store is 2,000 won cheaper than 50,000 won, find the price of the watermelon in the unit of ten thousand won. | 4.8 | 5 2 10 [OP_DIV] [OP_SUB] | var_a = 5
var_b = 2
var_c = 10
var_d = var_b / var_c
var_e = var_a - var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Geometry | What is the volume, in cubic centimeters (cm³), of the rectangular prism with a base perimeter of 32 centimeters (cm) and a height of 9 centimeters (cm), where the base has the maximum possible area? | 576 | 32 4 [OP_DIV] 2 [OP_POW] 9 [OP_MUL] | var_a = 32
var_b = 4
var_c = var_a / var_b
var_d = 2
var_e = var_c ** var_d
var_f = 9
var_g = var_e * var_f
print(int(var_g)) |
Correspondence | When 3+68A=691, what number should be in A, where 68A is three-digit number? | 8 | 3+68A=691 A [OP_DIGIT_UNK_SOLVER] | var_a = '3+68A=691'
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 | A number multiplied by 6 plus 17 divided by 5 equals 25. Find the value of a number minus 14. | 4 | 25 5 [OP_MUL] 17 [OP_SUB] 6 [OP_DIV] 14 [OP_SUB] | var_a = 25
var_b = 5
var_c = var_a * var_b
var_d = 17
var_e = var_c - var_d
var_f = 6
var_g = var_e / var_f
var_h = 14
var_i = var_g - var_h
print(int(var_i)) |
Comparison | If a basket weighing 0.2 kilograms (kg) contains 3 melons of the same weight, the basket weighs 2.51 kilograms (kg), and if it contains 5 apples of the same weight, the basket weighs 2.9 kilograms (kg). Find which is heavier: an apple or a melon. | melon | [OP_LIST_SOL] apple melon [OP_LIST_EOL] [OP_LIST_SOL] 2.9 0.2 [OP_SUB] 5 [OP_DIV] 2.51 0.2 [OP_SUB] 3 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'apple'
var_b = 'melon'
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 = 2.9
var_d = 0.2
var_e = var_c - var_d
var_f = 5
var_g = var_e / var_f
var_h = 2.51
var_i = 0.2
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)
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) |
Correspondence | When a number is divided by 37, the quotient is 2 and the remainder is 26. Find the value of 48 minus the quotient of a number divided by 4. | 23 | 48 37 2 [OP_MUL] 26 [OP_ADD] 4 [OP_DIV] [OP_SUB] | var_a = 48
var_b = 37
var_c = 2
var_d = var_b * var_c
var_e = 26
var_f = var_d + var_e
var_g = 4
var_h = var_f / var_g
var_i = var_a - var_h
print(int(var_i)) |
Comparison | In the running race, Namjoon came in second, and after Namjoon came in, four more people came in, and then Yoongi came in. Hoseok came in after Yoongi and three more people came in. What is Hoseok's rank? | 9 | 2 4 [OP_ADD] 3 [OP_ADD] | var_a = 2
var_b = 4
var_c = var_a + var_b
var_d = 3
var_e = var_c + var_d
print(int(var_e)) |
Comparison | Find the product of the largest number and smallest number multiplied among 0.34, 2/4, 9/11, 0.22, and 0.76. | 0.18 | [OP_LIST_SOL] 0.34 2 4 [OP_DIV] 9 11 [OP_DIV] 0.22 0.76 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_MUL] | var_a = 0.34
var_b = 2
var_c = 4
var_d = var_b / var_c
var_e = 9
var_f = 11
var_g = var_e / var_f
var_h = 0.22
var_i = 0.76
list_a= []
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_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_j = 1
list_b=list_a.copy()
list_b.sort()
var_k = list_b[-var_j]
var_l = 1
list_c=list_a.copy()
list_c.sort()
var_m = list_c[var_l-1]
var_n = var_k * var_m
print('{:.2f}'.format(round(var_n+1e-10,2))) |
Correspondence | You get a wrong answer 58 when the division of a number by 5 is added by 16. If the correct calculation should be a number divided by 15 and then added by 74, what would be the right answer? | 88 | 58 16 [OP_SUB] 5 [OP_MUL] 15 [OP_DIV] 74 [OP_ADD] | var_a = 58
var_b = 16
var_c = var_a - var_b
var_d = 5
var_e = var_c * var_d
var_f = 15
var_g = var_e / var_f
var_h = 74
var_i = var_g + var_h
print(int(var_i)) |
Comparison | When a box weighing 250 grams (g) was filled with sand and weighed, it was 1 kg (kg) 780 grams (g). When a bucket weighing 460 grams (g) was filled with sand and weighed, it was 2 kg (kg) 250 grams (g). Which is heavier, the sand in the box or that in the bucket? | bucket | [OP_LIST_SOL] box bucket [OP_LIST_EOL] [OP_LIST_SOL] 1 1000 [OP_MUL] 780 [OP_ADD] 250 [OP_SUB] 2 1000 [OP_MUL] 250 [OP_ADD] 460 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'box'
var_b = 'bucket'
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
var_d = 1000
var_e = var_c * var_d
var_f = 780
var_g = var_e + var_f
var_h = 250
var_i = var_g - var_h
var_j = 2
var_k = 1000
var_l = var_j * var_k
var_m = 250
var_n = var_l + var_m
var_o = 460
var_p = var_n - var_o
list_b= []
if "/" in str(var_p):
var_p = eval(str(var_p))
list_b.append(var_p)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
list_b.reverse()
var_q = 1
list_c=list_b.copy()
list_c.sort()
var_r = list_c[-var_q]
var_s = list_b.index(var_r)+1
var_t = list_a[var_s-1]
print(var_t) |
Geometry | There are five cuboids each with a height of 4 centimeters (cm), 7 centimeters (cm), 6 centimeters (cm), 9 centimeters (cm), and 2 centimeters (cm), and with a base area of 10 square centimeters (cm2). How many of these cuboids have a volume of 50 cubic centimeters (cm3) or less? | 2 | [OP_LIST_SOL] 4 7 6 9 2 [OP_LIST_EOL] 50 10 [OP_DIV] [OP_LIST_LESS_EQUAL] [OP_LIST_LEN] | var_a = 4
var_b = 7
var_c = 6
var_d = 9
var_e = 2
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 = 50
var_g = 10
var_h = var_f / var_g
list_b = []
for i in list_a:
if i <= var_h:
list_b.append(i)
var_i = len(list_b)
print(int(var_i)) |
Correspondence | 4 is the result of mistakenly subtracted 23 from a number when you should have multiplied by 23. Find the value when you calculate correctly? | 621 | 23 23 4 [OP_ADD] [OP_MUL] | var_a = 23
var_b = 23
var_c = 4
var_d = var_b + var_c
var_e = var_a * var_d
print(int(var_e)) |
Correspondence | When 82.04 is divided by a certain number, it is divisible and the quotient was 28. What number is that certain number? | 2.93 | 82.04 28 [OP_DIV] | var_a = 82.04
var_b = 28
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.