category
stringclasses 5
values | question
stringlengths 20
555
| answer
stringlengths 1
20
| solution_abst
stringlengths 1
287
| solution_code
stringlengths 27
5.97k
|
---|---|---|---|---|
Comparison | Four children (a), (b), (c), and (d) are competing in a running race. (c) is faster than (b) and (b) is slower than (d). If (d) is slower than (a) and (c) is slower than (d), which child is the slowest? | (b) | [OP_LIST_SOL] (a) (b) (c) (d) [OP_LIST_EOL] [OP_LIST_SOL] (a) (d) > (c) (d) < (d) (b) > (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 = '(a)'
var_f = '(d)'
var_g = '>'
var_h = '(c)'
var_i = '(d)'
var_j = '<'
var_k = '(d)'
var_l = '(b)'
var_m = '>'
var_n = '(b)'
var_o = '(c)'
var_p = '<'
list_b= []
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)
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_q = len(list_c)
var_r = list_c[var_q-1]
print(var_r) |
Arithmetic calculation | Students playing basketball are four times as much as students jumping rope. If the number of students jumping rope is 6, how many students are playing basketball? | 24 | 6 4 [OP_MUL] | var_a = 6
var_b = 4
var_c = var_a * var_b
print(int(var_c)) |
Arithmetic calculation | You want to plant trees at intervals of 3.1 meters (m) in a garden with a width of 27.9 meters (m). Find how many trees you can plant. However, the thickness of the wood is not considered. | 9 | 27.9 3.1 [OP_FDIV] 1 [OP_ADD] | var_a = 27.9
var_b = 3.1
var_c = var_a // var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Correspondence | When you multiply a number by 4, you get 166.08. What is the value of a number divided by 4? | 10.38 | 166.08 4 [OP_DIV] 4 [OP_DIV] | var_a = 166.08
var_b = 4
var_c = var_a / var_b
var_d = 4
var_e = var_c / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Correspondence | Hoseok added a number to 56 and got 110. Find the number. | 54 | 110 56 [OP_SUB] | var_a = 110
var_b = 56
var_c = var_a - var_b
print(int(var_c)) |
Correspondence | 63+68A=748. How much is single-digit number A? | 5 | 63+68A=748 A [OP_DIGIT_UNK_SOLVER] | var_a = '63+68A=748'
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 | When there are three numbers: 0.8, 1/2, and 9, what would be the smallest one among the numbers that are greater than 2? | 9 | [OP_LIST_SOL] 0.8 1/2 9 [OP_LIST_EOL] 2 [OP_LIST_MORE] 1 [OP_LIST_MIN] | var_a = 0.8
var_b = 0.5
var_c = 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 = 2
list_b = []
for i in list_a:
if i > var_d:
list_b.append(i)
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[var_e-1]
print(int(var_f)) |
Comparison | Yoongi got 4, Yuna 5, and Jungkook got the quotient of 6 divided by 3. Who got the smallest number? | Jungkook | [OP_LIST_SOL] Yoongi Yuna Jungkook [OP_LIST_EOL] [OP_LIST_SOL] 4 5 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 = 'Yuna'
var_c = 'Jungkook'
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 = 4
var_e = 5
var_f = 6
var_g = 3
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)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
var_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[var_i-1]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l) |
Arithmetic calculation | 30 students in Minju's class have their own attendance numbers from 1 to 30. Among the students in Minju's class, students who are 160 centimeters (cm) or taller are students 1, 3, 7, 10, 23, and 27, and students who weigh 50 kilograms (kg) or more are students 1, 9, 11, 20, and 23. How many students are 160 centimeters (cm) or taller or 50 kilograms (kg) or heavier? | 9 | [OP_LIST_SOL] 1 3 7 10 23 27 [OP_LIST_EOL] [OP_LIST_SOL] 1 9 11 20 23 [OP_LIST_EOL] [OP_SET_UNION] [OP_LIST_LEN] | var_a = 1
var_b = 3
var_c = 7
var_d = 10
var_e = 23
var_f = 27
list_a= []
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_g = 1
var_h = 9
var_i = 11
var_j = 20
var_k = 23
list_b= []
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)
list_b.reverse()
list_c = list(set(list_a) | set(list_b))
var_l = len(list_c)
print(int(var_l)) |
Correspondence | yellow and blue marbles are mixed in the box. There are a total of 913 marbles in the box, and the number of yellow marbles is 514. Find how many yellow marbles are more than blue marbles. | 115 | 514 913 514 [OP_SUB] [OP_SUB] | var_a = 514
var_b = 913
var_c = 514
var_d = var_b - var_c
var_e = var_a - var_d
print(int(var_e)) |
Geometry | Jaewoong lined up the students in the class in a square shape with 10 people on each row and column. How many students are at the perimeter? | 36 | 10 4 [OP_MUL] 4 [OP_SUB] | var_a = 10
var_b = 4
var_c = var_a * var_b
var_d = 4
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | There are a total of 129 persimmons and tangerines. How many persimmons are there if there are 43 fewer persimmons than tangerines? | 43 | 129 43 [OP_SUB] 2 [OP_DIV] | var_a = 129
var_b = 43
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e)) |
Geometry | There is a cuboid with a volume of 1380000000 cubic centimeters (cm3). What is the height of the cuboid in meters (m), if the surface area of its base is 115 square meters (m2)? | 12 | 1380000000 100 3 [OP_POW] [OP_DIV] 115 [OP_DIV] | var_a = 1380000000
var_b = 100
var_c = 3
var_d = var_b ** var_c
var_e = var_a / var_d
var_f = 115
var_g = var_e / var_f
print(int(var_g)) |
Arithmetic calculation | The car will spend 19 liters (l) of gas while traveling 9 kilometers (km). Find how many liters (l) of gas should be spent per 1 kilometer (km). | 2.11 | 19 9 [OP_DIV] | var_a = 19
var_b = 9
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Geometry | If you divide the width of a rectangular wall by 30 centimeters (cm), it is divided by 8, and if you divide the height by 30 centimeters (cm), it is divided by 5. Find the size of the wall in square meters (m2). | 3.6 | 30 100 [OP_DIV] 2 [OP_POW] 8 [OP_MUL] 5 [OP_MUL] | var_a = 30
var_b = 100
var_c = var_a / var_b
var_d = 2
var_e = var_c ** var_d
var_f = 8
var_g = var_e * var_f
var_h = 5
var_i = var_g * var_h
print('{:.2f}'.format(round(var_i+1e-10,2))) |
Geometry | A 20 centimeters (cm) high fishbowl, with a square base and sides of 20 centimeters (cm) has been filled with water a height of 15 centimeters (cm). If you pour water into this fishbowl from a cube-shaped container with an edge of 10 centimeters (cm), how high in centimeters (cm) will the water rise compared to the height before you poured the water in? Find the answer, including the decimal point. | 2.5 | 10 10 [OP_MUL] 10 [OP_MUL] 20 20 [OP_MUL] [OP_DIV] | var_a = 10
var_b = 10
var_c = var_a * var_b
var_d = 10
var_e = var_c * var_d
var_f = 20
var_g = 20
var_h = var_f * var_g
var_i = var_e / var_h
print('{:.2f}'.format(round(var_i+1e-10,2))) |
Arithmetic calculation | What is the smallest three-digit number that is a multiple of 5 and a multiple of 8 and a multiple of 2? | 120 | 100 999 1 [OP_LIST_ARANGE] 5 [OP_LIST_DIVISIBLE] 8 [OP_LIST_DIVISIBLE] 2 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN] | 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 = 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 = 8
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-1]
print(int(var_h)) |
Correspondence | Yoongi wants to add a three-digit number and a two-digit number. Yoongi mistakenly thought the 9 in the unit digit of a three-digit number was 6, and by changing the tens and unit digits of a two-digit number, he mistakenly thought it was 23. When the sum obtained by Yoongi is 299, find the three-digit number. | 279 | 299 23 [OP_SUB] 6 9 [OP_SUB] [OP_SUB] | var_a = 299
var_b = 23
var_c = var_a - var_b
var_d = 6
var_e = 9
var_f = var_d - var_e
var_g = var_c - var_f
print(int(var_g)) |
Comparison | There are Sora, Heesu, and Jiyeon. Sora has cards with 4 and 6 written on them, Heesu has cards with 7 and 5 written on them, and Jiyeon has cards with 3 and 8 written on them. Who has the greatest sum of cards? | Heesu | [OP_LIST_SOL] Sora Heesu Jiyeon [OP_LIST_EOL] [OP_LIST_SOL] 4 6 [OP_ADD] 7 5 [OP_ADD] 3 8 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Sora'
var_b = 'Heesu'
var_c = 'Jiyeon'
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 = 4
var_e = 6
var_f = var_d + var_e
var_g = 7
var_h = 5
var_i = var_g + var_h
var_j = 3
var_k = 8
var_l = var_j + var_k
list_b= []
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_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_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) |
Arithmetic calculation | There are 48 roses. The red rose is 3/8 of the total. Yellow roses are 5/16 of the total. How many more red roses are there than yellow roses? | 3 | 48 3/8 [OP_MUL] 48 5/16 [OP_MUL] [OP_SUB] | var_a = 48
var_b = 0.375
var_c = var_a * var_b
var_d = 48
var_e = 0.3125
var_f = var_d * var_e
var_g = var_c - var_f
print(int(var_g)) |
Correspondence | If AB82-9C9=493D and A, B, C, D are different numbers, find A. | 5 | AB82-9C9=493D A [OP_DIGIT_UNK_SOLVER] | var_a = 'AB82-9C9=493D'
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 | The sum of the legs of chickens and pigs in Yumi's farm is 48. If there are 9 pigs on the farm, how many chickens are there? | 6 | 48 4 9 [OP_MUL] [OP_SUB] 2 [OP_DIV] | var_a = 48
var_b = 4
var_c = 9
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)) |
Geometry | There is a piece of colored paper in the shape of a square with sides of 20 centimeters (cm). I divided the length of each side into thirds and cut them out with small pieces of colored paper. Find the area of the newly created small colored paper to two decimal places. | 44.44 | 20 3 [OP_DIV] 2 [OP_POW] | var_a = 20
var_b = 3
var_c = var_a / var_b
var_d = 2
var_e = var_c ** var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Comparison | There are 4 cells in front of you in which you can place numbers. The sum of each number multiplied by 1, 0.1, and 0.001 respectively is displayed. When 4, 2, and 7 is placed in that order, what is the number 0.05 greater than 100 times the number dsplayed on the monitor? | 420.75 | 1 4 [OP_MUL] 0.1 2 [OP_MUL] [OP_ADD] 0.001 7 [OP_MUL] [OP_ADD] 100 [OP_MUL] 0.05 [OP_ADD] | var_a = 1
var_b = 4
var_c = var_a * var_b
var_d = 0.1
var_e = 2
var_f = var_d * var_e
var_g = var_c + var_f
var_h = 0.001
var_i = 7
var_j = var_h * var_i
var_k = var_g + var_j
var_l = 100
var_m = var_k * var_l
var_n = 0.05
var_o = var_m + var_n
print('{:.2f}'.format(round(var_o+1e-10,2))) |
Correspondence | The five digit number 3A3B3 is a multiple of 33. How many possible Bs are there? | 10 | 3A3B3 [OP_GEN_POSSIBLE_LIST] 33 [OP_LIST_DIVISIBLE] 3A3B3 B [OP_LIST_FIND_UNK] [OP_LIST_LEN] | var_a = '3A3B3'
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 = 33
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 = '3A3B3'
var_d = 'B'
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 | You folded the crane using 12 sheets of colored paper, and at the end, only 9 sheets left. Find how many sheets were prepared at the beginning. | 21 | 12 9 [OP_ADD] | var_a = 12
var_b = 9
var_c = var_a + var_b
print(int(var_c)) |
Geometry | A square-shaped piece of colored paper was cut into several rectangles measuring 5 centimeters (cm) wide and 7 centimeters (cm) long. What is the minimum length in centimeters (cm) of one side of the square? | 35 | 5 7 [OP_LCM] | var_a = 5
var_b = 7
var_c = var_b * var_a / math.gcd(int(var_b), int(var_a))
print(int(var_c)) |
Correspondence | You had to add 48 to a number, but you mistakenly subtract it, and the result was 52. Find the result of the correct calculation. | 148 | 52 48 [OP_ADD] 48 [OP_ADD] | var_a = 52
var_b = 48
var_c = var_a + var_b
var_d = 48
var_e = var_c + var_d
print(int(var_e)) |
Geometry | Find the number of diagonals in an 18-sided figure with all side lengths and all angles equal in measure. | 135 | 18 18 3 [OP_SUB] [OP_MUL] 2 [OP_DIV] | var_a = 18
var_b = 18
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 | There are 3 geese inside the fence. If all geese are given more than 2 bamboos, how many ways are there to distribute 20 bamboos? | 120 | 3 20 [OP_ADD] 3 2 [OP_MUL] [OP_SUB] 1 [OP_SUB] 20 3 2 [OP_MUL] [OP_SUB] [OP_COMB] | var_a = 3
var_b = 20
var_c = var_a + var_b
var_d = 3
var_e = 2
var_f = var_d * var_e
var_g = var_c - var_f
var_h = 1
var_i = var_g - var_h
var_j = 20
var_k = 3
var_l = 2
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)) |
Geometry | What is the total number of diagonals that can be drawn in a hexagon? | 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)) |
Correspondence | A is a single digit number. Rounding 73A94 to the nearest thousand gives it 74000. Find the number of all possible numbers in A. | 5 | 73A94 [OP_GEN_POSSIBLE_LIST] 74000 500 [OP_ADD] [OP_LIST_LESS] 74000 500 [OP_SUB] [OP_LIST_MORE_EQUAL] 73A94 A [OP_LIST_FIND_UNK] [OP_LIST_LEN] | var_a = '73A94'
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 = 74000
var_c = 500
var_d = var_b + var_c
list_b = []
for i in list_a:
if i < var_d:
list_b.append(i)
var_e = 74000
var_f = 500
var_g = var_e - var_f
list_c = []
for i in list_b:
if i >= var_g:
list_c.append(i)
var_h = '73A94'
var_i = 'A'
var_h = str(var_h)
var_i = str(var_i)
unk_idx = var_h.index(var_i)
list_d = []
for elem in list_c:
elem = str(elem)
list_d.append(int(elem[unk_idx]))
list_d = list(set(list_d))
var_j = len(list_d)
print(int(var_j)) |
Arithmetic calculation | When Seokjin was doing a division, he misread the tens digit and units digit of the divisor 65 as the opposite to get the quotient of division 25, and the remainder also 25. Find the sum of the correctly calculated quotient and remainder. | 81 | 56 25 [OP_MUL] 25 [OP_ADD] 65 [OP_FDIV] 56 25 [OP_MUL] 25 [OP_ADD] 65 [OP_MOD] [OP_ADD] | var_a = 56
var_b = 25
var_c = var_a * var_b
var_d = 25
var_e = var_c + var_d
var_f = 65
var_g = var_e // var_f
var_h = 56
var_i = 25
var_j = var_h * var_i
var_k = 25
var_l = var_j + var_k
var_m = 65
var_n = var_l % var_m
var_o = var_g + var_n
print(int(var_o)) |
Arithmetic calculation | There are 12 white rabbits and 9 black rabbits. If 8 of them are females, how many male rabbits are there? | 13 | 12 9 [OP_ADD] 8 [OP_SUB] | var_a = 12
var_b = 9
var_c = var_a + var_b
var_d = 8
var_e = var_c - var_d
print(int(var_e)) |
Possibility | Jungkook has 3 boxes with 2 balls in them. How many balls does Jungkook have? | 6 | 2 3 [OP_MUL] | var_a = 2
var_b = 3
var_c = var_a * var_b
print(int(var_c)) |
Arithmetic calculation | There are chocolates with five numbers written on them: 25, 17, 21, 34, and 32. Among them, the older brother ate the chocolate with the largest number written on it, and the younger brother ate the chocolate with the smallest number written on it. What is the difference between the numbers written on the chocolates the two of them ate? | 17 | [OP_LIST_SOL] 25 17 21 34 32 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] | var_a = 25
var_b = 17
var_c = 21
var_d = 34
var_e = 32
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 1
list_b=list_a.copy()
list_b.sort()
var_g = list_b[-var_f]
var_h = 1
list_c=list_a.copy()
list_c.sort()
var_i = list_c[var_h-1]
var_j = var_g - var_i
print(int(var_j)) |
Comparison | Jungkook has 0.8 written on his card, Yoongi has 1/2 written on his card, and Yoojeong has 0.9 written on her card. Find the number of people who have numbers less than or equal to 0.3 written on their cards. | 0 | [OP_LIST_SOL] 0.8 1/2 0.9 [OP_LIST_EOL] 0.3 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN] | 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.3
list_b = []
for i in list_a:
if i <= var_d:
list_b.append(i)
var_e = len(list_b)
print(int(var_e)) |
Possibility | The house has 3 blue cards and 5 yellow cards. What is the total number of cases when you give one of the cards to your cousin? However, all cards are distinguishable. | 8 | 3 5 [OP_ADD] | var_a = 3
var_b = 5
var_c = var_a + var_b
print(int(var_c)) |
Possibility | You want to form a two-digit number by picking two different numbers from 0, 3, 5, 7, and 8. What is the sum of the largest number and the smallest number? | 117 | [OP_LIST_SOL] 0 3 5 7 8 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD] | var_a = 0
var_b = 3
var_c = 5
var_d = 7
var_e = 8
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 2
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_f))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = 1
list_d=list_b.copy()
list_d.sort()
var_j = list_d[var_i-1]
var_k = var_h + var_j
print(int(var_k)) |
Possibility | What is the smallest three-digit number that can be formed by using the five different numbers 3, 0, 2, 5, and 7 only once? | 203 | [OP_LIST_SOL] 3 0 2 5 7 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] | var_a = 3
var_b = 0
var_c = 2
var_d = 5
var_e = 7
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 = 3
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-1]
print(int(var_h)) |
Comparison | Eunseol divided 28 candies equally into 4 pockets, and Sujeong split 18 candies equally into 3 pockets. Who among Eunseol and Sujeong has fewer candies in one pocket? | Sujeong | [OP_LIST_SOL] Eunseol Sujeong [OP_LIST_EOL] [OP_LIST_SOL] 28 4 [OP_DIV] 18 3 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Eunseol'
var_b = 'Sujeong'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 28
var_d = 4
var_e = var_c / var_d
var_f = 18
var_g = 3
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-1]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l) |
Geometry | How much water is needed to fill a cube-shaped container with one side 7 centimeters (cm) long? | 343 | 7 3 [OP_POW] | var_a = 7
var_b = 3
var_c = var_a ** var_b
print(int(var_c)) |
Geometry | Some triangles have all three sides equal in length of 14/8 centimeters (cm). What is the sum of the lengths of the three sides of this triangle in centimeters (cm)? | 5.25 | 14/8 3 [OP_MUL] | var_a = 1.75
var_b = 3
var_c = var_a * var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Arithmetic calculation | There are five numbers 9/10, 1.8, 2, 1, and 11/5. Of these, write the number greater than 1 and less than 2 including the decimal point. | 1.8 | [OP_LIST_SOL] 9/10 1.8 2 1 11/5 [OP_LIST_EOL] 1 [OP_LIST_MORE] 2 [OP_LIST_LESS] 1 [OP_LIST_GET] | var_a = 0.9
var_b = 1.8
var_c = 2
var_d = 1
var_e = 2.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 = 1
list_b = []
for i in list_a:
if i > var_f:
list_b.append(i)
var_g = 2
list_c = []
for i in list_b:
if i < var_g:
list_c.append(i)
var_h = 1
var_i = list_c[var_h-1]
print('{:.2f}'.format(round(var_i+1e-10,2))) |
Correspondence | A is a single digit natural number. Find A from the multiplication formula AA×AA=5929 of two digit numbers where each digit is A. | 7 | AA×AA=5929 A [OP_DIGIT_UNK_SOLVER] | var_a = 'AA×AA=5929'
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)) |
Possibility | Ga-yeon wants to open the lock. The password for the lock is a three-digit number using only three numbers out of 1, 4, 5, and 9, and is said to be the second largest three-digit number with 9 in the tens place. When all digits are different, what is the password? | 591 | [OP_LIST_SOL] 1 4 5 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 10 9 [OP_LIST_SEARCH_FIXED_DIGIT] 2 [OP_LIST_MAX] | var_a = 1
var_b = 4
var_c = 5
var_d = 9
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_e))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_f = 10
var_g = 9
list_c = []
var_f = int(var_f)
var_g = int(var_g)
for i in list_b:
i = int(i)
if (i//var_f)%10 == var_g:
list_c.append(i)
var_h = 2
list_d=list_c.copy()
list_d.sort()
var_i = list_d[-var_h]
print(int(var_i)) |
Comparison | Jungkook had 6 apples, but he got 3 more. When Yoongi has 4 apples and Yuna has 5 apples, who has the most apples? | Jungkook | [OP_LIST_SOL] Jungkook Yoongi Yuna [OP_LIST_EOL] [OP_LIST_SOL] 6 3 [OP_ADD] 4 5 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Jungkook'
var_b = 'Yoongi'
var_c = 'Yuna'
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 = 3
var_f = var_d + var_e
var_g = 4
var_h = 5
list_b= []
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)
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 | I am trying to cut a log into 16 slices. It takes 9 seconds to make one cut, and after one cut, it is said to rest for 5 seconds and then cut again. How many seconds will it take to cut all these logs? | 210 | 16 1 [OP_SUB] 9 5 [OP_ADD] [OP_MUL] | var_a = 16
var_b = 1
var_c = var_a - var_b
var_d = 9
var_e = 5
var_f = var_d + var_e
var_g = var_c * var_f
print(int(var_g)) |
Comparison | When the paint was weighed using a scale and a 100 grams (g) eraser of the same weight, it was equal to the weight of 3 erasers, and when the crayons were weighed, it was equal to the weight of 5 erasers. Which is lighter, paint or crayons? | paint | [OP_LIST_SOL] paint crayons [OP_LIST_EOL] [OP_LIST_SOL] 100 3 [OP_MUL] 100 5 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'paint'
var_b = 'crayons'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 100
var_d = 3
var_e = var_c * var_d
var_f = 100
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-1]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l) |
Geometry | There is a wall in the shape of a rectangle with dimensions of 36 centimeters (cm) wide and 72 centimeters (cm) long. On this wall, I want to attach tiles that are 3 centimeters (cm) and 4 centimeters (cm) in width and length, respectively, without empty spaces. How many tiles should I glue in all? | 216 | 36 3 [OP_FDIV] 72 4 [OP_FDIV] [OP_MUL] | var_a = 36
var_b = 3
var_c = var_a // var_b
var_d = 72
var_e = 4
var_f = var_d // var_e
var_g = var_c * var_f
print(int(var_g)) |
Comparison | There are a total of 4 numbers: 0.8, 1/2, 0.5, 1/3. What is the sum of all numbers greater than 0.1? | 2.13 | [OP_LIST_SOL] 0.8 1/2 0.5 1/3 [OP_LIST_EOL] 0.1 [OP_LIST_MORE] [OP_LIST_SUM] | var_a = 0.8
var_b = 0.5
var_c = 0.5
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 = 0.1
list_b = []
for i in list_a:
if i > var_e:
list_b.append(i)
list_b = [float(i) for i in list_b]
var_f = sum(list_b)
print('{:.2f}'.format(round(var_f+1e-10,2))) |
Possibility | There are five different points on a circle. Find the number of line segments formed by joining two non-contiguous points. | 10 | 5 2 [OP_COMB] | var_a = 5
var_b = 2
var_c = 1
var_a = int(var_a)
var_b = int(var_b)
for i, elem in enumerate(range(var_b)):
var_c = var_c * (var_a-i)
for i, elem in enumerate(range(var_b)):
var_c = var_c / (i+1)
print(int(var_c)) |
Geometry | There is a rectangular farm. If the length of the long side is 1 kilometer (km) and the length of the short side is 2/8 km (km) shorter than the length of the long side, what is the total circumference of the farm in kilometers (km)? | 3.5 | 1 1 2/8 [OP_SUB] [OP_ADD] 2 [OP_MUL] | var_a = 1
var_b = 1
var_c = 0.25
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))) |
Comparison | Students lined up in order of seniority. Yuna is younger than Yujeong who is 15th oldest and older than Eunji who is 17th oldest. In what number oldest is Yuna? | 16 | 15 17 [OP_ADD] 2 [OP_FDIV] | var_a = 15
var_b = 17
var_c = var_a + var_b
var_d = 2
var_e = var_c // var_d
print(int(var_e)) |
Possibility | If there are 6 students A, B, C, D, E, and F, find the number of ways to select 3 representatives. | 20 | [OP_LIST_SOL] A B C D E F [OP_LIST_EOL] [OP_LIST_LEN] 3 [OP_COMB] | var_a = 'A'
var_b = 'B'
var_c = 'C'
var_d = 'D'
var_e = 'E'
var_f = 'F'
list_a= []
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_g = len(list_a)
var_h = 3
var_i = 1
var_g = int(var_g)
var_h = int(var_h)
for i, elem in enumerate(range(var_h)):
var_i = var_i * (var_g-i)
for i, elem in enumerate(range(var_h)):
var_i = var_i / (i+1)
print(int(var_i)) |
Comparison | What is the largest number less than 0.7 among 0.8, 1/2, 0.9, and 1/3? | 0.5 | [OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 0.7 [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 = 0.7
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))) |
Geometry | Eight smaller cubes of the same size are stacked to form a larger cube. If the volume of the stacked cubes is 1000 cubic centimeters (cm3), how many centimeters (cm) is the length of one edge of the smaller 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))))) |
Arithmetic calculation | There were 24 cars in the parking lot, and after 8 cars went out, another 6 cars went out. How many cars are left in the parking lot? | 10 | 24 8 [OP_SUB] 6 [OP_SUB] | var_a = 24
var_b = 8
var_c = var_a - var_b
var_d = 6
var_e = var_c - var_d
print(int(var_e)) |
Possibility | What is the tenth largest number among four digits with odd digits? | 9971 | 1 9 [OP_LIST_ODD] 4 [OP_LIST_GET_PRODUCT] 10 [OP_LIST_MAX] | var_a = 1
var_b = 9
list_a = []
if var_a%2==0:
for i in range(var_a+1, var_b+1, 2):
list_a.append(i)
else:
for i in range(var_a, var_b+1, 2):
list_a.append(i)
var_c = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=var_c))
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_d = 10
list_c=list_b.copy()
list_c.sort()
var_e = list_c[-var_d]
print(int(var_e)) |
Correspondence | Hoseok added 36 to a certain number and got 71. What is the value of adding 10 to this certain number? | 45 | 71 36 [OP_SUB] 10 [OP_ADD] | var_a = 71
var_b = 36
var_c = var_a - var_b
var_d = 10
var_e = var_c + var_d
print(int(var_e)) |
Comparison | 20 cars are parked in a row. The black car is 16th from the right, and the white car is 11th from the left. How many cars are between the black and white cars? | 5 | 16 11 [OP_ADD] 20 [OP_SUB] 2 [OP_SUB] | var_a = 16
var_b = 11
var_c = var_a + var_b
var_d = 20
var_e = var_c - var_d
var_f = 2
var_g = var_e - var_f
print(int(var_g)) |
Arithmetic calculation | Taehyung's average score for Korean, English, and science is 95. When Taehyung says his average score dropped by 3 points after taking the math test, what is his math score? | 83 | 95 3 [OP_SUB] 4 [OP_MUL] 95 3 [OP_MUL] [OP_SUB] | var_a = 95
var_b = 3
var_c = var_a - var_b
var_d = 4
var_e = var_c * var_d
var_f = 95
var_g = 3
var_h = var_f * var_g
var_i = var_e - var_h
print(int(var_i)) |
Geometry | Given that the sum of the lengths of the edges of one face of a regular tetrahedron is 18 centimeters (cm), how long is the length of one edge of this tetrahedron? | 6 | 18 3 [OP_DIV] | var_a = 18
var_b = 3
var_c = var_a / var_b
print(int(var_c)) |
Arithmetic calculation | Randomly selected two digit numbers were 31, 49, 62, and 76. What is the difference between the largest and smallest of these numbers? | 45 | [OP_LIST_SOL] 49 31 76 62 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] | var_a = 49
var_b = 31
var_c = 76
var_d = 62
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 1
list_b=list_a.copy()
list_b.sort()
var_f = list_b[-var_e]
var_g = 1
list_c=list_a.copy()
list_c.sort()
var_h = list_c[var_g-1]
var_i = var_f - var_h
print(int(var_i)) |
Geometry | There is an icosikaipentagon. How many diagonals can you draw from one vertex? | 22 | 25 3 [OP_SUB] | var_a = 25
var_b = 3
var_c = var_a - var_b
print(int(var_c)) |
Geometry | Jaewoong's house has a rectangular swimming pool with an area of 143.2 square meters (m2). If the length of this pool is 4 meters (m), what is the width in meters (m)? | 35.8 | 143.2 4 [OP_DIV] | var_a = 143.2
var_b = 4
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Correspondence | A+B+B=814.8. When a decimal point of B is moved one place to the right, it becomes equivalent to A. Calculate the value of A-B including the decimal point. | 34.92 | 814.8 10 10 [OP_ADD] 1 [OP_ADD] [OP_DIV] 814.8 10 10 [OP_ADD] 1 [OP_ADD] [OP_DIV] 10 [OP_DIV] [OP_SUB] | var_a = 814.8
var_b = 10
var_c = 10
var_d = var_b + var_c
var_e = 1
var_f = var_d + var_e
var_g = var_a / var_f
var_h = 814.8
var_i = 10
var_j = 10
var_k = var_i + var_j
var_l = 1
var_m = var_k + var_l
var_n = var_h / var_m
var_o = 10
var_p = var_n / var_o
var_q = var_g - var_p
print('{:.2f}'.format(round(var_q+1e-10,2))) |
Arithmetic calculation | The distance from the orchard to the house is 800 meters (m), the distance from the house to the pharmacy is 1300 meters (m), and the distance from the pharmacy to the school is 1700 meters (m). How many meters (m) is the distance from the orchard through the house to the pharmacy greater than the distance from the pharmacy to the school? | 400 | 800 1300 [OP_ADD] 1700 [OP_SUB] | var_a = 800
var_b = 1300
var_c = var_a + var_b
var_d = 1700
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | ABCD+ABCD=5472. What is the value of D when A, B, C, and D are different numbers? | 6 | ABCD+ABCD=5472 D [OP_DIGIT_UNK_SOLVER] | var_a = 'ABCD+ABCD=5472'
var_b = 'D'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Arithmetic calculation | If there are four numbers 10, 11, 12, and 13, what is the 2nd largest number divided by the 2nd smallest number? | 1.09 | [OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 2 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_DIV] | var_a = 10
var_b = 11
var_c = 12
var_d = 13
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 2
list_b=list_a.copy()
list_b.sort()
var_f = list_b[-var_e]
var_g = 2
list_c=list_a.copy()
list_c.sort()
var_h = list_c[var_g-1]
var_i = var_f / var_h
print('{:.2f}'.format(round(var_i+1e-10,2))) |
Geometry | How many diagonals can you draw in a hexagon? | 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)) |
Arithmetic calculation | Find how many divisors of 40 are there excluding 40. | 7 | 40 [OP_LIST_GET_DIVISOR] [OP_LIST_SOL] 40 [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] | var_a = 40
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 = 40
list_b= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_b.append(var_b)
list_b.reverse()
list_c = list(set(list_a) - set(list_b))
var_c = len(list_c)
print(int(var_c)) |
Arithmetic calculation | There were 25 boxes of apples and 12 boxes of pears in the mart. If you buy 8 more boxes of apples and 8 more boxes of pears, how many more boxes of apples there are than boxes of pears? | 13 | 25 8 [OP_ADD] 12 8 [OP_ADD] [OP_SUB] | var_a = 25
var_b = 8
var_c = var_a + var_b
var_d = 12
var_e = 8
var_f = var_d + var_e
var_g = var_c - var_f
print(int(var_g)) |
Geometry | The volume of a cuboid is 315 square centimeters (cm2). If the width is 9 centimeters (cm) and the length is 7 centimeters (cm), what is the height in centimeters (cm)? | 5 | 315 9 [OP_DIV] 7 [OP_DIV] | var_a = 315
var_b = 9
var_c = var_a / var_b
var_d = 7
var_e = var_c / var_d
print(int(var_e)) |
Correspondence | Yoongi tries to find the difference between a two-digit number and 53. Yoongi misunderstood the tens and ones digits of 53 and thought it was 35. The difference Yoongi calculated incorrectly is 27. Find the correct result. | 9 | 27 35 [OP_ADD] 53 [OP_SUB] | var_a = 27
var_b = 35
var_c = var_a + var_b
var_d = 53
var_e = var_c - var_d
print(int(var_e)) |
Geometry | Find the product of the number of faces and the number of vertices of a cube. | 48 | 6 8 [OP_MUL] | var_a = 6
var_b = 8
var_c = var_a * var_b
print(int(var_c)) |
Arithmetic calculation | How many natural numbers are there not more than 30 are odd or multiples of 5? | 18 | 1 30 1 [OP_LIST_ARANGE] 5 [OP_LIST_DIVISIBLE] 1 30 [OP_LIST_ODD] [OP_SET_UNION] [OP_LIST_LEN] | var_a = 1
var_b = 30
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 = 1
var_f = 30
list_c = []
if var_e%2==0:
for i in range(var_e+1, var_f+1, 2):
list_c.append(i)
else:
for i in range(var_e, var_f+1, 2):
list_c.append(i)
list_d = list(set(list_b) | set(list_c))
var_g = len(list_d)
print(int(var_g)) |
Correspondence | When we divide 37 by 8, the remainder is B and the quotient is A. Find the right value for A. | 4 | 37 8 [OP_FDIV] | var_a = 37
var_b = 8
var_c = var_a // var_b
print(int(var_c)) |
Comparison | There are 6 and 7 rows each of cars parked in the front and back of the father's car parked in the parking lot, and 5 and 6 rows each of cars parked on either side and the number of cars in each row is the same. How many are there in all? | 168 | 6 7 [OP_ADD] 1 [OP_ADD] 5 6 [OP_ADD] 1 [OP_ADD] [OP_MUL] | var_a = 6
var_b = 7
var_c = var_a + var_b
var_d = 1
var_e = var_c + var_d
var_f = 5
var_g = 6
var_h = var_f + var_g
var_i = 1
var_j = var_h + var_i
var_k = var_e * var_j
print(int(var_k)) |
Arithmetic calculation | You are trying to solve all the problems in the workbook in 4 days. You solved 1/2 of the problems were solved on the first day, 1/4 of the problems on the second day, 1/6 of the problems on the third day, and 20 problems left on the fourth day. How many problems are there in the workbook? | 240 | 20 1 1/2 1/4 [OP_ADD] 1/6 [OP_ADD] [OP_SUB] [OP_DIV] | var_a = 20
var_b = 1
var_c = 0.5
var_d = 0.25
var_e = var_c + var_d
var_f = 0.16666666666666666
var_g = var_e + var_f
var_h = var_b - var_g
var_i = var_a / var_h
print(int(eval('{:.2f}'.format(round(var_i+1e-10,2))))) |
Comparison | Seulgi is Hyunjung's grandmother. Miran is the daughter of Hohyun and the first daughter to marry Jaeyoung whose younger than her. Among Hohyun's children, Hyunjung is the eldest daughter. Who is the 3rd oldest among 5 people? | Hyunjung | [OP_LIST_SOL] Seulgi Hyunjung Miran Hohyun Jaeyoung [OP_LIST_EOL] [OP_LIST_SOL] Seulgi Hyunjung > Miran Hohyun < Miran Jaeyoung > Hohyun Hyunjung > Hyunjung Miran > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 3 [OP_LIST_GET] | var_a = 'Seulgi'
var_b = 'Hyunjung'
var_c = 'Miran'
var_d = 'Hohyun'
var_e = 'Jaeyoung'
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 = 'Seulgi'
var_g = 'Hyunjung'
var_h = '>'
var_i = 'Miran'
var_j = 'Hohyun'
var_k = '<'
var_l = 'Miran'
var_m = 'Jaeyoung'
var_n = '>'
var_o = 'Hohyun'
var_p = 'Hyunjung'
var_q = '>'
var_r = 'Hyunjung'
var_s = 'Miran'
var_t = '>'
list_b= []
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)
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)
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_u = 3
var_v = list_c[var_u-1]
print(var_v) |
Geometry | Hyungjin and Kyujun have been making a cube statue. The length of one side of the statue of Hyungjin is 100 centimeters (cm), and the length of one side of the statue of Gyujun is 2 meters (m). How many times the volume of the statue is different between the two? | 8 | 2 3 [OP_POW] 100 100 [OP_DIV] 3 [OP_POW] [OP_DIV] | var_a = 2
var_b = 3
var_c = var_a ** var_b
var_d = 100
var_e = 100
var_f = var_d / var_e
var_g = 3
var_h = var_f ** var_g
var_i = var_c / var_h
print(int(var_i)) |
Arithmetic calculation | There are 5 boxes of apples of the same weight in the supermarket. After removing 30 kilograms (kg) of apples from each box, the weight of the remaining apples in the five boxes was equal to the weight of the apples in the original two boxes. How many kilograms (kg) of apples were originally in each box? | 50 | 30 5 [OP_MUL] 5 2 [OP_SUB] [OP_DIV] | var_a = 30
var_b = 5
var_c = var_a * var_b
var_d = 5
var_e = 2
var_f = var_d - var_e
var_g = var_c / var_f
print(int(var_g)) |
Comparison | You are going to subtract the diameter of the smallest circle from the diameter of the largest circle among three circles (a), (b), and (c) with areas of 48 square centimeters (cm2), 108 square centimeters (cm2), and 75 square centimeters (cm2), respectively. Find the value in centimeter (cm) if pi is 3.
| 4 | [OP_LIST_SOL] 48 3 [OP_DIV] 1 2 [OP_DIV] [OP_POW] 108 3 [OP_DIV] 1 2 [OP_DIV] [OP_POW] 75 3 [OP_DIV] 1 2 [OP_DIV] [OP_POW] [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] 2 [OP_MUL] | var_a = 48
var_b = 3
var_c = var_a / var_b
var_d = 1
var_e = 2
var_f = var_d / var_e
var_g = var_c ** var_f
var_h = 108
var_i = 3
var_j = var_h / var_i
var_k = 1
var_l = 2
var_m = var_k / var_l
var_n = var_j ** var_m
var_o = 75
var_p = 3
var_q = var_o / var_p
var_r = 1
var_s = 2
var_t = var_r / var_s
var_u = var_q ** var_t
list_a= []
if "/" in str(var_u):
var_u = eval(str(var_u))
list_a.append(var_u)
if "/" in str(var_n):
var_n = eval(str(var_n))
list_a.append(var_n)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_a.append(var_g)
list_a.reverse()
var_v = 1
list_b=list_a.copy()
list_b.sort()
var_w = list_b[-var_v]
var_x = 1
list_c=list_a.copy()
list_c.sort()
var_y = list_c[var_x-1]
var_z = var_w - var_y
var_A = 2
var_B = var_z * var_A
print(int(var_B)) |
Arithmetic calculation | There are 2 sticks of different lengths. The length of the long stick is 18 centimeters (cm) longer than the length of the short stick, and the sum of the lengths of the two sticks is 30 centimeters (cm). Find how many sticks with the same length as the shorter sticks can be made by cutting the longer sticks. | 4 | 30 18 [OP_SUB] 2 [OP_DIV] 18 [OP_ADD] 30 18 [OP_SUB] 2 [OP_DIV] [OP_DIV] | var_a = 30
var_b = 18
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
var_f = 18
var_g = var_e + var_f
var_h = 30
var_i = 18
var_j = var_h - var_i
var_k = 2
var_l = var_j / var_k
var_m = var_g / var_l
print(int(var_m)) |
Arithmetic calculation | The number of (a) trees is twice the number of (b) trees, and there are 15 more (c) trees than (a) trees. If there are 47 (c) trees, how many (a), (b), (c) trees are there in total? | 95 | 47 15 [OP_SUB] 47 15 [OP_SUB] 2 [OP_DIV] [OP_ADD] 47 [OP_ADD] | var_a = 47
var_b = 15
var_c = var_a - var_b
var_d = 47
var_e = 15
var_f = var_d - var_e
var_g = 2
var_h = var_f / var_g
var_i = var_c + var_h
var_j = 47
var_k = var_i + var_j
print(int(var_k)) |
Arithmetic calculation | On the train, Yoojeong moved 3 stops and Namjoon moved 2 stops. How many stops did Yoojung and Namjoon travel by train? | 5 | 3 2 [OP_ADD] | var_a = 3
var_b = 2
var_c = var_a + var_b
print(int(var_c)) |
Arithmetic calculation | I decided to share 1 liter (L) of milk with my friends. Of these, Myeongseok drank 0.1 liters (L), and Mingu drank 0.2 liters (L) more than Myeongseok. After a while, if Min-jae came and drank 0.3 liters (L) of milk, how many liters (L) of milk could I drink? | 0.3 | 1 0.1 [OP_SUB] 0.1 0.2 [OP_ADD] [OP_SUB] 0.3 [OP_SUB] | var_a = 1
var_b = 0.1
var_c = var_a - var_b
var_d = 0.1
var_e = 0.2
var_f = var_d + var_e
var_g = var_c - var_f
var_h = 0.3
var_i = var_g - var_h
print('{:.2f}'.format(round(var_i+1e-10,2))) |
Comparison | Mina drank 0.3 liters (l) of Coke twice. Seokhyung drank 3/2 liter (l). If Songhwa drank 0.6 liters (l) less than Seokhyung, who drank the most cola? | Seokhyung | [OP_LIST_SOL] Mina Seokhyung Songhwa [OP_LIST_EOL] [OP_LIST_SOL] 0.3 2 [OP_MUL] 3 2 [OP_DIV] 3 2 [OP_DIV] 0.6 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Mina'
var_b = 'Seokhyung'
var_c = 'Songhwa'
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.3
var_e = 2
var_f = var_d * var_e
var_g = 3
var_h = 2
var_i = var_g / var_h
var_j = 3
var_k = 2
var_l = var_j / var_k
var_m = 0.6
var_n = var_l - var_m
list_b= []
if "/" in str(var_n):
var_n = eval(str(var_n))
list_b.append(var_n)
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_o = 1
list_c=list_b.copy()
list_c.sort()
var_p = list_c[-var_o]
var_q = list_b.index(var_p)+1
var_r = list_a[var_q-1]
print(var_r) |
Correspondence | A number that is a multiple of 7, when divided by 2, 3, 4, 5, or 6, has a remainder of 1. Find the third smallest of these numbers. | 1141 | 0 9999 1 [OP_LIST_ARANGE] 2 1 [OP_LIST_DIVIDE_AND_REMAIN] 3 1 [OP_LIST_DIVIDE_AND_REMAIN] 4 1 [OP_LIST_DIVIDE_AND_REMAIN] 5 1 [OP_LIST_DIVIDE_AND_REMAIN] 6 1 [OP_LIST_DIVIDE_AND_REMAIN] 7 [OP_LIST_DIVISIBLE] 3 [OP_LIST_MIN] | var_a = 0
var_b = 9999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 2
var_e = 1
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 = 3
var_g = 1
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 = 4
var_i = 1
list_d = []
var_h = int(var_h)
var_i = int(var_i)
if var_i < 0:
var_i = var_i + var_h
for i in list_c:
i = int(i)
if i%var_h == var_i:
list_d.append(i)
var_j = 5
var_k = 1
list_e = []
var_j = int(var_j)
var_k = int(var_k)
if var_k < 0:
var_k = var_k + var_j
for i in list_d:
i = int(i)
if i%var_j == var_k:
list_e.append(i)
var_l = 6
var_m = 1
list_f = []
var_l = int(var_l)
var_m = int(var_m)
if var_m < 0:
var_m = var_m + var_l
for i in list_e:
i = int(i)
if i%var_l == var_m:
list_f.append(i)
var_n = 7
list_g = []
var_n = int(var_n)
for i in list_f:
i = int(i)
if i % var_n == 0:
list_g.append(i)
var_o = 3
list_h=list_g.copy()
list_h.sort()
var_p = list_h[var_o-1]
print(int(var_p)) |
Arithmetic calculation | We have a machine that produces 370 pencils a day. How many days will it take to produce 1000 dozen pencils on this machine? | 33 | 1000 12 [OP_MUL] 370 [OP_DIV] 1 [OP_CEIL] | var_a = 1000
var_b = 12
var_c = var_a * var_b
var_d = 370
var_e = var_c / var_d
var_f = 1
var_g=int(((var_e+9*10**(var_f-2))//(10**(var_f-1)))*10**(var_f-1))
print(int(var_g)) |
Arithmetic calculation | Bacteria split into two in one minute. If after 1 minute it becomes 2, and after 2 minutes it becomes 4, and so on, how many will there be after 8 minutes? | 256 | 2 8 [OP_POW] | var_a = 2
var_b = 8
var_c = var_a ** var_b
print(int(var_c)) |
Arithmetic calculation | There are four numbers 10, 11, 12, and 13. What is the remainder when divided by the 3rd largest number and the 2nd largest number? | 11 | [OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 3 [OP_LIST_MAX] 2 [OP_LIST_MAX] [OP_MOD] | var_a = 10
var_b = 11
var_c = 12
var_d = 13
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=list_a.copy()
list_b.sort()
var_f = list_b[-var_e]
var_g = 2
list_c=list_a.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = var_f % var_h
print(int(var_i)) |
Geometry | How many circles with a radius of 4 centimeters (cm) can be drawn on a line segment of 24 centimeters (cm) without overlapping? | 3 | 24 4 2 [OP_MUL] [OP_DIV] | var_a = 24
var_b = 4
var_c = 2
var_d = var_b * var_c
var_e = var_a / var_d
print(int(var_e)) |
Arithmetic calculation | There are two goblins, Pongpong and Longlong. Pongpong adds 300 each day to 8000, and Longlong adds 500 each day to 5000. It is said that the treasure will be given on the same day as the number of Pongpong and Longlong. How many days can they get the treasure? | 15 | 8000 5000 [OP_SUB] 500 300 [OP_SUB] [OP_DIV] | var_a = 8000
var_b = 5000
var_c = var_a - var_b
var_d = 500
var_e = 300
var_f = var_d - var_e
var_g = var_c / var_f
print(int(var_g)) |
Comparison | Three classes A, B, and C participated in the reading competition. If the students in class A read more than the students in class B, and the students in class C read more than the students in class A, find which class read the fewest books. | B | [OP_LIST_SOL] A B C [OP_LIST_EOL] [OP_LIST_SOL] A B > C A > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [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 = 'A'
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 = len(list_c)
var_k = list_c[var_j-1]
print(var_k) |
Correspondence | The fishmonger sold half of the fish he had for lunch and 1/3 of the rest for dinner, leaving 12 fish. How many fish did they originally have in the shop? | 36 | 12 1 1/3 [OP_SUB] [OP_DIV] 1 1/2 [OP_SUB] [OP_DIV] | var_a = 12
var_b = 1
var_c = 0.3333333333333333
var_d = var_b - var_c
var_e = var_a / var_d
var_f = 1
var_g = 0.5
var_h = var_f - var_g
var_i = var_e / var_h
print(int(eval('{:.2f}'.format(round(var_i+1e-10,2))))) |
Comparison | I'm trying to put 22 people in order of height. When everyone's height is different, (a) is 13th from the back. If you start with the shortest person, what number does (a) stand in? | 10 | 22 13 [OP_SUB] 1 [OP_ADD] | var_a = 22
var_b = 13
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Correspondence | Each bag of jellies contains 3 strawberry-flavored jellies and 4 grape-flavored jellies. If you get 25 bags of new jellies today and the total number of strawberry-flavored jellies is 150, how many grape-flavored jellies will there be? | 100 | 150 3 [OP_DIV] 25 [OP_SUB] 4 [OP_MUL] | var_a = 150
var_b = 3
var_c = var_a / var_b
var_d = 25
var_e = var_c - var_d
var_f = 4
var_g = var_e * var_f
print(int(var_g)) |
Arithmetic calculation | Seokgi and Jihae shared 2 liters (L) and 100 milliliters (㎖) of milk. How many milliliters (ml) of milk must Seokgi drink if he is to drink 200 milliliters (ml) more than Jihae? | 1150 | 2 1000 [OP_MUL] 100 [OP_ADD] 200 [OP_ADD] 2 [OP_DIV] | var_a = 2
var_b = 1000
var_c = var_a * var_b
var_d = 100
var_e = var_c + var_d
var_f = 200
var_g = var_e + var_f
var_h = 2
var_i = var_g / var_h
print(int(var_i)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.