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 | Seokjin is going to the bookstore located on the 4th floor. If Seokjin is currently on the first floor, how many more floors must he go up to get to the bookstore? | 3 | 4 1 [OP_SUB] | var_a = 4
var_b = 1
var_c = var_a - var_b
print(int(var_c)) |
Arithmetic calculation | In a running match, Jungkook can run 2.7 kilometers (km) in an hour. How many hours would it take for Jimin to run 4.86 kilometers (km) at the same speed in this match? | 1.8 | 1 2.7 [OP_DIV] 4.86 [OP_MUL] | var_a = 1
var_b = 2.7
var_c = var_a / var_b
var_d = 4.86
var_e = var_c * var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Possibility | Out of 5 students, 3 are boys and 2 are girls. When 5 people are lined up in a row, find the case where all the female students stand in a row. | 48 | [OP_LIST_SOL] A B C D E [OP_LIST_EOL] [OP_LIST_SOL] C [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_LIST_SOL] C D [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 = 'C'
list_b= []
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_g = len(list_c)
var_h = len(list_c)
var_i = 1
var_g = int(var_g)
var_h = int(var_h)
for i, elem in enumerate(range(var_h)):
var_i = var_i * (var_g-i)
var_j = 'C'
var_k = 'D'
list_d= []
if "/" in str(var_k):
var_k = eval(str(var_k))
list_d.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_d.append(var_j)
list_d.reverse()
var_l = len(list_d)
var_m = len(list_d)
var_n = 1
var_l = int(var_l)
var_m = int(var_m)
for i, elem in enumerate(range(var_m)):
var_n = var_n * (var_l-i)
var_o = var_i * var_n
print(int(var_o)) |
Arithmetic calculation | Namjoon gave two strokes of a pencil he had to Yoongi, and he had 15 left. If one stroke is 12 pencils, how many pencils did Yoongi receive from Namjoon? | 9 | 12 2 [OP_MUL] 15 [OP_SUB] | var_a = 12
var_b = 2
var_c = var_a * var_b
var_d = 15
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | Hoseok subtracted 46 from a number to get 15. Find the exact result of subtracting 29 from this number. | 32 | 15 46 [OP_ADD] 29 [OP_SUB] | var_a = 15
var_b = 46
var_c = var_a + var_b
var_d = 29
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | When a children's book is placed on one side of the two-arm scale, and a 0.5 kilograms (kg) weight and two 0.3 kilograms (kg) weights are placed on the other side, and they are level, how many kilograms (kg) is the children's book. | 1.1 | 0.5 0.3 2 [OP_MUL] [OP_ADD] | var_a = 0.5
var_b = 0.3
var_c = 2
var_d = var_b * var_c
var_e = var_a + var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Possibility | You want to create a four-digit number using the numbers 7, 3, 5, and 8 only once. How many four-digit numbers can you make in total? | 24 | [OP_LIST_SOL] 7 3 5 8 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] [OP_LIST_LEN] | var_a = 7
var_b = 3
var_c = 5
var_d = 8
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_e))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_f = len(list_b)
print(int(var_f)) |
Arithmetic calculation | Fifteen sheets of colored tape, each 25 centimeters (cm) long, were joined together with an overlap of 0.5 centimeters (cm). How many meters (m) is the total length of the continuous color tape? | 3.68 | 25 25 0.5 [OP_SUB] 15 1 [OP_SUB] [OP_MUL] [OP_ADD] 100 [OP_DIV] | var_a = 25
var_b = 25
var_c = 0.5
var_d = var_b - var_c
var_e = 15
var_f = 1
var_g = var_e - var_f
var_h = var_d * var_g
var_i = var_a + var_h
var_j = 100
var_k = var_i / var_j
print('{:.2f}'.format(round(var_k+1e-10,2))) |
Comparison | It took Daehyun 12 days to read the 288-page novel, and Seung-hoon took 9 days to read the 243-page novel. Find out who of the two read more pages in one day. | Seung-hoon | [OP_LIST_SOL] Daehyun Seung-hoon [OP_LIST_EOL] [OP_LIST_SOL] 288 12 [OP_DIV] 243 9 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Daehyun'
var_b = 'Seung-hoon'
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 = 288
var_d = 12
var_e = var_c / var_d
var_f = 243
var_g = 9
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 | What is the number of faces of a quadrangular pyramid? | 5 | 4 1 [OP_ADD] | var_a = 4
var_b = 1
var_c = var_a + var_b
print(int(var_c)) |
Correspondence | There are cows and pigs on Gihun's farm. There are 100 pigs in total, and subtracting 3/4 of the number of cows by 25, dividing it by 7, and adding 50 equals the number of pigs. How many cows are there on Gihun's farm? | 500 | 100 50 [OP_SUB] 7 [OP_MUL] 25 [OP_ADD] 3/4 [OP_DIV] | var_a = 100
var_b = 50
var_c = var_a - var_b
var_d = 7
var_e = var_c * var_d
var_f = 25
var_g = var_e + var_f
var_h = 0.75
var_i = var_g / var_h
print(int(var_i)) |
Geometry | A prism has 24 vertices, and all edges are 5 centimeters (cm) long. What is the sum of the lengths of all the edges of this prism in centimeters (cm)? | 180 | 24 2 [OP_DIV] 3 [OP_MUL] 5 [OP_MUL] | var_a = 24
var_b = 2
var_c = var_a / var_b
var_d = 3
var_e = var_c * var_d
var_f = 5
var_g = var_e * var_f
print(int(var_g)) |
Correspondence | I accidentally divided a certain number by 63 when I was supposed to add this number to 36, and I got 9. How much is it if I calculate it correctly? | 43 | 36 63 9 [OP_DIV] [OP_ADD] | var_a = 36
var_b = 63
var_c = 9
var_d = var_b / var_c
var_e = var_a + var_d
print(int(var_e)) |
Correspondence | When the five-digit number ABCDE is divided by 6, the quotient is 13579 without a remainder. Find the value of ABC+DE. | 888 | 6 13579 [OP_MUL] [OP_NUM2LIST] 1 [OP_LIST_GET] 100 [OP_MUL] 2 [OP_LIST_GET] 10 [OP_MUL] 3 [OP_LIST_GET] [OP_ADD] [OP_ADD] 4 [OP_LIST_GET] 10 [OP_MUL] 5 [OP_LIST_GET] [OP_ADD] [OP_ADD] | var_a = 6
var_b = 13579
var_c = var_a * var_b
list_a = []
var_c = int(var_c)
while var_c//10 > 0:
list_a.append(var_c%10)
var_c = var_c//10
list_a.append(var_c%10)
list_a = list_a[::-1]
var_d = 1
var_e = list_a[var_d-1]
var_f = 100
var_g = var_e * var_f
var_h = 2
var_i = list_a[var_h-1]
var_j = 10
var_k = var_i * var_j
var_l = 3
var_m = list_a[var_l-1]
var_n = var_k + var_m
var_o = var_g + var_n
var_p = 4
var_q = list_a[var_p-1]
var_r = 10
var_s = var_q * var_r
var_t = 5
var_u = list_a[var_t-1]
var_v = var_s + var_u
var_w = var_o + var_v
print(int(var_w)) |
Arithmetic calculation | How many full buckets are there when 135.1 liters (L) of water is divided into 7 liters (L) buckets? | 19 | 135.1 7 [OP_FDIV] | var_a = 135.1
var_b = 7
var_c = var_a // var_b
print(int(var_c)) |
Possibility | There are 3 ways to get to the bookstore by bus, and 4 ways to go by subway. Find the number of cases you take the bus or subway from your home to the bookstore. | 7 | 3 4 [OP_ADD] | var_a = 3
var_b = 4
var_c = var_a + var_b
print(int(var_c)) |
Geometry | Red paint was applied to all faces of a cuboid measuring 5 centimeters (cm) wide, 4 centimeters (cm) long, and 3 centimeters (cm) high. Then, this cuboid was cut into 60 cubes with each edge being 1 centimeters (cm) long. What is the number of cube pieces that are colored on only one side? | 22 | 5 2 [OP_SUB] 4 2 [OP_SUB] [OP_MUL] 5 2 [OP_SUB] 3 2 [OP_SUB] [OP_MUL] [OP_ADD] 4 2 [OP_SUB] 3 2 [OP_SUB] [OP_MUL] [OP_ADD] 2 [OP_MUL] | var_a = 5
var_b = 2
var_c = var_a - var_b
var_d = 4
var_e = 2
var_f = var_d - var_e
var_g = var_c * var_f
var_h = 5
var_i = 2
var_j = var_h - var_i
var_k = 3
var_l = 2
var_m = var_k - var_l
var_n = var_j * var_m
var_o = var_g + var_n
var_p = 4
var_q = 2
var_r = var_p - var_q
var_s = 3
var_t = 2
var_u = var_s - var_t
var_v = var_r * var_u
var_w = var_o + var_v
var_x = 2
var_y = var_w * var_x
print(int(var_y)) |
Arithmetic calculation | One box contains 20 pairs of shoes. There are 8 boxes of (A) shoes, and the number of (B) shoe boxes is 5 times greater than the number of (A) shoe boxes. How many pairs of (B) shoes do you have more than (A) shoes? | 640 | 8 5 [OP_MUL] 8 [OP_SUB] 20 [OP_MUL] | var_a = 8
var_b = 5
var_c = var_a * var_b
var_d = 8
var_e = var_c - var_d
var_f = 20
var_g = var_e * var_f
print(int(var_g)) |
Arithmetic calculation | I want to distribute 81 candies to students. How many students can get candy if I give 9 candies to each student? | 9 | 81 9 [OP_DIV] | var_a = 81
var_b = 9
var_c = var_a / var_b
print(int(var_c)) |
Geometry | There is a regular pentagon with a side length of 15 centimeters (cm). Find the perimeter of this figure in centimeters (cm). | 75 | 15 5 [OP_MUL] | var_a = 15
var_b = 5
var_c = var_a * var_b
print(int(var_c)) |
Correspondence | In the orchard, 170 apples, 268 tangerines, and 120 mangoes were loaded equally into each of trucks. There are 8 apples left, 2 tangerines short, and 12 mangoes left. Find the maximum number of trucks in the orchard. | 54 | 170 8 [OP_SUB] 268 2 [OP_ADD] [OP_GCD] 120 12 [OP_SUB] [OP_GCD] | var_a = 170
var_b = 8
var_c = var_a - var_b
var_d = 268
var_e = 2
var_f = var_d + var_e
var_g = math.gcd(int(var_f), int(var_c))
var_h = 120
var_i = 12
var_j = var_h - var_i
var_k = math.gcd(int(var_j), int(var_g))
print(int(var_k)) |
Correspondence | What is the corresponding number for the variable B that fits the equation: A45+2B3=418. | 7 | A45+2B3=418 B [OP_DIGIT_UNK_SOLVER] | var_a = 'A45+2B3=418'
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)) |
Geometry | A regular polygon has a perimeter of 49 and a side length of 7. Find how many sides there are in total. | 7 | 49 7 [OP_DIV] | var_a = 49
var_b = 7
var_c = var_a / var_b
print(int(var_c)) |
Correspondence | I mistakingly multiplied a number by 6, when I should have multiplied it by 7, and the result was 12. What will be the answer to the correct calculation? | 14 | 12 6 [OP_DIV] 7 [OP_MUL] | var_a = 12
var_b = 6
var_c = var_a / var_b
var_d = 7
var_e = var_c * var_d
print(int(var_e)) |
Arithmetic calculation | Of the 80 students, 45 already have colored paper and the rest do not. If you want to distribute 1645 pieces of colored paper equally to students who do not have colored paper, how many pieces do you need to distribute to each student? | 47 | 1645 80 45 [OP_SUB] [OP_DIV] | var_a = 1645
var_b = 80
var_c = 45
var_d = var_b - var_c
var_e = var_a / var_d
print(int(var_e)) |
Geometry | In the auditorium, students sit in four lines to take the exam. If there are 8 people in a line, find the number of students sitting at the perimeter. | 20 | 4 8 [OP_ADD] 2 [OP_MUL] 4 [OP_SUB] | var_a = 4
var_b = 8
var_c = var_a + var_b
var_d = 2
var_e = var_c * var_d
var_f = 4
var_g = var_e - var_f
print(int(var_g)) |
Arithmetic calculation | The length of the red string is 8 meters (m). If the blue string is 8 times the length of the white string and the white string is 5 times the length of the red string, how many meters (m) is the blue string? | 320 | 8 5 [OP_MUL] 8 [OP_MUL] | var_a = 8
var_b = 5
var_c = var_a * var_b
var_d = 8
var_e = var_c * var_d
print(int(var_e)) |
Arithmetic calculation | What is the largest four-digit number that is a multiple of 5 and a multiple of 6 and a multiple of 2? | 9990 | 1000 9999 1 [OP_LIST_ARANGE] 5 [OP_LIST_DIVISIBLE] 6 [OP_LIST_DIVISIBLE] 2 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX] | 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]
print(int(var_h)) |
Arithmetic calculation | Suppose that the average of Korean, English, and Science is 89 points, and the average including the Social studies test rises by 1 point. Find the score of Social studies. | 93 | 89 1 [OP_ADD] 4 [OP_MUL] 89 3 [OP_MUL] [OP_SUB] | var_a = 89
var_b = 1
var_c = var_a + var_b
var_d = 4
var_e = var_c * var_d
var_f = 89
var_g = 3
var_h = var_f * var_g
var_i = var_e - var_h
print(int(var_i)) |
Arithmetic calculation | 8 of the freshmen participated in the running competition. The number of sophomores participating in the competition is 5 times the number of students in the first grade. What is a total number of freshmen and sophomores participated in the competition? | 48 | 8 5 [OP_MUL] 8 [OP_ADD] | var_a = 8
var_b = 5
var_c = var_a * var_b
var_d = 8
var_e = var_c + var_d
print(int(var_e)) |
Comparison | The students in Jungkook's class are all different heights and there are a total of 28 students. If you line up them in order of height, Eunji is 20th from the front and Jungkook is 14th from the front. How many students are between Jungkook and Eunji at this time? | 5 | 20 14 [OP_SUB] 1 [OP_SUB] | var_a = 20
var_b = 14
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e)) |
Possibility | Given the three natural numbers 1, 7, and 0, what is the largest number that can be formed by using all of these numbers once? | 710 | [OP_LIST_SOL] 7 1 0 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] | var_a = 7
var_b = 1
var_c = 0
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = len(list_a)
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
print(int(var_f)) |
Comparison | Seulgi is the name of Hyunjung's grandmother. One of Hohyun's daughters, Miran, married Jaeyoung, a younger man. When Hohyun's first daughter's name is Hyunjung, who is the 3rd oldest out of 5 people? | Hyunjung | [OP_LIST_SOL] Seulgi Hyunjung Miran Hohyun Jaeyoung [OP_LIST_EOL] [OP_LIST_SOL] Seulgi Hyunjung > Miran Hohyun < Miran Jaeyoung > Hohyun Hyunjung > Hyunjung Miran > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 3 [OP_LIST_GET] | var_a = 'Seulgi'
var_b = 'Hyunjung'
var_c = 'Miran'
var_d = 'Hohyun'
var_e = 'Jaeyoung'
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 'Seulgi'
var_g = 'Hyunjung'
var_h = '>'
var_i = 'Miran'
var_j = 'Hohyun'
var_k = '<'
var_l = 'Miran'
var_m = 'Jaeyoung'
var_n = '>'
var_o = 'Hohyun'
var_p = 'Hyunjung'
var_q = '>'
var_r = 'Hyunjung'
var_s = 'Miran'
var_t = '>'
list_b= []
if "/" in str(var_t):
var_t = eval(str(var_t))
list_b.append(var_t)
if "/" in str(var_s):
var_s = eval(str(var_s))
list_b.append(var_s)
if "/" in str(var_r):
var_r = eval(str(var_r))
list_b.append(var_r)
if "/" in str(var_q):
var_q = eval(str(var_q))
list_b.append(var_q)
if "/" in str(var_p):
var_p = eval(str(var_p))
list_b.append(var_p)
if "/" in str(var_o):
var_o = eval(str(var_o))
list_b.append(var_o)
if "/" in str(var_n):
var_n = eval(str(var_n))
list_b.append(var_n)
if "/" in str(var_m):
var_m = eval(str(var_m))
list_b.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
if cond_ in ("<", ">", "="):
operand_right = temp_stack.pop()
operand_left = temp_stack.pop()
if cond_ == "=":
cond_ = "=="
conditions.append(f"{operand_left} {cond_} {operand_right}")
else:
if not cond_.isdigit():
cond_ = "{" + cond_ + "}"
temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
item_name_index_dict = dict(zip(items_name_list, perm))
formatted_conditions = \
[condition.format_map(item_name_index_dict) for condition in conditions]
if all(map(eval, formatted_conditions)):
break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_u = 3
var_v = list_c[var_u-1]
print(var_v) |
Geometry | How many triangles are formed when a diagonal is drawn from a vertex of a nonagon? | 7 | 9 3 [OP_SUB] 1 [OP_ADD] | var_a = 9
var_b = 3
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Geometry | Drinks are lined up in a square shape. If there were 240 drinks in the perimeter, what is the total number of drinks? | 3721 | 240 4 [OP_DIV] 1 [OP_ADD] 2 [OP_POW] | var_a = 240
var_b = 4
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)) |
Geometry | A cuboid is 12 centimeters (cm) wide, 16 centimeters (cm) long, and 14 centimeters (cm) high. What is the surface area of the largest cube that can be cut out of this cube? | 864 | [OP_LIST_SOL] 12 16 14 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_POW] 6 [OP_MUL] | var_a = 12
var_b = 16
var_c = 14
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 1
list_b=list_a.copy()
list_b.sort()
var_e = list_b[var_d-1]
var_f = 2
var_g = var_e ** var_f
var_h = 6
var_i = var_g * var_h
print(int(var_i)) |
Geometry | There is a park with a side length of 14 meters (m). If the park is divided into districts in a rectangular shape measuring 8 meters (m) long by 2 meters (m) wide. How many districts can there be in the maximum? | 12 | 14 2 [OP_POW] 8 2 [OP_MUL] [OP_FDIV] | var_a = 14
var_b = 2
var_c = var_a ** var_b
var_d = 8
var_e = 2
var_f = var_d * var_e
var_g = var_c // var_f
print(int(var_g)) |
Possibility | You want to distribute 5 different pencils to 4 students. There may be students who do not receive a pencil. Find out the number of cases of distributing the pencils to the students. | 1024 | 4 5 [OP_POW] | var_a = 4
var_b = 5
var_c = var_a ** var_b
print(int(var_c)) |
Geometry | To make clothes, I decided to sew up the leftover fabric. If 20 pieces of fabric each 10 centimeters (cm) long are sewn together and the length of the joint is 5 millimeters (mm), how many centimeters (cm) is the length of the piece of fabric sewn together? | 190.5 | 10 20 [OP_MUL] 5 10 [OP_DIV] 20 1 [OP_SUB] [OP_MUL] [OP_SUB] | var_a = 10
var_b = 20
var_c = var_a * var_b
var_d = 5
var_e = 10
var_f = var_d / var_e
var_g = 20
var_h = 1
var_i = var_g - var_h
var_j = var_f * var_i
var_k = var_c - var_j
print('{:.2f}'.format(round(var_k+1e-10,2))) |
Correspondence | 57A-2B4=364. What number is B? | 1 | 57A-2B4=364 B [OP_DIGIT_UNK_SOLVER] | var_a = '57A-2B4=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 | How many natural numbers are more than 40 and less than 70? | 30 | 70 40 [OP_SUB] | var_a = 70
var_b = 40
var_c = var_a - var_b
print(int(var_c)) |
Possibility | Find the number of even numbers in a three-digit number that can be formed by using 5, 6, and 7 only once. | 2 | [OP_LIST_SOL] 5 6 7 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 2 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 5
var_b = 6
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 = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 2
list_c = []
var_e = int(var_e)
for i in list_b:
i = int(i)
if i % var_e == 0:
list_c.append(i)
var_f = len(list_c)
print(int(var_f)) |
Comparison | Choose the second largest number among 5, 8, 4, 3, and 2. | 5 | [OP_LIST_SOL] 5 8 4 3 2 [OP_LIST_EOL] 2 [OP_LIST_MAX] | var_a = 5
var_b = 8
var_c = 4
var_d = 3
var_e = 2
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 2
list_b=list_a.copy()
list_b.sort()
var_g = list_b[-var_f]
print(int(var_g)) |
Geometry | The 3rd-grade students from Sangyeon's school decided to plant one flower at an interval of 4 meters (m) on both sides of the 68-meter (m) road to create a flower path. How many flowers do they need? (Note that flowers must be planted at both ends of the road.) | 36 | 68 4 [OP_DIV] 2 [OP_MUL] 2 [OP_ADD] | var_a = 68
var_b = 4
var_c = var_a / var_b
var_d = 2
var_e = var_c * var_d
var_f = 2
var_g = var_e + var_f
print(int(var_g)) |
Geometry | I made a Christmas wreath by connecting 16 wires of 10.4 centimeters (cm) in length, overlapping each other by 3.5 centimeters (cm). Find the total length of the wreath in centimeters (cm). | 113.9 | 10.4 16 [OP_MUL] 3.5 16 1 [OP_SUB] [OP_MUL] [OP_SUB] | var_a = 10.4
var_b = 16
var_c = var_a * var_b
var_d = 3.5
var_e = 16
var_f = 1
var_g = var_e - var_f
var_h = var_d * var_g
var_i = var_c - var_h
print('{:.2f}'.format(round(var_i+1e-10,2))) |
Correspondence | Seungmin and Hyojoo went hiking. When Seungmin gave Hyojoo 0.43 liters (L) of water, the difference between the amount of water the two had was 0.88 liters (L). Find the difference in liters (l) before he gave her water. However, Seungmin has more water than Hyojoo. | 1.74 | 0.88 0.43 [OP_ADD] 0.43 [OP_ADD] | var_a = 0.88
var_b = 0.43
var_c = var_a + var_b
var_d = 0.43
var_e = var_c + var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Comparison | Yuna, Eunji, and Minyoung are standing in order of height. Minyoung is shorter than Eunji, and Yuna is taller than Eunji. If the shortest student is standing at the front, find out who is standing at the front. | Minyoung | [OP_LIST_SOL] Yuna Eunji Minyoung [OP_LIST_EOL] [OP_LIST_SOL] Yuna Eunji > Minyoung Eunji < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | var_a = 'Yuna'
var_b = 'Eunji'
var_c = 'Minyoung'
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 = 'Yuna'
var_e = 'Eunji'
var_f = '>'
var_g = 'Minyoung'
var_h = 'Eunji'
var_i = '<'
list_b= []
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
if cond_ in ("<", ">", "="):
operand_right = temp_stack.pop()
operand_left = temp_stack.pop()
if cond_ == "=":
cond_ = "=="
conditions.append(f"{operand_left} {cond_} {operand_right}")
else:
if not cond_.isdigit():
cond_ = "{" + cond_ + "}"
temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
item_name_index_dict = dict(zip(items_name_list, perm))
formatted_conditions = \
[condition.format_map(item_name_index_dict) for condition in conditions]
if all(map(eval, formatted_conditions)):
break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_j = len(list_c)
var_k = list_c[var_j-1]
print(var_k) |
Geometry | How many triangles are formed when a line segment is drawn from one vertex of a nonagon to a non-neighboring vertex? | 7 | 9 3 [OP_SUB] 1 [OP_ADD] | var_a = 9
var_b = 3
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Geometry | There are ribbons with lengths of 36 centimeters (cm), 42 centimeters (cm), and 48 centimeters (cm), respectively. I cut 1/6 of this ribbons and tied the remaining pieces together to make one long ribbon. The length of the ribbon made is 97 centimeters (cm). Find how many centimeters (cm) are used to tie the ribbons together. | 8 | 36 42 [OP_ADD] 48 [OP_ADD] 1 1/6 [OP_SUB] [OP_MUL] 97 [OP_SUB] | var_a = 36
var_b = 42
var_c = var_a + var_b
var_d = 48
var_e = var_c + var_d
var_f = 1
var_g = 0.16666666666666666
var_h = var_f - var_g
var_i = var_e * var_h
var_j = 97
var_k = var_i - var_j
print(int(var_k)) |
Comparison | Three fish caught by a fisherman were weighed. The mackerel was heavier than the flatfish, and the rockfish was heavier than the mackerel. How lightest is the rockfish among those three? | 3 | [OP_LIST_SOL] flatfish mackerel rockfish [OP_LIST_EOL] rockfish [OP_LIST_INDEX] | var_a = 'flatfish'
var_b = 'mackerel'
var_c = 'rockfish'
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 = 'rockfish'
var_e = list_a.index(var_d)+1
print(int(var_e)) |
Correspondence | What number must go in B to make 38A-B1=364? | 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 | Changhyeok's pocket money is 15,000 won. Using all of the pocket money he received, he bought a total of 12 snacks, each costing 1,000 won, and drinks, each costing 1,300 won. Find how many snacks Changhyeok bought. | 2 | 1300 12 [OP_MUL] 15000 [OP_SUB] 1300 1000 [OP_SUB] [OP_DIV] | var_a = 1300
var_b = 12
var_c = var_a * var_b
var_d = 15000
var_e = var_c - var_d
var_f = 1300
var_g = 1000
var_h = var_f - var_g
var_i = var_e / var_h
print(int(var_i)) |
Arithmetic calculation | There are four numbers 10, 11, 12, and 13. Which number is the second smallest? | 11 | [OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 2 [OP_LIST_MIN] | var_a = 10
var_b = 11
var_c = 12
var_d = 13
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 2
list_b=list_a.copy()
list_b.sort()
var_f = list_b[var_e-1]
print(int(var_f)) |
Arithmetic calculation | A large bucket contains 7 liters (L) of water and a small bucket contains 5 liters (L) of water. 2 liters (L) of water from the small bucket was poured into the large bucket. How many liters (L) more water is in the large bucket than in the small bucket? | 6 | 7 2 [OP_ADD] 5 2 [OP_SUB] [OP_SUB] | var_a = 7
var_b = 2
var_c = var_a + var_b
var_d = 5
var_e = 2
var_f = var_d - var_e
var_g = var_c - var_f
print(int(var_g)) |
Arithmetic calculation | 3 bottles of 0.2 liters (L) of milk are delivered to Minjeong's house every day. Find how many liters (L) of all the milk was delivered to Minjeong's house for a week. | 4.2 | 0.2 3 [OP_MUL] 7 [OP_MUL] | var_a = 0.2
var_b = 3
var_c = var_a * var_b
var_d = 7
var_e = var_c * var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Arithmetic calculation | Yesterday, Eunji's uncle gave Eunji some pocket money. Eunji bought a notebook with half of her pocket money, and when she received an additional 550 won from her mother today, her money became 1,000 won. How much money did she get from her uncle? | 900 | 1000 550 [OP_SUB] 2 [OP_MUL] | var_a = 1000
var_b = 550
var_c = var_a - var_b
var_d = 2
var_e = var_c * var_d
print(int(var_e)) |
Correspondence | Adding 8 to any number gives 88 as a result. What is the result of dividing a number by 10? | 8 | 88 8 [OP_SUB] 10 [OP_DIV] | var_a = 88
var_b = 8
var_c = var_a - var_b
var_d = 10
var_e = var_c / var_d
print(int(var_e)) |
Comparison | Jimin is better at games than Hoseok, and Hoseok is better at games than Youngsoo. While the three of them were playing the game, two more joined them. Of the two, Jinwoo is better than Hoseok but not as good as Jimin, and Donggyun is better than Jimin. Who is the worst gamer out of the five? | Youngsoo | [OP_LIST_SOL] Jimin Hoseok Youngsoo Jinwoo Donggyun [OP_LIST_EOL] [OP_LIST_SOL] Jimin Hoseok > Hoseok Youngsoo > Jinwoo Hoseok > Jimin Jinwoo > Donggyun Jimin > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | var_a = 'Jimin'
var_b = 'Hoseok'
var_c = 'Youngsoo'
var_d = 'Jinwoo'
var_e = 'Donggyun'
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 = 'Jimin'
var_g = 'Hoseok'
var_h = '>'
var_i = 'Hoseok'
var_j = 'Youngsoo'
var_k = '>'
var_l = 'Jinwoo'
var_m = 'Hoseok'
var_n = '>'
var_o = 'Jimin'
var_p = 'Jinwoo'
var_q = '>'
var_r = 'Donggyun'
var_s = 'Jimin'
var_t = '>'
list_b= []
if "/" in str(var_t):
var_t = eval(str(var_t))
list_b.append(var_t)
if "/" in str(var_s):
var_s = eval(str(var_s))
list_b.append(var_s)
if "/" in str(var_r):
var_r = eval(str(var_r))
list_b.append(var_r)
if "/" in str(var_q):
var_q = eval(str(var_q))
list_b.append(var_q)
if "/" in str(var_p):
var_p = eval(str(var_p))
list_b.append(var_p)
if "/" in str(var_o):
var_o = eval(str(var_o))
list_b.append(var_o)
if "/" in str(var_n):
var_n = eval(str(var_n))
list_b.append(var_n)
if "/" in str(var_m):
var_m = eval(str(var_m))
list_b.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
if cond_ in ("<", ">", "="):
operand_right = temp_stack.pop()
operand_left = temp_stack.pop()
if cond_ == "=":
cond_ = "=="
conditions.append(f"{operand_left} {cond_} {operand_right}")
else:
if not cond_.isdigit():
cond_ = "{" + cond_ + "}"
temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
item_name_index_dict = dict(zip(items_name_list, perm))
formatted_conditions = \
[condition.format_map(item_name_index_dict) for condition in conditions]
if all(map(eval, formatted_conditions)):
break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_u = len(list_c)
var_v = list_c[var_u-1]
print(var_v) |
Arithmetic calculation | 55 students participated in A competition and B competition. Among them, 38 students participated in A competition, and 42 students participated in B competition. If no student did not participate in neither competitions A nor B, how many students participated in both competitions? | 25 | 38 42 [OP_ADD] 55 [OP_SUB] | var_a = 38
var_b = 42
var_c = var_a + var_b
var_d = 55
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | There are three different natural numbers A, B, and C. When A+B=84, B+C=60, and A=B+B+B+B+B+B, find the value of A-C. | 24 | 84 7 [OP_DIV] 6 [OP_MUL] 60 84 7 [OP_DIV] [OP_SUB] [OP_SUB] | var_a = 84
var_b = 7
var_c = var_a / var_b
var_d = 6
var_e = var_c * var_d
var_f = 60
var_g = 84
var_h = 7
var_i = var_g / var_h
var_j = var_f - var_i
var_k = var_e - var_j
print(int(var_k)) |
Arithmetic calculation | Which three-digit number is the smallest among the common multiples of 3 and 5? | 105 | 100 999 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN] | var_a = 100
var_b = 999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 3
list_b = []
var_d = int(var_d)
for i in list_a:
i = int(i)
if i % var_d == 0:
list_b.append(i)
var_e = 5
list_c = []
var_e = int(var_e)
for i in list_b:
i = int(i)
if i % var_e == 0:
list_c.append(i)
var_f = 1
list_d=list_c.copy()
list_d.sort()
var_g = list_d[var_f-1]
print(int(var_g)) |
Arithmetic calculation | In the relay, Siwon ran 3/10 of the track, and Dawon ran 4/10 of the track. If the distance Siwon and Dawon run is 140 meters (m), what is the total distance of the relay race? | 200 | 140 3/10 4/10 [OP_ADD] [OP_DIV] | var_a = 140
var_b = 0.3
var_c = 0.4
var_d = var_b + var_c
var_e = var_a / var_d
print(int(var_e)) |
Arithmetic calculation | Jiwon went to a snack bar with his friends. There are 4 friends, including Jiwon, and they want to buy 5 fish cakes at 200 won each and 7 servings of tteokbokki at 800 won each. How much does one person have to pay if all of his friends pay the same? | 1650 | 200 5 [OP_MUL] 800 7 [OP_MUL] [OP_ADD] 4 [OP_DIV] | var_a = 200
var_b = 5
var_c = var_a * var_b
var_d = 800
var_e = 7
var_f = var_d * var_e
var_g = var_c + var_f
var_h = 4
var_i = var_g / var_h
print(int(var_i)) |
Correspondence | 50 is 26 greater than a number. What is the value of the number multiplied by 9? | 216 | 50 26 [OP_SUB] 9 [OP_MUL] | var_a = 50
var_b = 26
var_c = var_a - var_b
var_d = 9
var_e = var_c * var_d
print(int(var_e)) |
Correspondence | When 45 is divided by a number, the quotient is 11 and the remainder is 1. Find the value of the number. | 4 | 45 1 [OP_SUB] 11 [OP_DIV] | var_a = 45
var_b = 1
var_c = var_a - var_b
var_d = 11
var_e = var_c / var_d
print(int(var_e)) |
Arithmetic calculation | How many times does the number 1 appear on a test sheet with 5 multiple choice 20 questions? (However, there are no numbers other than the question number and the answer number.) | 32 | 1 20 1 [OP_LIST_ARANGE] [OP_LIST2NUM] [OP_NUM2LIST] 1 [OP_LIST_FIND_NUM] 20 [OP_ADD] | var_a = 1
var_b = 20
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d=""
for i in list_a:
i = str(i)
var_d = var_d + i
list_b = []
var_d = int(var_d)
while var_d//10 > 0:
list_b.append(var_d%10)
var_d = var_d//10
list_b.append(var_d%10)
list_b = list_b[::-1]
var_e = 1
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
var_g = 20
var_h = var_f + var_g
print(int(var_h)) |
Possibility | When you write numbers no more than 100 that have a remainder of 2 when divided by 3 in order, how many times 4 is written? | 6 | 1 100 1 [OP_LIST_ARANGE] 3 2 [OP_LIST_DIVIDE_AND_REMAIN] [OP_LIST2NUM] [OP_NUM2LIST] 4 [OP_LIST_FIND_NUM] | 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 = 3
var_e = 2
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=""
for i in list_b:
i = str(i)
var_f = var_f + i
list_c = []
var_f = int(var_f)
while var_f//10 > 0:
list_c.append(var_f%10)
var_f = var_f//10
list_c.append(var_f%10)
list_c = list_c[::-1]
var_g = 4
var_h = 0
var_g = int(var_g)
for i in list_c:
i = int(i)
if i == var_g:
var_h = var_h + 1
print(int(var_h)) |
Correspondence | The five-digit number 6AB87 is a multiple of 9. When creating the pair of numbers by putting the right numbers for A and B, how many possible number pairs can be made? | 11 | 6AB87 [OP_GEN_POSSIBLE_LIST] 9 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = '6AB87'
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 = 9
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)) |
Comparison | 20 students lined up in a single line. Jungkook is standing behind Yoongi, and 11 students are standing in front of Jungkook. How many students are standing behind Yoongi? | 9 | 20 11 [OP_SUB] 1 [OP_ADD] 1 [OP_SUB] | var_a = 20
var_b = 11
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
var_f = 1
var_g = var_e - var_f
print(int(var_g)) |
Correspondence | You made a mistake in multiplying 36 by a number, so I added a number to 63 instead. Suppose that you got 70. How much is it if you calculate it correctly? | 252 | 36 70 63 [OP_SUB] [OP_MUL] | var_a = 36
var_b = 70
var_c = 63
var_d = var_b - var_c
var_e = var_a * var_d
print(int(var_e)) |
Arithmetic calculation | Snails A and B travel at 10 meters (m) and 15 meters (m) per hour respectively when they go to the flower to eat. A arrives 30 minutes after B arrives. Find the distance between the flower and the starting points of the two snails. | 15 | 30 60 [OP_DIV] 1 10 [OP_DIV] 1 15 [OP_DIV] [OP_SUB] [OP_DIV] | var_a = 30
var_b = 60
var_c = var_a / var_b
var_d = 1
var_e = 10
var_f = var_d / var_e
var_g = 1
var_h = 15
var_i = var_g / var_h
var_j = var_f - var_i
var_k = var_c / var_j
print(int(eval('{:.2f}'.format(round(var_k+1e-10,2))))) |
Correspondence | When a number is divided by 0.06, it results 426. Find the inital unknown number. | 25.56 | 426 0.06 [OP_MUL] | var_a = 426
var_b = 0.06
var_c = var_a * var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Possibility | There are three different types of boxes. Find the number of ways in which there are no empty boxes when putting 5 balls of the same size into these boxes. | 6 | 1 3 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PRODUCT] [OP_LIST_NUM2SUM] 5 [OP_LIST_FIND_NUM] | var_a = 1
var_b = 3
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.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 = 5
var_g = 0
var_f = int(var_f)
for i in list_c:
i = int(i)
if i == var_f:
var_g = var_g + 1
print(int(var_g)) |
Arithmetic calculation | Among the people who entered the amusement park, 1518 were women, and among them, 536 were elementary school students. There were 525 more males than females, and 1257 of them were not in elementary school. How many elementary school students entered the amusement park in total? | 1322 | 1518 525 [OP_ADD] 1257 [OP_SUB] 536 [OP_ADD] | var_a = 1518
var_b = 525
var_c = var_a + var_b
var_d = 1257
var_e = var_c - var_d
var_f = 536
var_g = var_e + var_f
print(int(var_g)) |
Arithmetic calculation | A car needs 0.14 liters (l) of diesel to run 1 kilometer (km). If this car ran for 2 hours and 30 minutes at 93.6 kilometers (km) per hour, how many liters (L) of diesel were used? | 32.76 | 0.14 93.6 [OP_MUL] 2 30 60 [OP_DIV] [OP_ADD] [OP_MUL] | var_a = 0.14
var_b = 93.6
var_c = var_a * var_b
var_d = 2
var_e = 30
var_f = 60
var_g = var_e / var_f
var_h = var_d + var_g
var_i = var_c * var_h
print('{:.2f}'.format(round(var_i+1e-10,2))) |
Correspondence | When Hoseok divides a number by 6, he gets 11. Find what number is used by Hoseok. | 66 | 11 6 [OP_MUL] | var_a = 11
var_b = 6
var_c = var_a * var_b
print(int(var_c)) |
Arithmetic calculation | Jihye and Yonghee shared 85 marbles. If Jihye got 11 more marbles than Yonghee, how many marbles did Jihye got? | 48 | 85 11 [OP_SUB] 2 [OP_DIV] 11 [OP_ADD] | var_a = 85
var_b = 11
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
var_f = 11
var_g = var_e + var_f
print(int(var_g)) |
Possibility | When two out of nine cards numbered 1 through 9 are selected at the same time, find the number of cases in which the sum of the two cards is 3 or 14. | 3 | 1 9 1 [OP_LIST_ARANGE] 2 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] 14 [OP_LIST_FIND_NUM] 2 [OP_DIV] 3 [OP_LIST_FIND_NUM] 2 [OP_DIV] [OP_ADD] | 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 = 2
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
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 = 14
var_g = 0
var_f = int(var_f)
for i in list_c:
i = int(i)
if i == var_f:
var_g = var_g + 1
var_h = 2
var_i = var_g / var_h
var_j = 3
var_k = 0
var_j = int(var_j)
for i in list_c:
i = int(i)
if i == var_j:
var_k = var_k + 1
var_l = 2
var_m = var_k / var_l
var_n = var_i + var_m
print(int(var_n)) |
Arithmetic calculation | What is the sum of all integers less than 30 that are multiples of 5 or even numbers? | 285 | 1 30 1 [OP_LIST_ARANGE] 5 [OP_LIST_DIVISIBLE] 1 30 [OP_LIST_EVEN] [OP_SET_UNION] [OP_LIST_SUM] | var_a = 1
var_b = 30
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 5
list_b = []
var_d = int(var_d)
for i in list_a:
i = int(i)
if i % var_d == 0:
list_b.append(i)
var_e = 1
var_f = 30
list_c = []
if var_e%2!=0:
for i in range(var_e+1, var_f+1, 2):
list_c.append(i)
else:
for i in range(var_e, var_f+1, 2):
list_c.append(i)
list_d = list(set(list_b) | set(list_c))
list_d = [float(i) for i in list_d]
var_g = sum(list_d)
print(int(var_g)) |
Arithmetic calculation | Seokjin's mother gave birth to Seokjin at the age of 32. If his uncle is 3 years younger than his mother, find out how old his uncle is when Seokjin turns 12. | 41 | 12 32 [OP_ADD] 3 [OP_SUB] | var_a = 12
var_b = 32
var_c = var_a + var_b
var_d = 3
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | Yoongi bought a supplement containing 200 pills and took 12 pills every day for two weeks. How many pills are left? | 32 | 200 12 2 [OP_MUL] 7 [OP_MUL] [OP_SUB] | var_a = 200
var_b = 12
var_c = 2
var_d = var_b * var_c
var_e = 7
var_f = var_d * var_e
var_g = var_a - var_f
print(int(var_g)) |
Possibility | I am trying to create a three-digit number using 0, 1, 3, and 5. If each number can be used only once, find out the sum of the smallest number and the largest possible number. | 634 | [OP_LIST_SOL] 0 1 3 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD] | var_a = 0
var_b = 1
var_c = 3
var_d = 5
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
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 = 1
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
var_h = 1
list_d=list_b.copy()
list_d.sort()
var_i = list_d[var_h-1]
var_j = var_g + var_i
print(int(var_j)) |
Correspondence | When a natural number A is divided by a natural number B, the quotient is 28 and the remainder is 4. Find the smallest number that can be A. | 144 | 4 1 [OP_ADD] 28 [OP_MUL] 4 [OP_ADD] | var_a = 4
var_b = 1
var_c = var_a + var_b
var_d = 28
var_e = var_c * var_d
var_f = 4
var_g = var_e + var_f
print(int(var_g)) |
Possibility | Write the smallest three-digit number that can be formed by drawing three different numbers from 0, 3, 5, and 6. | 305 | [OP_LIST_SOL] 0 3 5 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] | var_a = 0
var_b = 3
var_c = 5
var_d = 6
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 = 1
list_c=list_b.copy()
list_c.sort()
var_g = list_c[var_f-1]
print(int(var_g)) |
Comparison | Yoongi collected 7, Jungkook 6, Yuna 9, and Yoojung 8. Who has the 2nd largest number? | Yoojung | [OP_LIST_SOL] Yoongi Jungkook Yuna Yoojung [OP_LIST_EOL] [OP_LIST_SOL] 7 6 9 8 [OP_LIST_EOL] 2 [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 = 2
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 | I am going to make a draw by cutting a rectangular piece of paper measuring 63 centimeters (cm) wide and 42 centimeters (cm) long. Find how many centimeters (cm) the length of one side of the lottery paper should be in order to make the lottery paper square and minimize the number of people who won the lottery. | 21 | 63 42 [OP_GCD] | var_a = 63
var_b = 42
var_c = math.gcd(int(var_b), int(var_a))
print(int(var_c)) |
Arithmetic calculation | Box (A) is full when you put four box (B) in it, and box (B) becomes full when you put six box (C) in it. 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)) |
Correspondence | 169 is 108 greater than a certain number. What number is 125 greater than the certain number? | 186 | 169 108 [OP_SUB] 125 [OP_ADD] | var_a = 169
var_b = 108
var_c = var_a - var_b
var_d = 125
var_e = var_c + var_d
print(int(var_e)) |
Correspondence | There are three bottles, A, B, and C, each with different sizes. 7 bottles of A and 3 bottles of B have the same capacity, and 1 bottle of B and 5 bottles of C are the same. How many bottles of C are equal to 21 bottles of A? | 45 | 21 7 [OP_DIV] 3 [OP_MUL] 1 [OP_DIV] 5 [OP_MUL] | var_a = 21
var_b = 7
var_c = var_a / var_b
var_d = 3
var_e = var_c * var_d
var_f = 1
var_g = var_e / var_f
var_h = 5
var_i = var_g * var_h
print(int(var_i)) |
Arithmetic calculation | The TV license fee is 30 won per 10 seconds. If Mingyu watched TV for 2 minutes and 40 seconds, how much would the license fee be? | 480 | 2 60 [OP_MUL] 40 [OP_ADD] 10 [OP_DIV] 30 [OP_MUL] | var_a = 2
var_b = 60
var_c = var_a * var_b
var_d = 40
var_e = var_c + var_d
var_f = 10
var_g = var_e / var_f
var_h = 30
var_i = var_g * var_h
print(int(var_i)) |
Comparison | Which of 0.8, 1/2, and 0.9 is the largest number less than 0.7? | 0.5 | [OP_LIST_SOL] 0.8 1/2 0.9 [OP_LIST_EOL] 0.7 [OP_LIST_LESS] 1 [OP_LIST_MAX] | var_a = 0.8
var_b = 0.5
var_c = 0.9
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 0.7
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]
print('{:.2f}'.format(round(var_f+1e-10,2))) |
Possibility | Find the number of two-digit integers that can be made by drawing 2 cards from 5 cards each containing the numbers 0, 1, 2, 3, and 4. | 16 | [OP_LIST_SOL] 0 1 2 3 4 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN] | var_a = 0
var_b = 1
var_c = 2
var_d = 3
var_e = 4
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 2
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_f))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_g = len(list_b)
print(int(var_g)) |
Geometry | Find how many diagonals are in a hendecagon. | 44 | 11 11 3 [OP_SUB] [OP_MUL] 2 [OP_DIV] | var_a = 11
var_b = 11
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 | To decorate the tree, you made several triangles using wire. The length of the wire was 84 centimeters (cm) before the decoration, and the wire became 12 centimeters (cm) at the end. Given that each triangle had a side length of 1 centimeter (cm), how many triangles can be made? | 24 | 84 12 [OP_SUB] 1 3 [OP_MUL] [OP_FDIV] | var_a = 84
var_b = 12
var_c = var_a - var_b
var_d = 1
var_e = 3
var_f = var_d * var_e
var_g = var_c // var_f
print(int(var_g)) |
Comparison | The distance from the house to the stationery store is 11/20 kilometers (km), and from the house to the pharmacy is 0.53 kilometers (km). Which is longer, the distance from your house to the stationery store or the distance from your house to the pharmacy? | stationery | [OP_LIST_SOL] stationery pharmacy [OP_LIST_EOL] [OP_LIST_SOL] 11/20 0.53 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'stationery'
var_b = 'pharmacy'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 0.55
var_d = 0.53
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 | You are trying to make the length of the tape for Minyoung and Yoojung the same. Minyoung has 17 meters (m) and 48 centimeters (cm), and Yoojung has 850 centimeters (cm). How much tape should Minyoung give to Yoojung? | 449 | 17 100 [OP_MUL] 48 [OP_ADD] 850 [OP_SUB] 2 [OP_DIV] | var_a = 17
var_b = 100
var_c = var_a * var_b
var_d = 48
var_e = var_c + var_d
var_f = 850
var_g = var_e - var_f
var_h = 2
var_i = var_g / var_h
print(int(var_i)) |
Comparison | There are 4 marbles (A), (B), (C), (D). Marble (B) is smaller than marble (D) and bigger than marble (C). If marble (A) is bigger than marble (D), find the smallest marble. | (C) | [OP_LIST_SOL] (A) (B) (C) (D) [OP_LIST_EOL] [OP_LIST_SOL] (B) (D) < (A) (D) > (B) (C) > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | var_a = '(A)'
var_b = '(B)'
var_c = '(C)'
var_d = '(D)'
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = '(B)'
var_f = '(D)'
var_g = '<'
var_h = '(A)'
var_i = '(D)'
var_j = '>'
var_k = '(B)'
var_l = '(C)'
var_m = '>'
list_b= []
if "/" in str(var_m):
var_m = eval(str(var_m))
list_b.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
if cond_ in ("<", ">", "="):
operand_right = temp_stack.pop()
operand_left = temp_stack.pop()
if cond_ == "=":
cond_ = "=="
conditions.append(f"{operand_left} {cond_} {operand_right}")
else:
if not cond_.isdigit():
cond_ = "{" + cond_ + "}"
temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
item_name_index_dict = dict(zip(items_name_list, perm))
formatted_conditions = \
[condition.format_map(item_name_index_dict) for condition in conditions]
if all(map(eval, formatted_conditions)):
break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_n = len(list_c)
var_o = list_c[var_n-1]
print(var_o) |
Arithmetic calculation | When the bus carrying 32 passengers arrived at the bus stop, 13 passengers got off and 19 passengers got on. How many people are left on the bus? | 38 | 32 19 [OP_ADD] 13 [OP_SUB] | var_a = 32
var_b = 19
var_c = var_a + var_b
var_d = 13
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | Write the smallest of the five-digit numbers that are divided into 2, 3, or 5. | 10020 | 10000 10000 10 [OP_MUL] 1 [OP_SUB] 1 [OP_LIST_ARANGE] 2 [OP_LIST_DIVISIBLE] 3 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN] | var_a = 10000
var_b = 10000
var_c = 10
var_d = var_b * var_c
var_e = 1
var_f = var_d - var_e
var_g = 1
list_a = [i for i in range(var_a, var_f + 1, var_g)]
var_h = 2
list_b = []
var_h = int(var_h)
for i in list_a:
i = int(i)
if i % var_h == 0:
list_b.append(i)
var_i = 3
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 = 5
list_d = []
var_j = int(var_j)
for i in list_c:
i = int(i)
if i % var_j == 0:
list_d.append(i)
var_k = 1
list_e=list_d.copy()
list_e.sort()
var_l = list_e[var_k-1]
print(int(var_l)) |
Correspondence | When a number is divided by 6, the quotient is 124 and the remainder is 4. What is the remainder when you add 24 to this number and divide it by 8? | 4 | 124 6 [OP_MUL] 4 [OP_ADD] 24 [OP_ADD] 8 [OP_MOD] | var_a = 124
var_b = 6
var_c = var_a * var_b
var_d = 4
var_e = var_c + var_d
var_f = 24
var_g = var_e + var_f
var_h = 8
var_i = var_g % var_h
print(int(var_i)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.