category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Possibility
Of the five cards with the numbers 6, 7, 8, 9, and 1 written on them, we want to select two cards allowing duplicates. How many possible cases are there?
15
[OP_LIST_SOL] 6 7 8 9 1 [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_ADD] 1 [OP_SUB] 2 [OP_COMB]
var_a = 6 var_b = 7 var_c = 8 var_d = 9 var_e = 1 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = len(list_a) var_g = 2 var_h = var_f + var_g var_i = 1 var_j = var_h - var_i var_k = 2 var_l = 1 var_j = int(var_j) var_k = int(var_k) for i, elem in enumerate(range(var_k)): var_l = var_l * (var_j-i) for i, elem in enumerate(range(var_k)): var_l = var_l / (i+1) print(int(var_l))
Correspondence
I multiplied a particular number by 1.87, when I should have divided that particular number by 25 and the result of that erroneous calculation was 231.88. Find what the quotient will be when calculated correctly.
4
231.88 1.87 [OP_DIV] 25 [OP_FDIV]
var_a = 231.88 var_b = 1.87 var_c = var_a / var_b var_d = 25 var_e = var_c // var_d print(int(var_e))
Comparison
Namjoon has fewer marbles than Eunji and also has fewer marbles than Taehyung. Eunji has fewer marbles than Taehyung. Who has the most marbles among them?
Taehyung
[OP_LIST_SOL] Namjoon Eunji Taehyung [OP_LIST_EOL] [OP_LIST_SOL] Namjoon Eunji < Namjoon Taehyung < Eunji Taehyung < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'Namjoon' var_b = 'Eunji' var_c = 'Taehyung' 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 = 'Namjoon' var_e = 'Eunji' var_f = '<' var_g = 'Namjoon' var_h = 'Taehyung' var_i = '<' var_j = 'Eunji' var_k = 'Taehyung' var_l = '<' list_b= [] if "/" in str(var_l): var_l = eval(str(var_l)) list_b.append(var_l) if "/" in str(var_k): var_k = eval(str(var_k)) list_b.append(var_k) if "/" in str(var_j): var_j = eval(str(var_j)) list_b.append(var_j) if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_m = 1 var_n = list_c[var_m-1] print(var_n)
Possibility
How many three-digit numbers contain all 5, 7, and 8?
6
[OP_LIST_SOL] 5 7 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 5 var_b = 7 var_c = 8 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = len(list_b) print(int(var_e))
Geometry
Find the surface area of a cube made up of 6 squares with a perimeter of 24 centimeters (cm).
216
24 4 [OP_DIV] 24 4 [OP_DIV] [OP_MUL] 6 [OP_MUL]
var_a = 24 var_b = 4 var_c = var_a / var_b var_d = 24 var_e = 4 var_f = var_d / var_e var_g = var_c * var_f var_h = 6 var_i = var_g * var_h print(int(var_i))
Geometry
If a perimeter of a rectangle whose width is 2 centimeters (cm) longer than its length is 16 centimeters (cm), what is its width?
5
16 2 [OP_DIV] 2 [OP_SUB] 2 [OP_DIV] 2 [OP_ADD]
var_a = 16 var_b = 2 var_c = var_a / var_b var_d = 2 var_e = var_c - var_d var_f = 2 var_g = var_e / var_f var_h = 2 var_i = var_g + var_h print(int(var_i))
Comparison
You are trying to compare the weight of paint and crayons by placing a weight of 100 grams (g) on the scale. Paint is equal to the weight of 3 weights, and crayons are equal to the weight of 5 weights. Get the lighter one between paint and crayons.
paint
[OP_LIST_SOL] paint crayons [OP_LIST_EOL] [OP_LIST_SOL] 100 3 [OP_MUL] 100 5 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'paint' var_b = 'crayons' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 100 var_d = 3 var_e = var_c * var_d var_f = 100 var_g = 5 var_h = var_f * var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[var_i-1] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Geometry
What is the area of a parallelogram with a base of 9.51 centimeters (cm) and a height of 4.8 centimeters (cm)?
45.65
9.51 4.8 [OP_MUL]
var_a = 9.51 var_b = 4.8 var_c = var_a * var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Comparison
It is said that at a stationery store, there are more heart patterned postcards than star patterned postcards, and more star patterned postcards than flower patterned postcards. Which pattern has the most postcards in this stationery store?
heart
[OP_LIST_SOL] heart star flower [OP_LIST_EOL] [OP_LIST_SOL] heart star > star flower > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'heart' var_b = 'star' var_c = 'flower' 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 = 'heart' var_e = 'star' var_f = '>' var_g = 'star' var_h = 'flower' 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)
Arithmetic calculation
There are three numbers 10, 11 and 12. What is the value of second largest number divided by the smallest number?
1.1
[OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 2 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_DIV]
var_a = 10 var_b = 11 var_c = 12 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 2 list_b=list_a.copy() list_b.sort() var_e = list_b[-var_d] var_f = 1 list_c=list_a.copy() list_c.sort() var_g = list_c[var_f-1] var_h = var_e / var_g print('{:.2f}'.format(round(var_h+1e-10,2)))
Arithmetic calculation
The bottle was full of water. Yooseung drank 2/5 of the water in the bottle and weighed the bottle and found it to be 144 grams (g). After a while, Hansol drank 2/3 of the remaining water and weighed the bottle again and it was 96 grams (g). How many grams (g) would you get if you drank all the water and weighed only the bottle?
72
144 144 96 [OP_SUB] 1 2/5 [OP_SUB] [OP_DIV] 2/3 [OP_DIV] 1 2/5 [OP_SUB] [OP_MUL] [OP_SUB]
var_a = 144 var_b = 144 var_c = 96 var_d = var_b - var_c var_e = 1 var_f = 0.4 var_g = var_e - var_f var_h = var_d / var_g var_i = 0.6666666666666666 var_j = var_h / var_i var_k = 1 var_l = 0.4 var_m = var_k - var_l var_n = var_j * var_m var_o = var_a - var_n print(int(var_o))
Geometry
Two triangles with a base length of 8 centimeters (cm) are joined to form a parallelogram. The area is 78.88 square cm (cm2). What is the height in centimeters (cm) of this parallelogram?
9.86
78.88 8 [OP_DIV]
var_a = 78.88 var_b = 8 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
The four-digit number 22AB, when divided by 3, has a remainder of 2, which is a multiple of 5. How many possible A's are there?
6
22AB [OP_GEN_POSSIBLE_LIST] 3 2 [OP_LIST_DIVIDE_AND_REMAIN] 5 [OP_LIST_DIVISIBLE] 22AB A [OP_LIST_FIND_UNK] [OP_LIST_LEN]
var_a = '22AB' ans_dict = dict() var_a = str(var_a) list_a = [] variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 0 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) if len(var_a) == len(str(int(temp))): new_elem = int(temp) list_a.append(new_elem) var_b = 3 var_c = 2 list_b = [] var_b = int(var_b) var_c = int(var_c) if var_c < 0: var_c = var_c + var_b for i in list_a: i = int(i) if i%var_b == var_c: list_b.append(i) var_d = 5 list_c = [] var_d = int(var_d) for i in list_b: i = int(i) if i % var_d == 0: list_c.append(i) var_e = '22AB' var_f = 'A' var_e = str(var_e) var_f = str(var_f) unk_idx = var_e.index(var_f) list_d = [] for elem in list_c: elem = str(elem) list_d.append(int(elem[unk_idx])) list_d = list(set(list_d)) var_g = len(list_d) print(int(var_g))
Geometry
The perimeter of the rectangle is 54 centimeters (cm), and the horizontal length of the rectangle is 3 centimeters (cm) longer than the vertical length of the rectangle. Find the horizontal length.
15
54 2 [OP_DIV] 3 [OP_SUB] 2 [OP_DIV] 3 [OP_ADD]
var_a = 54 var_b = 2 var_c = var_a / var_b var_d = 3 var_e = var_c - var_d var_f = 2 var_g = var_e / var_f var_h = 3 var_i = var_g + var_h print(int(var_i))
Arithmetic calculation
I counted the telephone poles between Seokgi's house and Dongmin's house along the way, and there were 20 in total. If the distance between telephone poles is 25 meters (m), how many meters (m) must Seokgi walk to Dongmin's house? (However, there are no telephone poles in front of Seokgi’s house and Dongmin’s house, and the distance from each house to the first telephone pole is 25 meters (m).)
525
20 1 [OP_ADD] 25 [OP_MUL]
var_a = 20 var_b = 1 var_c = var_a + var_b var_d = 25 var_e = var_c * var_d print(int(var_e))
Arithmetic calculation
There is a set of two books, volumes one and two. I bought 3 sets of this book and paid 21,000 won. If the price of the first volume is 300 won more than the price of the second volume, how much is the price of the second volume?
3350
21000 3 [OP_DIV] 300 [OP_SUB] 2 [OP_DIV]
var_a = 21000 var_b = 3 var_c = var_a / var_b var_d = 300 var_e = var_c - var_d var_f = 2 var_g = var_e / var_f print(int(var_g))
Comparison
Jihee used 1 and 1/5 meters (m) for shoelaces, and Hyunji used 8/5 meters (m). Find the answer to who used more shoelaces.
Hyunji
[OP_LIST_SOL] Jihee Hyunji [OP_LIST_EOL] [OP_LIST_SOL] 1 1/5 [OP_ADD] 8/5 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jihee' var_b = 'Hyunji' 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 = 1 var_d = 0.2 var_e = var_c + var_d var_f = 1.6 list_b= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Correspondence
Which of 12, 14, 15, and 20 is not divisible by 3 and is less than 18?
14
[OP_LIST_SOL] 12 14 15 20 [OP_LIST_EOL] 3 [OP_LIST_DIVISIBLE] [OP_SET_DIFFERENCE] 18 [OP_LIST_LESS] 1 [OP_LIST_GET]
var_a = 12 var_b = 14 var_c = 15 var_d = 20 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 = [] var_e = int(var_e) for i in list_a: i = int(i) if i % var_e == 0: list_b.append(i) list_c = list(set(list_a) - set(list_b)) var_f = 18 list_d = [] for i in list_c: if i < var_f: list_d.append(i) var_g = 1 var_h = list_d[var_g-1] print(int(var_h))
Arithmetic calculation
There are 58 roses. The number of roses is 15 more than the number of tulips and 25 less than the number of lilies. How many roses, tulips, and lilies are there in total?
184
58 58 15 [OP_SUB] [OP_ADD] 58 25 [OP_ADD] [OP_ADD]
var_a = 58 var_b = 58 var_c = 15 var_d = var_b - var_c var_e = var_a + var_d var_f = 58 var_g = 25 var_h = var_f + var_g var_i = var_e + var_h print(int(var_i))
Geometry
If the area of a rectangular swimming pool is 143.2 square meters (m2) and the length is 4 meters (m), how many meters (m) is the width?
35.8
143.2 4 [OP_DIV]
var_a = 143.2 var_b = 4 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
There is a children's book with 220 pages. If Jinwoo wants to read this book in a week, at least how many pages does Jinwoo have to read in a day?
32
220 7 [OP_DIV] 1 [OP_CEIL]
var_a = 220 var_b = 7 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))
Geometry
You have a plank that is 6 meters (m) wide and 4 meters (m) long. Rectangular colored paper measuring 60 centimeters (cm) in width and 20 centimeters (cm) in height was attached to this plank without overlapping. How many sheets of colored paper did you use at this time?
200
6 100 [OP_MUL] 4 100 [OP_MUL] [OP_MUL] 60 20 [OP_MUL] [OP_DIV]
var_a = 6 var_b = 100 var_c = var_a * var_b var_d = 4 var_e = 100 var_f = var_d * var_e var_g = var_c * var_f var_h = 60 var_i = 20 var_j = var_h * var_i var_k = var_g / var_j print(int(var_k))
Comparison
Which of the three numbers 5, 8, and 4 is the largest?
8
[OP_LIST_SOL] 5 8 4 [OP_LIST_EOL] 1 [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 = 1 list_b=list_a.copy() list_b.sort() var_e = list_b[-var_d] print(int(var_e))
Arithmetic calculation
If there are 7 pigs and 6 giraffes, what is the total number of giraffes and pigs?
13
7 6 [OP_ADD]
var_a = 7 var_b = 6 var_c = var_a + var_b print(int(var_c))
Geometry
Two cubes with one edge 5 cm (cm) long were placed in a line to make one cuboid. What is the volume of the cuboid made in cubic centimeters (cm3)?
250
5 5 2 [OP_MUL] [OP_MUL] 5 [OP_MUL]
var_a = 5 var_b = 5 var_c = 2 var_d = var_b * var_c var_e = var_a * var_d var_f = 5 var_g = var_e * var_f print(int(var_g))
Comparison
Nine people are standing in a line in order from shortest to tallest. Hoseok stands in the forefront. If you line up again in order from tallest to shortest, what number will Hoseok stand from the front?
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))
Arithmetic calculation
My father is 44 years old and my mother is 42 this year. How old is the father when the sum of the ages of the father and mother becomes 100?
51
44 100 44 42 [OP_ADD] [OP_SUB] 2 [OP_DIV] [OP_ADD]
var_a = 44 var_b = 100 var_c = 44 var_d = 42 var_e = var_c + var_d var_f = var_b - var_e var_g = 2 var_h = var_f / var_g var_i = var_a + var_h print(int(var_i))
Geometry
A square was made by arranging pieces of colored paper of the same size, 12 pieces in each width and 12 pieces in each length. How many colored papers are there in the border?
44
12 2 [OP_SUB] 4 [OP_MUL] 4 [OP_ADD]
var_a = 12 var_b = 2 var_c = var_a - var_b var_d = 4 var_e = var_c * var_d var_f = 4 var_g = var_e + var_f print(int(var_g))
Arithmetic calculation
Thirty pieces of tissue, each 25 centimeters (cm) long, were overlapped by 6 centimeters (cm) and attached in a long line. Find the total length in centimeters (cm) of 30 pieces of toilet paper attached.
576
25 25 6 [OP_SUB] 30 1 [OP_SUB] [OP_MUL] [OP_ADD]
var_a = 25 var_b = 25 var_c = 6 var_d = var_b - var_c var_e = 30 var_f = 1 var_g = var_e - var_f var_h = var_d * var_g var_i = var_a + var_h print(int(var_i))
Arithmetic calculation
Hoseok has 2 candies of (A) and 5 candies of (B). How many candies does Hoseok have in all?
7
2 5 [OP_ADD]
var_a = 2 var_b = 5 var_c = var_a + var_b print(int(var_c))
Correspondence
The number was supposed to be divided by 2.5, but it is divided by 2 and 2/5 by mistake, resulting in 15/32. What is the correct answer without mistakes?
0.45
15/32 2 2/5 [OP_ADD] [OP_MUL] 2.5 [OP_DIV]
var_a = 0.46875 var_b = 2 var_c = 0.4 var_d = var_b + var_c var_e = var_a * var_d var_f = 2.5 var_g = var_e / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Comparison
There are 24 colored pencils, and red colored pencils makes 1/4 of the total. There are 6 more blue colored pencils than the red colored pencils, and the rest are all yellow colored pencils. Find what color pencils you have the most.
blue
[OP_LIST_SOL] red blue yellow [OP_LIST_EOL] [OP_LIST_SOL] 24 1/4 [OP_MUL] 24 1/4 [OP_MUL] 6 [OP_ADD] 24 24 1/4 [OP_MUL] 6 [OP_ADD] [OP_SUB] 24 1/4 [OP_MUL] [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 = 0.25 var_f = var_d * var_e var_g = 24 var_h = 0.25 var_i = var_g * var_h var_j = 6 var_k = var_i + var_j var_l = 24 var_m = 24 var_n = 0.25 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 = 0.25 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)
Correspondence
6/11 of a number is 48. What is 1/8 of the number?
11
48 6/11 [OP_DIV] 1/8 [OP_MUL]
var_a = 48 var_b = 0.5454545454545454 var_c = var_a / var_b var_d = 0.125 var_e = var_c * var_d print(int(var_e))
Correspondence
If we round 7A7 up to the tens place, we get a value of 730. Find the right value for A.
2
7A7 [OP_GEN_POSSIBLE_LIST] 730 [OP_LIST_LESS_EQUAL] 730 10 [OP_SUB] [OP_LIST_MORE] 7A7 A [OP_LIST_FIND_UNK]
var_a = '7A7' 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 = 730 list_b = [] for i in list_a: if i <= var_b: list_b.append(i) var_c = 730 var_d = 10 var_e = var_c - var_d list_c = [] for i in list_b: if i > var_e: list_c.append(i) var_f = '7A7' 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
What is the volume, in cubic centimeters (cm3), of the largest cube you can make by cutting a rectangular cuboid block of wood that is 15 centimeters (cm) wide, 12 centimeters (cm) long, and 8 centimeters (cm) high?
512
[OP_LIST_SOL] 15 12 8 [OP_LIST_EOL] 1 [OP_LIST_MIN] 3 [OP_POW]
var_a = 15 var_b = 12 var_c = 8 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 1 list_b=list_a.copy() list_b.sort() var_e = list_b[var_d-1] var_f = 3 var_g = var_e ** var_f print(int(var_g))
Correspondence
There is a number obtained by adding 45 to 159, dividing this by 3, and adding 32. Divide this number by 12 to find the value.
8.33
159 45 [OP_ADD] 3 [OP_DIV] 32 [OP_ADD] 12 [OP_DIV]
var_a = 159 var_b = 45 var_c = var_a + var_b var_d = 3 var_e = var_c / var_d var_f = 32 var_g = var_e + var_f var_h = 12 var_i = var_g / var_h print('{:.2f}'.format(round(var_i+1e-10,2)))
Geometry
Find the number of diagonals that can be drawn from one vertex of a dodecagon.
9
12 3 [OP_SUB]
var_a = 12 var_b = 3 var_c = var_a - var_b print(int(var_c))
Arithmetic calculation
Find the remainder when 28 is divided by 10.02.
7.96
28 10.02 [OP_MOD]
var_a = 28 var_b = 10.02 var_c = var_a % var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Comparison
There are four whales of (a), (b), (c), and (d). (a) Whales are faster than (b) whales. (b) Whales are faster than (c) whales. (c) Whales are slower than (d) whales. (d) Whales are faster than (a) whales. Which whale is the slowest?
(c)
[OP_LIST_SOL] (a) (b) (c) (d) [OP_LIST_EOL] [OP_LIST_SOL] (a) (b) > (b) (c) > (c) (d) < (d) (a) > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET]
var_a = '(a)' var_b = '(b)' var_c = '(c)' var_d = '(d)' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = '(a)' var_f = '(b)' var_g = '>' var_h = '(b)' var_i = '(c)' var_j = '>' var_k = '(c)' var_l = '(d)' var_m = '<' var_n = '(d)' var_o = '(a)' var_p = '>' list_b= [] if "/" in str(var_p): var_p = eval(str(var_p)) list_b.append(var_p) if "/" in str(var_o): var_o = eval(str(var_o)) list_b.append(var_o) if "/" in str(var_n): var_n = eval(str(var_n)) list_b.append(var_n) if "/" in str(var_m): var_m = eval(str(var_m)) list_b.append(var_m) if "/" in str(var_l): var_l = eval(str(var_l)) list_b.append(var_l) if "/" in str(var_k): var_k = eval(str(var_k)) list_b.append(var_k) if "/" in str(var_j): var_j = eval(str(var_j)) list_b.append(var_j) if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_q = len(list_c) var_r = list_c[var_q-1] print(var_r)
Arithmetic calculation
You went to the bank with 25 checks for 1 million won and 8 checks for 100,000 won and put them in your bank account. If there was no money in the account before then, how much money is in the account now?
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))
Geometry
What is the total number of vertices in a tetrahedron?
4
3 1 [OP_ADD]
var_a = 3 var_b = 1 var_c = var_a + var_b print(int(var_c))
Comparison
Jungkook has the number 6 minus 3, Yoongi collected 4, and Yuna collected 5. Who has the smallest number?
Jungkook
[OP_LIST_SOL] Jungkook Yoongi Yuna [OP_LIST_EOL] [OP_LIST_SOL] 6 3 [OP_SUB] 4 5 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jungkook' var_b = 'Yoongi' var_c = 'Yuna' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 6 var_e = 3 var_f = var_d - var_e var_g = 4 var_h = 5 list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[var_i-1] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Correspondence
When the older brother is 10, the younger brother is 7 years old, and when the younger brother is 5 years old, the mother is 32 years old. Find the sum of the ages of the younger brother and mother when the older brother is 12 years old.
45
12 7 10 [OP_SUB] [OP_ADD] 12 7 10 [OP_SUB] [OP_ADD] 32 5 [OP_SUB] [OP_ADD] [OP_ADD]
var_a = 12 var_b = 7 var_c = 10 var_d = var_b - var_c var_e = var_a + var_d var_f = 12 var_g = 7 var_h = 10 var_i = var_g - var_h var_j = var_f + var_i var_k = 32 var_l = 5 var_m = var_k - var_l var_n = var_j + var_m var_o = var_e + var_n print(int(var_o))
Comparison
I listed the numbers of 2.38, 2.83, and 2.401 in descending order. What number comes in the second?
2.4
[OP_LIST_SOL] 2.38 2.83 2.401 [OP_LIST_EOL] 2 [OP_LIST_MAX]
var_a = 2.38 var_b = 2.83 var_c = 2.401 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('{:.2f}'.format(round(var_e+1e-10,2)))
Geometry
There is a rectangle with a length of 5.4 centimeters (cm) and an area of 48.6 square centimeters (cm2). How many centimeters (cm) is the width of this rectangle?
9
48.6 5.4 [OP_DIV]
var_a = 48.6 var_b = 5.4 var_c = var_a / var_b print(int(var_c))
Correspondence
Two-digit number that is a multiple of 6 and 9 has a remainder of 1 when divided by 7. Find this two digit number.
36
10 100 1 [OP_LIST_ARANGE] 6 9 [OP_LCM] 0 [OP_LIST_DIVIDE_AND_REMAIN] 7 1 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_GET]
var_a = 10 var_b = 100 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 6 var_e = 9 var_f = var_e * var_d / math.gcd(int(var_e), int(var_d)) var_g = 0 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 = 7 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
There are one-digit numbers A and B. 757AB384 is a multiple of 357. Find the value of B.
5
757AB384 [OP_GEN_POSSIBLE_LIST] 357 [OP_LIST_DIVISIBLE] 757AB384 B [OP_LIST_FIND_UNK]
var_a = '757AB384' 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 = 357 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 = '757AB384' var_d = 'B' var_c = str(var_c) var_d = str(var_d) unk_idx = var_c.index(var_d) var_e = 0 for elem in list_b: elem = str(elem) var_e = int(elem[unk_idx]) print(int(var_e))
Comparison
Among 5.21, 2/3, 3.21, 3.42, and 1/3, find the product of the smallest and the second smallest number.
0.22
[OP_LIST_SOL] 5.21 2/3 3.21 3.42 1/3 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_MUL]
var_a = 5.21 var_b = 0.6666666666666666 var_c = 3.21 var_d = 3.42 var_e = 0.3333333333333333 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)))
Correspondence
When 6AB+3=691, find A.
8
6AB+3=691 A [OP_DIGIT_UNK_SOLVER]
var_a = '6AB+3=691' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Arithmetic calculation
My mother is 42 years old this year, and my father is 44 years old. How old is the father in the year when the sum of their ages is 100?
51
44 100 44 42 [OP_ADD] [OP_SUB] 2 [OP_DIV] [OP_ADD]
var_a = 44 var_b = 100 var_c = 44 var_d = 42 var_e = var_c + var_d var_f = var_b - var_e var_g = 2 var_h = var_f / var_g var_i = var_a + var_h print(int(var_i))
Geometry
When the bottles were arranged in a square, there were 36 bottles left. I increased the width and height of the square by one column each, and there were still 3 bottles left out. How many bottles are there in total?
292
36 3 [OP_SUB] 1 [OP_SUB] 2 [OP_DIV] 2 [OP_POW] 36 [OP_ADD]
var_a = 36 var_b = 3 var_c = var_a - var_b var_d = 1 var_e = var_c - var_d var_f = 2 var_g = var_e / var_f var_h = 2 var_i = var_g ** var_h var_j = 36 var_k = var_i + var_j print(int(var_k))
Comparison
Yoongi had 4 apples, Yuna had 5 apples, and Jungkook had 6 apples, but he ate 3. Who has the most apples?
Yuna
[OP_LIST_SOL] Yoongi Yuna Jungkook [OP_LIST_EOL] [OP_LIST_SOL] 4 5 6 3 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yoongi' var_b = 'Yuna' var_c = 'Jungkook' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 4 var_e = 5 var_f = 6 var_g = 3 var_h = var_f - var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Possibility
There are three chicken restaurants, two pizza restaurants, and two Chinese restaurants near Minsu's house. When ordering delivery food from 3 of these places at the same time, find the number of cases.
35
3 2 [OP_ADD] 2 [OP_ADD] 3 [OP_COMB]
var_a = 3 var_b = 2 var_c = var_a + var_b var_d = 2 var_e = var_c + var_d var_f = 3 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))
Possibility
Use the all number cards 1, 6, and 8 once and find the third largest three-digit number.
681
[OP_LIST_SOL] 1 6 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 3 [OP_LIST_MAX]
var_a = 1 var_b = 6 var_c = 8 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = 3 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] print(int(var_f))
Geometry
The width of the square paper is 8 centimeters (cm). If the perimeter is 40 centimeters (cm), how long is the length?
12
40 2 [OP_DIV] 8 [OP_SUB]
var_a = 40 var_b = 2 var_c = var_a / var_b var_d = 8 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
You want to give dolls to students in a class. When 4 dolls were given to each student, 3 dolls were left, and when 5 dolls were given, 6 dolls were in short. How many dolls did you have?
39
3 6 [OP_ADD] 5 4 [OP_SUB] [OP_DIV] 4 [OP_MUL] 3 [OP_ADD]
var_a = 3 var_b = 6 var_c = var_a + var_b var_d = 5 var_e = 4 var_f = var_d - var_e var_g = var_c / var_f var_h = 4 var_i = var_g * var_h var_j = 3 var_k = var_i + var_j print(int(var_k))
Geometry
There is a pentagon whose all sides have the same length. If one side of this pentagon is 15 centimeters (cm) long, how many centimeters (cm) is the sum of all the side lengths?
75
15 5 [OP_MUL]
var_a = 15 var_b = 5 var_c = var_a * var_b print(int(var_c))
Possibility
How many three-digit integers greater than 600 and less than 950 have 4, 6, and 9 in each digit?
3
[OP_LIST_SOL] 4 6 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 600 [OP_LIST_MORE] 950 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = 4 var_b = 6 var_c = 9 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 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 = 600 list_c = [] for i in list_b: if i > var_e: list_c.append(i) var_f = 950 list_d = [] for i in list_c: if i < var_f: list_d.append(i) var_g = len(list_d) print(int(var_g))
Possibility
There are weights of 1 gram (g), 2 grams (g), 4 grams (g), and 8 grams (g) each in the lab. How many different weights can you measure using these weights?
15
2 4 [OP_POW] 1 [OP_SUB]
var_a = 2 var_b = 4 var_c = var_a ** var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Comparison
Yoongi has 4 apples, Yuna has 5, and Jungkook has 6 plus 3 apples. Who has the smallest number of apples?
Yoongi
[OP_LIST_SOL] Yoongi Yuna Jungkook [OP_LIST_EOL] [OP_LIST_SOL] 4 5 6 3 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yoongi' var_b = 'Yuna' var_c = 'Jungkook' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 4 var_e = 5 var_f = 6 var_g = 3 var_h = var_f + var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[var_i-1] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Geometry
How many pairs of sides are parallel in a regular hexagon?
3
6 2 [OP_FDIV]
var_a = 6 var_b = 2 var_c = var_a // var_b print(int(var_c))
Correspondence
When you multiply a number by 3 and then subtract 4, you get 5. Find the number.
3
5 4 [OP_ADD] 3 [OP_DIV]
var_a = 5 var_b = 4 var_c = var_a + var_b var_d = 3 var_e = var_c / var_d print(int(var_e))
Correspondence
When 90 is divided by any number, how many divisible numbers are there?
12
90 [OP_LIST_GET_DIVISOR] [OP_LIST_LEN]
var_a = 90 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 = len(list_a) print(int(var_b))
Geometry
There is a piece of colored paper in the shape of a square with a side length of 11 centimeters (cm). What is the area of this sheet of colored paper?
121
11 2 [OP_POW]
var_a = 11 var_b = 2 var_c = var_a ** var_b print(int(var_c))
Correspondence
When A is divided by 8, the quotient is B and the remainder is C. A, B, and C are natural numbers. If B and C are equal, what is the largest possible number of A?
63
8 1 [OP_SUB] 8 [OP_MUL] 8 1 [OP_SUB] [OP_ADD]
var_a = 8 var_b = 1 var_c = var_a - var_b var_d = 8 var_e = var_c * var_d var_f = 8 var_g = 1 var_h = var_f - var_g var_i = var_e + var_h print(int(var_i))
Possibility
There are 1 red marble, 1 blue marble, and 1 yellow marble. Find the number of ways in which two of these can be placed in two boxes of the same shape.
3
[OP_LIST_SOL] red blue yellow [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_COMB]
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 = len(list_a) var_e = 2 var_f = 1 var_d = int(var_d) var_e = int(var_e) for i, elem in enumerate(range(var_e)): var_f = var_f * (var_d-i) for i, elem in enumerate(range(var_e)): var_f = var_f / (i+1) print(int(var_f))
Geometry
There is a square with a side of 14 centimeters (cm). You want to subdivide this square into rectangles that are 2 centimeters (cm) wide and 8 centimeters (cm) long. How many such rectangles can you get at most?
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
If you throw three coins that are distinguishable from each other, how many outcomes will you get?
8
2 3 [OP_POW]
var_a = 2 var_b = 3 var_c = var_a ** var_b print(int(var_c))
Correspondence
You need to multiply a number by 3 and add 49. But you subtract 3 and add 49 mistakenly and get 66. Find the difference between the correctly calculated value and the incorrectly calculated value.
43
66 49 [OP_SUB] 3 [OP_ADD] 3 [OP_MUL] 49 [OP_ADD] 66 [OP_SUB]
var_a = 66 var_b = 49 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 = 49 var_i = var_g + var_h var_j = 66 var_k = var_i - var_j print(int(var_k))
Arithmetic calculation
Dohyun divided the donut into 3 equal pieces and ate one piece. Dongmin divided a donut of the same size into 12 equal pieces. How many donuts must Dongmin eat to eat the same amount as Dohyun?
4
12 3 [OP_DIV]
var_a = 12 var_b = 3 var_c = var_a / var_b print(int(var_c))
Arithmetic calculation
If you give 1 kg (kg) 900 grams (g) out of 3 kg (kg) 300 grams (g) of strawberries to a friend, how many grams (g) of strawberries are left?
1400
3 1000 [OP_MUL] 300 [OP_ADD] 1 1000 [OP_MUL] 900 [OP_ADD] [OP_SUB]
var_a = 3 var_b = 1000 var_c = var_a * var_b var_d = 300 var_e = var_c + var_d var_f = 1 var_g = 1000 var_h = var_f * var_g var_i = 900 var_j = var_h + var_i var_k = var_e - var_j print(int(var_k))
Geometry
Chae Song-i made a square with a side length of 13 centimeters (cm) using thread. What is the length of the thread that Chaesongi has?
52
13 4 [OP_MUL]
var_a = 13 var_b = 4 var_c = var_a * var_b print(int(var_c))
Geometry
There are two points with an actual distance of 5 kilometers (km). On a map with a scale of 1/250000, how many centimeters (cm) would be the length of the two points when measured with a ruler?
2
5 100 1000 [OP_MUL] [OP_MUL] 1/250000 [OP_MUL]
var_a = 5 var_b = 100 var_c = 1000 var_d = var_b * var_c var_e = var_a * var_d var_f = 4e-06 var_g = var_e * var_f print(int(var_g))
Geometry
Find the number of vertices of the rectangular prism.
8
4 2 [OP_MUL]
var_a = 4 var_b = 2 var_c = var_a * var_b print(int(var_c))
Comparison
I drew three circles with colored pencils. The radius of the orange circle is 4 centimeters (cm), the diameter of the light-green circle is 6 centimeters (cm), and the radius of the sky-blue circle is 5 centimeters (cm). What color circle is with the widest area?
sky-blue
[OP_LIST_SOL] orange light-green sky-blue [OP_LIST_EOL] [OP_LIST_SOL] 4 6 2 [OP_DIV] 5 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'orange' var_b = 'light-green' var_c = 'sky-blue' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 4 var_e = 6 var_f = 2 var_g = var_e / var_f var_h = 5 list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Correspondence
To make dumplings with 45 grams (g) of dough, each dumpling needs 4 grams (g). Find the maximum number of dumplings you can make.
11
45 4 [OP_FDIV]
var_a = 45 var_b = 4 var_c = var_a // var_b print(int(var_c))
Correspondence
Divide 90.1 by some number to get 5.3. Find out what the number is.
17
90.1 5.3 [OP_DIV]
var_a = 90.1 var_b = 5.3 var_c = var_a / var_b print(int(var_c))
Arithmetic calculation
How many three-digit numbers are multiples of 6, multiples of 5, multiples of 8, and multiples of 9?
2
100 999 1 [OP_LIST_ARANGE] 6 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 8 [OP_LIST_DIVISIBLE] 9 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 100 var_b = 999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 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) 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 = 8 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 = 9 list_e = [] var_g = int(var_g) for i in list_d: i = int(i) if i % var_g == 0: list_e.append(i) var_h = len(list_e) print(int(var_h))
Geometry
The shape of the base side of the pyramid is a dodecagon. How many faces does this pyramid have?
13
12 1 [OP_ADD]
var_a = 12 var_b = 1 var_c = var_a + var_b print(int(var_c))
Arithmetic calculation
Seokgi and Yeseul shared a wire. The length of this wire is 1 meter (m) and 50 centimeters (cm), and it is said that the Seokgi's share is 16 centimeters (cm) shorter than Yeseul. How many centimeters (cm) of wire does Seokgi have?
67
1 100 [OP_MUL] 50 [OP_ADD] 16 [OP_SUB] 2 [OP_DIV]
var_a = 1 var_b = 100 var_c = var_a * var_b var_d = 50 var_e = var_c + var_d var_f = 16 var_g = var_e - var_f var_h = 2 var_i = var_g / var_h print(int(var_i))
Arithmetic calculation
There are 8 apples in the basket. Jungkook put 7 more apples in the basket. How many apples are in the basket?
15
8 7 [OP_ADD]
var_a = 8 var_b = 7 var_c = var_a + var_b print(int(var_c))
Possibility
I am trying to pick two different numbers at the same time from natural numbers from 1 to 9. Find the number of ways in which the sum of two numbers is greater than 10.
32
1 9 1 [OP_LIST_ARANGE] 2 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] 10 [OP_LIST_MORE] [OP_LIST_LEN]
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 = 10 list_d = [] for i in list_c: if i > var_f: list_d.append(i) var_g = len(list_d) print(int(var_g))
Correspondence
4 is the result of mistakenly subtracting 5 from a number instead of subtracting 4. Find this number
9
4 5 [OP_ADD]
var_a = 4 var_b = 5 var_c = var_a + var_b print(int(var_c))
Correspondence
4A5B+C2D7=8070. Find C when there are four different numbers A, B, C, and D.
3
4A5B+C2D7=8070 C [OP_DIGIT_UNK_SOLVER]
var_a = '4A5B+C2D7=8070' var_b = 'C' 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
There is a quadrangular pyramid with the sum of the lengths of its edges being 14.8 meters (m). Find the length of one edge of this quadrangular pyramid when all the edge lengths are the same.
1.85
14.8 4 2 [OP_MUL] [OP_DIV]
var_a = 14.8 var_b = 4 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
Each box contains 3 balls. If you have 2 boxes, how many balls do you have in total?
6
3 2 [OP_MUL]
var_a = 3 var_b = 2 var_c = var_a * var_b print(int(var_c))
Comparison
There are numbers 0.8, 1/2, and 0.9. Find the largest of all numbers less than 0.6.
0.5
[OP_LIST_SOL] 0.8 1/2 0.9 [OP_LIST_EOL] 0.6 [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.6 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)))
Arithmetic calculation
If Junhyeok and Hyeonyoung do a certain task together for 8 days, they can do 7/12 of the total work. After the two of them worked together for eight days, Junhyeok decided to do the rest by himself. If Junhyeok worked alone for 10 days, how many days would it take to finish the job if Heonyeong did it alone from the beginning?
32
1 7/12 8 [OP_DIV] 1 7/12 [OP_SUB] 10 [OP_DIV] [OP_SUB] [OP_DIV]
var_a = 1 var_b = 0.5833333333333334 var_c = 8 var_d = var_b / var_c var_e = 1 var_f = 0.5833333333333334 var_g = var_e - var_f var_h = 10 var_i = var_g / var_h var_j = var_d - var_i var_k = var_a / var_j print(int(eval('{:.2f}'.format(round(var_k+1e-10,2)))))
Comparison
There are a total of three numbers: 0.8, 1/2, and 0.5. What is the smallest of these numbers greater than or equal to 0.1?
0.5
[OP_LIST_SOL] 0.8 1/2 0.5 [OP_LIST_EOL] 0.1 [OP_LIST_MORE_EQUAL] 1 [OP_LIST_MIN]
var_a = 0.8 var_b = 0.5 var_c = 0.5 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 0.1 list_b = [] for i in list_a: if i >= var_d: list_b.append(i) var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[var_e-1] print('{:.2f}'.format(round(var_f+1e-10,2)))
Arithmetic calculation
Find the sum of all numbers between 1 and 100.
5050
1 100 1 [OP_LIST_ARANGE] [OP_LIST_SUM]
var_a = 1 var_b = 100 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] list_a = [float(i) for i in list_a] var_d = sum(list_a) print(int(var_d))
Possibility
Find the number of two-digit natural numbers that can be made by selecting two figures among 0, 1, and 2.
4
[OP_LIST_SOL] 0 1 2 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 2 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = len(list_b) print(int(var_e))
Correspondence
Subtracting 5 from a number and dividing it by 3 gives you 4. Find the number.
17
4 3 [OP_MUL] 5 [OP_ADD]
var_a = 4 var_b = 3 var_c = var_a * var_b var_d = 5 var_e = var_c + var_d print(int(var_e))
Geometry
If the diameter of a circle is 8 centimeters (cm) and the circumference is 25.12 centimeters (cm), what is the pi of the circle?
3.14
25.12 8 [OP_DIV]
var_a = 25.12 var_b = 8 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Comparison
The volleyball teams A, B, C, and D are playing volleyball. A beat B 3-2, and B lost to D 2-5. When C beats D 3-2, find the last-place team.
B
[OP_LIST_SOL] A B C D [OP_LIST_EOL] [OP_LIST_SOL] A B > B D < C D > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET]
var_a = 'A' var_b = 'B' var_c = 'C' var_d = 'D' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 'A' var_f = 'B' var_g = '>' var_h = 'B' var_i = 'D' var_j = '<' var_k = 'C' var_l = 'D' 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
How many diagonals can you draw in a 10-sided figure?
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
Among the three people, the heaviest weight person differs from the middle weight person by 7 kilograms (kg) and 700 grams (g), and the lightest weight person differs from the middle weight person by 4.8 kilograms (kg). If the sum of the weights of the three people is 106 kilograms (kg) and 600 grams (g), how many kilograms (kg) does the heaviest person weigh?
42.27
106 600 1000 [OP_DIV] [OP_ADD] 7 700 1000 [OP_DIV] [OP_ADD] 2 [OP_MUL] [OP_ADD] 4.8 [OP_ADD] 3 [OP_DIV]
var_a = 106 var_b = 600 var_c = 1000 var_d = var_b / var_c var_e = var_a + var_d var_f = 7 var_g = 700 var_h = 1000 var_i = var_g / var_h var_j = var_f + var_i var_k = 2 var_l = var_j * var_k var_m = var_e + var_l var_n = 4.8 var_o = var_m + var_n var_p = 3 var_q = var_o / var_p print('{:.2f}'.format(round(var_q+1e-10,2)))
Correspondence
I had to divide a number by 4, but I accidentally divided a number by 2, and the share became 8. How much is it if I calculate it correctly?
4
8 2 [OP_MUL] 4 [OP_DIV]
var_a = 8 var_b = 2 var_c = var_a * var_b var_d = 4 var_e = var_c / var_d print(int(var_e))
Geometry
How many times the surface area of a sphere with a radius of 6 centimeters (cm) is greater than the surface area of a sphere with a radius of 3 centimeters (cm)?
4
6 3 [OP_DIV] 2 [OP_POW]
var_a = 6 var_b = 3 var_c = var_a / var_b var_d = 2 var_e = var_c ** var_d print(int(var_e))
Comparison
Seokjin walked up the stairs from the building entrance and arrived on the 5th floor. Hoseok took the elevator from the entrance of the same building and reached the 8th floor. Who climbed higher?
Hoseok
[OP_LIST_SOL] Seokjin Hoseok [OP_LIST_EOL] [OP_LIST_SOL] 5 8 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Seokjin' var_b = 'Hoseok' 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 = 8 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)
Geometry
What is the sum of all the sides of an equilateral triangle with sides of 13/12 meters (m)?
3.25
13/12 3 [OP_MUL]
var_a = 1.0833333333333333 var_b = 3 var_c = var_a * var_b print('{:.2f}'.format(round(var_c+1e-10,2)))