category
stringclasses 5
values | question
stringlengths 20
555
| answer
stringlengths 1
20
| solution_abst
stringlengths 1
287
| solution_code
stringlengths 27
5.97k
|
---|---|---|---|---|
Correspondence | It is said that adding 12 to 60 and then dividing by 3 is equal to a number subtracted by 12 and then multiplied by 3. Find the number. | 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 | What is the smallest number among the numbers greater than 1.1 among the numbers 1.4, 9/10, 1.2, 0.5, and 13/10? | 1.2 | [OP_LIST_SOL] 1.4 9/10 1.2 0.5 13/10 [OP_LIST_EOL] 1.1 [OP_LIST_MORE] 1 [OP_LIST_MIN] | 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)
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[var_g-1]
print('{:.2f}'.format(round(var_h+1e-10,2))) |
Correspondence | Yoongi multiplied 8 by some number and got 64. What number is it? | 8 | 64 8 [OP_DIV] | var_a = 64
var_b = 8
var_c = var_a / var_b
print(int(var_c)) |
Possibility | Each of the seven digits 0, 1, 2, 3, 4, 5, and 6 are used only once to form a seven-digit number. If this number is a multiple of 55, find the third largest number. | 6421305 | [OP_LIST_SOL] 0 1 2 3 4 5 6 [OP_LIST_EOL] 7 [OP_LIST_GET_PERM] 55 [OP_LIST_DIVISIBLE] 3 [OP_LIST_MAX] | var_a = 0
var_b = 1
var_c = 2
var_d = 3
var_e = 4
var_f = 5
var_g = 6
list_a= []
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_h = 7
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_h))
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_i = 55
list_c = []
var_i = int(var_i)
for i in list_b:
i = int(i)
if i % var_i == 0:
list_c.append(i)
var_j = 3
list_d=list_c.copy()
list_d.sort()
var_k = list_d[-var_j]
print(int(var_k)) |
Correspondence | A number multiplied by 4 and then multiplied by 25 gives 812. Find the 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 | If Mincheol has 3/4 meter (m) of purple string, 4/5 meter (m) of green string, and 2/3 meter (m) of white string, find out how many meters (m) of string Mincheol has. | 2.22 | 3/4 4/5 [OP_ADD] 2/3 [OP_ADD] | var_a = 0.75
var_b = 0.8
var_c = var_a + var_b
var_d = 0.6666666666666666
var_e = var_c + var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Arithmetic calculation | The length of the base of the trapezoid is 6/13 meters (m), and the height is 2 meters (m). How many times the length of its base is the length of its height? | 0.23 | 6/13 2 [OP_DIV] | var_a = 0.46153846153846156
var_b = 2
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Correspondence | Subtracting 2 from a certain number gives 5. What is the value of the certain number plus 2? | 9 | 5 2 [OP_ADD] 2 [OP_ADD] | var_a = 5
var_b = 2
var_c = var_a + var_b
var_d = 2
var_e = var_c + var_d
print(int(var_e)) |
Correspondence | The number of students in Jihoon's class is more than 35 and less than 70. If Jihoon's classmates form groups of 6, there will be 3 left, and if they form groups of 8, 1 will remain. Find the number of students in Jihoon's class. | 57 | 35 70 1 [OP_SUB] 1 [OP_LIST_ARANGE] 6 3 [OP_LIST_DIVIDE_AND_REMAIN] 8 1 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_GET] | var_a = 35
var_b = 70
var_c = 1
var_d = var_b - var_c
var_e = 1
list_a = [i for i in range(var_a, var_d + 1, var_e)]
var_f = 6
var_g = 3
list_b = []
var_f = int(var_f)
var_g = int(var_g)
if var_g < 0:
var_g = var_g + var_f
for i in list_a:
i = int(i)
if i%var_f == var_g:
list_b.append(i)
var_h = 8
var_i = 1
list_c = []
var_h = int(var_h)
var_i = int(var_i)
if var_i < 0:
var_i = var_i + var_h
for i in list_b:
i = int(i)
if i%var_h == var_i:
list_c.append(i)
var_j = 1
var_k = list_c[var_j-1]
print(int(var_k)) |
Correspondence | When the apples in the box were divided into 8 baskets in equal amounts, each basket contained 6 apples, leaving 4 apples. What is the number of apples divided by 8? | 6.5 | 6 8 [OP_MUL] 4 [OP_ADD] 8 [OP_DIV] | var_a = 6
var_b = 8
var_c = var_a * var_b
var_d = 4
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 | Yoongi subtracted 10 from a certain number and got 15. What is the value when 5 is added to the number? | 30 | 15 10 [OP_ADD] 5 [OP_ADD] | var_a = 15
var_b = 10
var_c = var_a + var_b
var_d = 5
var_e = var_c + var_d
print(int(var_e)) |
Geometry | The sum of all the lengths of the cube where two sides meet is 108 centimetres (cm). In this cube, what is the length in centimetres of the line segment that connects one vertex to the next? | 9 | 108 4 3 [OP_MUL] [OP_DIV] | var_a = 108
var_b = 4
var_c = 3
var_d = var_b * var_c
var_e = var_a / var_d
print(int(var_e)) |
Geometry | Find how many centimeters (cm) a wire of length 28 centimeters (cm) becomes when divided into quarters. | 7 | 28 4 [OP_DIV] | var_a = 28
var_b = 4
var_c = var_a / var_b
print(int(var_c)) |
Geometry | There is a pyramid whose sum of the number of vertices and the number of faces is 16. How many edges does this pyramid have? | 14 | 16 2 [OP_DIV] 1 [OP_SUB] 2 [OP_MUL] | var_a = 16
var_b = 2
var_c = var_a / var_b
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e * var_f
print(int(var_g)) |
Arithmetic calculation | Find the average of the multiples of 6 among the natural numbers from 1 to 100. | 51 | 1 100 1 [OP_LIST_ARANGE] 6 [OP_LIST_DIVISIBLE] [OP_LIST_MEAN] | var_a = 1
var_b = 100
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 6
list_b = []
var_d = int(var_d)
for i in list_a:
i = int(i)
if i % var_d == 0:
list_b.append(i)
list_b = [float(i) for i in list_b]
var_e = sum(list_b)/len(list_b)
print(int(var_e)) |
Geometry | How many diagonals can be drawn in the figure below? : Pentadecagon | 90 | 15 15 3 [OP_SUB] [OP_MUL] 2 [OP_DIV] | var_a = 15
var_b = 15
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 | Given two distinct points, how many straight lines pass through these two points? | 1 | 1 | var_a = 1
print(int(var_a)) |
Geometry | Ten friends are standing on the playground in the shape of a decagon. If you shake hands with all of your friends once, except for the person standing next to you, how many handshakes will you make? | 35 | 10 10 3 [OP_SUB] [OP_MUL] 2 [OP_DIV] | var_a = 10
var_b = 10
var_c = 3
var_d = var_b - var_c
var_e = var_a * var_d
var_f = 2
var_g = var_e / var_f
print(int(var_g)) |
Arithmetic calculation | Cars are equally spaced from the front and back on the road. If the distance between the first car and the last car is 242 meters (m), and the distance between the cars is 5.5 meters (m), how many cars are on the street? | 45 | 242 5.5 [OP_FDIV] 1 [OP_ADD] | var_a = 242
var_b = 5.5
var_c = var_a // var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Correspondence | I have to add 273 to a number, but I accidentally subtract it from a number, and it became 477. How much is it if I calculate it correctly? | 1023 | 477 273 [OP_ADD] 273 [OP_ADD] | var_a = 477
var_b = 273
var_c = var_a + var_b
var_d = 273
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | When adding a four-digit number to a two-digit number, the 8 in the ones place of the four-digit number was mistaken for 5, and the tens and ones places of the two-digit number were swapped and the number was mistaken for 63. In these circumstances, the result of the calculation was 2708. Find the result of the correct calculation. | 2738 | 2708 8 5 [OP_SUB] [OP_ADD] 63 36 [OP_SUB] [OP_ADD] | var_a = 2708
var_b = 8
var_c = 5
var_d = var_b - var_c
var_e = var_a + var_d
var_f = 63
var_g = 36
var_h = var_f - var_g
var_i = var_e + var_h
print(int(var_i)) |
Possibility | I'm trying to seat three sophomores and two freshmen in five single-row chairs. Find the case where three sophomores are sitting right next to each other. | 36 | [OP_LIST_SOL] A B C D E [OP_LIST_EOL] [OP_LIST_SOL] A C [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_LIST_SOL] A C E [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_MUL] | var_a = 'A'
var_b = 'B'
var_c = 'C'
var_d = 'D'
var_e = 'E'
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 = 'A'
var_g = 'C'
list_b= []
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
list_c = list(set(list_a) - set(list_b))
var_h = len(list_c)
var_i = len(list_c)
var_j = 1
var_h = int(var_h)
var_i = int(var_i)
for i, elem in enumerate(range(var_i)):
var_j = var_j * (var_h-i)
var_k = 'A'
var_l = 'C'
var_m = 'E'
list_d= []
if "/" in str(var_m):
var_m = eval(str(var_m))
list_d.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_d.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_d.append(var_k)
list_d.reverse()
var_n = len(list_d)
var_o = len(list_d)
var_p = 1
var_n = int(var_n)
var_o = int(var_o)
for i, elem in enumerate(range(var_o)):
var_p = var_p * (var_n-i)
var_q = var_j * var_p
print(int(var_q)) |
Arithmetic calculation | The sum of 5 consecutive odd numbers is 195. Write the 2nd largest of these 5 odd numbers. | 41 | 195 5 [OP_DIV] 5 2 [OP_FDIV] 2 [OP_MUL] [OP_ADD] 2 [OP_SUB] | var_a = 195
var_b = 5
var_c = var_a / var_b
var_d = 5
var_e = 2
var_f = var_d // var_e
var_g = 2
var_h = var_f * var_g
var_i = var_c + var_h
var_j = 2
var_k = var_i - var_j
print(int(var_k)) |
Arithmetic calculation | You went fishing and caught 4 fish (a) and 3 fish (b) in the morning. I caught a few more fish in the afternoon, so today you caught 10 fish in total. How many fish did you catch in the afternoon? | 3 | 10 4 3 [OP_ADD] [OP_SUB] | var_a = 10
var_b = 4
var_c = 3
var_d = var_b + var_c
var_e = var_a - var_d
print(int(var_e)) |
Correspondence | A certain number is a single digit. This number is greater than 0 and less than 2. Find this number. | 1 | 1 9 1 [OP_LIST_ARANGE] 0 [OP_LIST_MORE] 2 [OP_LIST_LESS] 1 [OP_LIST_GET] | var_a = 1
var_b = 9
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 0
list_b = []
for i in list_a:
if i > var_d:
list_b.append(i)
var_e = 2
list_c = []
for i in list_b:
if i < var_e:
list_c.append(i)
var_f = 1
var_g = list_c[var_f-1]
print(int(var_g)) |
Arithmetic calculation | If Miseon has 5 10,000 won bills, 3 1,000 won bills, and 9 100 won coins, find how much money he has in total. | 53900 | 10000 5 [OP_MUL] 1000 3 [OP_MUL] 100 9 [OP_MUL] [OP_ADD] [OP_ADD] | var_a = 10000
var_b = 5
var_c = var_a * var_b
var_d = 1000
var_e = 3
var_f = var_d * var_e
var_g = 100
var_h = 9
var_i = var_g * var_h
var_j = var_f + var_i
var_k = var_c + var_j
print(int(var_k)) |
Arithmetic calculation | There were several pieces of colored paper. When 9 of them were used, 12 were left. How many sheets of colored paper were there at the beginning? | 21 | 12 9 [OP_ADD] | var_a = 12
var_b = 9
var_c = var_a + var_b
print(int(var_c)) |
Geometry | What is the area in square meters (m2) of a square field with a side length of 14.25 meters (m)? | 203.06 | 14.25 2 [OP_POW] | var_a = 14.25
var_b = 2
var_c = var_a ** var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Comparison | A horse, a cow, a pig, a sheep, a rabbit, and a squirrel entered the fence in that order. Which animal came in fourth place? | sheep | [OP_LIST_SOL] horse cow pig sheep rabbit squirrel [OP_LIST_EOL] 4 [OP_LIST_GET] | var_a = 'horse'
var_b = 'cow'
var_c = 'pig'
var_d = 'sheep'
var_e = 'rabbit'
var_f = 'squirrel'
list_a= []
if "/" in str(var_f):
var_f = eval(str(var_f))
list_a.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_g = 4
var_h = list_a[var_g-1]
print(var_h) |
Correspondence | 3A-21=14. Find the value of A. | 5 | 3A-21=14 A [OP_DIGIT_UNK_SOLVER] | var_a = '3A-21=14'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Correspondence | 6 is the result of accidentally dividing a number by 15 when it is supposed to be multiplied by 15. How much do you get if you calculate correctly? | 1350 | 15 6 15 [OP_MUL] [OP_MUL] | var_a = 15
var_b = 6
var_c = 15
var_d = var_b * var_c
var_e = var_a * var_d
print(int(var_e)) |
Geometry | You are going to use all of the 30 centimeters (cm) of wire to make one rectangular shape. If the short side of the rectangle is 7 centimeters (cm), how many centimeters (cm) should the long side be? | 8 | 30 2 [OP_DIV] 7 [OP_SUB] | var_a = 30
var_b = 2
var_c = var_a / var_b
var_d = 7
var_e = var_c - var_d
print(int(var_e)) |
Comparison | Which of the three numbers 5, 8, and 4 is the second largest? | 5 | [OP_LIST_SOL] 5 8 4 [OP_LIST_EOL] 2 [OP_LIST_MAX] | var_a = 5
var_b = 8
var_c = 4
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 2
list_b=list_a.copy()
list_b.sort()
var_e = list_b[-var_d]
print(int(var_e)) |
Geometry | There is an icosagon. How many diagonals can be drawn from a vertex? | 17 | 20 3 [OP_SUB] | var_a = 20
var_b = 3
var_c = var_a - var_b
print(int(var_c)) |
Correspondence | A, B, and C are three different natural numbers. When A is divided by 11, the quotient is B and the remainder is C. Find the largest number that can be C. | 10 | 11 1 [OP_SUB] | var_a = 11
var_b = 1
var_c = var_a - var_b
print(int(var_c)) |
Correspondence | I need to add 32, but I accidently added 23 to some number, and I got 68 as a result. What number is this? | 45 | 68 23 [OP_SUB] | var_a = 68
var_b = 23
var_c = var_a - var_b
print(int(var_c)) |
Possibility | What is the difference between the largest number and the third smallest number possible when forming a number greater than or equal to 100 and less than 1000 with using odd numbers less than or equal to 5 only once? | 216 | 0 5 [OP_LIST_ODD] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 3 [OP_LIST_MIN] [OP_SUB] | var_a = 0
var_b = 5
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 = 3
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 = 1
list_c=list_b.copy()
list_c.sort()
var_e = list_c[-var_d]
var_f = 3
list_d=list_b.copy()
list_d.sort()
var_g = list_d[var_f-1]
var_h = var_e - var_g
print(int(var_h)) |
Geometry | What is the perimeter in centimeters (cm) of an isosceles triangle with two sides measuring 12 centimeters (cm) and the other side measuring 17 centimeters (cm)? | 41 | 12 2 [OP_MUL] 17 [OP_ADD] | var_a = 12
var_b = 2
var_c = var_a * var_b
var_d = 17
var_e = var_c + var_d
print(int(var_e)) |
Geometry | A regular pentagon with one edge 16 centimetres (cm) long is made with one piece of thread. If the same thread is used to make an octagon, find the length of one edge of the octagon. | 10 | 16 5 [OP_MUL] 8 [OP_DIV] | var_a = 16
var_b = 5
var_c = var_a * var_b
var_d = 8
var_e = var_c / var_d
print(int(var_e)) |
Possibility | There are 4 types of pencils and 6 types of ballpoint pens. How many ways can you choose one type of pencil and one type of ballpoint pen? | 24 | 4 6 [OP_MUL] | var_a = 4
var_b = 6
var_c = var_a * var_b
print(int(var_c)) |
Comparison | A and 24 are different natural numbers. If these two numbers are divisors or multiples of each other, find the third smallest of the two-digit numbers corresponding to A. | 3 | 24 [OP_LIST_GET_DIVISOR] 24 99 24 [OP_LIST_ARANGE] [OP_SET_UNION] 3 [OP_LIST_MIN] | var_a = 24
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 = 24
var_c = 99
var_d = 24
list_b = [i for i in range(var_b, var_c + 1, var_d)]
list_c = list(set(list_a) | set(list_b))
var_e = 3
list_d=list_c.copy()
list_d.sort()
var_f = list_d[var_e-1]
print(int(var_f)) |
Possibility | If there are five number cards 4, 2, 8, 1, and 9, what is the value when each number card is used only once to make the largest quotient from (three-digit number)/(double-digit number)? | 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)) |
Arithmetic calculation | Suppose you have 49 rabbits and 37 frogs on the farm. The total number of frogs and chickens is larger than rabbits by 9. How many chickens do you have? | 21 | 49 9 [OP_ADD] 37 [OP_SUB] | var_a = 49
var_b = 9
var_c = var_a + var_b
var_d = 37
var_e = var_c - var_d
print(int(var_e)) |
Comparison | Nine people stand in a line in order of shortest to tallest. Hoseok stands at the very back. If you line up again in order of the tallest to the tallest, what number will Hoseok stand from the back? | 9 | 9 1 [OP_SUB] 1 [OP_ADD] | var_a = 9
var_b = 1
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Geometry | A triangular pyramid has a base area of 3 square centimeters (cm2) and a side area of 6 square centimeters (cm2). Find the surface area of this triangular pyramid. | 21 | 3 6 3 [OP_MUL] [OP_ADD] | var_a = 3
var_b = 6
var_c = 3
var_d = var_b * var_c
var_e = var_a + var_d
print(int(var_e)) |
Possibility | You have 2 chances to draw from the basket. If there are 1 apple, 1 peach, 1 pear, and 1 melon in each basket, how many ways can you pick them? | 6 | [OP_LIST_SOL] apple peach pear melon [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_COMB] | var_a = 'apple'
var_b = 'peach'
var_c = 'pear'
var_d = 'melon'
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 = len(list_a)
var_f = 2
var_g = 1
var_e = int(var_e)
var_f = int(var_f)
for i, elem in enumerate(range(var_f)):
var_g = var_g * (var_e-i)
for i, elem in enumerate(range(var_f)):
var_g = var_g / (i+1)
print(int(var_g)) |
Comparison | There is a cube whose length is 5 centimeters (cm), and a cuboid B with the width, depth, and height of 4 centimeters (cm), 5 centimeters (cm), and 6 centimeters (cm), respectively. Find which of A and B has the greater volume. | A | [OP_LIST_SOL] A B [OP_LIST_EOL] [OP_LIST_SOL] 5 3 [OP_POW] 4 5 6 [OP_MUL] [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 = 5
var_d = 3
var_e = var_c ** var_d
var_f = 4
var_g = 5
var_h = 6
var_i = var_g * var_h
var_j = var_f * var_i
list_b= []
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_k = 1
list_c=list_b.copy()
list_c.sort()
var_l = list_c[-var_k]
var_m = list_b.index(var_l)+1
var_n = list_a[var_m-1]
print(var_n) |
Arithmetic calculation | Kyuhyung and Hanbyeol shared the 15,000 won allowance that their mother gave them. If Kyuhyung got 2400 won less than Hanbyeol, how much did Kyuhyung get? | 6300 | 15000 2400 [OP_SUB] 2 [OP_DIV] | var_a = 15000
var_b = 2400
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e)) |
Arithmetic calculation | Yumi counted a number by reducing 10 for 4 times. If the original number was 320, what is the value of Yumi counted? | 280 | 320 10 4 [OP_MUL] [OP_SUB] | var_a = 320
var_b = 10
var_c = 4
var_d = var_b * var_c
var_e = var_a - var_d
print(int(var_e)) |
Possibility | Try to make a signal by throwing a coin 3 times. How many possible signals are there in all? | 8 | 2 3 [OP_POW] | var_a = 2
var_b = 3
var_c = var_a ** var_b
print(int(var_c)) |
Arithmetic calculation | Find the sum of odd numbers in the sequence from 1 to 200. | 10000 | 1 200 [OP_LIST_ODD] [OP_LIST_SUM] | var_a = 1
var_b = 200
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)
list_a = [float(i) for i in list_a]
var_c = sum(list_a)
print(int(var_c)) |
Comparison | 25 students stand in a line. When 9 students are standing behind Yuna, how many students are standing in front of Yuna? | 15 | 25 9 [OP_SUB] 1 [OP_SUB] | var_a = 25
var_b = 9
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e)) |
Geometry | The sum of the vertices, faces, and edges of a certain prism is 44. How many edges does this prism have? | 21 | 44 2 [OP_SUB] 2 1 [OP_ADD] 3 [OP_ADD] [OP_DIV] 3 [OP_MUL] | var_a = 44
var_b = 2
var_c = var_a - var_b
var_d = 2
var_e = 1
var_f = var_d + var_e
var_g = 3
var_h = var_f + var_g
var_i = var_c / var_h
var_j = 3
var_k = var_i * var_j
print(int(var_k)) |
Comparison | Each Dongkyun, Youngtak, and Seunghwan have cookies. If Dongkyun has more cookies than Youngtak, and Seunghwan has more cookies than Dongkyun, who has the most cookies? | Seunghwan | [OP_LIST_SOL] Dongkyun Youngtak Seunghwan [OP_LIST_EOL] [OP_LIST_SOL] Dongkyun Youngtak > Seunghwan Dongkyun > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET] | var_a = 'Dongkyun'
var_b = 'Youngtak'
var_c = 'Seunghwan'
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 'Dongkyun'
var_e = 'Youngtak'
var_f = '>'
var_g = 'Seunghwan'
var_h = 'Dongkyun'
var_i = '>'
list_b= []
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
if cond_ in ("<", ">", "="):
operand_right = temp_stack.pop()
operand_left = temp_stack.pop()
if cond_ == "=":
cond_ = "=="
conditions.append(f"{operand_left} {cond_} {operand_right}")
else:
if not cond_.isdigit():
cond_ = "{" + cond_ + "}"
temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
item_name_index_dict = dict(zip(items_name_list, perm))
formatted_conditions = \
[condition.format_map(item_name_index_dict) for condition in conditions]
if all(map(eval, formatted_conditions)):
break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_j = 1
var_k = list_c[var_j-1]
print(var_k) |
Correspondence | Rounding down 6A76 to the hundreds place gives 6800. Find A. | 8 | 6A76 [OP_GEN_POSSIBLE_LIST] 6800 [OP_LIST_MORE_EQUAL] 6800 100 [OP_ADD] [OP_LIST_LESS] 6A76 A [OP_LIST_FIND_UNK] | var_a = '6A76'
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 = 6800
list_b = []
for i in list_a:
if i >= var_b:
list_b.append(i)
var_c = 6800
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 = '6A76'
var_g = 'A'
var_f = str(var_f)
var_g = str(var_g)
unk_idx = var_f.index(var_g)
var_h = 0
for elem in list_c:
elem = str(elem)
var_h = int(elem[unk_idx])
print(int(var_h)) |
Geometry | A circular plate with a radius of 15 centimeters (cm) has a circumference of 90 centimeters (cm). How many times is the plate's circumference longer than its diameter? | 3 | 90 15 2 [OP_MUL] [OP_DIV] | var_a = 90
var_b = 15
var_c = 2
var_d = var_b * var_c
var_e = var_a / var_d
print(int(var_e)) |
Correspondence | Ye-seul gave Ga-yeong 10 more than 1/4 of the colored papers she had, gave Sang-yeon 5 less than 3/5 of the remaining papers, and used 12 of the remaining papers to make an art piece. There are 13 papers left. How many colored papers did Ye-seul have at first? | 80 | 13 12 [OP_ADD] 5 [OP_SUB] 1 3/5 [OP_SUB] [OP_DIV] 10 [OP_ADD] 1 1/4 [OP_SUB] [OP_DIV] | var_a = 13
var_b = 12
var_c = var_a + var_b
var_d = 5
var_e = var_c - var_d
var_f = 1
var_g = 0.6
var_h = var_f - var_g
var_i = var_e / var_h
var_j = 10
var_k = var_i + var_j
var_l = 1
var_m = 0.25
var_n = var_l - var_m
var_o = var_k / var_n
print(int(var_o)) |
Geometry | There are two water bottles with a capacity of 4 liters (L) and 436 milliliters (ml) and two water bottles with a capacity of 1999 milliliters (ml). Find the weight in kilograms (kg) of these bottles when they are full of water. | 12.87 | 4 436 1000 [OP_DIV] [OP_ADD] 1999 1000 [OP_DIV] [OP_ADD] 2 [OP_MUL] | var_a = 4
var_b = 436
var_c = 1000
var_d = var_b / var_c
var_e = var_a + var_d
var_f = 1999
var_g = 1000
var_h = var_f / var_g
var_i = var_e + var_h
var_j = 2
var_k = var_i * var_j
print('{:.2f}'.format(round(var_k+1e-10,2))) |
Arithmetic calculation | I am about to read the book in 4 days. I read 1/2 of the book on the first day and 1/4 of the book on the second day. Then on the third day, I read 1/6 of the entire book and on the fourth day, I had 20 pages left. Find how many pages are in the entire book. | 240 | 20 1 1/2 1/4 [OP_ADD] 1/6 [OP_ADD] [OP_SUB] [OP_DIV] | var_a = 20
var_b = 1
var_c = 0.5
var_d = 0.25
var_e = var_c + var_d
var_f = 0.16666666666666666
var_g = var_e + var_f
var_h = var_b - var_g
var_i = var_a / var_h
print(int(eval('{:.2f}'.format(round(var_i+1e-10,2))))) |
Correspondence | When you divide a number by 11 and add 156, you get 178. Find the number. | 242 | 178 156 [OP_SUB] 11 [OP_MUL] | var_a = 178
var_b = 156
var_c = var_a - var_b
var_d = 11
var_e = var_c * var_d
print(int(var_e)) |
Correspondence | Find the sum of A, B, C, and D that satisfies A00B-50C9=1D93. Different alphabets represent different single-digit numbers. | 18 | [OP_LIST_SOL] A00B-50C9=1D93 A [OP_DIGIT_UNK_SOLVER] A00B-50C9=1D93 B [OP_DIGIT_UNK_SOLVER] A00B-50C9=1D93 C [OP_DIGIT_UNK_SOLVER] A00B-50C9=1D93 D [OP_DIGIT_UNK_SOLVER] [OP_LIST_EOL] [OP_LIST_SUM] | var_a = 'A00B-50C9=1D93'
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 = 'A00B-50C9=1D93'
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 = 'A00B-50C9=1D93'
var_h = 'C'
ans_dict = dict()
var_g = var_g.replace('×','*')
var_g = var_g.replace('x','*')
var_g = var_g.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_g):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_g
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_g):
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_i = ans_dict[var_h]
var_j = 'A00B-50C9=1D93'
var_k = 'D'
ans_dict = dict()
var_j = var_j.replace('×','*')
var_j = var_j.replace('x','*')
var_j = var_j.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_j):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_j
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_j):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_l = ans_dict[var_k]
list_a= []
if "/" in str(var_l):
var_l = eval(str(var_l))
list_a.append(var_l)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_a.append(var_i)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_a.append(var_f)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
list_a.reverse()
list_a = [float(i) for i in list_a]
var_m = sum(list_a)
print(int(var_m)) |
Possibility | If the numbers 1, 5, 9 and 4 are each used once to make a number, what is the third largest three-digit number with a tens digit of 5? | 459 | [OP_LIST_SOL] 1 5 9 4 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 10 5 [OP_LIST_SEARCH_FIXED_DIGIT] 3 [OP_LIST_MAX] | var_a = 1
var_b = 5
var_c = 9
var_d = 4
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 = 5
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 = 3
list_d=list_c.copy()
list_d.sort()
var_i = list_d[-var_h]
print(int(var_i)) |
Arithmetic calculation | Haechan ran at a speed of 150 meters (m) in 20 seconds. How many meters (m) did Haechan run in 1 minute? | 450 | 1 60 [OP_MUL] 20 [OP_DIV] 150 [OP_MUL] | var_a = 1
var_b = 60
var_c = var_a * var_b
var_d = 20
var_e = var_c / var_d
var_f = 150
var_g = var_e * var_f
print(int(var_g)) |
Arithmetic calculation | A swimming pool was filled with only 7 liters (L) and 200 milliliters (㎖) of water, which was supposed to have 15 liters (L) of water in it. If the water hose can fill the pool at a rate of 600 milliliters (ml) per second, how many seconds does it take to fill it with all 15 liters (L)? | 13 | 15 1000 [OP_MUL] 7 1000 [OP_MUL] 200 [OP_ADD] [OP_SUB] 600 [OP_DIV] 1 [OP_CEIL] | var_a = 15
var_b = 1000
var_c = var_a * var_b
var_d = 7
var_e = 1000
var_f = var_d * var_e
var_g = 200
var_h = var_f + var_g
var_i = var_c - var_h
var_j = 600
var_k = var_i / var_j
var_l = 1
var_m=int(((var_k+9*10**(var_l-2))//(10**(var_l-1)))*10**(var_l-1))
print(int(var_m)) |
Comparison | Jimin got (a) box and (b) box for presents. When a (a) box is lighter than a (b) box, which box is a lighter box? | (a) | [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) |
Comparison | Nine people stand in a line in order from shortest to tallest. Hoseok is standing 5th from the back. If you line up again in order from the tallest to the shortest, what number will Hoseok stand from the back? | 5 | 9 5 [OP_SUB] 1 [OP_ADD] | var_a = 9
var_b = 5
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Geometry | You want to plant trees at intervals of 3.1 meters (m) in a circular garden with a circumference of 27.9 meters (m). Find how many trees you can plant. | 9 | 27.9 3.1 [OP_DIV] | var_a = 27.9
var_b = 3.1
var_c = var_a / var_b
print(int(var_c)) |
Arithmetic calculation | 10 rows of marbles are placed. 8 of them were placed in 9 rows, and 4 were placed in the other row. How many marbles are there in all? | 76 | 9 8 [OP_MUL] 1 4 [OP_MUL] [OP_ADD] | var_a = 9
var_b = 8
var_c = var_a * var_b
var_d = 1
var_e = 4
var_f = var_d * var_e
var_g = var_c + var_f
print(int(var_g)) |
Geometry | How many triangles are formed by drawing a diagonal from one vertex of an octagon? | 6 | 8 3 [OP_SUB] 1 [OP_ADD] | var_a = 8
var_b = 3
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Possibility | Eunhee is about to clean the classroom with her five friends. When she has to select 2 people to be in charge of the classroom floor and 1 person to be in charge of the window, find the number of cases where Eunhee becomes in charge of the classroom floor. | 12 | 5 1 [OP_SUB] 2 1 [OP_SUB] 1 [OP_ADD] [OP_PERM] | var_a = 5
var_b = 1
var_c = var_a - var_b
var_d = 2
var_e = 1
var_f = var_d - var_e
var_g = 1
var_h = var_f + var_g
var_i = 1
var_c = int(var_c)
var_h = int(var_h)
for i, elem in enumerate(range(var_h)):
var_i = var_i * (var_c-i)
print(int(var_i)) |
Arithmetic calculation | Seohyun donates to a total of two places. If she had donated 1 million won 25 times to one place and 8 times to the other by 100,000 won, how much money has Seohyun donated so far? | 25800000 | 100 10000 [OP_MUL] 25 [OP_MUL] 10 10000 [OP_MUL] 8 [OP_MUL] [OP_ADD] | var_a = 100
var_b = 10000
var_c = var_a * var_b
var_d = 25
var_e = var_c * var_d
var_f = 10
var_g = 10000
var_h = var_f * var_g
var_i = 8
var_j = var_h * var_i
var_k = var_e + var_j
print(int(var_k)) |
Correspondence | Suppose Jimin wanted to do the addition of a certain number and 34. But she made a mistake by subtracting a number from 20 and got 60. Find the value that Jimin actually wanted to get. | -6 | 34 20 60 [OP_SUB] [OP_ADD] | var_a = 34
var_b = 20
var_c = 60
var_d = var_b - var_c
var_e = var_a + var_d
print(int(var_e)) |
Correspondence | If you add 2 to a number before subtracting 3, you get 7. What number is this? | 8 | 7 3 [OP_ADD] 2 [OP_SUB] | var_a = 7
var_b = 3
var_c = var_a + var_b
var_d = 2
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | 36 is the result adding 12 to a number divided by 7. Find the value of this number divided by 4. | 42 | 36 12 [OP_SUB] 7 [OP_MUL] 4 [OP_DIV] | var_a = 36
var_b = 12
var_c = var_a - var_b
var_d = 7
var_e = var_c * var_d
var_f = 4
var_g = var_e / var_f
print(int(var_g)) |
Correspondence | 29 is subtracted from and 64 added to this number. What number is required for the result of this to be 76? | 41 | 76 64 [OP_SUB] 29 [OP_ADD] | var_a = 76
var_b = 64
var_c = var_a - var_b
var_d = 29
var_e = var_c + var_d
print(int(var_e)) |
Correspondence | When 27 is divided by a number, the quotient is 5 and the remainder is 7. Find the value that is divisible by the sum of the number and 5, and has a quotient of 7. | 63 | 27 7 [OP_SUB] 5 [OP_DIV] 5 [OP_ADD] 7 [OP_MUL] | var_a = 27
var_b = 7
var_c = var_a - var_b
var_d = 5
var_e = var_c / var_d
var_f = 5
var_g = var_e + var_f
var_h = 7
var_i = var_g * var_h
print(int(var_i)) |
Arithmetic calculation | Heungbu and his family decided to fetch 10 liters (l) of water from the village well for farming. Heungbu scooped up the water three times with a 1 liter (L) and 500 milliliter (㎖) bowl, and Heungbu's wife scooped up the water once with a 1 liter (L) and 750 milliliters (㎖) bowl. When Heungbu's son decided to fetch all the remaining water, how many times did he have to visit the well if he had a bowl of 1 liter (L) and 250 milliliters (㎖)? | 3 | 10 1000 [OP_MUL] 1 1000 [OP_MUL] 500 [OP_ADD] 3 [OP_MUL] [OP_SUB] 1 1000 [OP_MUL] 750 [OP_ADD] [OP_SUB] 1 1000 [OP_MUL] 250 [OP_ADD] [OP_DIV] | var_a = 10
var_b = 1000
var_c = var_a * var_b
var_d = 1
var_e = 1000
var_f = var_d * var_e
var_g = 500
var_h = var_f + var_g
var_i = 3
var_j = var_h * var_i
var_k = var_c - var_j
var_l = 1
var_m = 1000
var_n = var_l * var_m
var_o = 750
var_p = var_n + var_o
var_q = var_k - var_p
var_r = 1
var_s = 1000
var_t = var_r * var_s
var_u = 250
var_v = var_t + var_u
var_w = var_q / var_v
print(int(var_w)) |
Arithmetic calculation | The size of six box (C) equals the size of box (B), and the size of four box (B) equals the size of box (A). How many box (C) should you put in box (A) to make it full? | 24 | 4 6 [OP_MUL] 1 [OP_MUL] | var_a = 4
var_b = 6
var_c = var_a * var_b
var_d = 1
var_e = var_c * var_d
print(int(var_e)) |
Comparison | To fill the bathtub with water, you need to pour 7 times using the red bucket, 8 times of the blue bucket, and 5 times of the green bucket. Which color of the bucket will contain the most water when each of them is filled up with water? | green | [OP_LIST_SOL] red blue green [OP_LIST_EOL] [OP_LIST_SOL] 1 7 [OP_DIV] 1 8 [OP_DIV] 1 5 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'red'
var_b = 'blue'
var_c = 'green'
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 = 7
var_f = var_d / var_e
var_g = 1
var_h = 8
var_i = var_g / var_h
var_j = 1
var_k = 5
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) |
Comparison | During PE class, students lined up in a single line in order of height from the tallest. Jungkook is the 7th and Minyoung is the 5th. Taehyung is taller than Minyoung but shorter than Jungkook. What number is Taehyung? | 6 | 5 7 [OP_ADD] 2 [OP_FDIV] | var_a = 5
var_b = 7
var_c = var_a + var_b
var_d = 2
var_e = var_c // var_d
print(int(var_e)) |
Arithmetic calculation | There are five numbers 10, 11, 12, 13, and 14. Divide the smallest number by the second smallest number. | 0.91 | [OP_LIST_SOL] 10 11 12 13 14 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_DIV] | 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-1]
var_h = 2
list_c=list_a.copy()
list_c.sort()
var_i = list_c[var_h-1]
var_j = var_g / var_i
print('{:.2f}'.format(round(var_j+1e-10,2))) |
Arithmetic calculation | If you want to put 2135 candies in a box with 100 candies each, how many boxes are needed at least? | 22 | 2153 100 [OP_DIV] 1 [OP_CEIL] | var_a = 2153
var_b = 100
var_c = var_a / var_b
var_d = 1
var_e=int(((var_c+9*10**(var_d-2))//(10**(var_d-1)))*10**(var_d-1))
print(int(var_e)) |
Arithmetic calculation | How many trips are needed to transport 48 crates weighing 1 kg (kg) using 6 carts that can carry up to 4 kg (kg) at the same time? | 2 | 48 4 6 [OP_MUL] [OP_DIV] | var_a = 48
var_b = 4
var_c = 6
var_d = var_b * var_c
var_e = var_a / var_d
print(int(var_e)) |
Correspondence | Five digit number A375B is a multiple of 24. Find the number of single digit numbers that fit in A. | 3 | A375B [OP_GEN_POSSIBLE_LIST] 24 [OP_LIST_DIVISIBLE] A375B A [OP_LIST_FIND_UNK] [OP_LIST_LEN] | var_a = 'A375B'
ans_dict = dict()
var_a = str(var_a)
list_a = []
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 0
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
if len(var_a) == len(str(int(temp))):
new_elem = int(temp)
list_a.append(new_elem)
var_b = 24
list_b = []
var_b = int(var_b)
for i in list_a:
i = int(i)
if i % var_b == 0:
list_b.append(i)
var_c = 'A375B'
var_d = 'A'
var_c = str(var_c)
var_d = str(var_d)
unk_idx = var_c.index(var_d)
list_c = []
for elem in list_b:
elem = str(elem)
list_c.append(int(elem[unk_idx]))
list_c = list(set(list_c))
var_e = len(list_c)
print(int(var_e)) |
Comparison | Eunji got on the train in 10th place. 11 more people got on the train following Eunji, and then Yuna got on the train. When did Yuna get on the train? Answer in ordinal number. | 22 | 10 11 [OP_ADD] 1 [OP_ADD] | var_a = 10
var_b = 11
var_c = var_a + var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Comparison | You are comparing the area of a regular square and a regular triangle. A side of a square is 4 centimeters (cm). If the triangle is 4 centimeters (cm) high and the base is 6 centimeters (cm), choose the wider one. | square | [OP_LIST_SOL] square triangle [OP_LIST_EOL] [OP_LIST_SOL] 4 2 [OP_POW] 6 4 [OP_MUL] 2 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'square'
var_b = 'triangle'
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 = 2
var_e = var_c ** var_d
var_f = 6
var_g = 4
var_h = var_f * var_g
var_i = 2
var_j = var_h / var_i
list_b= []
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_k = 1
list_c=list_b.copy()
list_c.sort()
var_l = list_c[-var_k]
var_m = list_b.index(var_l)+1
var_n = list_a[var_m-1]
print(var_n) |
Comparison | The four students, Yoongi, Jungkook, Yuna, and Yoojung, each have the numbers 7, 6, 9, and 8. Whose number is the biggest? | Yuna | [OP_LIST_SOL] Yoongi Jungkook Yuna Yoojung [OP_LIST_EOL] [OP_LIST_SOL] 7 6 9 8 [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'
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 = 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 | Hajun went to school 5 times and it took him 1 hour and 36 minutes. How many minutes does it take to go once? | 19.2 | 1 60 [OP_MUL] 36 [OP_ADD] 5 [OP_DIV] | var_a = 1
var_b = 60
var_c = var_a * var_b
var_d = 36
var_e = var_c + var_d
var_f = 5
var_g = var_e / var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Comparison | There are 24 marbles. Of these, the red marbles are 1/4 of the total, the amount of blue marbles is 6 more than that of the red marbles, and the rest are yellow marbles. What color marbles do you have the most? | blue | [OP_LIST_SOL] red blue yellow [OP_LIST_EOL] [OP_LIST_SOL] 24 4 [OP_DIV] 24 4 [OP_DIV] 6 [OP_ADD] 24 24 4 [OP_DIV] 6 [OP_ADD] [OP_SUB] 24 4 [OP_DIV] [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'red'
var_b = 'blue'
var_c = 'yellow'
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 = 24
var_e = 4
var_f = var_d / var_e
var_g = 24
var_h = 4
var_i = var_g / var_h
var_j = 6
var_k = var_i + var_j
var_l = 24
var_m = 24
var_n = 4
var_o = var_m / var_n
var_p = 6
var_q = var_o + var_p
var_r = var_l - var_q
var_s = 24
var_t = 4
var_u = var_s / var_t
var_v = var_r - var_u
list_b= []
if "/" in str(var_v):
var_v = eval(str(var_v))
list_b.append(var_v)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
var_w = 1
list_c=list_b.copy()
list_c.sort()
var_x = list_c[-var_w]
var_y = list_b.index(var_x)+1
var_z = list_a[var_y-1]
print(var_z) |
Geometry | Trees were planted in a square shape in the open field. If 5 trees are planted per side, how many trees should be planted? | 16 | 5 4 [OP_MUL] 4 [OP_SUB] | var_a = 5
var_b = 4
var_c = var_a * var_b
var_d = 4
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | Minchan is organizing the gym storage. If there are 240 baseballs, ping-pong balls, and tennis balls in total, the baseballs are divided into 35 boxes of 4 each, and the tennis balls are divided into 6 boxes of 3 each. How many ping-pong balls are there if all remaining balls are ping-pong balls? | 82 | 240 4 35 [OP_MUL] [OP_SUB] 3 6 [OP_MUL] [OP_SUB] | var_a = 240
var_b = 4
var_c = 35
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 3
var_g = 6
var_h = var_f * var_g
var_i = var_e - var_h
print(int(var_i)) |
Possibility | Kyungsoo went to a stationery store with a friend. If there are 3 types of pencils and 5 types of ballpoint pens in the stationery store, in how many ways can Kyungsoo choose one pencil and one ballpoint pen? | 15 | 3 1 [OP_COMB] 5 1 [OP_COMB] [OP_MUL] | var_a = 3
var_b = 1
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)
var_d = 5
var_e = 1
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)
var_g = var_c * var_f
print(int(var_g)) |
Comparison | Taehee jumped rope 23 times yesterday, and Jihoon did 35 times. Today, Taehee did 14 times more than yesterday, but Jihoon did 19 times less than yesterday. Who jumped more ropes yesterday and today combined? | Taehee | [OP_LIST_SOL] Taehee Jihoon [OP_LIST_EOL] [OP_LIST_SOL] [OP_LIST_SOL] 23 23 14 [OP_LIST_EOL] [OP_LIST_SUM] [OP_LIST_SOL] 35 35 -19 [OP_LIST_EOL] [OP_LIST_SUM] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_POP] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Taehee'
var_b = 'Jihoon'
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 = 23
var_d = 23
var_e = 14
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()
list_b = [float(i) for i in list_b]
var_f = sum(list_b)
var_g = 35
var_h = 35
var_i = -19
list_c= []
if "/" in str(var_i):
var_i = eval(str(var_i))
list_c.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_c.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_c.append(var_g)
list_c.reverse()
list_c = [float(i) for i in list_c]
var_j = sum(list_c)
list_d= []
if "/" in str(var_j):
var_j = eval(str(var_j))
list_d.append(var_j)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_d.append(var_f)
list_d.reverse()
var_k = 1
list_e=list_d.copy()
list_e.sort()
var_l = list_e[-var_k]
var_m = list_d.index(var_l)+1
var_n = list_a[var_m-1]
print(var_n) |
Comparison | Find the probability of getting a card with a number less than or equal to 9 when drawing one of the following number cards: 1, 3, 4, 6, 7, and 9. | 1 | [OP_LIST_SOL] 1 3 4 6 7 9 [OP_LIST_EOL] 9 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN] [OP_LIST_SOL] 1 3 4 6 7 9 [OP_LIST_EOL] [OP_LIST_LEN] [OP_DIV] | var_a = 1
var_b = 3
var_c = 4
var_d = 6
var_e = 7
var_f = 9
list_a= []
if "/" in str(var_f):
var_f = eval(str(var_f))
list_a.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_g = 9
list_b = []
for i in list_a:
if i <= var_g:
list_b.append(i)
var_h = len(list_b)
var_i = 1
var_j = 3
var_k = 4
var_l = 6
var_m = 7
var_n = 9
list_c= []
if "/" in str(var_n):
var_n = eval(str(var_n))
list_c.append(var_n)
if "/" in str(var_m):
var_m = eval(str(var_m))
list_c.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_c.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_c.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_c.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_c.append(var_i)
list_c.reverse()
var_o = len(list_c)
var_p = var_h / var_o
print(int(var_p)) |
Geometry | You made a square by arranging 10 tickets horizontally and vertically without gaps. If the tickets on the perimeter were turned over and the ones on the inside were not turned over, how many of them were not turned over? | 64 | 10 2 [OP_SUB] 2 [OP_POW] | var_a = 10
var_b = 2
var_c = var_a - var_b
var_d = 2
var_e = var_c ** var_d
print(int(var_e)) |
Correspondence | You were supposed to multiply a certain number by 5, then add 24, then divide by 7, but you accidentally add 24, divide it by 5, then multiply by 7, and you get 70. Find the correct calculated value. | 22 | 70 7 [OP_DIV] 5 [OP_MUL] 24 [OP_SUB] 5 [OP_MUL] 24 [OP_ADD] 7 [OP_DIV] | var_a = 70
var_b = 7
var_c = var_a / var_b
var_d = 5
var_e = var_c * var_d
var_f = 24
var_g = var_e - var_f
var_h = 5
var_i = var_g * var_h
var_j = 24
var_k = var_i + var_j
var_l = 7
var_m = var_k / var_l
print(int(var_m)) |
Geometry | There is a rectangle whose long side is 1 meter (m) and its short side is 2/8 meter (m) shorter than its long side. Find the answer in meters (m) equal to the sum of the lengths of the four sides of this rectangle. | 3.5 | 1 1 2/8 [OP_SUB] [OP_ADD] 2 [OP_MUL] | var_a = 1
var_b = 1
var_c = 0.25
var_d = var_b - var_c
var_e = var_a + var_d
var_f = 2
var_g = var_e * var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Comparison | Jimin is lighter than Namjoon and heavier than Seokjin. Seokjin is heavier than Hoseok. Which of the 4 is the lightest? | Hoseok | [OP_LIST_SOL] Seokjin Hoseok Jimin Namjoon [OP_LIST_EOL] [OP_LIST_SOL] Seokjin Hoseok > Seokjin Jimin < Namjoon Jimin > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | var_a = 'Seokjin'
var_b = 'Hoseok'
var_c = 'Jimin'
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 = 'Seokjin'
var_f = 'Hoseok'
var_g = '>'
var_h = 'Seokjin'
var_i = 'Jimin'
var_j = '<'
var_k = 'Namjoon'
var_l = 'Jimin'
var_m = '>'
list_b= []
if "/" in str(var_m):
var_m = eval(str(var_m))
list_b.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
if cond_ in ("<", ">", "="):
operand_right = temp_stack.pop()
operand_left = temp_stack.pop()
if cond_ == "=":
cond_ = "=="
conditions.append(f"{operand_left} {cond_} {operand_right}")
else:
if not cond_.isdigit():
cond_ = "{" + cond_ + "}"
temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
item_name_index_dict = dict(zip(items_name_list, perm))
formatted_conditions = \
[condition.format_map(item_name_index_dict) for condition in conditions]
if all(map(eval, formatted_conditions)):
break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_n = len(list_c)
var_o = list_c[var_n-1]
print(var_o) |
Geometry | There is an octahedron. Find the number of faces of this octahedron. | 8 | 8 | var_a = 8
print(int(var_a)) |
Possibility | You are going to use 3 out of 10 wooden blocks of different lengths. How many ways can you choose 3 blocks out of 10? | 120 | 10 3 [OP_COMB] | var_a = 10
var_b = 3
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)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.