category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Comparison
The left button is written as 21/5 and the right button as 4.9. If you have to press the button with the higher number, which button would you choose to press?
right
[OP_LIST_SOL] left right [OP_LIST_EOL] [OP_LIST_SOL] 21/5 4.9 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'left' var_b = 'right' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 4.2 var_d = 4.9 list_b= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_b.append(var_c) list_b.reverse() var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] var_g = list_b.index(var_f)+1 var_h = list_a[var_g-1] print(var_h)
Possibility
If 6 volleyball teams play with each other once, how many matches will take place?
15
6 2 [OP_COMB]
var_a = 6 var_b = 2 var_c = 1 var_a = int(var_a) var_b = int(var_b) for i, elem in enumerate(range(var_b)): var_c = var_c * (var_a-i) for i, elem in enumerate(range(var_b)): var_c = var_c / (i+1) print(int(var_c))
Arithmetic calculation
I bought 8 bookshelves of the same shape. This bookshelf has 5 layers, and each layer can hold 85 books. How many books can I put in my new bookcase?
3400
8 5 [OP_MUL] 85 [OP_MUL]
var_a = 8 var_b = 5 var_c = var_a * var_b var_d = 85 var_e = var_c * var_d print(int(var_e))
Geometry
A cube with one edge that is 15 centimeters (cm) long is displayed in the exhibition hall. What is the sum of the lengths of all the edges of this cube?
180
15 4 3 [OP_MUL] [OP_MUL]
var_a = 15 var_b = 4 var_c = 3 var_d = var_b * var_c var_e = var_a * var_d print(int(var_e))
Arithmetic calculation
What is the largest three-digit multiple of 6?
996
100 999 1 [OP_LIST_ARANGE] 6 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX]
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 = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] print(int(var_f))
Geometry
Minho has a triangular ruler with a base of 15 centimeters (cm) and a height of 20 centimeters (cm). When a triangle is drawn along the surface of this triangular ruler, find the area of the drawn triangle in square centimeters (cm2).
150
15 20 [OP_MUL] 2 [OP_DIV]
var_a = 15 var_b = 20 var_c = var_a * var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Comparison
We compared the swimming speeds of five fish A, B, C, D, and E. A is faster than B but slower than C. D is faster than E but slower than B. Which of these fish is the slowest?
E
[OP_LIST_SOL] A B C D E [OP_LIST_EOL] [OP_LIST_SOL] A B > A C < E D < B 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' var_e = 'E' list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 'A' var_g = 'B' var_h = '>' var_i = 'A' var_j = 'C' var_k = '<' var_l = 'E' var_m = 'D' var_n = '<' var_o = 'B' var_p = 'D' var_q = '>' list_b= [] 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_r = len(list_c) var_s = list_c[var_r-1] print(var_s)
Geometry
When the small square-shaped notebooks are arraged without gaps to form a large square, there are 20 notebooks left. When I tried to increase the width and height by one row each, 9 notebooks were short. How many notebooks are there in total?
216
20 9 [OP_ADD] 1 [OP_SUB] 2 [OP_DIV] 2 [OP_POW] 20 [OP_ADD]
var_a = 20 var_b = 9 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 = 20 var_k = var_i + var_j print(int(var_k))
Correspondence
A47BC is a five-digit number and is a multiple of 4, 5, or 9. How many possible numbers can be A in A47BC?
5
A47BC [OP_GEN_POSSIBLE_LIST] 4 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 9 [OP_LIST_DIVISIBLE] A47BC A [OP_LIST_FIND_UNK] [OP_LIST_LEN]
var_a = 'A47BC' ans_dict = dict() var_a = str(var_a) list_a = [] variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 0 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) if len(var_a) == len(str(int(temp))): new_elem = int(temp) list_a.append(new_elem) var_b = 4 list_b = [] var_b = int(var_b) for i in list_a: i = int(i) if i % var_b == 0: list_b.append(i) var_c = 5 list_c = [] var_c = int(var_c) for i in list_b: i = int(i) if i % var_c == 0: list_c.append(i) var_d = 9 list_d = [] var_d = int(var_d) for i in list_c: i = int(i) if i % var_d == 0: list_d.append(i) var_e = 'A47BC' var_f = 'A' var_e = str(var_e) var_f = str(var_f) unk_idx = var_e.index(var_f) list_e = [] for elem in list_d: elem = str(elem) list_e.append(int(elem[unk_idx])) list_e = list(set(list_e)) var_g = len(list_e) print(int(var_g))
Geometry
What is the area of a square with a perimeter of 48 centimeters (cm)?
144
48 4 [OP_DIV] 2 [OP_POW]
var_a = 48 var_b = 4 var_c = var_a / var_b var_d = 2 var_e = var_c ** var_d print(int(var_e))
Arithmetic calculation
There are 82 blue and red pens in total. Find the number of blue pens when there are 6 more blue pens than red pens.
44
82 6 [OP_SUB] 2 [OP_DIV] 6 [OP_ADD]
var_a = 82 var_b = 6 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d var_f = 6 var_g = var_e + var_f print(int(var_g))
Geometry
There are 27 cube dice, and each side is 3 centimeters (cm) long. When these dice are stacked to form a cube, what is the surface area of the cube?
486
3 27 1/3 [OP_POW] [OP_MUL] 2 [OP_POW] 6 [OP_MUL]
var_a = 3 var_b = 27 var_c = 0.3333333333333333 var_d = var_b ** var_c var_e = var_a * var_d var_f = 2 var_g = var_e ** var_f var_h = 6 var_i = var_g * var_h print(int(var_i))
Geometry
What is the sum of the measures of the six interior angles of a hexagon?
720
6 2 [OP_SUB] 180 [OP_MUL]
var_a = 6 var_b = 2 var_c = var_a - var_b var_d = 180 var_e = var_c * var_d print(int(var_e))
Comparison
The red bus took 4 hours to drive 200 kilometers (km), and the yellow bus took 3 hours to drive 180 kilometers (km). Which bus is faster?
yellow
[OP_LIST_SOL] red yellow [OP_LIST_EOL] [OP_LIST_SOL] 200 4 [OP_DIV] 180 3 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'red' var_b = 'yellow' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 200 var_d = 4 var_e = var_c / var_d var_f = 180 var_g = 3 var_h = var_f / var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Correspondence
There are numbers when divided by 8, the remainder is 5, and when divided by 3, the remainder is 2. When these numbers are counted from the smallest to largest, find the 20th number.
461
0 9999 1 [OP_LIST_ARANGE] 3 2 [OP_LIST_DIVIDE_AND_REMAIN] 8 5 [OP_LIST_DIVIDE_AND_REMAIN] 20 [OP_LIST_MIN]
var_a = 0 var_b = 9999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 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 = 8 var_g = 5 list_c = [] var_f = int(var_f) var_g = int(var_g) if var_g < 0: var_g = var_g + var_f for i in list_b: i = int(i) if i%var_f == var_g: list_c.append(i) var_h = 20 list_d=list_c.copy() list_d.sort() var_i = list_d[var_h-1] print(int(var_i))
Correspondence
Subtracting 30 from a number is a multiple of 70. Find the smallest value of any possible number. However, a number is greater than 280.
310
280 30 [OP_ADD]
var_a = 280 var_b = 30 var_c = var_a + var_b print(int(var_c))
Possibility
When using the given number cards 7, 5, and 2 all once to make a number greater than 530 and less than 710, write the number that can be in the tens place.
7
[OP_LIST_SOL] 7 5 2 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 530 [OP_LIST_MORE] 710 [OP_LIST_LESS] 1 [OP_LIST_GET] 100 [OP_MOD] 10 [OP_FDIV]
var_a = 7 var_b = 5 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 = 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 = 530 list_c = [] for i in list_b: if i > var_e: list_c.append(i) var_f = 710 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] var_i = 100 var_j = var_h % var_i var_k = 10 var_l = var_j // var_k print(int(var_l))
Possibility
Figure out the smallest sum of numbers that are made out of the number cards 1, 4, 9, and 5 using only once.
19
1 4 [OP_ADD] 9 [OP_ADD] 5 [OP_ADD]
var_a = 1 var_b = 4 var_c = var_a + var_b var_d = 9 var_e = var_c + var_d var_f = 5 var_g = var_e + var_f print(int(var_g))
Arithmetic calculation
There were 1.6 liters (L) of chocolate milk. If you drank 0.8 liters (L) yesterday and 0.3 liters (L) today, how many liters (L) of chocolate milk are left?
0.5
1.6 0.8 [OP_SUB] 0.3 [OP_SUB]
var_a = 1.6 var_b = 0.8 var_c = var_a - var_b var_d = 0.3 var_e = var_c - var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Comparison
Choose the smallest number among 5, 9, 10, and 2.
2
[OP_LIST_SOL] 5 9 10 2 [OP_LIST_EOL] 1 [OP_LIST_MIN]
var_a = 5 var_b = 9 var_c = 10 var_d = 2 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 1 list_b=list_a.copy() list_b.sort() var_f = list_b[var_e-1] print(int(var_f))
Geometry
There are some pieces of paper tape of 18 centimeters (cm) each, and 12 pieces of it are overlapped to form a round ring with a circumference of 210 centimeters (cm). If the length of the overlapped part is the same, write down how much is it in millimeters (mm).
5
18 12 [OP_MUL] 210 [OP_SUB] 12 [OP_DIV] 10 [OP_MUL]
var_a = 18 var_b = 12 var_c = var_a * var_b var_d = 210 var_e = var_c - var_d var_f = 12 var_g = var_e / var_f var_h = 10 var_i = var_g * var_h print(int(var_i))
Geometry
There is a cube with each edge 3 centimeters (cm) long. If one digs out cubes with its edge 1 centimeters (cm) long from each center of the faces of the cube, what is the volume in cubic centimeters (cm3) of the remaining part?
21
3 3 [OP_POW] 1 3 [OP_POW] 6 [OP_MUL] [OP_SUB]
var_a = 3 var_b = 3 var_c = var_a ** var_b var_d = 1 var_e = 3 var_f = var_d ** var_e var_g = 6 var_h = var_f * var_g var_i = var_c - var_h print(int(var_i))
Comparison
Thirteen students competed in jumping rope. After the match, there were 4 people who did fewer jump ropes than Namjoon. What rank is Namjoon?
9
13 4 [OP_SUB]
var_a = 13 var_b = 4 var_c = var_a - var_b print(int(var_c))
Arithmetic calculation
2 times the sum of cows and pigs is 32. If there are 7 cows, how many pigs are there?
9
32 2 [OP_DIV] 7 [OP_SUB]
var_a = 32 var_b = 2 var_c = var_a / var_b var_d = 7 var_e = var_c - var_d print(int(var_e))
Correspondence
The six-digit number A2468B is divisible by 55. How many possible numbers can be A2468B?
2
A2468B [OP_GEN_POSSIBLE_LIST] 55 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 'A2468B' 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 = 55 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))
Arithmetic calculation
Among the students in Yuna's class, there are 28 students who like Korean, 27 students who like math, and 22 students who like both Korean and math. If there is no student who does not like both Korean and math, how many students are there in Yuna's class?
33
28 27 [OP_ADD] 22 [OP_SUB]
var_a = 28 var_b = 27 var_c = var_a + var_b var_d = 22 var_e = var_c - var_d print(int(var_e))
Possibility
The seven digits 0, 1, 2, 3, 4, 5, and 6 are used once to form a seven-digit number. If this number is a multiple of 55, find the smallest number.
1042635
[OP_LIST_SOL] 0 1 2 3 4 5 6 [OP_LIST_EOL] 7 [OP_LIST_GET_PERM] 55 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN]
var_a = 0 var_b = 1 var_c = 2 var_d = 3 var_e = 4 var_f = 5 var_g = 6 list_a= [] if "/" in str(var_g): var_g = eval(str(var_g)) list_a.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_h = 7 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_h)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_i = 55 list_c = [] var_i = int(var_i) for i in list_b: i = int(i) if i % var_i == 0: list_c.append(i) var_j = 1 list_d=list_c.copy() list_d.sort() var_k = list_d[var_j-1] print(int(var_k))
Correspondence
If you round down 9A7 to the tens place, you get 930. Find the value of A.
3
9A7 [OP_GEN_POSSIBLE_LIST] 930 [OP_LIST_MORE_EQUAL] 930 10 [OP_ADD] [OP_LIST_LESS] 9A7 A [OP_LIST_FIND_UNK]
var_a = '9A7' 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 = 930 list_b = [] for i in list_a: if i >= var_b: list_b.append(i) var_c = 930 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 = '9A7' 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))
Comparison
You want to drink 1 liter (L) of juice and 3 liters (L) of juice equally divided into cups of the same shape and size. If 1 liter (L) of juice is divided equally into 2 A cups and 3 liters (L) of juice is divided equally into 4 B cups, which cup has more juice, Cup A or Cup B?
B
[OP_LIST_SOL] A B [OP_LIST_EOL] [OP_LIST_SOL] 1 2 [OP_MUL] 3 4 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'A' var_b = 'B' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 1 var_d = 2 var_e = var_c * var_d var_f = 3 var_g = 4 var_h = var_f * var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Correspondence
When 12 is divided by A, the quotient is B and the remainder is C. A, B, and C are natural numbers. If the quotient and the remainder are equal, what is the largest possible A?
11
12 1 [OP_SUB]
var_a = 12 var_b = 1 var_c = var_a - var_b print(int(var_c))
Geometry
If you multiply the width of a square by 0.8 and the length by 5 to create a new rectangle, its area increases by 15.18 square centimeters (cm2) than the area of the original square. What is the area of the first square in square centimeters (cm2)?
5.06
15.18 0.8 5 [OP_MUL] 1 [OP_SUB] [OP_DIV]
var_a = 15.18 var_b = 0.8 var_c = 5 var_d = var_b * var_c var_e = 1 var_f = var_d - var_e var_g = var_a / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Correspondence
You had to multiply a number by 5 and then multiply by 10, but mistakenly multiplied 15 instead to get 45. Find the correctly calculated value.
150
45 15 [OP_DIV] 5 [OP_MUL] 10 [OP_MUL]
var_a = 45 var_b = 15 var_c = var_a / var_b var_d = 5 var_e = var_c * var_d var_f = 10 var_g = var_e * var_f print(int(var_g))
Comparison
How many of 0.8, 1/2, 0.9, and 1/3 are less than or equal to 0.4?
1
[OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 0.4 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN]
var_a = 0.8 var_b = 0.5 var_c = 0.9 var_d = 0.3333333333333333 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 0.4 list_b = [] for i in list_a: if i <= var_e: list_b.append(i) var_f = len(list_b) print(int(var_f))
Comparison
A total of 108 coins consists of 10-won coins, 50-won coins, and 100-won coins. The amount of the 50-won coins is 1/3 of the amount of the 10-won coins, and the amount of the 100-won coins is 1/2 of that of the 50-won coins. What kind of won-coins do you have the least?
100-won
[OP_LIST_SOL] 10-won 50-won 100-won [OP_LIST_EOL] [OP_LIST_SOL] 1 1 3 [OP_DIV] 1 3 [OP_DIV] 2 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = '10-won' var_b = '50-won' var_c = '100-won' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 1 var_e = 1 var_f = 3 var_g = var_e / var_f var_h = 1 var_i = 3 var_j = var_h / var_i var_k = 2 var_l = var_j / var_k list_b= [] if "/" in str(var_l): var_l = eval(str(var_l)) list_b.append(var_l) if "/" in str(var_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_m = 1 list_c=list_b.copy() list_c.sort() var_n = list_c[var_m-1] var_o = list_b.index(var_n)+1 var_p = list_a[var_o-1] print(var_p)
Geometry
If you draw two diagonals from a square, you get B polygons having A sides and C right-angled polygons having A sides. What is A×(B+C)?
24
3 8 [OP_MUL]
var_a = 3 var_b = 8 var_c = var_a * var_b print(int(var_c))
Arithmetic calculation
There are 10.4 kilograms (kg) of flour in a large barrel. If you want to divide this flour into several bowls, how many bowls will you need to divide 0.8 kg (kg) into each bowl?
13
10.4 0.8 [OP_DIV] 1 [OP_CEIL]
var_a = 10.4 var_b = 0.8 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))
Correspondence
When you divide a number by 4, you get 12. What is the result of dividing the number by 3?
16
12 4 [OP_MUL] 3 [OP_DIV]
var_a = 12 var_b = 4 var_c = var_a * var_b var_d = 3 var_e = var_c / var_d print(int(var_e))
Correspondence
A is a single digit number. Find A when the multiplication expression AA×AA of two digit numbers is 5929.
7
AA×AA=5929 A [OP_DIGIT_UNK_SOLVER]
var_a = 'AA×AA=5929' 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))
Geometry
There is a rectangular garden. The perimeter of this garden is 48 meters (m), and the length of the garden is 2 meters (m) added to its width. Find the width of the garden.
11
48 2 [OP_DIV] 2 [OP_SUB] 2 [OP_DIV]
var_a = 48 var_b = 2 var_c = var_a / var_b var_d = 2 var_e = var_c - var_d var_f = 2 var_g = var_e / var_f print(int(var_g))
Comparison
Flowerpot A is 14th from the right, and flowerpot B is 29th from the left. If the total number of pots is 33, how many are there between A and B?
8
14 29 [OP_ADD] 33 [OP_SUB] 2 [OP_SUB]
var_a = 14 var_b = 29 var_c = var_a + var_b var_d = 33 var_e = var_c - var_d var_f = 2 var_g = var_e - var_f print(int(var_g))
Arithmetic calculation
Find the smallest odd number between 2 and 7.
3
2 7 [OP_LIST_ODD] 1 [OP_LIST_MIN]
var_a = 2 var_b = 7 list_a = [] if var_a%2==0: for i in range(var_a+1, var_b+1, 2): list_a.append(i) else: for i in range(var_a, var_b+1, 2): list_a.append(i) var_c = 1 list_b=list_a.copy() list_b.sort() var_d = list_b[var_c-1] print(int(var_d))
Arithmetic calculation
You want to draw points at intervals of 5 centimeters (cm) on a line that is 30 centimeters (cm) long. How many times should a dot be drawn when there is no dot at the beginning and end of a line?
5
30 5 [OP_DIV] 1 [OP_SUB]
var_a = 30 var_b = 5 var_c = var_a / var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Correspondence
There are a total of 60 marbles in the bag. There are 32 black marbles, 10 red marbles, and 5 green marbles. If the marbles in the bag are black, red, green, and white, how many white marbles are there?
13
60 32 [OP_SUB] 10 [OP_SUB] 5 [OP_SUB]
var_a = 60 var_b = 32 var_c = var_a - var_b var_d = 10 var_e = var_c - var_d var_f = 5 var_g = var_e - var_f print(int(var_g))
Possibility
How many three-digit numbers are there where each digit is odd?
125
1 9 [OP_LIST_ODD] 3 [OP_LIST_GET_PRODUCT] [OP_LIST_LEN]
var_a = 1 var_b = 9 list_a = [] if var_a%2==0: for i in range(var_a+1, var_b+1, 2): list_a.append(i) else: for i in range(var_a, var_b+1, 2): list_a.append(i) var_c = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=var_c)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_d = len(list_b) print(int(var_d))
Arithmetic calculation
There are 1, 4, 0, 7, 5, 2, and 8. You want to create a four-digit number by using the numbers between the 2nd and 7th from the left only once. Find the 4th largest number that can be made.
7520
[OP_LIST_SOL] 4 0 7 5 2 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 4 [OP_LIST_MAX]
var_a = 4 var_b = 0 var_c = 7 var_d = 5 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 = 4 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = 4 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] print(int(var_h))
Comparison
Jungkook collected 6 divided by 3 apples, and Yoongi collected 4 apples. Who has fewer apples?
Jungkook
[OP_LIST_SOL] Jungkook Yoongi [OP_LIST_EOL] [OP_LIST_SOL] 6 3 [OP_FDIV] 4 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jungkook' var_b = 'Yoongi' 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 = 6 var_d = 3 var_e = var_c // var_d var_f = 4 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-1] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Possibility
You want to create a number with two decimal places less than 6. How many can you make if you can only use 2, 4, 6 and the decimal point once?
4
[OP_LIST_SOL] 2 4 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 6 10 3 1 [OP_SUB] [OP_POW] [OP_MUL] [OP_LIST_LESS] [OP_LIST_LEN]
var_a = 2 var_b = 4 var_c = 6 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 = 6 var_f = 10 var_g = 3 var_h = 1 var_i = var_g - var_h var_j = var_f ** var_i var_k = var_e * var_j list_c = [] for i in list_b: if i < var_k: list_c.append(i) var_l = len(list_c) print(int(var_l))
Arithmetic calculation
Find the distance left after 2 hours of driving to an airport which is 300 kilometers (km) from home at 60 kilometers (km) per hour.
180
300 60 2 [OP_MUL] [OP_SUB]
var_a = 300 var_b = 60 var_c = 2 var_d = var_b * var_c var_e = var_a - var_d print(int(var_e))
Geometry
What is the surface area of an octahedron with sides of 2 centimeters (cm)?
10.39
3 3 1/2 [OP_POW] [OP_MUL] 2 [OP_DIV] 2 2 [OP_POW] [OP_MUL]
var_a = 3 var_b = 3 var_c = 0.5 var_d = var_b ** var_c var_e = var_a * var_d var_f = 2 var_g = var_e / var_f var_h = 2 var_i = 2 var_j = var_h ** var_i var_k = var_g * var_j print('{:.2f}'.format(round(var_k+1e-10,2)))
Geometry
You want to build an apartment complex on a rectangular piece of empty land that is 262 kilometers (km) wide and 185 km long, divided into squares. If one side of the apartment complex is 18 kilometers (km), find how many apartment complexes can be built.
140
262 18 [OP_FDIV] 185 18 [OP_FDIV] [OP_MUL]
var_a = 262 var_b = 18 var_c = var_a // var_b var_d = 185 var_e = 18 var_f = var_d // var_e var_g = var_c * var_f print(int(var_g))
Arithmetic calculation
What is the largest five-digit number that is a multiple of 2 and a multiple of 3 and a multiple of 8 and a multiple of 9?
99936
10000 99999 1 [OP_LIST_ARANGE] 2 [OP_LIST_DIVISIBLE] 3 [OP_LIST_DIVISIBLE] 8 [OP_LIST_DIVISIBLE] 9 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX]
var_a = 10000 var_b = 99999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 2 list_b = [] var_d = int(var_d) for i in list_a: i = int(i) if i % var_d == 0: list_b.append(i) var_e = 3 list_c = [] var_e = int(var_e) for i in list_b: i = int(i) if i % var_e == 0: list_c.append(i) var_f = 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 = 1 list_f=list_e.copy() list_f.sort() var_i = list_f[-var_h] print(int(var_i))
Possibility
There are 5 number cards, each with a number from 1 to 5 written on it. When you take out 3 of these and find the sum of the numbers, find the sum of all possible sums.
63
1 5 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] [OP_LIST_SOL] [OP_LIST_EOL] [OP_SET_UNION] [OP_LIST_SUM]
var_a = 1 var_b = 5 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] 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) list_d= [] list_d.reverse() list_e = list(set(list_c) | set(list_d)) list_e = [float(i) for i in list_e] var_f = sum(list_e) print(int(var_f))
Possibility
Find the sixth smallest number among five digits that can be formed using 0, 4, 6, 7, and 8 only once.
40876
[OP_LIST_SOL] 0 4 6 7 8 [OP_LIST_EOL] 5 [OP_LIST_GET_PERM] 6 [OP_LIST_MIN]
var_a = 0 var_b = 4 var_c = 6 var_d = 7 var_e = 8 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 = 5 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 = 6 list_c=list_b.copy() list_c.sort() var_h = list_c[var_g-1] print(int(var_h))
Correspondence
A and B are single-digit numbers. A is 3 greater than 5, and B is 2 less than A. Find the sum of A and B.
14
5 3 [OP_ADD] 5 3 [OP_ADD] 2 [OP_SUB] [OP_ADD]
var_a = 5 var_b = 3 var_c = var_a + var_b var_d = 5 var_e = 3 var_f = var_d + var_e var_g = 2 var_h = var_f - var_g var_i = var_c + var_h print(int(var_i))
Comparison
Hyunjin's school has 324 female students and 541 male students, and Seonju's school has 416 female students and 253 male students. Find whose school has more students.
Hyunjin
[OP_LIST_SOL] Hyunjin Seonju [OP_LIST_EOL] [OP_LIST_SOL] 324 541 [OP_ADD] 416 253 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Hyunjin' var_b = 'Seonju' 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 = 324 var_d = 541 var_e = var_c + var_d var_f = 416 var_g = 253 var_h = var_f + var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Arithmetic calculation
Find the average score of three subjects when Math is 100, and the average score of Korean and English is 88.
92
88 2 [OP_MUL] 100 [OP_ADD] 2 1 [OP_ADD] [OP_DIV]
var_a = 88 var_b = 2 var_c = var_a * var_b var_d = 100 var_e = var_c + var_d var_f = 2 var_g = 1 var_h = var_f + var_g var_i = var_e / var_h print(int(var_i))
Arithmetic calculation
Find the second smallest factor of 32.
2
32 [OP_LIST_GET_DIVISOR] 2 [OP_LIST_MIN]
var_a = 32 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 = 2 list_b=list_a.copy() list_b.sort() var_c = list_b[var_b-1] print(int(var_c))
Arithmetic calculation
A family decided to share one pineapple. Grandpa ate 1/6 of the whole, and Grandma ate 2/5 of the remaining pineapple. If the remaining pineapple after Chaeyoung ate 2/3 of the pineapple left after Grandpa and Grandma ate was 120 grams (g), how many grams (g) did the first pineapple weigh?
720
120 1 1/6 [OP_SUB] [OP_DIV] 1 2/5 [OP_SUB] [OP_DIV] 1 2/3 [OP_SUB] [OP_DIV]
var_a = 120 var_b = 1 var_c = 0.16666666666666666 var_d = var_b - var_c var_e = var_a / var_d var_f = 1 var_g = 0.4 var_h = var_f - var_g var_i = var_e / var_h var_j = 1 var_k = 0.6666666666666666 var_l = var_j - var_k var_m = var_i / var_l print(int(eval('{:.2f}'.format(round(var_m+1e-10,2)))))
Geometry
What is the length in centimeters (cm) of the radius of a circle whose diameter are 26 centimeters (cm)?
13
26 2 [OP_DIV]
var_a = 26 var_b = 2 var_c = var_a / var_b print(int(var_c))
Arithmetic calculation
This year Seokjin is 7 years old and Seokjin's mother is 33 years old. After 5 years, how many years is Seokjin's mother older than Seokjin?
26
33 5 [OP_ADD] 7 5 [OP_ADD] [OP_SUB]
var_a = 33 var_b = 5 var_c = var_a + var_b var_d = 7 var_e = 5 var_f = var_d + var_e var_g = var_c - var_f print(int(var_g))
Arithmetic calculation
I bought 7 boxes of cucumbers, 16 in each box. Thirteen of them are rotten and discarded, and the remaining cucumbers are divided equally into 8 bags. How many cucumbers are left that didn't fit in the bag?
3
16 7 [OP_MUL] 13 [OP_SUB] 8 [OP_MOD]
var_a = 16 var_b = 7 var_c = var_a * var_b var_d = 13 var_e = var_c - var_d var_f = 8 var_g = var_e % var_f print(int(var_g))
Possibility
You are going to give 8 candies to Yuna and Hoseok. If Yuna and Hoseok take at least 1 candy, then how many different ways can candy be distributed?
7
8 2 [OP_SUB] 1 [OP_ADD]
var_a = 8 var_b = 2 var_c = var_a - var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
Seokjin bought two notebooks for 500 won with the money he had and a pencil for 270 won, he finally had 230 won left. How much money did Seokjin have at first?
1500
230 270 1 [OP_MUL] [OP_ADD] 500 2 [OP_MUL] [OP_ADD]
var_a = 230 var_b = 270 var_c = 1 var_d = var_b * var_c var_e = var_a + var_d var_f = 500 var_g = 2 var_h = var_f * var_g var_i = var_e + var_h print(int(var_i))
Arithmetic calculation
In a calculation that adds a two-digit number to a four-digit number, the digit in the ones place of the four-digit number is incorrectly seen as 5. Also, when we mistook and switched the digits in the tens and ones place of a two-digit number, we got 63. If the incorrect calculation resulted in 2708, and the original four-digit number has 8 in the ones place, what is the correct result of the calculation?
2738
2708 8 5 [OP_SUB] [OP_ADD] 63 36 [OP_SUB] [OP_ADD]
var_a = 2708 var_b = 8 var_c = 5 var_d = var_b - var_c var_e = var_a + var_d var_f = 63 var_g = 36 var_h = var_f - var_g var_i = var_e + var_h print(int(var_i))
Arithmetic calculation
A bank has a waiting list with numbers ranging from 1 to 54. Find how many times the number 5 appears in this waiting list.
10
1 54 1 [OP_LIST_ARANGE] [OP_LIST2NUM] [OP_NUM2LIST] 5 [OP_LIST_FIND_NUM]
var_a = 1 var_b = 54 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 = 5 var_f = 0 var_e = int(var_e) for i in list_b: i = int(i) if i == var_e: var_f = var_f + 1 print(int(var_f))
Correspondence
When you open a faucet, 9 milliliters (ml) of water pours out in one second. Water was poured in for 8 seconds and after that, an additional 7 milliliters (ml) was added in a large canteen that was empty. If the water contained in this canteen is divided by 6 milliliters (ml) into small canteens, how many canteens will be needed at most?
14
8 9 [OP_MUL] 7 [OP_ADD] 6 [OP_DIV] 1 [OP_CEIL]
var_a = 8 var_b = 9 var_c = var_a * var_b var_d = 7 var_e = var_c + var_d var_f = 6 var_g = var_e / var_f var_h = 1 var_i=int(((var_g+9*10**(var_h-2))//(10**(var_h-1)))*10**(var_h-1)) print(int(var_i))
Arithmetic calculation
There were 1238 snacks and 374 more ramens than snacks in the market. Of these, some snacks were sold, and 276 ramen were bought, so the total of ramen and snacks was 2527. How many sweets were sold?
599
1238 2527 1238 374 [OP_ADD] 276 [OP_ADD] [OP_SUB] [OP_SUB]
var_a = 1238 var_b = 2527 var_c = 1238 var_d = 374 var_e = var_c + var_d var_f = 276 var_g = var_e + var_f var_h = var_b - var_g var_i = var_a - var_h print(int(var_i))
Correspondence
There is a number whose multiples are 160 minus 4 and 197 minus 2. If you divide that number by 229, it is said to be short of 5. Find the largest natural number among these numbers.
39
197 2 [OP_SUB] 160 4 [OP_SUB] [OP_GCD] 229 5 [OP_ADD] [OP_GCD]
var_a = 197 var_b = 2 var_c = var_a - var_b var_d = 160 var_e = 4 var_f = var_d - var_e var_g = math.gcd(int(var_f), int(var_c)) var_h = 229 var_i = 5 var_j = var_h + var_i var_k = math.gcd(int(var_j), int(var_g)) print(int(var_k))
Possibility
A class president and vice president is going to be elected. How many possible cases of the election are there out of Jungkook, Jimin, and Yoongi.
6
[OP_LIST_SOL] Jungkook Jimin Yoongi [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_PERM]
var_a = 'Jungkook' var_b = 'Jimin' var_c = 'Yoongi' 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) print(int(var_f))
Arithmetic calculation
Find the number of ways in which a multiple of 3 or 2 comes up when a die is thrown.
4
1 6 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 1 6 [OP_LIST_EVEN] [OP_SET_UNION] [OP_LIST_LEN]
var_a = 1 var_b = 6 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 = 1 var_f = 6 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)) var_g = len(list_d) print(int(var_g))
Correspondence
You want to divide 66 golf balls and 49 tennis balls among several carts. The number of golf balls in each cart and the number of tennis balls in each cart are the same. How many carts will there be if there are 6 golf balls left and 4 tennis balls left?
15
49 4 [OP_SUB] 66 6 [OP_SUB] [OP_GCD]
var_a = 49 var_b = 4 var_c = var_a - var_b var_d = 66 var_e = 6 var_f = var_d - var_e var_g = math.gcd(int(var_f), int(var_c)) print(int(var_g))
Geometry
I used 63 centimeters (cm) of wire to make an equilateral triangle. Find how many centimeters (cm) of wire are needed to make one side of this equilateral triangle.
21
63 3 [OP_DIV]
var_a = 63 var_b = 3 var_c = var_a / var_b print(int(var_c))
Correspondence
Rounding 12A3 to the hundreds place gives 1300. How many possible numbers are A?
5
12A3 [OP_GEN_POSSIBLE_LIST] 1300 50 [OP_SUB] [OP_LIST_MORE_EQUAL] 1300 50 [OP_ADD] [OP_LIST_LESS] 12A3 A [OP_LIST_FIND_UNK] [OP_LIST_LEN]
var_a = '12A3' 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 = 1300 var_c = 50 var_d = var_b - var_c list_b = [] for i in list_a: if i >= var_d: list_b.append(i) var_e = 1300 var_f = 50 var_g = var_e + var_f list_c = [] for i in list_b: if i < var_g: list_c.append(i) var_h = '12A3' var_i = 'A' var_h = str(var_h) var_i = str(var_i) unk_idx = var_h.index(var_i) list_d = [] for elem in list_c: elem = str(elem) list_d.append(int(elem[unk_idx])) list_d = list(set(list_d)) var_j = len(list_d) print(int(var_j))
Arithmetic calculation
There are 6/5, 1/10, and 1.56. What is the sum of these?
2.86
6/5 1/10 [OP_ADD] 1.56 [OP_ADD]
var_a = 1.2 var_b = 0.1 var_c = var_a + var_b var_d = 1.56 var_e = var_c + var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
How many two-digit numbers are common multiples of 3 and 5?
6
10 99 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 10 var_b = 99 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 = len(list_c) print(int(var_f))
Comparison
What is the sum of all numbers less than or equal to 0.4 among 0.8, 1/2, and 0.9?
0
[OP_LIST_SOL] 0.8 1/2 0.9 [OP_LIST_EOL] 0.4 [OP_LIST_LESS_EQUAL] [OP_LIST_SUM]
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.4 list_b = [] for i in list_a: if i <= var_d: list_b.append(i) list_b = [float(i) for i in list_b] var_e = sum(list_b) print(int(var_e))
Possibility
You are going to paint 5 different colors on a circle, triangle, and square. How many ways are there to paint them?
60
5 [OP_LIST_SOL] circle triangle square [OP_LIST_EOL] [OP_LIST_LEN] [OP_PERM]
var_a = 5 var_b = 'circle' var_c = 'triangle' var_d = 'square' 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) list_a.reverse() var_e = len(list_a) var_f = 1 var_a = int(var_a) var_e = int(var_e) for i, elem in enumerate(range(var_e)): var_f = var_f * (var_a-i) print(int(var_f))
Correspondence
There are colored carps and crucian carps in the aquarium tank. Both of them eat 3 bags of feed. To feed all these fish, the keepers prepare 60 bags of individual feed and 15 bags of 8 packets of feeds. There are 52 colored carps in the tank. Find how many crucian carps are in the tank.
8
15 8 [OP_MUL] 60 [OP_ADD] 3 [OP_DIV] 52 [OP_SUB]
var_a = 15 var_b = 8 var_c = var_a * var_b var_d = 60 var_e = var_c + var_d var_f = 3 var_g = var_e / var_f var_h = 52 var_i = var_g - var_h print(int(var_i))
Geometry
There is a bag in the shape of a cuboid. If the bag is 9 centimeters (cm) wide, 4 centimeters (cm) long, and 7 centimeters (cm) high, what is the volume in cubic centimeters (cm3) of the bag?
252
9 4 [OP_MUL] 7 [OP_MUL]
var_a = 9 var_b = 4 var_c = var_a * var_b var_d = 7 var_e = var_c * var_d print(int(var_e))
Geometry
You used wire to make one square shape with a side of 20 centimeters (cm). You are going to re-stretch this wire and use it all to make one rectangular shape. If the width of the rectangle is 14 centimeters (cm), how many centimeters (cm) is the length?
26
20 4 [OP_MUL] 2 [OP_DIV] 14 [OP_SUB]
var_a = 20 var_b = 4 var_c = var_a * var_b var_d = 2 var_e = var_c / var_d var_f = 14 var_g = var_e - var_f print(int(var_g))
Possibility
How many two-digit natural numbers can be formed using even numbers smaller than 5 and with different digits?
4
0 5 1 [OP_SUB] [OP_LIST_EVEN] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 var_b = 5 var_c = 1 var_d = var_b - var_c list_a = [] if var_a%2!=0: for i in range(var_a+1, var_d+1, 2): list_a.append(i) else: for i in range(var_a, var_d+1, 2): list_a.append(i) var_e = 2 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
It is said that one machine makes eight toys per hour. How many hours does it take to make 200 toys with 5 machines?
5
200 8 5 [OP_MUL] [OP_DIV]
var_a = 200 var_b = 8 var_c = 5 var_d = var_b * var_c var_e = var_a / var_d print(int(var_e))
Comparison
Multiples of 3 greater than 0 and less than 100 are written sequentially. What is the product of the 22st and 23th numbers from the left?
4554
0 3 [OP_ADD] 100 3 [OP_LIST_ARANGE] 22 [OP_LIST_MIN] 23 [OP_LIST_MIN] [OP_MUL]
var_a = 0 var_b = 3 var_c = var_a + var_b var_d = 100 var_e = 3 list_a = [i for i in range(var_c, var_d + 1, var_e)] var_f = 22 list_b=list_a.copy() list_b.sort() var_g = list_b[var_f-1] var_h = 23 list_c=list_a.copy() list_c.sort() var_i = list_c[var_h-1] var_j = var_g * var_i print(int(var_j))
Comparison
What is the sum of the fractions greater than 1/2 of 3/7, 4/11, 5/9, 6/13, and 9/20?
0.56
[OP_LIST_SOL] 3/7 4/11 5/9 6/13 9/20 [OP_LIST_EOL] 1/2 [OP_LIST_MORE] [OP_LIST_SUM]
var_a = 0.42857142857142855 var_b = 0.36363636363636365 var_c = 0.5555555555555556 var_d = 0.46153846153846156 var_e = 0.45 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 = 0.5 list_b = [] for i in list_a: if i > var_f: list_b.append(i) list_b = [float(i) for i in list_b] var_g = sum(list_b) print('{:.2f}'.format(round(var_g+1e-10,2)))
Possibility
A wire of 10 centimeters (cm) in length is to be cut into pieces of 1 centimeter (cm), 2 centimeters (cm), and 3 centimeters (cm) lengths. How many cutting methods are there in all?
10
[OP_LIST_SOL] 0 1 2 3 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PRODUCT] [OP_LIST_NUM2SUM] 10 [OP_LIST_FIND_NUM]
var_a = 0 var_b = 1 var_c = 2 var_d = 3 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = len(list_a) list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] list_c=[] for i in list_b: var_f = 0 i = int(i) while i//10 > 0: var_f = var_f + i%10 i = i//10 var_f = var_f + i%10 list_c.append(var_f) var_g = 10 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))
Arithmetic calculation
Sixteen strips of colored tape, each 10.4 centimeters (cm) long, were joined together in a circle with overlaps of 3.5 centimeters (cm). How many centimeters (cm) is the total length of the circle-shaped colored tape that was joined together?
110.4
10.4 3.5 [OP_SUB] 16 [OP_MUL]
var_a = 10.4 var_b = 3.5 var_c = var_a - var_b var_d = 16 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
When you mistakenly multiply a number that should be divided by 4, the result was 166.08. Find the result of the correct calculation.
10.38
166.08 4 [OP_DIV] 4 [OP_DIV]
var_a = 166.08 var_b = 4 var_c = var_a / var_b var_d = 4 var_e = var_c / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
There are four different numbers A, B, C, and D. Find ABCD from the four-digit formula ABCD+ABCD=7314.
3657
[OP_LIST_SOL] ABCD+ABCD=7314 A [OP_DIGIT_UNK_SOLVER] ABCD+ABCD=7314 B [OP_DIGIT_UNK_SOLVER] ABCD+ABCD=7314 C [OP_DIGIT_UNK_SOLVER] ABCD+ABCD=7314 D [OP_DIGIT_UNK_SOLVER] [OP_LIST_EOL] [OP_LIST2NUM]
var_a = 'ABCD+ABCD=7314' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] var_d = 'ABCD+ABCD=7314' var_e = 'B' ans_dict = dict() var_d = var_d.replace('×','*') var_d = var_d.replace('x','*') var_d = var_d.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_d): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_d for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_d): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_f = ans_dict[var_e] var_g = 'ABCD+ABCD=7314' var_h = 'C' ans_dict = dict() var_g = var_g.replace('×','*') var_g = var_g.replace('x','*') var_g = var_g.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_g): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_g for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_g): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_i = ans_dict[var_h] var_j = 'ABCD+ABCD=7314' var_k = 'D' ans_dict = dict() var_j = var_j.replace('×','*') var_j = var_j.replace('x','*') var_j = var_j.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_j): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_j for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_j): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_l = ans_dict[var_k] list_a= [] if "/" in str(var_l): var_l = eval(str(var_l)) list_a.append(var_l) if "/" in str(var_i): var_i = eval(str(var_i)) list_a.append(var_i) if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) list_a.reverse() var_m="" for i in list_a: i = str(i) var_m = var_m + i print(int(var_m))
Comparison
Draw one of the cards numbered 1 through 9 and find the sum of all the numbers that, when multiplied by 21, are greater than 84 multiplied by 2.
9
1 9 1 [OP_LIST_ARANGE] 84 2 [OP_MUL] 21 [OP_DIV] [OP_LIST_MORE] [OP_LIST_SUM]
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 = 84 var_e = 2 var_f = var_d * var_e var_g = 21 var_h = var_f / var_g list_b = [] for i in list_a: if i > var_h: list_b.append(i) list_b = [float(i) for i in list_b] var_i = sum(list_b) print(int(var_i))
Arithmetic calculation
Joohyeon bought candies that cost 300 won each and snacks that cost 500 won each using 3,000 won. If he bought a total of 8, how many snacks did Joohyeon buy?
3
3000 300 8 [OP_MUL] [OP_SUB] 500 300 [OP_SUB] [OP_DIV]
var_a = 3000 var_b = 300 var_c = 8 var_d = var_b * var_c var_e = var_a - var_d var_f = 500 var_g = 300 var_h = var_f - var_g var_i = var_e / var_h print(int(var_i))
Geometry
You made a regular triangle using ribbon with a side length of 20/9 centimeters (cm). If you unroll this ribbon to make a regular pentagon, find how many centimeters (cm) the length of one side is.
1.33
20/9 3 [OP_MUL] 5 [OP_DIV]
var_a = 2.2222222222222223 var_b = 3 var_c = var_a * var_b var_d = 5 var_e = var_c / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Geometry
What is the area of a rectangle with one side measuring 5.9 centimeters (cm) and the other side measuring 3 centimeters (cm)?
17.7
5.9 3 [OP_MUL]
var_a = 5.9 var_b = 3 var_c = var_a * var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
I decided to pack 138 apples in a box with 18 apples each and put the rest in a basket. Find how many apples are in the basket.
12
138 18 [OP_MOD]
var_a = 138 var_b = 18 var_c = var_a % var_b print(int(var_c))
Arithmetic calculation
This year, Jungkook is 16 years old and his mother is 46 years old. How many years ago was Jungkook's mother's age four times Jungkook's?
6
16 4 [OP_MUL] 46 [OP_SUB] 4 1 [OP_SUB] [OP_DIV]
var_a = 16 var_b = 4 var_c = var_a * var_b var_d = 46 var_e = var_c - var_d var_f = 4 var_g = 1 var_h = var_f - var_g var_i = var_e / var_h print(int(var_i))
Correspondence
211.5 is B minus A. When B is the value of multiplying the decimal A by 10, find A including the decimal point.
23.5
211.5 10 1 [OP_SUB] [OP_DIV]
var_a = 211.5 var_b = 10 var_c = 1 var_d = var_b - var_c var_e = var_a / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Geometry
You have a triangle with a base of 5/6 meters (m) and a height of 4/6 meters (m). How many meters (m) is the base of this triangle greater than its height?
0.17
5/6 4/6 [OP_SUB]
var_a = 0.8333333333333334 var_b = 0.6666666666666666 var_c = var_a - var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
How many three-digit numbers are there when the sum of all the digits is 9 and is divisible by 5?
13
100 1000 1 [OP_SUB] 1 [OP_LIST_ARANGE] 5 [OP_LIST_DIVISIBLE] [OP_LIST_NUM2SUM] 9 [OP_LIST_FIND_NUM]
var_a = 100 var_b = 1000 var_c = 1 var_d = var_b - var_c var_e = 1 list_a = [i for i in range(var_a, var_d + 1, var_e)] var_f = 5 list_b = [] var_f = int(var_f) for i in list_a: i = int(i) if i % var_f == 0: list_b.append(i) list_c=[] for i in list_b: var_g = 0 i = int(i) while i//10 > 0: var_g = var_g + i%10 i = i//10 var_g = var_g + i%10 list_c.append(var_g) var_h = 9 var_i = 0 var_h = int(var_h) for i in list_c: i = int(i) if i == var_h: var_i = var_i + 1 print(int(var_i))
Possibility
Find the number of ways in which a multiple of 3 comes out the first time and a multiple of 4 comes out the second time by doing the action of drawing a card out of 12 cards with numbers from 1 to 12 written twice.
12
1 12 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] [OP_LIST_POP] 4 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] [OP_MUL]
var_a = 1 var_b = 12 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 = len(list_b) var_f = 4 list_c = [] var_f = int(var_f) for i in list_a: i = int(i) if i % var_f == 0: list_c.append(i) var_g = len(list_c) var_h = var_e * var_g print(int(var_h))
Possibility
When Bumjin wants to put two math books and two English books on his bookshelf, how many times does he put the math books next to each other?
12
3 3 [OP_PERM] 2 [OP_MUL]
var_a = 3 var_b = 3 var_c = 1 var_a = int(var_a) var_b = int(var_b) for i, elem in enumerate(range(var_b)): var_c = var_c * (var_a-i) var_d = 2 var_e = var_c * var_d print(int(var_e))
Correspondence
You need to add 5.46 to a number but mistakenly subtracted it and got 3.97. Find the result of the correct calculation.
6.95
5.46 3.97 [OP_SUB] 5.46 [OP_ADD]
var_a = 5.46 var_b = 3.97 var_c = var_a - var_b var_d = 5.46 var_e = var_c + var_d print('{:.2f}'.format(round(var_e+1e-10,2)))