category
stringclasses 5
values | question
stringlengths 20
555
| answer
stringlengths 1
20
| solution_abst
stringlengths 1
287
| solution_code
stringlengths 27
5.97k
|
---|---|---|---|---|
Arithmetic calculation | Five dictionaries weighing 1050 grams (g) each were placed on one side of the two-arm scale. Two of nine identical books, each weighing 4.5 kilograms (kg), were placed on opposite sides of a two-arm scale. How many more 850-gram (g) pencil cases should be placed on the side where the books are placed to level the scale? | 5 | 1050 5 [OP_MUL] 4.5 1000 [OP_MUL] 9 [OP_DIV] 2 [OP_MUL] [OP_SUB] 850 [OP_DIV] | var_a = 1050
var_b = 5
var_c = var_a * var_b
var_d = 4.5
var_e = 1000
var_f = var_d * var_e
var_g = 9
var_h = var_f / var_g
var_i = 2
var_j = var_h * var_i
var_k = var_c - var_j
var_l = 850
var_m = var_k / var_l
print(int(var_m)) |
Geometry | Some maps have a scale of 1/250000. Given two points whose actual distance is 5 kilometers (km), find the length in centimeters (cm) on the map. | 2 | 5 100 1000 [OP_MUL] [OP_MUL] 1/250000 [OP_MUL] | var_a = 5
var_b = 100
var_c = 1000
var_d = var_b * var_c
var_e = var_a * var_d
var_f = 4e-06
var_g = var_e * var_f
print(int(var_g)) |
Correspondence | You made a mistake in dividing a certain number by 8, so you multiplied it by 8 and added 8 to get 56. Show how much it would be if you did it correctly, to two decimal places. | 0.75 | 56 8 [OP_SUB] 8 [OP_DIV] 8 [OP_DIV] | var_a = 56
var_b = 8
var_c = var_a - var_b
var_d = 8
var_e = var_c / var_d
var_f = 8
var_g = var_e / var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Correspondence | 752AB which is five digit number is divisible by 3. If A and B can contain numbers from 0 to 9, how many numbers satisfy the condition? | 33 | 752AB [OP_GEN_POSSIBLE_LIST] 3 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = '752AB'
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 = 3
list_b = []
var_b = int(var_b)
for i in list_a:
i = int(i)
if i % var_b == 0:
list_b.append(i)
var_c = len(list_b)
print(int(var_c)) |
Geometry | How many edges are there on the face of a regular tetrahedron? | 3 | 3 | var_a = 3
print(int(var_a)) |
Comparison | Choose a number greater than 1.1 from among 1.4, 9/10, 1.2, 0.5, and 13/10, and find the sum of the selected numbers | 3.9 | [OP_LIST_SOL] 1.4 9/10 1.2 0.5 13/10 [OP_LIST_EOL] 1.1 [OP_LIST_MORE] [OP_LIST_SUM] | var_a = 1.4
var_b = 0.9
var_c = 1.2
var_d = 0.5
var_e = 1.3
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.1
list_b = []
for i in list_a:
if i > var_f:
list_b.append(i)
list_b = [float(i) for i in list_b]
var_g = sum(list_b)
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Correspondence | I divided a number by 16 incorrectly, which was supposed to be multiplied by 16, and the quotient is divided by 8. Find the correct calculated value. | 2048 | 8 16 [OP_MUL] 16 [OP_MUL] | var_a = 8
var_b = 16
var_c = var_a * var_b
var_d = 16
var_e = var_c * var_d
print(int(var_e)) |
Correspondence | There are 901 Go balls. If you need a total of 53 Go balls to play a Go game, find the number of Go games that can be played simultaneously. | 17 | 1 53 901 [OP_DIV] [OP_DIV] | var_a = 1
var_b = 53
var_c = 901
var_d = var_b / var_c
var_e = var_a / var_d
print(int(var_e)) |
Comparison | Seongmin and Danbi made Pepero. Seongmin made 12 meters (m) and Danbi made 9 meters (m). Which of the two made it longer? | Seongmin | [OP_LIST_SOL] Seongmin Danbi [OP_LIST_EOL] [OP_LIST_SOL] 12 9 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Seongmin'
var_b = 'Danbi'
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 = 12
var_d = 9
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 | Woojin's family harvested potatoes in the field. The younger brother dug out 3.8 kilograms (kg), and the older sister dug out 8.4 kilograms (kg) more than the younger brother did. If Woojin dug out 3720 grams (g) more than 1/10 of the weight of her sister did, how many kilograms (kg) of Woojin's harvested potatoes? | 4.94 | 3.8 8.4 [OP_ADD] 1/10 [OP_MUL] 3720 1000 [OP_DIV] [OP_ADD] | var_a = 3.8
var_b = 8.4
var_c = var_a + var_b
var_d = 0.1
var_e = var_c * var_d
var_f = 3720
var_g = 1000
var_h = var_f / var_g
var_i = var_e + var_h
print('{:.2f}'.format(round(var_i+1e-10,2))) |
Arithmetic calculation | Find the total amount of bread in 3 bags containing 3 loaves. | 9 | 3 3 [OP_MUL] | 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. What is the quotient of the second largest number divided by the smallest number? | 1 | [OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 2 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_FDIV] | 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 = 1
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)) |
Comparison | There is a square with a side length of 7 centimeters (cm), an equilateral-triangle with a side length of 9 centimeters (cm), and a circle with a radius of 5 centimeters (cm). Which shape has the longest perimeter when pi is calculated as 3? | circle | [OP_LIST_SOL] square equilateral-triangle circle [OP_LIST_EOL] [OP_LIST_SOL] 7 4 [OP_MUL] 9 3 [OP_MUL] 5 3 2 [OP_MUL] [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'square'
var_b = 'equilateral-triangle'
var_c = 'circle'
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 = 7
var_e = 4
var_f = var_d * var_e
var_g = 9
var_h = 3
var_i = var_g * var_h
var_j = 5
var_k = 3
var_l = 2
var_m = var_k * var_l
var_n = var_j * 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) |
Arithmetic calculation | At the fruit shop, apples are 1,000 won each and peaches are 2,000 won each. If you bought 15 apples and peaches in total and paid 22,000 won, find how many peaches you have bought. | 7 | 22000 1000 15 [OP_MUL] [OP_SUB] 2000 1000 [OP_SUB] [OP_DIV] | var_a = 22000
var_b = 1000
var_c = 15
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 2000
var_g = 1000
var_h = var_f - var_g
var_i = var_e / var_h
print(int(var_i)) |
Correspondence | Yoongi subtracted 17 from a certain number to get 55. Now we want to divide this number by 9. What value can you get? | 8 | 55 17 [OP_ADD] 9 [OP_DIV] | var_a = 55
var_b = 17
var_c = var_a + var_b
var_d = 9
var_e = var_c / var_d
print(int(var_e)) |
Correspondence | While traveling, Seonwoo drank 1/2 of the water he had on the first day, 1/3 of the remaining water on the second day, and 1/2 of the remaining water on the third day, leaving him with 250 milliliters (ml). How many milliliters (ml) did Seonwoo have at first? | 1500 | 250 1 1/2 [OP_SUB] [OP_DIV] 1 1/3 [OP_SUB] [OP_DIV] 1 1/2 [OP_SUB] [OP_DIV] | var_a = 250
var_b = 1
var_c = 0.5
var_d = var_b - var_c
var_e = var_a / var_d
var_f = 1
var_g = 0.3333333333333333
var_h = var_f - var_g
var_i = var_e / var_h
var_j = 1
var_k = 0.5
var_l = var_j - var_k
var_m = var_i / var_l
print(int(eval('{:.2f}'.format(round(var_m+1e-10,2))))) |
Comparison | There are three numbers: 0.8, 1/2, and 0.5. What is the smallest of these numbers greater than 0.1? | 0.5 | [OP_LIST_SOL] 0.8 1/2 0.5 [OP_LIST_EOL] 0.1 [OP_LIST_MORE] 1 [OP_LIST_MIN] | var_a = 0.8
var_b = 0.5
var_c = 0.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 = 0.1
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('{:.2f}'.format(round(var_f+1e-10,2))) |
Geometry | How many centimeters (cm) is the base of a triangle with an area of 9.31 square centimeters (cm2) and a height of 4.9 centimeters (cm)? | 3.8 | 9.31 2 [OP_MUL] 4.9 [OP_DIV] | var_a = 9.31
var_b = 2
var_c = var_a * var_b
var_d = 4.9
var_e = var_c / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Possibility | How many three-digit natural numbers greater than 200 are there in which each digit is different from one another and consists only of 0, 1, 3, 5, and 6? | 36 | [OP_LIST_SOL] 0 1 3 5 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 200 [OP_LIST_MORE] [OP_LIST_LEN] | var_a = 0
var_b = 1
var_c = 3
var_d = 5
var_e = 6
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 = 200
list_c = []
for i in list_b:
if i > var_g:
list_c.append(i)
var_h = len(list_c)
print(int(var_h)) |
Comparison | Heejin works out 10 times a day for 30 minutes each time. And Jimin exercises 8 times a day for 20 minutes each time. Find the one who exercises more in a day. | Heejin | [OP_LIST_SOL] Heejin Jimin [OP_LIST_EOL] [OP_LIST_SOL] 10 30 [OP_MUL] 8 20 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Heejin'
var_b = 'Jimin'
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 = 10
var_d = 30
var_e = var_c * var_d
var_f = 8
var_g = 20
var_h = var_f * var_g
list_b= []
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[-var_i]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l) |
Geometry | There are 5 different points on the circle. How many straight lines can be formed by connecting two of these points? Note that the line created with one point and the first next point that meet while following a circle does not count. | 5 | 5 5 3 [OP_SUB] [OP_MUL] 2 [OP_DIV] | var_a = 5
var_b = 5
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)) |
Geometry | We plan to plant trees at intervals of 4 kilometers (km) on a straight road of 28 kilometers (km). Find the maximum number of trees you can plant. | 8 | 28 4 [OP_DIV] 1 [OP_ADD] | var_a = 28
var_b = 4
var_c = var_a / var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | There are 10 balls. Jungkook wants to put 5 balls in one box. How many boxes does he need at this time? | 2 | 10 5 [OP_DIV] | var_a = 10
var_b = 5
var_c = var_a / var_b
print(int(var_c)) |
Possibility | How many total two-digit numbers can be made by using both the number cards 1 and 4 once? | 2 | [OP_LIST_SOL] 1 4 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN] | var_a = 1
var_b = 4
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
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, 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 = len(list_b)
print(int(var_d)) |
Possibility | You are trying to create two-digit numbers with 2, 3, and 7 allowing duplicates. Find the sum of all possible numbers. | 396 | [OP_LIST_SOL] 2 3 7 [OP_LIST_EOL] 2 [OP_LIST_GET_PRODUCT] [OP_LIST_SUM] | var_a = 2
var_b = 3
var_c = 7
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.product(list_b, repeat=var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
list_b = [float(i) for i in list_b]
var_e = sum(list_b)
print(int(var_e)) |
Arithmetic calculation | The five-digit number 1ABC9 is divisible by 13. How many three-digit numbers ABC is possible? | 77 | 1ABC9 [OP_GEN_POSSIBLE_LIST] 13 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = '1ABC9'
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 = 13
list_b = []
var_b = int(var_b)
for i in list_a:
i = int(i)
if i % var_b == 0:
list_b.append(i)
var_c = len(list_b)
print(int(var_c)) |
Correspondence | There are two different numbers A and B. Find the value of A-B in the two-digit subtraction equation 6A-B2=36. | 5 | 6A-B2=36 A [OP_DIGIT_UNK_SOLVER] 6A-B2=36 B [OP_DIGIT_UNK_SOLVER] [OP_SUB] | var_a = '6A-B2=36'
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 = '6A-B2=36'
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)) |
Geometry | The company (a) produces cuboid-shaped tissue boxes with a length of 20 centimeters (cm), a width of 10 centimeters (cm), and a height of 10 centimeters (cm), and the company (b) produces tissue boxes in the shape of a cube whose width, length, and height are 13 centimeters (cm). Suppose you place tissues in both boxes, which company's box will contain more tissues? | (b) | [OP_LIST_SOL] (a) (b) [OP_LIST_EOL] [OP_LIST_SOL] 20 10 [OP_MUL] 10 [OP_MUL] 13 13 [OP_MUL] 13 [OP_MUL] [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 = 20
var_d = 10
var_e = var_c * var_d
var_f = 10
var_g = var_e * var_f
var_h = 13
var_i = 13
var_j = var_h * var_i
var_k = 13
var_l = var_j * var_k
list_b= []
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
list_b.reverse()
var_m = 1
list_c=list_b.copy()
list_c.sort()
var_n = list_c[-var_m]
var_o = list_b.index(var_n)+1
var_p = list_a[var_o-1]
print(var_p) |
Arithmetic calculation | Minyoung grew 125 carrots per hour, and Yujeong grew 137 carrots per hour. When growing carrots for 6 hours, how many carrots did Yujeong grow more than Minyoung? | 72 | 137 125 [OP_SUB] 6 [OP_MUL] | var_a = 137
var_b = 125
var_c = var_a - var_b
var_d = 6
var_e = var_c * var_d
print(int(var_e)) |
Comparison | There are cubes (A), (B), and (C). In (A), the length of one edge is 7 centimeters (cm), and in (B), the length of one edge is 11 centimeters (cm). Also, (C) has an edge with 9 centimeters (cm) long. Which shape has the largest surface area among (A), (B), and (C)? | (B) | [OP_LIST_SOL] (A) (B) (C) [OP_LIST_EOL] [OP_LIST_SOL] 6 7 2 [OP_POW] [OP_MUL] 6 11 2 [OP_POW] [OP_MUL] 6 9 2 [OP_POW] [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [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 = 6
var_e = 7
var_f = 2
var_g = var_e ** var_f
var_h = var_d * var_g
var_i = 6
var_j = 11
var_k = 2
var_l = var_j ** var_k
var_m = var_i * var_l
var_n = 6
var_o = 9
var_p = 2
var_q = var_o ** var_p
var_r = var_n * var_q
list_b= []
if "/" in str(var_r):
var_r = eval(str(var_r))
list_b.append(var_r)
if "/" in str(var_m):
var_m = eval(str(var_m))
list_b.append(var_m)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
list_b.reverse()
var_s = 1
list_c=list_b.copy()
list_c.sort()
var_t = list_c[-var_s]
var_u = list_b.index(var_t)+1
var_v = list_a[var_u-1]
print(var_v) |
Arithmetic calculation | How many even numbers are no more than 20? | 10 | 1 20 [OP_LIST_EVEN] [OP_LIST_LEN] | var_a = 1
var_b = 20
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 = len(list_a)
print(int(var_c)) |
Geometry | You want to make a square with a side of 40 centimeters (cm) using wire. Find the amount of wire you need in centimeters (cm). | 160 | 40 4 [OP_MUL] | var_a = 40
var_b = 4
var_c = var_a * var_b
print(int(var_c)) |
Possibility | How many natural numbers are there from 1 to 1000, in which the sum of their digits is equal to 11? | 69 | 1 1000 1 [OP_LIST_ARANGE] [OP_LIST_NUM2SUM] 11 [OP_LIST_FIND_NUM] | var_a = 1
var_b = 1000
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
list_b=[]
for i in list_a:
var_d = 0
i = int(i)
while i//10 > 0:
var_d = var_d + i%10
i = i//10
var_d = var_d + i%10
list_b.append(var_d)
var_e = 11
var_f = 0
var_e = int(var_e)
for i in list_b:
i = int(i)
if i == var_e:
var_f = var_f + 1
print(int(var_f)) |
Possibility | Try to put colored pencils in a line. If you have 1 blue pencil and 5 indistinguishable purple pencils, how many different ways can you place them? | 6 | 5 1 [OP_ADD] 1 [OP_COMB] | var_a = 5
var_b = 1
var_c = var_a + var_b
var_d = 1
var_e = 1
var_c = int(var_c)
var_d = int(var_d)
for i, elem in enumerate(range(var_d)):
var_e = var_e * (var_c-i)
for i, elem in enumerate(range(var_d)):
var_e = var_e / (i+1)
print(int(var_e)) |
Correspondence | When 691-A87=4, find A. | 6 | 691-A87=4 A [OP_DIGIT_UNK_SOLVER] | var_a = '691-A87=4'
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 | I planted different flowers in a row. The rose was planted eighth from the front, and the lily was planted right after the rose. At what number from the front was the lily planted? | 9 | 8 1 [OP_ADD] | var_a = 8
var_b = 1
var_c = var_a + var_b
print(int(var_c)) |
Arithmetic calculation | Changgi, Chaeyoung, and Hyeonjeong weigh 106 kilograms (kg) and 600 grams (g). Chaeyoung is 7 kilograms (kg) 700 grams (g) heavier than Hyunjeong, and Changgi is 4.8 kilograms (kg) heavier than Chaeyoung. How many kilograms (kg) does Changgi weigh? | 41.3 | 106 600 1000 [OP_DIV] [OP_ADD] 7 700 1000 [OP_DIV] [OP_ADD] [OP_ADD] 4.8 2 [OP_MUL] [OP_ADD] 3 [OP_DIV] | var_a = 106
var_b = 600
var_c = 1000
var_d = var_b / var_c
var_e = var_a + var_d
var_f = 7
var_g = 700
var_h = 1000
var_i = var_g / var_h
var_j = var_f + var_i
var_k = var_e + var_j
var_l = 4.8
var_m = 2
var_n = var_l * var_m
var_o = var_k + var_n
var_p = 3
var_q = var_o / var_p
print('{:.2f}'.format(round(var_q+1e-10,2))) |
Arithmetic calculation | If you divide 40 apples into 7 boxes at most, how many apples do not fit in the box? | 5 | 40 7 [OP_FDIV] | var_a = 40
var_b = 7
var_c = var_a // var_b
print(int(var_c)) |
Geometry | I want to draw a diagonal from some octagon. Find the number of diagonals drawn. | 20 | 8 8 3 [OP_SUB] [OP_MUL] 2 [OP_DIV] | var_a = 8
var_b = 8
var_c = 3
var_d = var_b - var_c
var_e = var_a * var_d
var_f = 2
var_g = var_e / var_f
print(int(var_g)) |
Correspondence | The quotient of A614, which is a four-digit number, divided by 6 is a four-digit number. How many digits are possible for A? | 4 | A614 [OP_GEN_POSSIBLE_LIST] 6000 [OP_LIST_MORE_EQUAL] 60000 [OP_LIST_LESS] [OP_LIST_LEN] | var_a = 'A614'
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 = 6000
list_b = []
for i in list_a:
if i >= var_b:
list_b.append(i)
var_c = 60000
list_c = []
for i in list_b:
if i < var_c:
list_c.append(i)
var_d = len(list_c)
print(int(var_d)) |
Geometry | What is the volume in cubic centimeters (cm3) of a cube with a surface area of 150 square centimeters (cm2)? | 125 | 150 6 [OP_DIV] 1/2 [OP_POW] 3 [OP_POW] | var_a = 150
var_b = 6
var_c = var_a / var_b
var_d = 0.5
var_e = var_c ** var_d
var_f = 3
var_g = var_e ** var_f
print(int(var_g)) |
Geometry | The area of a parallelogram is 78.88 square centimeters (cm2) and its height is 8 centimeters (cm). What is the length of the base? | 9.86 | 78.88 8 [OP_DIV] | var_a = 78.88
var_b = 8
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Correspondence | If you put 6 candies in a bag, there will be 4 left over, and if you put 7 candies in a bag, there will be 5 left over. If 8 candies are in each bag, 6 will be left, and 10 candies in each bag will have 8 left over. Find the minimum number of candies. | 838 | 0 9999 1 [OP_LIST_ARANGE] 6 4 [OP_LIST_DIVIDE_AND_REMAIN] 7 5 [OP_LIST_DIVIDE_AND_REMAIN] 8 6 [OP_LIST_DIVIDE_AND_REMAIN] 10 8 [OP_LIST_DIVIDE_AND_REMAIN] 1 [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 = 6
var_e = 4
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 = 7
var_g = 5
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 = 8
var_i = 6
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 = 10
var_k = 8
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 = 1
list_f=list_e.copy()
list_f.sort()
var_m = list_f[var_l-1]
print(int(var_m)) |
Arithmetic calculation | Willow trees are planted at 30-meter (m) intervals along the circular pond. If the circumference of the pond is 1 kilometer (km) and 200 meters (m), how many willow trees were planted in all? | 40 | 1 1000 [OP_MUL] 200 [OP_ADD] 30 [OP_DIV] | var_a = 1
var_b = 1000
var_c = var_a * var_b
var_d = 200
var_e = var_c + var_d
var_f = 30
var_g = var_e / var_f
print(int(var_g)) |
Correspondence | When AB2-41=591 is true, what number should go in B? | 3 | AB2-41=591 B [OP_DIGIT_UNK_SOLVER] | var_a = 'AB2-41=591'
var_b = 'B'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Arithmetic calculation | There are 30 trees along the straight road. If the distance between every tree is 3 meters (m), what is the distance between the first and the last trees? | 87 | 3 30 1 [OP_SUB] [OP_MUL] | var_a = 3
var_b = 30
var_c = 1
var_d = var_b - var_c
var_e = var_a * var_d
print(int(var_e)) |
Comparison | The length of the colored tape that Juman has is 0.6 meters (m). The length of the colored tape that Jeongho has is 3/10 meters (m) longer than that of Juman. Jiyong's colored tape is 19/25 meters (m) long, and Cheoljung's colored tape is 0.2 meters (m) shorter than Jiyong's. Who has the 2nd shortest colored tape? | Juman | [OP_LIST_SOL] Juman Jeongho Jiyong Cheoljung [OP_LIST_EOL] [OP_LIST_SOL] 0.6 0.6 3/10 [OP_ADD] 19/25 19/25 0.2 [OP_SUB] [OP_LIST_EOL] 2 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Juman'
var_b = 'Jeongho'
var_c = 'Jiyong'
var_d = 'Cheoljung'
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.6
var_f = 0.6
var_g = 0.3
var_h = var_f + var_g
var_i = 0.76
var_j = 0.76
var_k = 0.2
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_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_m = 2
list_c=list_b.copy()
list_c.sort()
var_n = list_c[var_m-1]
var_o = list_b.index(var_n)+1
var_p = list_a[var_o-1]
print(var_p) |
Correspondence | If 20 is the product of some number divided by 3 and 12 added, what is that number? | 24 | 20 12 [OP_SUB] 3 [OP_MUL] | var_a = 20
var_b = 12
var_c = var_a - var_b
var_d = 3
var_e = var_c * var_d
print(int(var_e)) |
Arithmetic calculation | There are three numbers 10, 11, and 12. What is the quotient of the largest number divided by the second smallest number? | 1 | [OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_FDIV] | 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]
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)) |
Geometry | The gift box that Jaewoong is buying is 9 centimeters (cm) wide, 4 centimeters (cm) long, and 7 centimeters (cm) high. What is this gift box's volume in cubic centimeters (cm3)? | 252 | 9 4 [OP_MUL] 7 [OP_MUL] | var_a = 9
var_b = 4
var_c = var_a * var_b
var_d = 7
var_e = var_c * var_d
print(int(var_e)) |
Comparison | There are 3 boxes containing 16 Red-bean bread each weighing 200 grams (g). There are 2 boxes containing 12 pieces of conch-shaped bread each weighing 250 grams (g). All empty boxes weigh the same. Which bread is in the box that weighs more than other boxes? | Red-bean | [OP_LIST_SOL] Red-bean conch-shaped [OP_LIST_EOL] [OP_LIST_SOL] 200 16 [OP_MUL] 250 12 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Red-bean'
var_b = 'conch-shaped'
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 = 16
var_e = var_c * var_d
var_f = 250
var_g = 12
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 | Multiplying the grandson's age by 6 equals the grandfather's age. After 4 years, the ages of grandfather and grandson add up to be 78. How old is the grandson now? | 10 | 78 4 2 [OP_MUL] [OP_SUB] 1 6 [OP_ADD] [OP_DIV] | var_a = 78
var_b = 4
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 1
var_g = 6
var_h = var_f + var_g
var_i = var_e / var_h
print(int(var_i)) |
Arithmetic calculation | Yeon-seok ran 18 meters (m) today. If he doubles his distance each day, find how many meters (m) he would run on the fourth day. | 144 | 18 2 4 1 [OP_SUB] [OP_POW] [OP_MUL] | var_a = 18
var_b = 2
var_c = 4
var_d = 1
var_e = var_c - var_d
var_f = var_b ** var_e
var_g = var_a * var_f
print(int(var_g)) |
Comparison | Yoongi collected 4 apples, Jungkook collected 6 divided by 3 apples, and Yuna collected 5 apples. Whose apples are the most? | Yuna | [OP_LIST_SOL] Yoongi Jungkook Yuna [OP_LIST_EOL] [OP_LIST_SOL] 4 6 3 [OP_FDIV] 5 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Yoongi'
var_b = 'Jungkook'
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 = 4
var_e = 6
var_f = 3
var_g = var_e // var_f
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_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]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l) |
Possibility | Find the sum of the largest and the third smallest three-digit number that can be created by using the three natural numbers 1, 6, and 8 once. | 1479 | [OP_LIST_SOL] 1 6 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 3 [OP_LIST_MIN] [OP_ADD] | var_a = 1
var_b = 6
var_c = 8
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = 3
list_d=list_b.copy()
list_d.sort()
var_h = list_d[var_g-1]
var_i = var_f + var_h
print(int(var_i)) |
Geometry | A piece of paper that is 12 centimeters (cm) long was folded in half once, leaving a line in the middle. How long is it from the end of the paper to the central line? | 6 | 12 2 [OP_DIV] | var_a = 12
var_b = 2
var_c = var_a / var_b
print(int(var_c)) |
Correspondence | Some fruit boxes contain pears and apples. When these fruits were packed in 4 pieces, 12 bundles came out and 3 pieces remained. If there are 12 apples, how many pears are there? | 39 | 12 4 [OP_MUL] 3 [OP_ADD] 12 [OP_SUB] | var_a = 12
var_b = 4
var_c = var_a * var_b
var_d = 3
var_e = var_c + var_d
var_f = 12
var_g = var_e - var_f
print(int(var_g)) |
Correspondence | 17 is the result of mistakenly subtracting 82 from a certain number that should have subtracted 28. Find the certain number. | 99 | 17 82 [OP_ADD] | var_a = 17
var_b = 82
var_c = var_a + var_b
print(int(var_c)) |
Correspondence | We have the expression 38A-B1=364. Find the number that is required in B. | 2 | 38A-B1=364 B [OP_DIGIT_UNK_SOLVER] | var_a = '38A-B1=364'
var_b = 'B'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Arithmetic calculation | Eunji went to the mart. She bought a toy with 1/4 of the total money and a book with 1/3 of the remaining money. If she ended up having 1,600 won, how much money did Eunji take at the beginning? | 3200 | 1600 1 1/3 [OP_SUB] [OP_DIV] 1 1/4 [OP_SUB] [OP_DIV] | var_a = 1600
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.25
var_h = var_f - var_g
var_i = var_e / var_h
print(int(eval('{:.2f}'.format(round(var_i+1e-10,2))))) |
Geometry | What is the number of edges of a cube? | 12 | 6 2 [OP_SUB] 3 [OP_MUL] | var_a = 6
var_b = 2
var_c = var_a - var_b
var_d = 3
var_e = var_c * var_d
print(int(var_e)) |
Correspondence | I should have added 32 to a number and multiply it by 12 but I accidently multiplied it by 3 and subtracted 45, and 159 came out as a result. If you calculate this correctly, how much is it? | 1200 | 159 45 [OP_ADD] 3 [OP_DIV] 32 [OP_ADD] 12 [OP_MUL] | var_a = 159
var_b = 45
var_c = var_a + var_b
var_d = 3
var_e = var_c / var_d
var_f = 32
var_g = var_e + var_f
var_h = 12
var_i = var_g * var_h
print(int(var_i)) |
Possibility | If there are 3 bus routes and 2 subway routes going from Seohee's house to school, find the number of ways to go by subway. | 2 | [OP_LIST_SOL] 3 2 [OP_LIST_EOL] [OP_LIST_SOL] bus subway [OP_LIST_EOL] subway [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 3
var_b = 2
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 = 'bus'
var_d = 'subway'
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 = 'subway'
var_f = list_b.index(var_e)+1
var_g = list_a[var_f-1]
print(int(var_g)) |
Possibility | You are playing ball toss. If you hit inside the red circle, you get 3 points, if you hit inside the yellow circle, you get 2 points, and if you don't hit inside the circle, you get 1 point. How many different points can you get by throwing the ball 3 times? | 27 | [OP_LIST_SOL] 3 2 1 [OP_LIST_EOL] 3 [OP_LIST_GET_PRODUCT] [OP_LIST_NUM2SUM] [OP_LIST_LEN] | var_a = 3
var_b = 2
var_c = 1
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
list_c=[]
for i in list_b:
var_e = 0
i = int(i)
while i//10 > 0:
var_e = var_e + i%10
i = i//10
var_e = var_e + i%10
list_c.append(var_e)
var_f = len(list_c)
print(int(var_f)) |
Comparison | The four students, Yoongi, Jungkook, Yuna, and Yoojung, each have the numbers 7, 6, 9, and 8. Who has the 2nd smallest number? | Yoongi | [OP_LIST_SOL] Yoongi Jungkook Yuna Yoojung [OP_LIST_EOL] [OP_LIST_SOL] 7 6 9 8 [OP_LIST_EOL] 2 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Yoongi'
var_b = 'Jungkook'
var_c = 'Yuna'
var_d = 'Yoojung'
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 = 7
var_f = 6
var_g = 9
var_h = 8
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)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_i = 2
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) |
Comparison | The three friends Seunga, Kyunghwan, and Doyun each have 20,000 won in pocket money. Looking at the remaining pocket money of the three people, if Seunga is 1/4 of the total, Kyunghwan is 1/8 of the total, and Doyun is 1/5 of the total, find out who spent the most pocket money. | Kyunghwan | [OP_LIST_SOL] Seunga Kyunghwan Doyun [OP_LIST_EOL] [OP_LIST_SOL] 1 1/4 [OP_SUB] 1 1/8 [OP_SUB] 1 1/5 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Seunga'
var_b = 'Kyunghwan'
var_c = 'Doyun'
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
var_e = 0.25
var_f = var_d - var_e
var_g = 1
var_h = 0.125
var_i = var_g - var_h
var_j = 1
var_k = 0.2
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 | The number of blue marbles is 3 times the number of red marbles and the number of red marbles is 15 more than the number of yellow marbles. If the number of all marbles is 165, find the number of blue marbles. | 108 | 165 15 [OP_ADD] 3 1 1 [OP_ADD] [OP_ADD] [OP_DIV] 3 [OP_MUL] | var_a = 165
var_b = 15
var_c = var_a + var_b
var_d = 3
var_e = 1
var_f = 1
var_g = var_e + var_f
var_h = var_d + var_g
var_i = var_c / var_h
var_j = 3
var_k = var_i * var_j
print(int(var_k)) |
Possibility | You want to create a three-digit number using some numbers from 2, 0, 5, 9, and 6 without any duplicates. Find the value of the largest number minus the smallest number. | 760 | [OP_LIST_SOL] 2 0 5 9 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] [OP_ABS] | var_a = 2
var_b = 0
var_c = 5
var_d = 9
var_e = 6
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 = 1
list_d=list_b.copy()
list_d.sort()
var_j = list_d[var_i-1]
var_k = var_h - var_j
var_l = abs(var_k)
print(int(var_l)) |
Arithmetic calculation | Jimin went to the stationery store and bought 37 red ballpoint pens and 17 blue ballpoint pens. How many ballpoint pens are there in all? | 54 | 37 17 [OP_ADD] | var_a = 37
var_b = 17
var_c = var_a + var_b
print(int(var_c)) |
Geometry | Hyeonseong made a hexagonal pyramid with a side edge of 8 centimeters (cm) on colored paper during math class. If the sum of the lengths of all the edges of this pyramid is 120 centimeters (cm), how long is the length of one edge of the base? | 12 | 120 8 6 [OP_MUL] [OP_SUB] 6 [OP_DIV] | var_a = 120
var_b = 8
var_c = 6
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 6
var_g = var_e / var_f
print(int(var_g)) |
Correspondence | I need to subtract 23 from a number, but I accidentally subtracted 32 and it turned out to be 25. How much do you get if you calculate it right? | 34 | 25 32 [OP_ADD] 23 [OP_SUB] | var_a = 25
var_b = 32
var_c = var_a + var_b
var_d = 23
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | There are candies in the box. If you pack 30 of these candies, you have 14 leftovers, if you pack 50 of these candies, you have 24 left over, and if you pack 70 of these candies, you have 34 left over. Find the minimum number of candies in the box. | 524 | 0 9999 1 [OP_LIST_ARANGE] 30 14 [OP_LIST_DIVIDE_AND_REMAIN] 50 24 [OP_LIST_DIVIDE_AND_REMAIN] 70 34 [OP_LIST_DIVIDE_AND_REMAIN] 1 [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 = 30
var_e = 14
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 = 50
var_g = 24
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 = 70
var_i = 34
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 = 1
list_e=list_d.copy()
list_e.sort()
var_k = list_e[var_j-1]
print(int(var_k)) |
Possibility | When 4 students: Hyunji, Eunjeong, Migeum, and Youngmi stand in a line, find the number of cases in which Hyunji stands at the front or at the back. | 12 | [OP_LIST_SOL] Hyunji Eunjeong Migeum Youngmi [OP_LIST_EOL] [OP_LIST_SOL] Hyunji [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_LIST_SOL] Front Back [OP_LIST_EOL] [OP_LIST_LEN] [OP_MUL] | var_a = 'Hyunji'
var_b = 'Eunjeong'
var_c = 'Migeum'
var_d = 'Youngmi'
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 = 'Hyunji'
list_b= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
list_c = list(set(list_a) - set(list_b))
var_f = len(list_c)
var_g = len(list_c)
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)
var_i = 'Front'
var_j = 'Back'
list_d= []
if "/" in str(var_j):
var_j = eval(str(var_j))
list_d.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_d.append(var_i)
list_d.reverse()
var_k = len(list_d)
var_l = var_h * var_k
print(int(var_l)) |
Arithmetic calculation | You are going to overlap 24 pieces of a tape measure and connect them in one line. If the length of one tape measure is 28 centimeters (cm), and the length of all connected tape measures is 580 centimeters (cm), find out how many centimeters (cm) a tape measure is connected each. | 4 | 28 24 [OP_MUL] 580 [OP_SUB] 24 1 [OP_SUB] [OP_DIV] | var_a = 28
var_b = 24
var_c = var_a * var_b
var_d = 580
var_e = var_c - var_d
var_f = 24
var_g = 1
var_h = var_f - var_g
var_i = var_e / var_h
print(int(var_i)) |
Arithmetic calculation | When Yunhwan drinks 182.88 liters (L) of water per month, how much water does Yunhwan drink for a year? | 2194.56 | 182.88 12 [OP_MUL] | var_a = 182.88
var_b = 12
var_c = var_a * var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Possibility | You want to create two different digit numbers by using 3 and 5 only once. How many two-digit numbers can you make? | 2 | [OP_LIST_SOL] 3 5 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN] | var_a = 3
var_b = 5
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 2
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, 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 = len(list_b)
print(int(var_d)) |
Arithmetic calculation | What is the sum of all natural numbers greater than 28 and less than or equal to 31? | 90 | 28 1 [OP_ADD] 31 1 [OP_LIST_ARANGE] [OP_LIST_SUM] | var_a = 28
var_b = 1
var_c = var_a + var_b
var_d = 31
var_e = 1
list_a = [i for i in range(var_c, var_d + 1, var_e)]
list_a = [float(i) for i in list_a]
var_f = sum(list_a)
print(int(var_f)) |
Comparison | Hoseok is always 4th from the left and 9th from the right in a row. How many students are there if there are 5 lines every time they jump rope and the number of students in each line is the same? | 60 | 5 4 9 [OP_ADD] 1 [OP_SUB] [OP_MUL] | var_a = 5
var_b = 4
var_c = 9
var_d = var_b + var_c
var_e = 1
var_f = var_d - var_e
var_g = var_a * var_f
print(int(var_g)) |
Geometry | In a right triangle, when a hypotenuse is 10, what is the length of the other side of the length of one side other than the hypotenuse is 6?
| 8 | 10 2 [OP_POW] 6 2 [OP_POW] [OP_SUB] 1/2 [OP_POW] | var_a = 10
var_b = 2
var_c = var_a ** var_b
var_d = 6
var_e = 2
var_f = var_d ** var_e
var_g = var_c - var_f
var_h = 0.5
var_i = var_g ** var_h
print(int(var_i)) |
Comparison | A pumpkin weighs 2 and 9/10 of a kilogram (kg), and a watermelon weighs 41/10 kilograms (kg). Which is heavier, the pumpkin or the watermelon? | watermelon | [OP_LIST_SOL] pumpkin watermelon [OP_LIST_EOL] [OP_LIST_SOL] 2 9/10 [OP_ADD] 41/10 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'pumpkin'
var_b = 'watermelon'
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 = 0.9
var_e = var_c + var_d
var_f = 4.1
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 | There are five numbers: 10, 11, 12, 13, and 14. What is the product of the largest number and the second largest number? | 182 | [OP_LIST_SOL] 10 11 12 13 14 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MAX] [OP_MUL] | var_a = 10
var_b = 11
var_c = 12
var_d = 13
var_e = 14
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 = 2
list_c=list_a.copy()
list_c.sort()
var_i = list_c[-var_h]
var_j = var_g * var_i
print(int(var_j)) |
Geometry | How many right angles are there in a rectangle? | 4 | 4 | var_a = 4
print(int(var_a)) |
Arithmetic calculation | Find the smaller one between the two odd numbers when the sum of two consecutive odd numbers is 48. | 23 | 48 2 [OP_SUB] 2 [OP_DIV] | var_a = 48
var_b = 2
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e)) |
Correspondence | There are three blackboard erasers in each class, but after gathering 12 broken blackboard erasers and throwing them out, there remained 60. Find the number of classes divided by 3 and then added by 12. | 20 | 60 12 [OP_ADD] 3 [OP_DIV] 3 [OP_DIV] 12 [OP_ADD] | var_a = 60
var_b = 12
var_c = var_a + var_b
var_d = 3
var_e = var_c / var_d
var_f = 3
var_g = var_e / var_f
var_h = 12
var_i = var_g + var_h
print(int(var_i)) |
Comparison | Yoongi collected 4 points, and Jungkook collected 6 minus 3 points. Who has the big number? | Yoongi | [OP_LIST_SOL] Yoongi Jungkook [OP_LIST_EOL] [OP_LIST_SOL] 4 6 3 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Yoongi'
var_b = 'Jungkook'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 4
var_d = 6
var_e = 3
var_f = var_d - var_e
list_b= []
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j) |
Possibility | If there are 5 people A, B, C, D, and E, find the number of ways to select 2 representatives. | 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)) |
Arithmetic calculation | Jeongmin saves 300 won every day and Siwoo saves 500 won every day. Currently, there are 12,000 won in Jeongmin's bank account and 4,000 won in Siwoo's bank account. How many days have to pass so that the amounts in Jung-min's and Siwoo's bank accounts be the same? | 40 | 12000 4000 [OP_SUB] 500 300 [OP_SUB] [OP_DIV] | var_a = 12000
var_b = 4000
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)) |
Arithmetic calculation | What is the smallest 4-digit number that is divisible by 3 numbers 5, 6, and 2? | 1020 | 1000 9999 1 [OP_LIST_ARANGE] 5 [OP_LIST_DIVISIBLE] 6 [OP_LIST_DIVISIBLE] 2 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN] | var_a = 1000
var_b = 9999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 5
list_b = []
var_d = int(var_d)
for i in list_a:
i = int(i)
if i % var_d == 0:
list_b.append(i)
var_e = 6
list_c = []
var_e = int(var_e)
for i in list_b:
i = int(i)
if i % var_e == 0:
list_c.append(i)
var_f = 2
list_d = []
var_f = int(var_f)
for i in list_c:
i = int(i)
if i % var_f == 0:
list_d.append(i)
var_g = 1
list_e=list_d.copy()
list_e.sort()
var_h = list_e[var_g-1]
print(int(var_h)) |
Geometry | If the length of one diagonal of a square is 12 centimeters (cm), what is the area of the square? | 72 | 12 2 [OP_POW] 2 [OP_DIV] | var_a = 12
var_b = 2
var_c = var_a ** var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e)) |
Correspondence | You incorrectly subtracted 152 when you should have added 152 to a number, resulting in 346. Find what the correct number would be. | 650 | 346 152 [OP_ADD] 152 [OP_ADD] | var_a = 346
var_b = 152
var_c = var_a + var_b
var_d = 152
var_e = var_c + var_d
print(int(var_e)) |
Comparison | Eunji was the 100th person riding the train, and Yuna was the 11th one after Eunji. What place did Yuna take to get on the train out of total people? | 111 | 100 11 [OP_ADD] | var_a = 100
var_b = 11
var_c = var_a + var_b
print(int(var_c)) |
Geometry | How many faces does a tetrahedron have? | 4 | 4 | var_a = 4
print(int(var_a)) |
Correspondence | There are three-digit numbers with a hundreds digit of 9. When these numbers are divisible by 7, how many of these three-digit numbers are there? | 14 | 9 100 [OP_MUL] 9 100 [OP_MUL] 99 [OP_ADD] 1 [OP_LIST_ARANGE] 7 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 9
var_b = 100
var_c = var_a * var_b
var_d = 9
var_e = 100
var_f = var_d * var_e
var_g = 99
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 = 7
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)) |
Possibility | You want to make a four-digit number by drawing four out of 5, 6, 4, and 7 and using them only once. Find the number of even 4-digit numbers that can be made. | 12 | [OP_LIST_SOL] 5 6 4 7 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 2 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 5
var_b = 6
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 = 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 = 2
list_c = []
var_f = int(var_f)
for i in list_b:
i = int(i)
if i % var_f == 0:
list_c.append(i)
var_g = len(list_c)
print(int(var_g)) |
Arithmetic calculation | Namjoon ate 8 cookies, and when he gave 7 cookies to Hoseok, there are 9 cookies left. How many cookies did Namjoon have at first? | 24 | 9 7 [OP_ADD] 8 [OP_ADD] | var_a = 9
var_b = 7
var_c = var_a + var_b
var_d = 8
var_e = var_c + var_d
print(int(var_e)) |
Possibility | When you select three of the numbers 1, 2, 3, 4, and 5 and use each of them once to make a number less than 1000, find the sum of the third largest number and the third smallest number that you can make. | 666 | [OP_LIST_SOL] 1 2 3 4 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1000 [OP_LIST_LESS] 3 [OP_LIST_MAX] 3 [OP_LIST_MIN] [OP_ADD] | var_a = 1
var_b = 2
var_c = 3
var_d = 4
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 = 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 = 1000
list_c = []
for i in list_b:
if i < var_g:
list_c.append(i)
var_h = 3
list_d=list_c.copy()
list_d.sort()
var_i = list_d[-var_h]
var_j = 3
list_e=list_c.copy()
list_e.sort()
var_k = list_e[var_j-1]
var_l = var_i + var_k
print(int(var_l)) |
Correspondence | A, B, and C are single digit numbers. The number A47BC is a multiple of 4, 5, and 9. Find the number of all possible numbers in A. | 5 | A47BC [OP_GEN_POSSIBLE_LIST] 4 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 9 [OP_LIST_DIVISIBLE] A47BC A [OP_LIST_FIND_UNK] [OP_LIST_LEN] | var_a = 'A47BC'
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 = 4
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 = 5
list_c = []
var_c = int(var_c)
for i in list_b:
i = int(i)
if i % var_c == 0:
list_c.append(i)
var_d = 9
list_d = []
var_d = int(var_d)
for i in list_c:
i = int(i)
if i % var_d == 0:
list_d.append(i)
var_e = 'A47BC'
var_f = 'A'
var_e = str(var_e)
var_f = str(var_f)
unk_idx = var_e.index(var_f)
list_e = []
for elem in list_d:
elem = str(elem)
list_e.append(int(elem[unk_idx]))
list_e = list(set(list_e))
var_g = len(list_e)
print(int(var_g)) |
Correspondence | When A is divided by 7, the quotient is 5 and the remainder is 3. Find A at this time. | 38 | 7 5 [OP_MUL] 3 [OP_ADD] | var_a = 7
var_b = 5
var_c = var_a * var_b
var_d = 3
var_e = var_c + var_d
print(int(var_e)) |
Comparison | During the presentation, students take turns giving their presentations. Eunjeong is 6th from the back, and The 7 students are in front of Eunjung. How many students are there in total? | 13 | 6 7 [OP_ADD] | var_a = 6
var_b = 7
var_c = var_a + var_b
print(int(var_c)) |
Comparison | Taehyung, Minju, Sangmin, Yoonjeong, and Yoojung borrowed the most books from the library in that order. Who borrowed the second most books? | Minju | [OP_LIST_SOL] Taehyung Minju Sangmin Yoonjeong Yoojung [OP_LIST_EOL] 2 [OP_LIST_GET] | var_a = 'Taehyung'
var_b = 'Minju'
var_c = 'Sangmin'
var_d = 'Yoonjeong'
var_e = 'Yoojung'
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
var_g = list_a[var_f-1]
print(var_g) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.