category
stringclasses 5
values | question
stringlengths 20
555
| answer
stringlengths 1
20
| solution_abst
stringlengths 1
287
| solution_code
stringlengths 27
5.97k
|
---|---|---|---|---|
Possibility | Jiyeon wants to make the biggest number by using the number cards in front of her once. Given the number cards 1, 4, and 5, what natural number should she create? | 541 | [OP_LIST_SOL] 1 4 5 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] | var_a = 1
var_b = 4
var_c = 5
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)
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
print(int(var_f)) |
Comparison | Hohyun is 162 centimeters (cm) tall and Seulgi is 159 centimeters (cm) tall. Who is taller? | Hohyun | [OP_LIST_SOL] Hohyun Seulgi [OP_LIST_EOL] [OP_LIST_SOL] 162 159 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Hohyun'
var_b = 'Seulgi'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 162
var_d = 159
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) |
Arithmetic calculation | The length of the wooden block of Yoojung is 30 centimeters (cm) shorter from 31 meters (m). Write the length of the wooden block that she has in centimeters (cm). | 3070 | 31 100 [OP_MUL] 30 [OP_SUB] | var_a = 31
var_b = 100
var_c = var_a * var_b
var_d = 30
var_e = var_c - var_d
print(int(var_e)) |
Possibility | Find the sum of the largest and the third largest three-digit number which has 3 in the tens and that can be made by using 1, 7, 4, and 3 once. | 1465 | [OP_LIST_SOL] 1 7 4 3 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 10 3 [OP_LIST_SEARCH_FIXED_DIGIT] 1 [OP_LIST_MAX] 3 [OP_LIST_GET] [OP_ADD] | var_a = 1
var_b = 7
var_c = 4
var_d = 3
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 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 = 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 = 1
list_d=list_c.copy()
list_d.sort()
var_i = list_d[-var_h]
var_j = 3
var_k = list_c[var_j-1]
var_l = var_i + var_k
print(int(var_l)) |
Comparison | The playground of Dongmin's School is 1105 square meters (m2) and has 650 students. The playground at Yonghee's school is 1440 square meters (m2) and has 960 students. Whose school has the largest playground area per student? | Dongmin | [OP_LIST_SOL] Dongmin Yonghee [OP_LIST_EOL] [OP_LIST_SOL] 1105 650 [OP_DIV] 1440 960 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Dongmin'
var_b = 'Yonghee'
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 = 1105
var_d = 650
var_e = var_c / var_d
var_f = 1440
var_g = 960
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) |
Geometry | There is a parallelogram with an area of 44 square centimeters (cm2) and a height of 11 centimeters (cm). What is the length of the base of this parallelogram in centimeters (cm)? | 4 | 44 11 [OP_DIV] | var_a = 44
var_b = 11
var_c = var_a / var_b
print(int(var_c)) |
Geometry | There are cards in the shape of a rectangle. If the sum of the lengths of the four sides of this card is 46 centimeters (cm) and the length of the width is 7 centimeters (cm) longer than the length of the length, find the length in centimeters (cm) of the width of this card. | 15 | 46 2 [OP_DIV] 7 [OP_SUB] 2 [OP_DIV] 7 [OP_ADD] | var_a = 46
var_b = 2
var_c = var_a / var_b
var_d = 7
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
var_h = 7
var_i = var_g + var_h
print(int(var_i)) |
Correspondence | Find the smallest natural number B such that 360÷(A×A×A/B)=5 | 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)) |
Arithmetic calculation | There are 9/5, 1/10, 1/2, and 1/6. What do you get if you add them all together? | 2.57 | 9/5 1/10 [OP_ADD] 1/2 [OP_ADD] 1/6 [OP_ADD] | var_a = 1.8
var_b = 0.1
var_c = var_a + var_b
var_d = 0.5
var_e = var_c + var_d
var_f = 0.16666666666666666
var_g = var_e + var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Comparison | Factory A made 40,680 toys with 60 machines, and Factory B made 37,510 toys with 55 machines. Which factory made more toys per machine on average? | B | [OP_LIST_SOL] A B [OP_LIST_EOL] [OP_LIST_SOL] 40680 60 [OP_DIV] 37510 55 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'A'
var_b = 'B'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 40680
var_d = 60
var_e = var_c / var_d
var_f = 37510
var_g = 55
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 | Of the 13 animals, 6 are black and all others are white. How many white animals are there? | 7 | 13 6 [OP_SUB] | var_a = 13
var_b = 6
var_c = var_a - var_b
print(int(var_c)) |
Possibility | There are three number cards 1, 7 and 3. When two of these are used to form the largest two-digit number, find the unused number. | 1 | [OP_LIST_SOL] 1 7 3 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] [OP_LIST_POP] [OP_NUM2LIST] [OP_SET_DIFFERENCE] 1 [OP_LIST_GET] | var_a = 1
var_b = 7
var_c = 3
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 2
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
list_d = []
var_f = int(var_f)
while var_f//10 > 0:
list_d.append(var_f%10)
var_f = var_f//10
list_d.append(var_f%10)
list_d = list_d[::-1]
list_e = list(set(list_a) - set(list_d))
var_g = 1
var_h = list_e[var_g-1]
print(int(var_h)) |
Possibility | Make a three-digit number by drawing the number cards from 0 to 9 once. Then, find the sum of the 2nd largest and the 2nd smallest of these numbers. | 1089 | 0 9 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PERM] 2 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_ADD] | var_a = 0
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]
var_e = 2
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = 2
list_d=list_b.copy()
list_d.sort()
var_h = list_d[var_g-1]
var_i = var_f + var_h
print(int(var_i)) |
Geometry | After arranging several pencil cases into a square shape, there were 6 pencil cases left. So, I tried to increase the width and length by one row, but 11 pencil cases was not enough. If the pencil cases are lined up in 7 rows, how many pencil cases are there in one row? | 10 | 6 11 [OP_ADD] 1 [OP_SUB] 2 [OP_DIV] 2 [OP_POW] 6 [OP_ADD] 7 [OP_DIV] | var_a = 6
var_b = 11
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 = 6
var_k = var_i + var_j
var_l = 7
var_m = var_k / var_l
print(int(var_m)) |
Comparison | What is the second largest number among 5, 8, 4, 3, and 7? | 7 | [OP_LIST_SOL] 5 8 4 3 7 [OP_LIST_EOL] 2 [OP_LIST_MAX] | var_a = 5
var_b = 8
var_c = 4
var_d = 3
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 = 2
list_b=list_a.copy()
list_b.sort()
var_g = list_b[-var_f]
print(int(var_g)) |
Arithmetic calculation | Donghyeon's class teacher gives away compliment stickers to classmates whenever they do a good deed. If 10 students each received 5, 6, 5, 5, 6, 4, 5, 5, 6, 7 compliment stickers, how many students received 5 compliment stickers? | 5 | [OP_LIST_SOL] 5 6 5 5 6 4 5 5 6 7 [OP_LIST_EOL] 5 [OP_LIST_FIND_NUM] | var_a = 5
var_b = 6
var_c = 5
var_d = 5
var_e = 6
var_f = 4
var_g = 5
var_h = 5
var_i = 6
var_j = 7
list_a= []
if "/" in str(var_j):
var_j = eval(str(var_j))
list_a.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_a.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_a.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_a.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_a.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_k = 5
var_l = 0
var_k = int(var_k)
for i in list_a:
i = int(i)
if i == var_k:
var_l = var_l + 1
print(int(var_l)) |
Possibility | Find the sum of the smallest and largest numbers that are made up of 1, 2, and 5 and are greater than 100 and less than 1000. | 646 | [OP_LIST_SOL] 1 2 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD] | var_a = 1
var_b = 2
var_c = 5
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = 1
list_d=list_b.copy()
list_d.sort()
var_h = list_d[var_g-1]
var_i = var_f + var_h
print(int(var_i)) |
Geometry | If the area of the remaining paper is 13 square centimeters (cm2) after a cube is cut from a rectangular piece of paper measuring 40 centimeters (cm) long and 25 centimeters (cm) wide, how many centimeters (cm) is one edge of the cube? | 12 | 40 25 [OP_MUL] 136 [OP_SUB] 6 [OP_DIV] 1/2 [OP_POW] | var_a = 40
var_b = 25
var_c = var_a * var_b
var_d = 136
var_e = var_c - var_d
var_f = 6
var_g = var_e / var_f
var_h = 0.5
var_i = var_g ** var_h
print(int(var_i)) |
Correspondence | A club has 52 members. If 37 of them are men, how many of them are women? | 15 | 52 37 [OP_SUB] | var_a = 52
var_b = 37
var_c = var_a - var_b
print(int(var_c)) |
Geometry | There is a rhombus-shaped key holder. If the length of one diagonal of the key holder is 7.4 centimeters (cm) and the area is 21.46 square centimeters (cm2), how long is the other diagonal in centimeters (cm?) | 5.8 | 21.46 2 [OP_MUL] 7.4 [OP_DIV] | var_a = 21.46
var_b = 2
var_c = var_a * var_b
var_d = 7.4
var_e = var_c / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Correspondence | I multiplied a particular number by 4 and then multiplied again by 25 and I got 812. Find that particular number. | 8.12 | 812 25 [OP_DIV] 4 [OP_DIV] | var_a = 812
var_b = 25
var_c = var_a / var_b
var_d = 4
var_e = var_c / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Arithmetic calculation | What is the average of the natural numbers greater than 12 and less than 53? | 32.5 | 12 53 1 [OP_LIST_ARANGE] [OP_LIST_MEAN] | var_a = 12
var_b = 53
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
list_a = [float(i) for i in list_a]
var_d = sum(list_a)/len(list_a)
print('{:.2f}'.format(round(var_d+1e-10,2))) |
Arithmetic calculation | Hyorim's 6th graders decided to go on a field trip ahead of graduation. If 252 students and 8 teachers go together, the cost of renting a 41-seater bus is 300,000 won and the highway toll per bus is 7,500. How much does it cost to rent the bus and pay the toll? | 2152500 | 252 8 [OP_ADD] 41 [OP_DIV] 1 [OP_CEIL] 300000 7500 [OP_ADD] [OP_MUL] | var_a = 252
var_b = 8
var_c = var_a + var_b
var_d = 41
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))
var_h = 300000
var_i = 7500
var_j = var_h + var_i
var_k = var_g * var_j
print(int(var_k)) |
Correspondence | 9 is a number that 2 subtracted from the number and added with 4. Find what the number is. | 7 | 9 2 [OP_ADD] 4 [OP_SUB] | var_a = 9
var_b = 2
var_c = var_a + var_b
var_d = 4
var_e = var_c - var_d
print(int(var_e)) |
Comparison | The older brother and younger brother are going to share 25 stamps. If the older brother has 1 more stamp than twice the number of stamps the younger brother has, find how many stamps the older brother has. | 17 | 25 1 [OP_SUB] 2 1 [OP_ADD] [OP_DIV] 2 [OP_MUL] 1 [OP_ADD] | var_a = 25
var_b = 1
var_c = var_a - var_b
var_d = 2
var_e = 1
var_f = var_d + var_e
var_g = var_c / var_f
var_h = 2
var_i = var_g * var_h
var_j = 1
var_k = var_i + var_j
print(int(var_k)) |
Arithmetic calculation | There are 8 red apples, 5 green apples, and 9 tangerines. How many fewer tangerines than apples? | 4 | 8 5 [OP_ADD] 9 [OP_SUB] | var_a = 8
var_b = 5
var_c = var_a + var_b
var_d = 9
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | If the gap between a certain number and 5.46 is 3.97 and the number is less than 5.46, find the sum of the number and 5.46. | 6.95 | 5.46 5.46 3.97 [OP_SUB] [OP_ADD] | var_a = 5.46
var_b = 5.46
var_c = 3.97
var_d = var_b - var_c
var_e = var_a + var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Correspondence | When there is an equation, A72-23=549, find the number A. | 5 | A72-23=549 A [OP_DIGIT_UNK_SOLVER] | var_a = 'A72-23=549'
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 | I'm going to connect 20 masks, each 15.25 centimeters (cm) long. How many centimeters (cm) do I need to attach the masks so that the total is 248 centimeters (cm)? | 3 | 15.25 248 15.25 [OP_SUB] 20 1 [OP_SUB] [OP_DIV] [OP_SUB] | var_a = 15.25
var_b = 248
var_c = 15.25
var_d = var_b - var_c
var_e = 20
var_f = 1
var_g = var_e - var_f
var_h = var_d / var_g
var_i = var_a - var_h
print(int(var_i)) |
Correspondence | There are four-digit numbers that are divisible by 12. If the thousands digit is 2, how many of the four-digit numbers are there? | 83 | 2 1000 [OP_MUL] 2 1000 [OP_MUL] 999 [OP_ADD] 1 [OP_LIST_ARANGE] 12 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 2
var_b = 1000
var_c = var_a * var_b
var_d = 2
var_e = 1000
var_f = var_d * var_e
var_g = 999
var_h = var_f + var_g
var_i = 1
list_a = [i for i in range(var_c, var_h + 1, var_i)]
var_j = 12
list_b = []
var_j = int(var_j)
for i in list_a:
i = int(i)
if i % var_j == 0:
list_b.append(i)
var_k = len(list_b)
print(int(var_k)) |
Arithmetic calculation | How many three-digit numbers are divisible by the three numbers 2, 3, and 9? | 50 | 100 999 1 [OP_LIST_ARANGE] 2 [OP_LIST_DIVISIBLE] 3 [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 = 2
list_b = []
var_d = int(var_d)
for i in list_a:
i = int(i)
if i % var_d == 0:
list_b.append(i)
var_e = 3
list_c = []
var_e = int(var_e)
for i in list_b:
i = int(i)
if i % var_e == 0:
list_c.append(i)
var_f = 9
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 = len(list_d)
print(int(var_g)) |
Correspondence | I mistakenly subtracted a certain number from 63 when I had to subtract this number from 36, and it became 70. How much is it if calculated correctly? | 43 | 36 63 70 [OP_SUB] [OP_SUB] | var_a = 36
var_b = 63
var_c = 70
var_d = var_b - var_c
var_e = var_a - var_d
print(int(var_e)) |
Geometry | There is a box with a base in the shape of an equilateral triangular prism with a side of 13/12 meters (m). What are the minimum meters (m) of ribbon required to wrap the ribbon around the perimeter of this box? | 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))) |
Geometry | Find the area of a rectangle whose width is 25 centimeters (cm) and its length is 20 centimeters (cm). | 500 | 25 20 [OP_MUL] | var_a = 25
var_b = 20
var_c = var_a * var_b
print(int(var_c)) |
Comparison | Jiwoo drank 1100 milliliters (ml) of milk, 3 liters (l) and 400 milliliters (ml) of juice. When Jungkook drank 4 liters (l) and 800 milliliters (ml) of water, who drank more? | Jungkook | [OP_LIST_SOL] Jungkook Jiwoo [OP_LIST_EOL] [OP_LIST_SOL] 4 1000 [OP_MUL] 800 [OP_ADD] 1100 3 1000 [OP_MUL] 400 [OP_ADD] [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Jungkook'
var_b = 'Jiwoo'
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 = 1000
var_e = var_c * var_d
var_f = 800
var_g = var_e + var_f
var_h = 1100
var_i = 3
var_j = 1000
var_k = var_i * var_j
var_l = 400
var_m = var_k + var_l
var_n = var_h + var_m
list_b= []
if "/" in str(var_n):
var_n = eval(str(var_n))
list_b.append(var_n)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
list_b.reverse()
var_o = 1
list_c=list_b.copy()
list_c.sort()
var_p = list_c[-var_o]
var_q = list_b.index(var_p)+1
var_r = list_a[var_q-1]
print(var_r) |
Comparison | When students standing in a line, Yoojung was at the very back. And there are 8 students standing between Eunjeong and Yoojung. If Eunjeong was at 5th place from the front, how many students were there? | 14 | 5 8 [OP_ADD] 1 [OP_ADD] | var_a = 5
var_b = 8
var_c = var_a + var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Geometry | After arranging several cans of soda in a square shape, there were 6 cans left. So, I tried to increase the width and length by one row, but 11 cans were inadequate. If you arrange these cans in 7 rows, how many cans are there in one row? | 10 | 6 11 [OP_ADD] 1 [OP_SUB] 2 [OP_DIV] 2 [OP_POW] 6 [OP_ADD] 7 [OP_DIV] | var_a = 6
var_b = 11
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 = 6
var_k = var_i + var_j
var_l = 7
var_m = var_k / var_l
print(int(var_m)) |
Comparison | Jungkook is taller than Yoongi. Namjoon is taller than Jungkook and shorter than Yuna. Which of the 4 people is the shortest? | Yoongi | [OP_LIST_SOL] Jungkook Yoongi Namjoon Yuna [OP_LIST_EOL] [OP_LIST_SOL] Jungkook Yoongi > Namjoon Jungkook > Namjoon Yuna < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | var_a = 'Jungkook'
var_b = 'Yoongi'
var_c = 'Namjoon'
var_d = 'Yuna'
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 = 'Jungkook'
var_f = 'Yoongi'
var_g = '>'
var_h = 'Namjoon'
var_i = 'Jungkook'
var_j = '>'
var_k = 'Namjoon'
var_l = 'Yuna'
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) |
Correspondence | I have a three-digit A27. When I round down this number from the hundreds place, I get 200. Find A. | 2 | A27 [OP_GEN_POSSIBLE_LIST] 200 [OP_LIST_MORE_EQUAL] 200 100 [OP_ADD] [OP_LIST_LESS] A [OP_LIST_FIND_UNK] | var_a = 'A27'
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 = 200
list_b = []
for i in list_a:
if i >= var_b:
list_b.append(i)
var_c = 200
var_d = 100
var_e = var_c + var_d
list_c = []
for i in list_b:
if i < var_e:
list_c.append(i)
var_f = 'A'
var_a = str(var_a)
var_f = str(var_f)
unk_idx = var_a.index(var_f)
var_g = 0
for elem in list_c:
elem = str(elem)
var_g = int(elem[unk_idx])
print(int(var_g)) |
Possibility | You are trying to create a three-digit number by drawing 3 of the 4 number cards 1, 3, 4, 7, and using them only once. How many possible numbers are greater than 360 and less than or equal to 455? | 6 | [OP_LIST_SOL] 1 3 4 7 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 360 [OP_LIST_MORE] 455 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN] | var_a = 1
var_b = 3
var_c = 4
var_d = 7
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 = 360
list_c = []
for i in list_b:
if i > var_f:
list_c.append(i)
var_g = 455
list_d = []
for i in list_c:
if i <= var_g:
list_d.append(i)
var_h = len(list_d)
print(int(var_h)) |
Correspondence | Subtracting 7 from a number gives 9. What is the product of multiplying a number 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)) |
Comparison | There are three numbers 0.8, 1/2, and 9. Which of the numbers greater than or equal to 2? | 9 | [OP_LIST_SOL] 0.8 1/2 9 [OP_LIST_EOL] 2 [OP_LIST_MORE_EQUAL] 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 | I handed out erasers to both classes. In Dohun’s class, 15 people share 45 erasers, and in Kihun’s class, 5 people share 30 erasers. In which class will one student have more eraser? | Kihun | [OP_LIST_SOL] Dohun Kihun [OP_LIST_EOL] [OP_LIST_SOL] 45 15 [OP_DIV] 30 5 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Dohun'
var_b = 'Kihun'
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 = 45
var_d = 15
var_e = var_c / var_d
var_f = 30
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) |
Correspondence | A is 634. A is 593 greater than C. C is 482 less than B. Get B. | 523 | 634 593 [OP_SUB] 482 [OP_ADD] | var_a = 634
var_b = 593
var_c = var_a - var_b
var_d = 482
var_e = var_c + var_d
print(int(var_e)) |
Correspondence | Yoongi subtracted 7 from a certain number and got 9. What is this number multiplied by 3? | 48 | 9 7 [OP_ADD] 3 [OP_MUL] | var_a = 9
var_b = 7
var_c = var_a + var_b
var_d = 3
var_e = var_c * var_d
print(int(var_e)) |
Correspondence | Subtracting 46 from a number resulted in 15. Find how much it would be when 29 is subtracted from this number. | 32 | 15 46 [OP_ADD] 29 [OP_SUB] | var_a = 15
var_b = 46
var_c = var_a + var_b
var_d = 29
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | Gyeong-hun climbed the mountain, walking at 3 kilometers (km) per hour on the way up and walking at 4 kilometers (km) per hour on the way down, taking an extra 2 kilometers (km) on the way down, for a total of 4 hours. How far did Gyeong-hun go? | 8 | 4 2 4 [OP_DIV] [OP_SUB] 1 3 [OP_DIV] 1 4 [OP_DIV] [OP_ADD] [OP_DIV] 2 [OP_ADD] | var_a = 4
var_b = 2
var_c = 4
var_d = var_b / var_c
var_e = var_a - var_d
var_f = 1
var_g = 3
var_h = var_f / var_g
var_i = 1
var_j = 4
var_k = var_i / var_j
var_l = var_h + var_k
var_m = var_e / var_l
var_n = 2
var_o = var_m + var_n
print(int(var_o)) |
Possibility | How many four-digit numbers formed by using 1, 3, 7, and 9 once have a 7 in the ones place? | 6 | [OP_LIST_SOL] 1 3 7 9 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 1 7 [OP_LIST_SEARCH_FIXED_DIGIT] [OP_LIST_LEN] | var_a = 1
var_b = 3
var_c = 7
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 = 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 = 1
var_g = 7
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)) |
Arithmetic calculation | Find the smallest divisor of 28. | 1 | 28 [OP_LIST_GET_DIVISOR] 1 [OP_LIST_MIN] | var_a = 28
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 = 1
list_b=list_a.copy()
list_b.sort()
var_c = list_b[var_b-1]
print(int(var_c)) |
Geometry | What do you get if you add all the numbers of sides of a rectangle, triangle, and a circle? | 7 | 0 3 [OP_ADD] 4 [OP_ADD] | var_a = 0
var_b = 3
var_c = var_a + var_b
var_d = 4
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | There are four numbers 10, 11, 12, and 13. What is the sum of the smallest number and the next smallest number? | 21 | [OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_ADD] | 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 = 1
list_b=list_a.copy()
list_b.sort()
var_f = list_b[var_e-1]
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(int(var_i)) |
Possibility | Find the largest quotient of (three-digit number) ÷ (two-digit number) using the number cards 4, 2, 8, 1, 9 only once. | 82 | [OP_LIST_SOL] 4 2 8 1 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] [OP_LIST_POP] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] [OP_FDIV] | var_a = 4
var_b = 2
var_c = 8
var_d = 1
var_e = 9
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 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]
var_i = 2
list_d = [str(i) for i in list_a]
list_d = list(itertools.permutations(list_d, var_i))
list_d = [''.join(num_list) for num_list in list_d]
list_d = [str_num for str_num in list_d if str_num[0] != '0']
list_d = [float(i) for i in list_d]
var_j = 1
list_e=list_d.copy()
list_e.sort()
var_k = list_e[var_j-1]
var_l = var_h // var_k
print(int(var_l)) |
Geometry | I am trying to make a square as small as possible by arranging rectangular bricks 12 centimeters (cm) wide and 15 centimeters (cm) long without overlapping. How many bricks will you need altogether? | 20 | 12 15 [OP_LCM] 2 [OP_POW] 12 15 [OP_MUL] [OP_DIV] | var_a = 12
var_b = 15
var_c = var_b * var_a / math.gcd(int(var_b), int(var_a))
var_d = 2
var_e = var_c ** var_d
var_f = 12
var_g = 15
var_h = var_f * var_g
var_i = var_e / var_h
print(int(var_i)) |
Correspondence | 51 is the result of mistakenly subtracting 6 from a number instead of multipling by 6. How much is it if you calculate it correctly? | 342 | 51 6 [OP_ADD] 6 [OP_MUL] | var_a = 51
var_b = 6
var_c = var_a + var_b
var_d = 6
var_e = var_c * var_d
print(int(var_e)) |
Correspondence | Jihoon cut a fishing line to make a fishing rod. When you add 3.1 meters (m) to the current length of this fishing line, multiply it 3.1 times, and then multiply it again by 2.1 it becomes the length of the original fishing line. If the length of the fishing line of Ji-hoon's fishing rod is 8.9 meters (m), find the original length of the fishing line in meters (m). | 78.12 | 8.9 3.1 [OP_ADD] 3.1 [OP_MUL] 2.1 [OP_MUL] | var_a = 8.9
var_b = 3.1
var_c = var_a + var_b
var_d = 3.1
var_e = var_c * var_d
var_f = 2.1
var_g = var_e * var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Comparison | 19 toys are placed in a row. If Toy (A) is 8th from the right, where is toy (A) placed from the left? | 12 | 19 8 [OP_SUB] 1 [OP_ADD] | var_a = 19
var_b = 8
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | A bundle of colored paper includes 10 sheets. When Jungkook has 3 bundles and 8 more individual sheets, how many sheets of colored paper does Jungkook have? | 38 | 10 3 [OP_MUL] 8 [OP_ADD] | var_a = 10
var_b = 3
var_c = var_a * var_b
var_d = 8
var_e = var_c + var_d
print(int(var_e)) |
Comparison | What is the sum of all numbers less than 0.4 among 0.8, 1/2, 0.9, and 1/3? | 0.33 | [OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 0.4 [OP_LIST_LESS] [OP_LIST_SUM] | 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.4
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))) |
Comparison | Yuna, Eunji, Minyoung, and Yoojeong are having a flying contest. Minyoung flew farther than Eunji, and Eunji flew farther than Yoojeong, and Yuna flew farther than Yoojeong. When Minyoung flew farther than Yoojeong, who came last in the competition? | Yoojeong | [OP_LIST_SOL] Yuna Eunji Minyoung Yoojeong [OP_LIST_EOL] [OP_LIST_SOL] Yuna Yoojeong > Minyoung Eunji > Eunji Yoojeong > Yoojeong Minyoung < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | var_a = 'Yuna'
var_b = 'Eunji'
var_c = 'Minyoung'
var_d = 'Yoojeong'
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 = 'Yuna'
var_f = 'Yoojeong'
var_g = '>'
var_h = 'Minyoung'
var_i = 'Eunji'
var_j = '>'
var_k = 'Eunji'
var_l = 'Yoojeong'
var_m = '>'
var_n = 'Yoojeong'
var_o = 'Minyoung'
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) |
Geometry | A cube with a volume of 3375 cubic centimeters (cm3) is made by stacking building blocks with a volume of 1 cubic centimeters (cm3). How many layers are there in this building of cubes? | 15 | 3375 1/3 [OP_POW] | var_a = 3375
var_b = 0.3333333333333333
var_c = var_a ** var_b
print(int(eval('{:.2f}'.format(round(var_c+1e-10,2))))) |
Correspondence | If A-10=15, what number should go in A? | 25 | A-10=15 A [OP_NUM_UNK_SOLVER] | var_a = 'A-10=15'
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]
print(int(var_c)) |
Arithmetic calculation | Find the number of numbers less than or equal to 6 among single-digit even numbers. | 3 | 1 9 [OP_LIST_EVEN] 6 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN] | 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 = 6
list_b = []
for i in list_a:
if i <= var_c:
list_b.append(i)
var_d = len(list_b)
print(int(var_d)) |
Arithmetic calculation | What is the largest four-digit number that can be formed using 1, 2, 4, 6, and 5, where each digit is different? | 6542 | [OP_LIST_SOL] 1 2 4 6 5 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] | var_a = 1
var_b = 2
var_c = 4
var_d = 6
var_e = 5
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 = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_f))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
print(int(var_h)) |
Arithmetic calculation | There were 7 buses in the parking lot, but after a while 6 more came. How many buses are currently in the parking lot? | 13 | 7 6 [OP_ADD] | var_a = 7
var_b = 6
var_c = var_a + var_b
print(int(var_c)) |
Geometry | There is a cube with a side length of 8 centimeters (cm). What is the surface area of this cube? | 384 | 8 2 [OP_POW] 6 [OP_MUL] | var_a = 8
var_b = 2
var_c = var_a ** var_b
var_d = 6
var_e = var_c * var_d
print(int(var_e)) |
Comparison | Nine people are standing in a line in order of height from shortest to tallest. Hoseok is standing at the tail end, and Yuna is standing 5th in front of Hoseok. If you line up again in order from tallest to shortest, in what number from the front will Yuna stand? | 6 | 9 9 [OP_SUB] 5 [OP_ADD] 1 [OP_ADD] | var_a = 9
var_b = 9
var_c = var_a - var_b
var_d = 5
var_e = var_c + var_d
var_f = 1
var_g = var_e + var_f
print(int(var_g)) |
Comparison | The blue bus takes 4 hours to cover 200 kilometers (km), and the green bus takes 3 hours to cover 180 kilometers (km). What color bus should you use to get to the destination quickly? | green | [OP_LIST_SOL] blue green [OP_LIST_EOL] [OP_LIST_SOL] 200 4 [OP_DIV] 180 3 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'blue'
var_b = 'green'
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 = 200
var_d = 4
var_e = var_c / var_d
var_f = 180
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]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l) |
Geometry | There is a regular tetrahedron with a side length of 7 centimeters (cm). What is the surface area of this tetrahedron in square centimeters (cm2)? | 84.87 | 3 1/2 [OP_POW] 7 2 [OP_POW] [OP_MUL] | var_a = 3
var_b = 0.5
var_c = var_a ** var_b
var_d = 7
var_e = 2
var_f = var_d ** var_e
var_g = var_c * var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Correspondence | 73 is the result when you subtract 50 from a number, divide it by 4, multiply this by 3 again, and then add 28. What is this number? | 110 | 73 28 [OP_SUB] 3 [OP_DIV] 4 [OP_MUL] 50 [OP_ADD] | var_a = 73
var_b = 28
var_c = var_a - var_b
var_d = 3
var_e = var_c / var_d
var_f = 4
var_g = var_e * var_f
var_h = 50
var_i = var_g + var_h
print(int(var_i)) |
Correspondence | There are two different numbers A and B. Find the sum of A and B in 9A6-BB=BBB. | 15 | 9A6-BB=BBB A [OP_DIGIT_UNK_SOLVER] 9A6-BB=BBB B [OP_DIGIT_UNK_SOLVER] [OP_ADD] | var_a = '9A6-BB=BBB'
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]
var_d = '9A6-BB=BBB'
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] = 1
candi = list(itertools.product('0123456789', 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)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_d):
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_f = ans_dict[var_e]
var_g = var_c + var_f
print(int(var_g)) |
Comparison | There are four numbers in total: 0.8, 1/2, 0.5, and 1/3. How many of them are greater than or equal to 3? | 0 | [OP_LIST_SOL] 0.8 1/2 0.5 1/3 [OP_LIST_EOL] 3 [OP_LIST_MORE_EQUAL] [OP_LIST_LEN] | 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 = 3
list_b = []
for i in list_a:
if i >= var_e:
list_b.append(i)
var_f = len(list_b)
print(int(var_f)) |
Comparison | Two boxes A and B have been delivered. Yoojeong is going to take the smaller of the two boxes. If the box A is bigger than the box B, which box should Yoojeong take? | B | [OP_LIST_SOL] A B [OP_LIST_EOL] [OP_LIST_SOL] A B > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | var_a = 'A'
var_b = 'B'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 'A'
var_d = 'B'
var_e = '>'
list_b= []
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)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_b.append(var_c)
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_f = len(list_c)
var_g = list_c[var_f-1]
print(var_g) |
Geometry | How many diagonals can be drawn in a rectangle? | 2 | 4 4 3 [OP_SUB] [OP_MUL] 2 [OP_DIV] | var_a = 4
var_b = 4
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)) |
Comparison | Seongcheol used 5 liters (l) of water to wash his face, and Seongcheol's younger brother used 4900 milliliters (ml) of water. Find who used more water. | Seongcheol | [OP_LIST_SOL] Seongcheol brother [OP_LIST_EOL] [OP_LIST_SOL] 5 1000 [OP_MUL] 4900 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Seongcheol'
var_b = 'brother'
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 = 5
var_d = 1000
var_e = var_c * var_d
var_f = 4900
list_b= []
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j) |
Arithmetic calculation | The distance from Namjoon's house to the school is 1.2 kilometers (km). If Namjoon returned home and returned to school at the point of 0.3 kilometers (km), find how many kilometers (km) he walked more than usual, including the decimal point. | 0.6 | 1.2 0.3 2 [OP_MUL] [OP_ADD] 1.2 [OP_SUB] | var_a = 1.2
var_b = 0.3
var_c = 2
var_d = var_b * var_c
var_e = var_a + var_d
var_f = 1.2
var_g = var_e - var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Arithmetic calculation | There are three numbers 10, 11, and 12. What is the product of the second largest number and the second smallest number? | 121 | [OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 2 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_MUL] | var_a = 10
var_b = 11
var_c = 12
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=list_a.copy()
list_b.sort()
var_e = list_b[-var_d]
var_f = 2
list_c=list_a.copy()
list_c.sort()
var_g = list_c[var_f-1]
var_h = var_e * var_g
print(int(var_h)) |
Arithmetic calculation | Heeju's school has 500 students. Among them, 289 students like mountains and 337 students like the sea. If there are 56 students who neither like the mountains nor the sea, how many students like both the mountains and the sea? | 182 | 289 337 [OP_ADD] 500 56 [OP_SUB] [OP_SUB] | var_a = 289
var_b = 337
var_c = var_a + var_b
var_d = 500
var_e = 56
var_f = var_d - var_e
var_g = var_c - var_f
print(int(var_g)) |
Possibility | Yuna, Taehyung, and Jimin are going to choose two among them to do the chores. How many different cases are there in all? | 3 | [OP_LIST_SOL] Yuna Taehyung Jimin [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_COMB] | var_a = 'Yuna'
var_b = 'Taehyung'
var_c = 'Jimin'
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)) |
Correspondence | You want to add 24 to some number. If the answer when adding 42 incorrectly is 50, what is the correct calculation result? | 32 | 50 42 [OP_SUB] 24 [OP_ADD] | var_a = 50
var_b = 42
var_c = var_a - var_b
var_d = 24
var_e = var_c + var_d
print(int(var_e)) |
Possibility | One boy and one girl have transferred to Eunsu's school. Eunsu's school has 6 classes for boys and 4 classes for girls. How many classes can transfer students go to? | 24 | 4 6 [OP_MUL] | var_a = 4
var_b = 6
var_c = var_a * var_b
print(int(var_c)) |
Comparison | Seokjin, Hoseok, and Namjoon took a math test. Namjoon's math score is higher than Hoseok's math score, and Seokjin's math score is higher than Hoseok's math score. If Seokjin's math score is lower than Namjoon's math score, who has the highest math score? | Namjoon | [OP_LIST_SOL] Seokjin Hoseok Namjoon [OP_LIST_EOL] [OP_LIST_SOL] Seokjin Hoseok > Namjoon Hoseok > Seokjin Namjoon < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET] | var_a = 'Seokjin'
var_b = 'Hoseok'
var_c = 'Namjoon'
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 = 'Seokjin'
var_e = 'Hoseok'
var_f = '>'
var_g = 'Namjoon'
var_h = 'Hoseok'
var_i = '>'
var_j = 'Seokjin'
var_k = 'Namjoon'
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) |
Possibility | How many three-digit numbers greater than 850 and less than 920 can you make using the numbers 3, 9 and 8? | 1 | [OP_LIST_SOL] 3 9 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 850 [OP_LIST_MORE] 920 [OP_LIST_LESS] [OP_LIST_LEN] | var_a = 3
var_b = 9
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 = 850
list_c = []
for i in list_b:
if i > var_e:
list_c.append(i)
var_f = 920
list_d = []
for i in list_c:
if i < var_f:
list_d.append(i)
var_g = len(list_d)
print(int(var_g)) |
Geometry | A rectangle was made with a 40 centimeters (cm) wire. If the length of one side is 8 centimeters (cm), what is the length of the other side in centimeters (cm)? | 12 | 40 2 [OP_DIV] 8 [OP_SUB] | var_a = 40
var_b = 2
var_c = var_a / var_b
var_d = 8
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | If 9 more people left the bus than the ones who got on at the stop, how many people are on the bus now given that the bus originally had 38 people on it? | 29 | 38 9 [OP_SUB] | var_a = 38
var_b = 9
var_c = var_a - var_b
print(int(var_c)) |
Possibility | You want to create four-digit numbers by using the numbers 7, 2, 5, and 9. How many four-digit numbers can you make? The same number can appear multiple times. | 256 | [OP_LIST_SOL] 7 2 5 9 [OP_LIST_EOL] 4 [OP_LIST_GET_PRODUCT] [OP_LIST_LEN] | var_a = 7
var_b = 2
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 = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=var_e))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_f = len(list_b)
print(int(var_f)) |
Comparison | Among the students standing in line, Yoongi is standing where 7 people are on the left and 5 people are on the right. Including Yoongi, how many people are standing in line? | 13 | 7 5 [OP_ADD] 1 [OP_ADD] | var_a = 7
var_b = 5
var_c = var_a + var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | Hoseok has 138 pieces of purple-colored paper. Hoseok has 119 more yellow-colored paper than blue-colored paper, and 185 less purple-colored paper than yellow-colored paper. How many purple, yellow, and blue-colored paper does Hoseok have in total? | 467 | 138 138 119 [OP_ADD] [OP_ADD] 138 119 [OP_ADD] 185 [OP_SUB] [OP_ADD] | var_a = 138
var_b = 138
var_c = 119
var_d = var_b + var_c
var_e = var_a + var_d
var_f = 138
var_g = 119
var_h = var_f + var_g
var_i = 185
var_j = var_h - var_i
var_k = var_e + var_j
print(int(var_k)) |
Comparison | Jimin, Yoongi, Taehyung, and Namjoon have different numbers of apples. If Taehyung has fewer than Namjoon, Jimin has more than Yoongi, and Yoongi has more than Namjoon, who has the fewest apples? | Taehyung | [OP_LIST_SOL] Jimin Yoongi Taehyung Namjoon [OP_LIST_EOL] [OP_LIST_SOL] Jimin Yoongi > Taehyung Namjoon < Yoongi Namjoon > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | var_a = 'Jimin'
var_b = 'Yoongi'
var_c = 'Taehyung'
var_d = 'Namjoon'
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 = 'Jimin'
var_f = 'Yoongi'
var_g = '>'
var_h = 'Taehyung'
var_i = 'Namjoon'
var_j = '<'
var_k = 'Yoongi'
var_l = 'Namjoon'
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) |
Arithmetic calculation | Taehyung and Minyoung had a walking race. One minute later, Taehyung walked 114 meters (m) and Minyoung walked 79 meters (m). After 1 hour, how many meters (m) will Taehyung have walked more than Minyoung? | 2100 | 114 79 [OP_SUB] 1 [OP_MUL] 60 [OP_MUL] | var_a = 114
var_b = 79
var_c = var_a - var_b
var_d = 1
var_e = var_c * var_d
var_f = 60
var_g = var_e * var_f
print(int(var_g)) |
Correspondence | Adding 2 to a particular number and subtracting 6, and multiplying it by 3 and dividing it by 4 equals 3. Find that particular number. | 8 | 3 4 [OP_MUL] 3 [OP_DIV] 6 [OP_ADD] 2 [OP_SUB] | var_a = 3
var_b = 4
var_c = var_a * var_b
var_d = 3
var_e = var_c / var_d
var_f = 6
var_g = var_e + var_f
var_h = 2
var_i = var_g - var_h
print(int(var_i)) |
Correspondence | If the sum of the weights of Jiho, Sanghyeon, and Seungju is greater than 280 and the remainder is 30 when divided by 70, what is the minimum sum of the weights of the three people? | 310 | 280 30 [OP_ADD] | var_a = 280
var_b = 30
var_c = var_a + var_b
print(int(var_c)) |
Correspondence | When multiplied by 4, this number became 28. Find this number. | 7 | 28 4 [OP_DIV] | var_a = 28
var_b = 4
var_c = var_a / var_b
print(int(var_c)) |
Geometry | What is the sum of the number of vertices and the number of sides of a triangle? | 6 | 3 3 [OP_ADD] | var_a = 3
var_b = 3
var_c = var_a + var_b
print(int(var_c)) |
Arithmetic calculation | There are three numbers 10, 11, and 12. Divide the smallest number by the second smallest number. | 0.91 | [OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_DIV] | var_a = 10
var_b = 11
var_c = 12
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 = 1
list_b=list_a.copy()
list_b.sort()
var_e = list_b[var_d-1]
var_f = 2
list_c=list_a.copy()
list_c.sort()
var_g = list_c[var_f-1]
var_h = var_e / var_g
print('{:.2f}'.format(round(var_h+1e-10,2))) |
Correspondence | We added 2 to a certain number and then subtracted 6. Multiply this by 3 and then divide by 4 and we get 3. What is that number? | 8 | 3 4 [OP_MUL] 3 [OP_DIV] 6 [OP_ADD] 2 [OP_SUB] | var_a = 3
var_b = 4
var_c = var_a * var_b
var_d = 3
var_e = var_c / var_d
var_f = 6
var_g = var_e + var_f
var_h = 2
var_i = var_g - var_h
print(int(var_i)) |
Arithmetic calculation | The chicken laid 59 more eggs today than yesterday. If the chicken laid 10 eggs yesterday, how many eggs did it lay today? | 69 | 10 59 [OP_ADD] | var_a = 10
var_b = 59
var_c = var_a + var_b
print(int(var_c)) |
Correspondence | When A is divided by 5, the quotient is 2 and the remainder is B. A and B are both natural numbers. What is the largest possible value of B? | 4 | 5 1 [OP_SUB] | var_a = 5
var_b = 1
var_c = var_a - var_b
print(int(var_c)) |
Geometry | I am trying to find the radius of a lake that has the shape of a circle. If the diameter of this lake is 26 meters (m), what is the radius of the lake in meters (m)? | 13 | 26 2 [OP_DIV] | var_a = 26
var_b = 2
var_c = var_a / var_b
print(int(var_c)) |
Comparison | 2/7 of the sports day participants are on the white team and 3/8 are on the blue team. Which team has more participants? | blue | [OP_LIST_SOL] white blue [OP_LIST_EOL] [OP_LIST_SOL] 2 7 [OP_DIV] 3 8 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'white'
var_b = 'blue'
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
var_d = 7
var_e = var_c / var_d
var_f = 3
var_g = 8
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) |
Possibility | How many cases are available if you choose and buy 2 different fruits among apples, peaches, pears, melons, and tangerines? | 10 | [OP_LIST_SOL] apples peaches pears melons tangerines [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_COMB] | var_a = 'apples'
var_b = 'peaches'
var_c = 'pears'
var_d = 'melons'
var_e = 'tangerines'
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = len(list_a)
var_g = 2
var_h = 1
var_f = int(var_f)
var_g = int(var_g)
for i, elem in enumerate(range(var_g)):
var_h = var_h * (var_f-i)
for i, elem in enumerate(range(var_g)):
var_h = var_h / (i+1)
print(int(var_h)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.