category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Correspondence
While Yoongi was adding 57 to the two-digit number, he mistook the 9 in the units digit of the two-digit number for 6. If the sum obtained by Yoongi is 123, what is the correct calculation result?
126
123 57 [OP_SUB] 6 9 [OP_SUB] [OP_SUB] 57 [OP_ADD]
var_a = 123 var_b = 57 var_c = var_a - var_b var_d = 6 var_e = 9 var_f = var_d - var_e var_g = var_c - var_f var_h = 57 var_i = var_g + var_h print(int(var_i))
Arithmetic calculation
Yeonjoo decided to share 18 of the 138 chocolates with her friends and eat the rest herself. If Yeonjoo ate less chocolate than one friend received, find how many chocolates she ate.
12
138 18 [OP_MOD]
var_a = 138 var_b = 18 var_c = var_a % var_b print(int(var_c))
Arithmetic calculation
The total weight of the apples in the basket is 52 kilograms (kg). If it was 28 kg (kg) after removing half of it and weighing it again, how much kg (kg) were the apples alone?
48
52 28 [OP_SUB] 2 [OP_MUL]
var_a = 52 var_b = 28 var_c = var_a - var_b var_d = 2 var_e = var_c * var_d print(int(var_e))
Correspondence
Subtract 29 from the original number of candies and divide by 13, leaving only 15 candies. What is the initial number of candies?
224
15 13 [OP_MUL] 29 [OP_ADD]
var_a = 15 var_b = 13 var_c = var_a * var_b var_d = 29 var_e = var_c + var_d print(int(var_e))
Geometry
There is a box in the shape of a regular dodecahedron. How many edges?
30
30
var_a = 30 print(int(var_a))
Possibility
You are going to buy 17 fruits. If you buy more than one of five types of fruit and allow duplicates, how many ways to buy fruit in total?
1820
5 17 [OP_ADD] 5 1 [OP_MUL] [OP_SUB] 1 [OP_SUB] 17 5 1 [OP_MUL] [OP_SUB] [OP_COMB]
var_a = 5 var_b = 17 var_c = var_a + var_b var_d = 5 var_e = 1 var_f = var_d * var_e var_g = var_c - var_f var_h = 1 var_i = var_g - var_h var_j = 17 var_k = 5 var_l = 1 var_m = var_k * var_l var_n = var_j - var_m var_o = 1 var_i = int(var_i) var_n = int(var_n) for i, elem in enumerate(range(var_n)): var_o = var_o * (var_i-i) for i, elem in enumerate(range(var_n)): var_o = var_o / (i+1) print(int(var_o))
Arithmetic calculation
Eunji read 18 pages of the book on Tuesday, and read more on Wednesday as well. Then she read 23 pages of this book on Thursday, thus reading 60 pages in total for 3 days. How many pages did Eunji read on Wednesday?
19
60 18 [OP_SUB] 23 [OP_SUB]
var_a = 60 var_b = 18 var_c = var_a - var_b var_d = 23 var_e = var_c - var_d print(int(var_e))
Possibility
I want to create a two-digit number by drawing two different numbers from 0, 1, 3, 5, 7. How many possible two-digit numbers are there?
16
[OP_LIST_SOL] 0 1 3 5 7 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 3 var_d = 5 var_e = 7 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = len(list_b) print(int(var_g))
Arithmetic calculation
There are 40 students in Jimin's class. Jimin and Jungkook's math scores are 98 and 100, respectively. Excluding these two students, the average score in math is 79. What is the average math score of Jimin's class?
80
40 2 [OP_SUB] 79 [OP_MUL] 98 [OP_ADD] 100 [OP_ADD] 40 [OP_DIV]
var_a = 40 var_b = 2 var_c = var_a - var_b var_d = 79 var_e = var_c * var_d var_f = 98 var_g = var_e + var_f var_h = 100 var_i = var_g + var_h var_j = 40 var_k = var_i / var_j print(int(var_k))
Geometry
The bee hive is shaped like a regular hexagon. If the circumference of the bee hive is 43.56 millimeters (mm), what is the length of one side?
7.26
43.56 6 [OP_DIV]
var_a = 43.56 var_b = 6 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
While Jimin tried to subtract a number from 34, he subtracted a number from 20 by mistake and got 60. Write down the result of the correct calculation.
74
34 20 60 [OP_SUB] [OP_SUB]
var_a = 34 var_b = 20 var_c = 60 var_d = var_b - var_c var_e = var_a - var_d print(int(var_e))
Correspondence
Moving a decimal point of a prime number to the right by one place makes it 5.4 more than the original value. What was the original prime number?
0.6
5.4 9 [OP_DIV]
var_a = 5.4 var_b = 9 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
There are 4 pockets. If there are 16 coins in each pocket, what is the total number of coins?
64
16 4 [OP_MUL]
var_a = 16 var_b = 4 var_c = var_a * var_b print(int(var_c))
Arithmetic calculation
Given that 5 times the number of students in first grade who participated in a running competition is the same as the number of students in second grade participating in the match. If only 8 students were from the first grade, how many students participated in the running race in total?
48
8 5 [OP_MUL] 8 [OP_ADD]
var_a = 8 var_b = 5 var_c = var_a * var_b var_d = 8 var_e = var_c + var_d print(int(var_e))
Geometry
The stones are laid out in a tight, regular row to form a square with 5 stones at the sides. What is the number of stones laid out on the perimeter?
16
5 4 [OP_MUL] 4 [OP_SUB]
var_a = 5 var_b = 4 var_c = var_a * var_b var_d = 4 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
Yuna had 60 candies. She ate 6 pieces everyday for a week, and she plan to eat 3 pieces a day from now on. How many more days she can eat candy?
6
60 6 7 [OP_MUL] [OP_SUB] 3 [OP_DIV]
var_a = 60 var_b = 6 var_c = 7 var_d = var_b * var_c var_e = var_a - var_d var_f = 3 var_g = var_e / var_f print(int(var_g))
Arithmetic calculation
A bag containing 14 identical books weighs 11.14 kilograms (kg). If the empty bag weighs 0.5 kilograms (kg), how much does one book weigh in kilograms (kg)?
0.76
11.14 0.5 [OP_SUB] 14 [OP_DIV]
var_a = 11.14 var_b = 0.5 var_c = var_a - var_b var_d = 14 var_e = var_c / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Possibility
We are going to divide the students into 2 groups. How many ways can you divide Jungkook, Jimin, Yoongi, Yuna, and Taehyung? The difference in the number of students in each group is 1 student.
10
[OP_LIST_SOL] Jungkook Jimin Yoongi Yuna Taehyung [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_COMB]
var_a = 'Jungkook' var_b = 'Jimin' var_c = 'Yoongi' var_d = 'Yuna' var_e = 'Taehyung' 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 = 1 var_f = int(var_f) var_g = int(var_g) for i, elem in enumerate(range(var_g)): var_h = var_h * (var_f-i) for i, elem in enumerate(range(var_g)): var_h = var_h / (i+1) print(int(var_h))
Comparison
Jungkook, Jimin, Seokjin, Taehyung, and Namjoon are lined up in a row. Jungkook is standing to the right of Jimin, and Seokjin is standing to the left of Jimin. When Jeongguk is standing next to Taehyung's left and Seokjin is standing next to Namjoon's left, who is standing to the far right?
Taehyung
[OP_LIST_SOL] Jungkook Jimin Seokjin Taehyung Namjoon [OP_LIST_EOL] [OP_LIST_SOL] Jungkook Jimin > Seokjin Jimin < Namjoon Seokjin < Jungkook Taehyung < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'Jungkook' var_b = 'Jimin' var_c = 'Seokjin' var_d = 'Taehyung' var_e = 'Namjoon' 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 = 'Jungkook' var_g = 'Jimin' var_h = '>' var_i = 'Seokjin' var_j = 'Jimin' var_k = '<' var_l = 'Namjoon' var_m = 'Seokjin' var_n = '<' var_o = 'Jungkook' var_p = 'Taehyung' 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 = 1 var_s = list_c[var_r-1] print(var_s)
Geometry
Including the decimal point, find the sum of the lengths of the four sides of a square with a side length of 14 meters (m), in meters (m).
5.6
14 4 [OP_MUL] 10 [OP_DIV]
var_a = 14 var_b = 4 var_c = var_a * var_b var_d = 10 var_e = var_c / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Possibility
Jungkook has 5 red balls, 4 blue balls, and 3 yellow balls. When Jungkook gives Yoongi 1 blue ball, how many yellow balls does Jungkook have?
3
3
var_a = 3 print(int(var_a))
Arithmetic calculation
How many natural numbers greater than 15 and less than 40 are divisible by 3?
8
15 1 [OP_ADD] 40 1 [OP_SUB] 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 15 var_b = 1 var_c = var_a + var_b var_d = 40 var_e = 1 var_f = var_d - var_e var_g = 1 list_a = [i for i in range(var_c, var_f + 1, var_g)] var_h = 3 list_b = [] var_h = int(var_h) for i in list_a: i = int(i) if i % var_h == 0: list_b.append(i) var_i = len(list_b) print(int(var_i))
Arithmetic calculation
Jungkook has 3 balls and Yoongi has 2 balls. How many balls do Jungkook and Yoongi have?
5
3 2 [OP_ADD]
var_a = 3 var_b = 2 var_c = var_a + var_b print(int(var_c))
Geometry
The perimeter of the square is 17.8 centimeters (cm). Find the length of one side of this square.
4.45
17.8 4 [OP_DIV]
var_a = 17.8 var_b = 4 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
The total number of students in Yoongi's class is 32. Among them, male students account for 5/8 of the total. Among male students, 3/4 of all male students wear glasses. How many male students in Yoongi's class do not wear glasses?
5
32 5/8 [OP_MUL] 1 3/4 [OP_SUB] [OP_MUL]
var_a = 32 var_b = 0.625 var_c = var_a * var_b var_d = 1 var_e = 0.75 var_f = var_d - var_e var_g = var_c * var_f print(int(var_g))
Geometry
I measured the circumference of a hula hoop with a diameter of 100 centimeters (cm) and it was 314 centimeters(cm). How many times bigger is the circumference of this hula hoop compared to its diameter?
3.14
314 100 [OP_DIV]
var_a = 314 var_b = 100 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Geometry
The sum of all the edges of the toy pyramid is 14.8 meters (m). What is the length of one edge of the pyramid if all edges are made the same? Find in meters (m).
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
We are trying to create a subtraction equation between two digits using 2, 4, 5, and 8 all at once. Find the result when the difference is largest.
61
[OP_LIST_SOL] 2 4 5 8 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] 10 [OP_MUL] 2 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_SUB] [OP_ADD]
var_a = 2 var_b = 4 var_c = 5 var_d = 8 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 1 list_b=list_a.copy() list_b.sort() var_f = list_b[-var_e] var_g = 1 list_c=list_a.copy() list_c.sort() var_h = list_c[var_g-1] var_i = var_f - var_h var_j = 10 var_k = var_i * var_j var_l = 2 list_d=list_a.copy() list_d.sort() var_m = list_d[-var_l] var_n = 2 list_e=list_a.copy() list_e.sort() var_o = list_e[var_n-1] var_p = var_m - var_o var_q = var_k + var_p print(int(var_q))
Comparison
Nine people stand in a line in order from the shortest to the tallest. Hoseok stands at the 2nd from the front, and Yuna stands the 3rd behind Hoseok. If you organize the line again in order from the tallest people, what place will Yuna stand from the front?
5
9 2 [OP_SUB] 3 [OP_SUB] 1 [OP_ADD]
var_a = 9 var_b = 2 var_c = var_a - var_b var_d = 3 var_e = var_c - var_d var_f = 1 var_g = var_e + var_f print(int(var_g))
Correspondence
Find A when AB+BC=BCB
9
AB+BC=BCB A [OP_DIGIT_UNK_SOLVER]
var_a = 'AB+BC=BCB' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Correspondence
A is 238. A is greater than B by 143. B is lesser than C by 304. Find the value of A+C.
637
238 238 143 [OP_SUB] 304 [OP_ADD] [OP_ADD]
var_a = 238 var_b = 238 var_c = 143 var_d = var_b - var_c var_e = 304 var_f = var_d + var_e var_g = var_a + var_f print(int(var_g))
Geometry
There are several square-shaped cards. When I laid out these cards to form a square, there were 36 cards left outside the square, so I increased one horizontal and one vertical side by one column, and there were still 3 cards left. How many cards are there in all?
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))
Geometry
Find the number of diagonals that can be drawn from one vertex of the icosahedron.
17
20 3 [OP_SUB]
var_a = 20 var_b = 3 var_c = var_a - var_b print(int(var_c))
Correspondence
A is a single digit number. Find the sum of all possible numbers that can be A in division 9A5÷5<197.
28
9A5÷5<197 A [OP_DIGIT_UNK_SOLVER] [OP_LIST_SUM]
var_a = '9A5÷5<197' 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] = [] 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].append(int(c[i])) list_a = list(set(ans_dict[var_b])) list_a = [float(i) for i in list_a] var_c = sum(list_a) print(int(var_c))
Correspondence
There is a machine that makes 4 tops per minute and a machine that makes 7 bottoms per minute. Adding 12 existing tops to the machine-made tops in a few minutes resulted in 36 pieces. Find how many bottoms the machine made during that time.
42
36 12 [OP_SUB] 7 [OP_MUL] 4 [OP_DIV]
var_a = 36 var_b = 12 var_c = var_a - var_b var_d = 7 var_e = var_c * var_d var_f = 4 var_g = var_e / var_f print(int(var_g))
Arithmetic calculation
Find the number of natural numbers from 1 to 100 in which the units digit is 0.
10
1 100 1 [OP_LIST_ARANGE] 1 0 [OP_LIST_SEARCH_FIXED_DIGIT] [OP_LIST_LEN]
var_a = 1 var_b = 100 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 1 var_e = 0 list_b = [] var_d = int(var_d) var_e = int(var_e) for i in list_a: i = int(i) if (i//var_d)%10 == var_e: list_b.append(i) var_f = len(list_b) print(int(var_f))
Correspondence
Given the expression AB4C+17D8=5671 containing the different numbers A, B, C, and D, find B, not A.
9
AB4C+17D8=5671 B [OP_DIGIT_UNK_SOLVER]
var_a = 'AB4C+17D8=5671' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Correspondence
There are candies inside a box. When packed in sets of 20, there are 4 left over; when packed in sets of 30, there are 14 left over; when packed in sets of 50, there are 24 left over; and when packed in sets of 70, there are 34 left over. Determine the minimum number of candies inside the box.
524
0 9999 1 [OP_LIST_ARANGE] 20 4 [OP_LIST_DIVIDE_AND_REMAIN] 30 14 [OP_LIST_DIVIDE_AND_REMAIN] 50 24 [OP_LIST_DIVIDE_AND_REMAIN] 70 34 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_MIN]
var_a = 0 var_b = 9999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 20 var_e = 4 list_b = [] var_d = int(var_d) var_e = int(var_e) if var_e < 0: var_e = var_e + var_d for i in list_a: i = int(i) if i%var_d == var_e: list_b.append(i) var_f = 30 var_g = 14 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 = 50 var_i = 24 list_d = [] var_h = int(var_h) var_i = int(var_i) if var_i < 0: var_i = var_i + var_h for i in list_c: i = int(i) if i%var_h == var_i: list_d.append(i) var_j = 70 var_k = 34 list_e = [] var_j = int(var_j) var_k = int(var_k) if var_k < 0: var_k = var_k + var_j for i in list_d: i = int(i) if i%var_j == var_k: list_e.append(i) var_l = 1 list_f=list_e.copy() list_f.sort() var_m = list_f[var_l-1] print(int(var_m))
Correspondence
A and B are single-digit numbers. If A2468B is a multiple of 55, how many possible numbers can this number be?
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))
Geometry
How many sides are there on the face of an icosahedron?
3
3
var_a = 3 print(int(var_a))
Geometry
The lengths of the hypotenuse and non-hypotenuse of a right triangle are 13 and 12, respectively. What is the length of the other side?
5
13 2 [OP_POW] 12 2 [OP_POW] [OP_SUB] 1/2 [OP_POW]
var_a = 13 var_b = 2 var_c = var_a ** var_b var_d = 12 var_e = 2 var_f = var_d ** var_e var_g = var_c - var_f var_h = 0.5 var_i = var_g ** var_h print(int(var_i))
Arithmetic calculation
Seoyoon traveled by train that goes 120 kilometers (km) per hour to get from her house to her grandmother's house. After traveling for 2 hours by train, the remaining distance to her grandmother's house was 2.4 kilometers (km). If it took 3 hours by car to go from Seoyoon's house to grandmother's house at a constant speed, how many kilometers (km) does the car travel per hour?
80.8
120 2 [OP_MUL] 2.4 [OP_ADD] 3 [OP_DIV]
var_a = 120 var_b = 2 var_c = var_a * var_b var_d = 2.4 var_e = var_c + var_d var_f = 3 var_g = var_e / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Possibility
Find the smallest five-digit number that can be formed using 0, 4, 6, 7, and 8 once.
40678
[OP_LIST_SOL] 0 4 6 7 8 [OP_LIST_EOL] 5 [OP_LIST_GET_PERM] 1 [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 = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[var_g-1] print(int(var_h))
Arithmetic calculation
There is a same number of 10-won and 50-won coins, and there are a total 12 of 10-won, 50-won, and 100-won coins. If the total amount is 500-won, how many 100-won coins are there?
2
12 500 100 12 [OP_MUL] [OP_SUB] 10 50 [OP_ADD] 100 2 [OP_MUL] [OP_SUB] [OP_DIV] 2 [OP_MUL] [OP_SUB]
var_a = 12 var_b = 500 var_c = 100 var_d = 12 var_e = var_c * var_d var_f = var_b - var_e var_g = 10 var_h = 50 var_i = var_g + var_h var_j = 100 var_k = 2 var_l = var_j * var_k var_m = var_i - var_l var_n = var_f / var_m var_o = 2 var_p = var_n * var_o var_q = var_a - var_p print(int(var_q))
Geometry
If the surface area of a cube is 486 square centimeters (cm2), how many centimeters (cm) is the sum of the lengths of all its edges?
108
486 6 [OP_DIV] 0.5 [OP_POW] 12 [OP_MUL]
var_a = 486 var_b = 6 var_c = var_a / var_b var_d = 0.5 var_e = var_c ** var_d var_f = 12 var_g = var_e * var_f print(int(var_g))
Correspondence
A is a single digit number. What is A that satisfies 3.4<3.A<4, 4/3>4/A>4/6?
5
3.4<3.A<4 A [OP_DIGIT_UNK_SOLVER] 4/3>4/A>4/6 A [OP_DIGIT_UNK_SOLVER] [OP_SET_INTERSECT] 1 [OP_LIST_GET]
var_a = '3.4<3.A<4' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = [] 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].append(int(c[i])) list_a = list(set(ans_dict[var_b])) var_c = '4/3>4/A>4/6' var_d = 'A' ans_dict = dict() var_c = var_c.replace('×','*') var_c = var_c.replace('x','*') var_c = var_c.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_c): if v in variable_candi: ans_dict[v] = [] candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_c 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_c): 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].append(int(c[i])) list_b = list(set(ans_dict[var_d])) list_c = list(set(list_a) & set(list_b)) var_e = 1 var_f = list_c[var_e-1] print(int(var_f))
Comparison
Namjoon has fewer marbles than Eunji. Namjoon has fewer marbles than Taehyung. Eunji has fewer marbles than Taehyung. Who has the most marbles?
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)
Geometry
When you open a faucet, it is said that 36 milliliters (ml) of water comes out per second. If the volume of the tank is 252 cubic centimeters (cm3), how many seconds will it take to fill the tank?
7
252 36 1 [OP_MUL] [OP_DIV]
var_a = 252 var_b = 36 var_c = 1 var_d = var_b * var_c var_e = var_a / var_d print(int(var_e))
Arithmetic calculation
A year ago, Hoseok's mother was 35 years old and Hoseok was 5 years old. Find how many times his mother's age is Hoseok's age 4 years from now.
4
35 1 [OP_ADD] 4 [OP_ADD] 5 1 [OP_ADD] 4 [OP_ADD] [OP_DIV]
var_a = 35 var_b = 1 var_c = var_a + var_b var_d = 4 var_e = var_c + var_d var_f = 5 var_g = 1 var_h = var_f + var_g var_i = 4 var_j = var_h + var_i var_k = var_e / var_j print(int(var_k))
Comparison
Jimin has a 59 centimeters (cm) string. Yoojeong has a 53 centimeters (cm) string. Who has the shorter string?
Yoojeong
[OP_LIST_SOL] Jimin Yoojeong [OP_LIST_EOL] [OP_LIST_SOL] 59 53 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jimin' var_b = 'Yoojeong' 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 = 59 var_d = 53 list_b= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_b.append(var_c) list_b.reverse() var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[var_e-1] var_g = list_b.index(var_f)+1 var_h = list_a[var_g-1] print(var_h)
Arithmetic calculation
There are 15 cucumbers in the mart. The number of radishes is 3 times the number of cucumbers, and there are 9 carrots. How many times the number of radishes is equal to the number of carrots?
5
15 3 [OP_MUL] 9 [OP_DIV]
var_a = 15 var_b = 3 var_c = var_a * var_b var_d = 9 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
1 Chinese Yuan is equal to 161.5 Won in Korean money. I'm trying to change 170,000 won in Korean money into 1000 yuan and 10 yuan in Chinese money. If you change as many 1000 yuan as possible, how many 10 yuan can you get?
5
17 10000 [OP_MUL] 161.5 1000 [OP_MUL] [OP_MOD] 161.5 10 [OP_MUL] [OP_FDIV]
var_a = 17 var_b = 10000 var_c = var_a * var_b var_d = 161.5 var_e = 1000 var_f = var_d * var_e var_g = var_c % var_f var_h = 161.5 var_i = 10 var_j = var_h * var_i var_k = var_g // var_j print(int(var_k))
Arithmetic calculation
Find the odd number between 30 and 50 with a remainder of 2 when divided by 7.
37
30 50 [OP_LIST_ODD] 7 2 [OP_LIST_DIVIDE_AND_REMAIN] [OP_LIST_SUM]
var_a = 30 var_b = 50 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 = 7 var_d = 2 list_b = [] var_c = int(var_c) var_d = int(var_d) if var_d < 0: var_d = var_d + var_c for i in list_a: i = int(i) if i%var_c == var_d: list_b.append(i) list_b = [float(i) for i in list_b] var_e = sum(list_b) print(int(var_e))
Comparison
What is the sum of the numbers less than 0.4 among 0.8, 1/2, 0.3, and 1/3?
0.63
[OP_LIST_SOL] 0.8 1/2 0.3 1/3 [OP_LIST_EOL] 0.4 [OP_LIST_LESS] [OP_LIST_SUM]
var_a = 0.8 var_b = 0.5 var_c = 0.3 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) list_b = [float(i) for i in list_b] var_f = sum(list_b) print('{:.2f}'.format(round(var_f+1e-10,2)))
Arithmetic calculation
Which three-digit number is the smallest common multiple of 5, 8, and 2?
120
100 999 1 [OP_LIST_ARANGE] 5 [OP_LIST_DIVISIBLE] 8 [OP_LIST_DIVISIBLE] 2 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN]
var_a = 100 var_b = 999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 5 list_b = [] var_d = int(var_d) for i in list_a: i = int(i) if i % var_d == 0: list_b.append(i) var_e = 8 list_c = [] var_e = int(var_e) for i in list_b: i = int(i) if i % var_e == 0: list_c.append(i) var_f = 2 list_d = [] var_f = int(var_f) for i in list_c: i = int(i) if i % var_f == 0: list_d.append(i) var_g = 1 list_e=list_d.copy() list_e.sort() var_h = list_e[var_g-1] print(int(var_h))
Arithmetic calculation
The subway travels at 1.6 kilometers (km) per minute. If it took 3 minutes and 15 seconds to completely cross a bridge that is 4.85 kilometers (km) long, how long is the subway in meters (m)?
350
1.6 3 15 60 [OP_DIV] [OP_ADD] [OP_MUL] 4.85 [OP_SUB] 1000 [OP_MUL]
var_a = 1.6 var_b = 3 var_c = 15 var_d = 60 var_e = var_c / var_d var_f = var_b + var_e var_g = var_a * var_f var_h = 4.85 var_i = var_g - var_h var_j = 1000 var_k = var_i * var_j print(int(eval('{:.2f}'.format(round(var_k+1e-10,2)))))
Arithmetic calculation
How many meters (m) is the length of a side of an equilateral triangle with a perimeter of 2 meters (m) in decimal numbers?
0.67
2 3 [OP_DIV]
var_a = 2 var_b = 3 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
Subtract 62 from any number and add 45 to get 55. Find the value of a number multiplied by 7.
504
55 45 [OP_SUB] 62 [OP_ADD] 7 [OP_MUL]
var_a = 55 var_b = 45 var_c = var_a - var_b var_d = 62 var_e = var_c + var_d var_f = 7 var_g = var_e * var_f print(int(var_g))
Possibility
Find the sum of the largest and smallest three-digit number that can be formed by using 5, 6, and 7 only once.
1332
[OP_LIST_SOL] 5 6 7 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD]
var_a = 5 var_b = 6 var_c = 7 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] var_g = 1 list_d=list_b.copy() list_d.sort() var_h = list_d[var_g-1] var_i = var_f + var_h print(int(var_i))
Arithmetic calculation
Jungkook has 3 red balls and Yoongi has 2 blue balls. When Yoongi gave 1 blue ball to Jungkook, how many balls does Jungkook have now?
4
3 1 [OP_ADD]
var_a = 3 var_b = 1 var_c = var_a + var_b print(int(var_c))
Arithmetic calculation
Find the remainder when 256 is divided by 13.
9
256 13 [OP_MOD]
var_a = 256 var_b = 13 var_c = var_a % var_b print(int(var_c))
Geometry
There is a rectangular drawing paper measuring 25 centimeters (cm) wide and 20 centimeters (cm) long. What is the area of this sheet of paper?
500
25 20 [OP_MUL]
var_a = 25 var_b = 20 var_c = var_a * var_b print(int(var_c))
Arithmetic calculation
Your older brother is 1/10 meter (m) taller than you, and your younger brother is 1.1 meter (m) shorter than you by 0.2 meter (m). How tall is your brother in meters (m)?
1.4
0.2 1.1 [OP_ADD] 1/10 [OP_ADD]
var_a = 0.2 var_b = 1.1 var_c = var_a + var_b var_d = 0.1 var_e = var_c + var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
Among the students in the (a) class, 35 students like art, 32 students like music, and 19 students like both art and music. If there is no student who does not like both art and music, how many students are in the (a) class?
48
35 32 [OP_ADD] 19 [OP_SUB]
var_a = 35 var_b = 32 var_c = var_a + var_b var_d = 19 var_e = var_c - var_d print(int(var_e))
Comparison
Nine people are standing in a row in order from the short person. Hoseok is standing in the second place from the back, and Yuna is standing right behind Hoseok. If you line up again starting with the tall person, which place will Yuna stand from the front?
1
2 1 [OP_SUB]
var_a = 2 var_b = 1 var_c = var_a - var_b print(int(var_c))
Possibility
What is the value when you subtract the smallest three-digit number from the largest three-digit number that can be made by drawing three different numbers from 1, 2, 6, 7, or 8?
750
[OP_LIST_SOL] 1 2 6 7 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB]
var_a = 1 var_b = 2 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 = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = 1 list_d=list_b.copy() list_d.sort() var_j = list_d[var_i-1] var_k = var_h - var_j print(int(var_k))
Geometry
You are planning to divide the tofu into three pieces, each in a rectangular shape, measuring 54 centimeters (cm) long and 20 centimeters (cm) wide when viewed from above. You want to cut all 3 pieces to have the same size of a square when viewed from above. Find the length in centimeters (cm) of one side to make the largest square. (However, tofu is only cut from top to bottom.)
18
[OP_LIST_SOL] 54 3 [OP_FDIV] 20 3 [OP_FDIV] [OP_LIST_EOL] 1 [OP_LIST_MAX]
var_a = 54 var_b = 3 var_c = var_a // var_b var_d = 20 var_e = 3 var_f = var_d // var_e list_a= [] 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_g = 1 list_b=list_a.copy() list_b.sort() var_h = list_b[-var_g] print(int(var_h))
Arithmetic calculation
The weight after using half of the milk was 5 kilograms (kg) and the weight of the first carton was 8 kilograms (kg). How many kilograms (kg) does an empty milk carton weigh?
2
8 8 5 [OP_SUB] 1 [OP_MUL] 1/2 [OP_DIV] [OP_SUB]
var_a = 8 var_b = 8 var_c = 5 var_d = var_b - var_c var_e = 1 var_f = var_d * var_e var_g = 0.5 var_h = var_f / var_g var_i = var_a - var_h print(int(var_i))
Correspondence
When A is divided by 5, the quotient is 2 and the remainder is B. A and B are both natural numbers. What is the largest possible value of A?
14
5 2 [OP_MUL] 5 1 [OP_SUB] [OP_ADD]
var_a = 5 var_b = 2 var_c = var_a * var_b var_d = 5 var_e = 1 var_f = var_d - var_e var_g = var_c + var_f print(int(var_g))
Comparison
In a running race, Namjoon, Yoonki, and Hoseok crossed the finish line one after the other. If Namjoon is in 10th place, in which place is Hoseok?
12
10 [OP_LIST_SOL] Namjoon Yoongi Hoseok [OP_LIST_EOL] Hoseok [OP_LIST_INDEX] Namjoon [OP_LIST_INDEX] [OP_SUB] [OP_ADD]
var_a = 10 var_b = 'Namjoon' var_c = 'Yoongi' var_d = 'Hoseok' 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 = 'Hoseok' var_f = list_a.index(var_e)+1 var_g = 'Namjoon' var_h = list_a.index(var_g)+1 var_i = var_f - var_h var_j = var_a + var_i print(int(var_j))
Correspondence
There is a certain number. If 2/9 of this number is 10, what is 2/5 of this number?
18
10 2/9 [OP_DIV] 2/5 [OP_MUL]
var_a = 10 var_b = 0.2222222222222222 var_c = var_a / var_b var_d = 0.4 var_e = var_c * var_d print(int(var_e))
Correspondence
There are 9 fish in each fisherman's bucket, but only 3 of them are mackerel. If there are 27 mackerels in total, how many buckets are there?
9
27 3 [OP_MUL] 9 [OP_DIV]
var_a = 27 var_b = 3 var_c = var_a * var_b var_d = 9 var_e = var_c / var_d print(int(var_e))
Geometry
How many centimeters (cm) is the sum of the lengths of the edges of a cuboid measuring 10 centimeters (cm) wide, 8 centimeters (cm) long, and 5 centimeters (cm) high?
92
10 4 [OP_MUL] 8 4 [OP_MUL] [OP_ADD] 5 4 [OP_MUL] [OP_ADD]
var_a = 10 var_b = 4 var_c = var_a * var_b var_d = 8 var_e = 4 var_f = var_d * var_e var_g = var_c + var_f var_h = 5 var_i = 4 var_j = var_h * var_i var_k = var_g + var_j print(int(var_k))
Geometry
I'm trying to make a square shape as small as possible by sticking a rectangular photo of 12 centimeters (cm) in width and 15 centimeters (cm) in length without overlapping them on the wall. How many photos do you need?
20
12 15 [OP_LCM] 2 [OP_POW] 12 15 [OP_MUL] [OP_DIV]
var_a = 12 var_b = 15 var_c = var_b * var_a / math.gcd(int(var_b), int(var_a)) var_d = 2 var_e = var_c ** var_d var_f = 12 var_g = 15 var_h = var_f * var_g var_i = var_e / var_h print(int(var_i))
Arithmetic calculation
There are five numbers 10, 11, 12, 13, and 14. What is the sum of the largest number and the second largest number?
27
[OP_LIST_SOL] 10 11 12 13 14 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MAX] [OP_ADD]
var_a = 10 var_b = 11 var_c = 12 var_d = 13 var_e = 14 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 1 list_b=list_a.copy() list_b.sort() var_g = list_b[-var_f] var_h = 2 list_c=list_a.copy() list_c.sort() var_i = list_c[-var_h] var_j = var_g + var_i print(int(var_j))
Possibility
If 1, 3, 4, and 7 are used once to form the largest three-digit number with 1 in the tens place and the second largest three-digit number, what is the sum of these two numbers?
1427
[OP_LIST_SOL] 1 3 4 7 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 10 1 [OP_LIST_SEARCH_FIXED_DIGIT] 1 [OP_LIST_MAX] 2 [OP_LIST_MAX] [OP_ADD]
var_a = 1 var_b = 3 var_c = 4 var_d = 7 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 10 var_g = 1 list_c = [] var_f = int(var_f) var_g = int(var_g) for i in list_b: i = int(i) if (i//var_f)%10 == var_g: list_c.append(i) var_h = 1 list_d=list_c.copy() list_d.sort() var_i = list_d[-var_h] var_j = 2 list_e=list_c.copy() list_e.sort() var_k = list_e[-var_j] var_l = var_i + var_k print(int(var_l))
Correspondence
A is a number satisfying 34.8A>34.84. What is the sum of all single-digit numbers that can fit in A?
35
34.8A>34.84 A [OP_DIGIT_UNK_SOLVER] [OP_LIST_SUM]
var_a = '34.8A>34.84' 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] = [] 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].append(int(c[i])) list_a = list(set(ans_dict[var_b])) list_a = [float(i) for i in list_a] var_c = sum(list_a) print(int(var_c))
Correspondence
If we add a certain number to 18, and then divide it by 3, and then add 10, and then divide by 5, we get 4 as a result. Find out the number in question.
12
4 5 [OP_MUL] 10 [OP_SUB] 3 [OP_MUL] 18 [OP_SUB]
var_a = 4 var_b = 5 var_c = var_a * var_b var_d = 10 var_e = var_c - var_d var_f = 3 var_g = var_e * var_f var_h = 18 var_i = var_g - var_h print(int(var_i))
Correspondence
The equation 69A+53=748 is said to hold. What number should go in A, where 69A is three-digit number?
5
69A+53=748 A [OP_DIGIT_UNK_SOLVER]
var_a = '69A+53=748' 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))
Possibility
How many two-digit numbers can be formed by selecting only two of the three natural numbers 1, 2, and 7? (The number can be used repeatedly)
9
[OP_LIST_SOL] 1 2 7 [OP_LIST_EOL] 2 [OP_LIST_GET_PRODUCT] [OP_LIST_LEN]
var_a = 1 var_b = 2 var_c = 7 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = len(list_b) print(int(var_e))
Arithmetic calculation
There are 4 tribes on the couple continent. There are 204 males and 468 females in Gaga tribe, and 334 males and 516 females in Nana tribe. There are 427 males and 458 females in Dada tribe, and 549 males and 239 females in Lala tribe. Find the difference between males and females on this couple continent.
167
[OP_LIST_SOL] 204 334 427 549 [OP_LIST_EOL] [OP_LIST_SUM] [OP_LIST_SOL] 468 516 458 239 [OP_LIST_EOL] [OP_LIST_SUM] [OP_SUB] [OP_ABS]
var_a = 204 var_b = 334 var_c = 427 var_d = 549 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() list_a = [float(i) for i in list_a] var_e = sum(list_a) var_f = 468 var_g = 516 var_h = 458 var_i = 239 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) list_b.reverse() list_b = [float(i) for i in list_b] var_j = sum(list_b) var_k = var_e - var_j var_l = abs(var_k) print(int(var_l))
Arithmetic calculation
Some machines make 2 cell phones per hour. If the factory has 7 machines in all, how many hours does it take to make 182 cell phones in the factory?
13
182 7 2 [OP_MUL] [OP_DIV]
var_a = 182 var_b = 7 var_c = 2 var_d = var_b * var_c var_e = var_a / var_d print(int(var_e))
Possibility
You want to subtract three of the 4 numbers 0, 2, 4, and 6, and then create a three-digit number using each number only once. Find the difference between the largest and smallest possible numbers.
438
[OP_LIST_SOL] 0 2 4 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB]
var_a = 0 var_b = 2 var_c = 4 var_d = 6 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] var_h = 1 list_d=list_b.copy() list_d.sort() var_i = list_d[var_h-1] var_j = var_g - var_i print(int(var_j))
Correspondence
There are N consecutive natural numbers from 1 to N. The sum of the even numbers in these numbers is 90 and the sum of the odd numbers is 100. find N.
19
100 90 [OP_SUB] 2 [OP_MUL] 1 [OP_SUB]
var_a = 100 var_b = 90 var_c = var_a - var_b var_d = 2 var_e = var_c * var_d var_f = 1 var_g = var_e - var_f print(int(var_g))
Correspondence
B+A+B=814.8. When the decimal point of A is shifted one place to the left, it turns equivalent to B. Find the value of A-B including the decimal point.
611.1
814.8 10 2 [OP_ADD] [OP_DIV] 10 [OP_MUL] 814.8 10 2 [OP_ADD] [OP_DIV] [OP_SUB]
var_a = 814.8 var_b = 10 var_c = 2 var_d = var_b + var_c var_e = var_a / var_d var_f = 10 var_g = var_e * var_f var_h = 814.8 var_i = 10 var_j = 2 var_k = var_i + var_j var_l = var_h / var_k var_m = var_g - var_l print('{:.2f}'.format(round(var_m+1e-10,2)))
Geometry
A trapezoid is 8 centimeters (cm) high, the length of the top side is 6 centimeters (cm) shorter than the length of the bottom side, and it is 72 square centimeters (㎠) wide. What is the length of the top side of this trapezoid?
6
72 2 [OP_MUL] 8 [OP_DIV] 6 [OP_SUB] 2 [OP_DIV]
var_a = 72 var_b = 2 var_c = var_a * var_b var_d = 8 var_e = var_c / var_d var_f = 6 var_g = var_e - var_f var_h = 2 var_i = var_g / var_h print(int(var_i))
Correspondence
This number minus 46 became 15. What is this number minus 29?
32
15 46 [OP_ADD] 29 [OP_SUB]
var_a = 15 var_b = 46 var_c = var_a + var_b var_d = 29 var_e = var_c - var_d print(int(var_e))
Correspondence
The number of first-year students is 695, of which 329 are female students. If the number of male second-year students is 254, find the number of male students in the first-year and second-year.
620
695 329 [OP_SUB] 254 [OP_ADD]
var_a = 695 var_b = 329 var_c = var_a - var_b var_d = 254 var_e = var_c + var_d print(int(var_e))
Geometry
Find the sum of the faces, edges, and vertices of an octagonal pyramid.
34
8 1 [OP_ADD] 8 2 [OP_MUL] [OP_ADD] 8 1 [OP_ADD] [OP_ADD]
var_a = 8 var_b = 1 var_c = var_a + var_b var_d = 8 var_e = 2 var_f = var_d * var_e var_g = var_c + var_f var_h = 8 var_i = 1 var_j = var_h + var_i var_k = var_g + var_j print(int(var_k))
Correspondence
7/8 of a number is 28. What is that number added by 16 and multiplied by 5/16?
15
28 8 7 [OP_DIV] [OP_MUL] 16 [OP_ADD] 5 16 [OP_DIV] [OP_MUL]
var_a = 28 var_b = 8 var_c = 7 var_d = var_b / var_c var_e = var_a * var_d var_f = 16 var_g = var_e + var_f var_h = 5 var_i = 16 var_j = var_h / var_i var_k = var_g * var_j print(int(var_k))
Possibility
Use each of the numbers 1, 2, 3, 4, and 5 once to make three-digit natural numbers. Find the sum of the digits of all possible numbers.
540
1 5 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] [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_c = [float(i) for i in list_c] var_f = sum(list_c) print(int(var_f))
Comparison
Hoseok placed 8th in the running event. Yoojung did better than Hoseok, but worse than Namjoon who came in 6th place. What rank is Yoojung in?
7
8 6 [OP_ADD] 2 [OP_DIV]
var_a = 8 var_b = 6 var_c = var_a + var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
The sum of five consecutive natural numbers is 90. What is the second largest of these natural numbers?
19
90 0 5 1 [OP_SUB] 1 [OP_LIST_ARANGE] [OP_LIST_SUM] [OP_SUB] 5 [OP_DIV] 5 2 [OP_SUB] [OP_ADD]
var_a = 90 var_b = 0 var_c = 5 var_d = 1 var_e = var_c - var_d var_f = 1 list_a = [i for i in range(var_b, var_e + 1, var_f)] list_a = [float(i) for i in list_a] var_g = sum(list_a) var_h = var_a - var_g var_i = 5 var_j = var_h / var_i var_k = 5 var_l = 2 var_m = var_k - var_l var_n = var_j + var_m print(int(var_n))
Possibility
Even numbers from 1 to 999 were written sequentially to make 2468101214...996998. Find the sum of each digit in this number.
6500
2 999 2 [OP_LIST_ARANGE] [OP_LIST_NUM2SUM] [OP_LIST_SUM]
var_a = 2 var_b = 999 var_c = 2 list_a = [i for i in range(var_a, var_b + 1, var_c)] list_b=[] for i in list_a: var_d = 0 i = int(i) while i//10 > 0: var_d = var_d + i%10 i = i//10 var_d = var_d + i%10 list_b.append(var_d) list_b = [float(i) for i in list_b] var_e = sum(list_b) print(int(var_e))
Geometry
I drew a right triangle on a paper. In this right triangle, the length of the non-hypotenuse side is 6 and the other non-hypotenuse side length is 8. What is the length of the hypotenuse at this time?
10
6 2 [OP_POW] 8 2 [OP_POW] [OP_ADD] 1/2 [OP_POW]
var_a = 6 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 var_h = 0.5 var_i = var_g ** var_h print(int(var_i))
Arithmetic calculation
If you light a rope that is 6 meters (m) long, it burns at 2 meters (m) per minute. When the length of the burnt rope is 2 meters (m), find how many minutes have passed after the rope is lighted.
1
2 2 [OP_DIV]
var_a = 2 var_b = 2 var_c = var_a / var_b print(int(var_c))
Arithmetic calculation
A box contains a total of 240 red and blue ballpoint pens in total. There are 2 fewer blue ballpoint pens than red ballpoint pens. Find how many red ballpoint pens are in all.
121
240 2 [OP_SUB] 2 [OP_DIV] 2 [OP_ADD]
var_a = 240 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))
Possibility
Suppose that you throw the ball 4 times and count the points. How many different points can you get given that you get 3 points and 2 points when hitting the red circle and green circle, and 1 point if you miss the target?
81
[OP_LIST_SOL] 3 2 1 [OP_LIST_EOL] 4 [OP_LIST_GET_PRODUCT] [OP_LIST_NUM2SUM] [OP_LIST_LEN]
var_a = 3 var_b = 2 var_c = 1 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 4 list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] list_c=[] for i in list_b: var_e = 0 i = int(i) while i//10 > 0: var_e = var_e + i%10 i = i//10 var_e = var_e + i%10 list_c.append(var_e) var_f = len(list_c) print(int(var_f))
Arithmetic calculation
Find the sum of the common divisors of 32 and 24.
15
32 [OP_LIST_GET_DIVISOR] 24 [OP_LIST_GET_DIVISOR] [OP_SET_INTERSECT] [OP_LIST_SUM]
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 = 24 list_b = [] num_sqrt = int(math.sqrt(var_b)) for i in range(1, num_sqrt+1): if var_b % i == 0: list_b.append(i) list_b.append(int(var_b/i)) list_b = sorted(set(list_b)) list_c = list(set(list_a) & set(list_b)) list_c = [float(i) for i in list_c] var_c = sum(list_c) print(int(var_c))
Arithmetic calculation
Find the greatest common divisor of 24 and 36.
12
24 [OP_LIST_GET_DIVISOR] 36 [OP_LIST_GET_DIVISOR] [OP_SET_INTERSECT] 1 [OP_LIST_MAX]
var_a = 24 list_a = [] num_sqrt = int(math.sqrt(var_a)) for i in range(1, num_sqrt+1): if var_a % i == 0: list_a.append(i) list_a.append(int(var_a/i)) list_a = sorted(set(list_a)) var_b = 36 list_b = [] num_sqrt = int(math.sqrt(var_b)) for i in range(1, num_sqrt+1): if var_b % i == 0: list_b.append(i) list_b.append(int(var_b/i)) list_b = sorted(set(list_b)) list_c = list(set(list_a) & set(list_b)) var_c = 1 list_d=list_c.copy() list_d.sort() var_d = list_d[-var_c] print(int(var_d))