category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Geometry
How many degrees is the measure of one angle of a regular decagon?
144
10 2 [OP_SUB] 180 [OP_MUL] 10 [OP_DIV]
var_a = 10 var_b = 2 var_c = var_a - var_b var_d = 180 var_e = var_c * var_d var_f = 10 var_g = var_e / var_f print(int(var_g))
Comparison
Jihee used 1 meter (m) and 1/5 meters (m), and Hyun used 8/5 meters (m) of shoelaces. Find out who used more shoelaces.
Hyun
[OP_LIST_SOL] Jihee Hyun [OP_LIST_EOL] [OP_LIST_SOL] 1 1 5 [OP_DIV] [OP_ADD] 8 5 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jihee' var_b = 'Hyun' 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 = 1 var_e = 5 var_f = var_d / var_e var_g = var_c + var_f var_h = 8 var_i = 5 var_j = var_h / var_i list_b= [] if "/" in str(var_j): var_j = eval(str(var_j)) list_b.append(var_j) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) list_b.reverse() var_k = 1 list_c=list_b.copy() list_c.sort() var_l = list_c[-var_k] var_m = list_b.index(var_l)+1 var_n = list_a[var_m-1] print(var_n)
Comparison
I have three brothers, and when they add up their ages, it becomes 34. The age of the oldest brother is 3 times the age of the youngest brother, and the age of the second oldest brother is 2 years younger than twice the age of the youngest brother. How old is the second oldest brother?
10
34 2 [OP_ADD] 3 1 [OP_ADD] 2 [OP_ADD] [OP_DIV] 2 [OP_MUL] 2 [OP_SUB]
var_a = 34 var_b = 2 var_c = var_a + var_b var_d = 3 var_e = 1 var_f = var_d + var_e var_g = 2 var_h = var_f + var_g var_i = var_c / var_h var_j = 2 var_k = var_i * var_j var_l = 2 var_m = var_k - var_l print(int(var_m))
Geometry
There is a triangle with a side length of 6 centimeters (cm). If the other two sides of the triangle are equal in length and the sum of all sides is 20 centimeters (cm), how many centimeters (cm) is the length of one of the two equal sides?
7
20 6 [OP_SUB] 2 [OP_DIV]
var_a = 20 var_b = 6 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Correspondence
When we divide the natural number A by 5, we get a remainder of 4 and a quotient of 6. Find the right value for A.
34
5 6 [OP_MUL] 4 [OP_ADD]
var_a = 5 var_b = 6 var_c = var_a * var_b var_d = 4 var_e = var_c + var_d print(int(var_e))
Comparison
When students stand in a line, Yoojung is at the front, and Eunjung is standing at the 5th from the back. If 30 students are standing between Yoojung and Eunjeong, how many students are in a line?
36
5 30 [OP_ADD] 1 [OP_ADD]
var_a = 5 var_b = 30 var_c = var_a + var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Possibility
Using the number cards 1, 6, and 8 all once, find the difference between the second largest three-digit number and the third smallest three-digit number.
198
[OP_LIST_SOL] 1 6 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 2 [OP_LIST_MAX] 3 [OP_LIST_MIN] [OP_SUB] [OP_ABS]
var_a = 1 var_b = 6 var_c = 8 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = 2 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] var_g = 3 list_d=list_b.copy() list_d.sort() var_h = list_d[var_g-1] var_i = var_f - var_h var_j = abs(var_i) print(int(var_j))
Possibility
You have 4 blue pencils and 1 red pencil. How many different ways can you place 5 pencils in a row?
5
4 1 [OP_ADD] 4 [OP_COMB]
var_a = 4 var_b = 1 var_c = var_a + var_b var_d = 4 var_e = 1 var_c = int(var_c) var_d = int(var_d) for i, elem in enumerate(range(var_d)): var_e = var_e * (var_c-i) for i, elem in enumerate(range(var_d)): var_e = var_e / (i+1) print(int(var_e))
Geometry
I want to put 5 cm (cm) height of water into a cuboid shaped fishbowl that is 10 cm (cm) width, 12 cm (cm) length, and 10 cm (cm) height. Find the volume of water that needs to be added.
600
10 12 [OP_MUL] 5 [OP_MUL]
var_a = 10 var_b = 12 var_c = var_a * var_b var_d = 5 var_e = var_c * var_d print(int(var_e))
Arithmetic calculation
Round the value of 14.23÷4.7 to two decimal places.
3.03
14.23 4.7 [OP_DIV] 2 [OP_ROUND]
var_a = 14.23 var_b = 4.7 var_c = var_a / var_b var_d = 2 var_e = round(float(var_c)+1e-10, var_d) print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
Kanghee and Hojae shared a 2kg (kg) and 100g (g) watermelon. If Kanghee ate 200 grams (g) more than Hojae did, how many kilograms (kg) of watermelon did Kanghee eat?
1.15
2 1000 [OP_MUL] 100 [OP_ADD] 200 [OP_ADD] 2 [OP_DIV] 1000 [OP_DIV]
var_a = 2 var_b = 1000 var_c = var_a * var_b var_d = 100 var_e = var_c + var_d var_f = 200 var_g = var_e + var_f var_h = 2 var_i = var_g / var_h var_j = 1000 var_k = var_i / var_j print('{:.2f}'.format(round(var_k+1e-10,2)))
Arithmetic calculation
Find the number of natural numbers in the following range: 8 or more and 21 or less.
14
8 21 1 [OP_LIST_ARANGE] [OP_LIST_LEN]
var_a = 8 var_b = 21 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = len(list_a) print(int(var_d))
Geometry
How many vertices does a pyramid with a regular hexagonal base have?
7
6 1 [OP_ADD]
var_a = 6 var_b = 1 var_c = var_a + var_b print(int(var_c))
Correspondence
Divide 172 by 4, subtract 28, and then multiply by this number, and add 7 to get 172. Find this number.
11
172 7 [OP_SUB] 172 4 [OP_DIV] 28 [OP_SUB] [OP_DIV]
var_a = 172 var_b = 7 var_c = var_a - var_b var_d = 172 var_e = 4 var_f = var_d / var_e var_g = 28 var_h = var_f - var_g var_i = var_c / var_h print(int(var_i))
Arithmetic calculation
It takes Jinsu 4 hours to complete a task by himself. What is the amount of work that Jinsu can do in one hour?
0.25
1 4 [OP_DIV]
var_a = 1 var_b = 4 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
A and B are single digit numbers. Add 4 to 2 to get A, subtract 1 from 3 to get B. Find A+B at this time.
10
2 4 [OP_ADD] 1 3 [OP_ADD] [OP_ADD]
var_a = 2 var_b = 4 var_c = var_a + var_b var_d = 1 var_e = 3 var_f = var_d + var_e var_g = var_c + var_f print(int(var_g))
Correspondence
Between a certain natural number and 81, there are 15 consecutive natural numbers. What is this certain number if it is a natural number less than 81?
65
81 15 [OP_SUB] 1 [OP_SUB]
var_a = 81 var_b = 15 var_c = var_a - var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Possibility
There are 3 kinds of chicken and 2 kinds of drinks, and you want to choose one from each to eat for lunch. How many choices can you make?
6
3 2 [OP_MUL]
var_a = 3 var_b = 2 var_c = var_a * var_b print(int(var_c))
Comparison
When you took the exam of Korean, Social, Mathematics, English, and Science in order, what subject did you take third?
Mathematics
[OP_LIST_SOL] Korean Social Mathematics English Science [OP_LIST_EOL] 3 [OP_LIST_GET]
var_a = 'Korean' var_b = 'Social' var_c = 'Mathematics' var_d = 'English' var_e = 'Science' 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 var_g = list_a[var_f-1] print(var_g)
Arithmetic calculation
If you tell the King of Addition any two numbers, he can quickly add all the numbers in between of that two. When you told him 6 and 21, what would be the answer of the King of Addition?
216
6 21 1 [OP_LIST_ARANGE] [OP_LIST_SUM]
var_a = 6 var_b = 21 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] list_a = [float(i) for i in list_a] var_d = sum(list_a) print(int(var_d))
Possibility
There are 12 carnations. You gave one carnation to each of the two teachers. Then, you would like to distribute the remaining carnations to two teachers. How many ways are there?
11
12 2 1 [OP_MUL] [OP_SUB] 1 [OP_ADD]
var_a = 12 var_b = 2 var_c = 1 var_d = var_b * var_c var_e = var_a - var_d var_f = 1 var_g = var_e + var_f print(int(var_g))
Arithmetic calculation
A certain number is the smallest three-digit number that leaves a remainder of 7 when divided by 20 and a remainder of 7 when divided by 25. What number is it?
107
100 999 1 [OP_LIST_ARANGE] 20 7 [OP_LIST_DIVIDE_AND_REMAIN] 25 7 [OP_LIST_DIVIDE_AND_REMAIN] 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 = 20 var_e = 7 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 = 25 var_g = 7 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 = 1 list_d=list_c.copy() list_d.sort() var_i = list_d[var_h-1] print(int(var_i))
Correspondence
What number must be in B to make A7B+23=695, where 27B is three-digit number?
2
A7B+23=695 B [OP_DIGIT_UNK_SOLVER]
var_a = 'A7B+23=695' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Arithmetic calculation
The sum of 5 consecutive natural numbers is 60. Find the last number.
14
60 0 5 1 [OP_SUB] 1 [OP_LIST_ARANGE] [OP_LIST_SUM] [OP_SUB] 5 [OP_DIV] 5 1 [OP_SUB] [OP_ADD]
var_a = 60 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 = 1 var_m = var_k - var_l var_n = var_j + var_m print(int(var_n))
Arithmetic calculation
After 24 years, Minsu's age will have been four times his current age. How old is Minsu now?
8
24 4 1 [OP_SUB] [OP_DIV]
var_a = 24 var_b = 4 var_c = 1 var_d = var_b - var_c var_e = var_a / var_d print(int(var_e))
Correspondence
Rounding down 2A3 to the nearest ten makes it 280. What is A?
8
2A3 [OP_GEN_POSSIBLE_LIST] 280 [OP_LIST_MORE_EQUAL] 280 10 [OP_ADD] [OP_LIST_LESS] 2A3 A [OP_LIST_FIND_UNK]
var_a = '2A3' 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 = 280 list_b = [] for i in list_a: if i >= var_b: list_b.append(i) var_c = 280 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 = '2A3' 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))
Arithmetic calculation
(A) apartment complex has four buildings. Each building has up to 6 floors, and there are two households on the first floor of each building, and three households on each floor from the second to sixth floor. How many households can live in (A) apartment complex?
68
4 1 2 [OP_MUL] 6 2 [OP_SUB] 1 [OP_ADD] 3 [OP_MUL] [OP_ADD] [OP_MUL]
var_a = 4 var_b = 1 var_c = 2 var_d = var_b * var_c var_e = 6 var_f = 2 var_g = var_e - var_f var_h = 1 var_i = var_g + var_h var_j = 3 var_k = var_i * var_j var_l = var_d + var_k var_m = var_a * var_l print(int(var_m))
Geometry
There are two squares whose area ratio is 9:25. When two cubes are made using these squares of the same size as each square, find how many times the volume of the larger cube is the volume of the smaller cube.
4.63
25 1/2 [OP_POW] 3 [OP_POW] 9 1/2 [OP_POW] 3 [OP_POW] [OP_DIV]
var_a = 25 var_b = 0.5 var_c = var_a ** var_b var_d = 3 var_e = var_c ** var_d var_f = 9 var_g = 0.5 var_h = var_f ** var_g var_i = 3 var_j = var_h ** var_i var_k = var_e / var_j print('{:.2f}'.format(round(var_k+1e-10,2)))
Arithmetic calculation
There are four numbers 10, 11, 12, and 13. What do you get if you combine the largest number and the second smallest number?
24
[OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_ADD]
var_a = 10 var_b = 11 var_c = 12 var_d = 13 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 1 list_b=list_a.copy() list_b.sort() var_f = list_b[-var_e] var_g = 2 list_c=list_a.copy() list_c.sort() var_h = list_c[var_g-1] var_i = var_f + var_h print(int(var_i))
Arithmetic calculation
A carton of milk weighed eight kilograms (kg). After using half the milk, I weighed it again and it was 5 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))
Comparison
There are 4 books weighing 0.26 kg (kg) in Myeongseok's bag, and 1 book weighing 1.2 kg (kg) is in Mingu's bag. If two people's bags weigh the same, whose bag is heavier?
Mingu
[OP_LIST_SOL] Myeongseok Mingu [OP_LIST_EOL] [OP_LIST_SOL] 4 0.26 [OP_MUL] 1.2 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Myeongseok' var_b = 'Mingu' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 4 var_d = 0.26 var_e = var_c * var_d var_f = 1.2 list_b= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Geometry
If you add the number of diagonals and the number of sides of a regular dodecagon, what will you get?
66
12 12 3 [OP_SUB] [OP_MUL] 2 [OP_DIV] 12 [OP_ADD]
var_a = 12 var_b = 12 var_c = 3 var_d = var_b - var_c var_e = var_a * var_d var_f = 2 var_g = var_e / var_f var_h = 12 var_i = var_g + var_h print(int(var_i))
Arithmetic calculation
Students are trying to line up at intervals of 6 meters (m) on a playground that is 156 meters (m) long. How many students can line up at the beginning and end when students are said to line up?
27
156 6 [OP_DIV] 1 [OP_ADD]
var_a = 156 var_b = 6 var_c = var_a / var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
What is the smallest three-digit number that is a multiple of 6 and that of 5, 8, and 9?
360
100 999 1 [OP_LIST_ARANGE] 6 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 8 [OP_LIST_DIVISIBLE] 9 [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 = 6 list_b = [] var_d = int(var_d) for i in list_a: i = int(i) if i % var_d == 0: list_b.append(i) var_e = 5 list_c = [] var_e = int(var_e) for i in list_b: i = int(i) if i % var_e == 0: list_c.append(i) var_f = 8 list_d = [] var_f = int(var_f) for i in list_c: i = int(i) if i % var_f == 0: list_d.append(i) var_g = 9 list_e = [] var_g = int(var_g) for i in list_d: i = int(i) if i % var_g == 0: list_e.append(i) var_h = 1 list_f=list_e.copy() list_f.sort() var_i = list_f[var_h-1] print(int(var_i))
Correspondence
Rounding the five-digit number 62A94 to the hundred's place is 63000. Find the sum of the numbers from 0 to 9 that can be used for A.
35
62A94 [OP_GEN_POSSIBLE_LIST] 62500 [OP_LIST_MORE_EQUAL] 62A94 A [OP_LIST_FIND_UNK] [OP_LIST_SUM]
var_a = '62A94' 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 = 62500 list_b = [] for i in list_a: if i >= var_b: list_b.append(i) var_c = '62A94' var_d = 'A' var_c = str(var_c) var_d = str(var_d) unk_idx = var_c.index(var_d) list_c = [] for elem in list_b: elem = str(elem) list_c.append(int(elem[unk_idx])) list_c = list(set(list_c)) list_c = [float(i) for i in list_c] var_e = sum(list_c) print(int(var_e))
Correspondence
What numbers can be put in A if 3A5-2B=364?
8
3A5-2B=364 A [OP_DIGIT_UNK_SOLVER]
var_a = '3A5-2B=364' 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
I have to subtract a number from 514, but I accidentally added a number and it became 913. How much is it if I calculate it correctly?
115
514 913 514 [OP_SUB] [OP_SUB]
var_a = 514 var_b = 913 var_c = 514 var_d = var_b - var_c var_e = var_a - var_d print(int(var_e))
Correspondence
A number divided by 4 is 12. What is the value when the number is divided 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
When you wrongly multiply a number that should have been divided by 0.55, you get 4.235. What is the quotient when calculated correctly?
14
4.235 0.55 [OP_DIV] 0.55 [OP_DIV]
var_a = 4.235 var_b = 0.55 var_c = var_a / var_b var_d = 0.55 var_e = var_c / var_d print(int(var_e))
Possibility
Two different numbers were drawn from 9, 4, 3, and 5 to form a two-digit number. What is the difference between the largest number and the smallest number?
61
[OP_LIST_SOL] 9 4 3 5 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB]
var_a = 9 var_b = 4 var_c = 3 var_d = 5 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 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 = 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))
Possibility
How many ways are there to divide all 32 apples and put them in a box without any remainder? (However, putting 32 apples in one box is not considered.)
5
32 [OP_LIST_GET_DIVISOR] [OP_LIST_SOL] 1 [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN]
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 = 1 list_b= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_b.append(var_b) list_b.reverse() list_c = list(set(list_a) - set(list_b)) var_c = len(list_c) print(int(var_c))
Arithmetic calculation
There are three numbers 10, 11, and 12. What is the remainder when the largest number is divided by the second smallest number?
1
[OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_MOD]
var_a = 10 var_b = 11 var_c = 12 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 1 list_b=list_a.copy() list_b.sort() var_e = list_b[-var_d] var_f = 2 list_c=list_a.copy() list_c.sort() var_g = list_c[var_f-1] var_h = var_e % var_g print(int(var_h))
Geometry
One cube is made by stacking 8 small cubes with a surface area of 96 square centimeters (cm2). What is the volume of this stacked cube?
512
96 6 [OP_DIV] 1/2 [OP_POW] 8 2 [OP_DIV] 2 [OP_DIV] [OP_MUL] 3 [OP_POW]
var_a = 96 var_b = 6 var_c = var_a / var_b var_d = 0.5 var_e = var_c ** var_d var_f = 8 var_g = 2 var_h = var_f / var_g var_i = 2 var_j = var_h / var_i var_k = var_e * var_j var_l = 3 var_m = var_k ** var_l print(int(var_m))
Arithmetic calculation
It takes 400 grams (g) of flour to make 3 loaves of bread. How many slices of bread can you make with 2.3 kilograms (kg) of flour? (However, you can only make 3 slices of bread at a time.)
15
2.3 1000 [OP_MUL] 400 [OP_FDIV] 3 [OP_MUL]
var_a = 2.3 var_b = 1000 var_c = var_a * var_b var_d = 400 var_e = var_c // var_d var_f = 3 var_g = var_e * var_f print(int(var_g))
Comparison
5 students measured their heights. Seokjin is shorter than Myeonghyeon, and Juri is shorter than Jungkook. If Jungwoo is taller than Myeonghyeon, who is the tallest?
Jungkook
[OP_LIST_SOL] Juri Jungwoo Myeonghyeon Seokjin Jungkook [OP_LIST_EOL] [OP_LIST_SOL] Juri Jungwoo > Myeonghyeon Seokjin > Juri Jungkook < Myeonghyeon Jungwoo < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'Juri' var_b = 'Jungwoo' var_c = 'Myeonghyeon' var_d = 'Seokjin' var_e = 'Jungkook' 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 = 'Juri' var_g = 'Jungwoo' var_h = '>' var_i = 'Myeonghyeon' var_j = 'Seokjin' var_k = '>' var_l = 'Juri' var_m = 'Jungkook' var_n = '<' var_o = 'Myeonghyeon' var_p = 'Jungwoo' 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)
Arithmetic calculation
Find the sum of the largest and smallest divisors of 15 excluding 1 and itself.
8
15 [OP_LIST_GET_DIVISOR] 2 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_ADD]
var_a = 15 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] var_d = 2 list_c=list_a.copy() list_c.sort() var_e = list_c[var_d-1] var_f = var_c + var_e print(int(var_f))
Arithmetic calculation
Yuna solved 8 English problems a day. How many English questions did Yuna solve in one week?
56
7 8 [OP_MUL]
var_a = 7 var_b = 8 var_c = var_a * var_b print(int(var_c))
Possibility
Find the difference between the second smallest number and third smallest number from three digit numbers that can be made by using all three cards with the numbers 1, 7, and 3 written once.
144
[OP_LIST_SOL] 1 7 3 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 2 [OP_LIST_MIN] 3 [OP_LIST_MIN] [OP_SUB] [OP_ABS]
var_a = 1 var_b = 7 var_c = 3 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = 2 list_c=list_b.copy() list_c.sort() var_f = list_c[var_e-1] var_g = 3 list_d=list_b.copy() list_d.sort() var_h = list_d[var_g-1] var_i = var_f - var_h var_j = abs(var_i) print(int(var_j))
Arithmetic calculation
Seongmin rode a bicycle for 1 hour and 24 minutes at a constant speed of 10.8 kilometers (km) per hour. At this time, find the total distance traveled by Seongmin in kilometers (km).
15.12
10.8 1 24 60 [OP_DIV] [OP_ADD] [OP_MUL]
var_a = 10.8 var_b = 1 var_c = 24 var_d = 60 var_e = var_c / var_d var_f = var_b + var_e var_g = var_a * var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Correspondence
Subtract 254 from a number and add 329 to get 695. Find the number.
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
There are two cuboids with the same base. The base is 44 centimeters (cm) long and 35 centimeters (cm) wide. When the heights of the two cuboids are 7 centimeters (cm) and 3 centimeters (cm), find the sum of the volumes of the two cuboids.
15400
44 35 [OP_MUL] 7 3 [OP_ADD] [OP_MUL]
var_a = 44 var_b = 35 var_c = var_a * var_b var_d = 7 var_e = 3 var_f = var_d + var_e var_g = var_c * var_f print(int(var_g))
Comparison
In a garden, there are more roses than tulips, more tulips than cosmoses, and more cosmoses than sunflowers. If you are trying to equal the number of flowers per type by planting more flowers in the garden, which flower should be planted the most?
sunflowers
[OP_LIST_SOL] roses tulips cosmoses sunflowers [OP_LIST_EOL] [OP_LIST_SOL] roses tulips > tulips cosmoses > cosmoses sunflowers > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET]
var_a = 'roses' var_b = 'tulips' var_c = 'cosmoses' var_d = 'sunflowers' 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 = 'roses' var_f = 'tulips' var_g = '>' var_h = 'tulips' var_i = 'cosmoses' var_j = '>' var_k = 'cosmoses' var_l = 'sunflowers' var_m = '>' list_b= [] if "/" in str(var_m): var_m = eval(str(var_m)) list_b.append(var_m) if "/" in str(var_l): var_l = eval(str(var_l)) list_b.append(var_l) if "/" in str(var_k): var_k = eval(str(var_k)) list_b.append(var_k) if "/" in str(var_j): var_j = eval(str(var_j)) list_b.append(var_j) if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_n = len(list_c) var_o = list_c[var_n-1] print(var_o)
Possibility
You want to create a six-digit number by using 1, 4, and 0 twice. What is the difference between the largest number and the smallest possible number possible?
340956
[OP_LIST_SOL] 1 1 4 4 0 0 [OP_LIST_EOL] 6 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB]
var_a = 1 var_b = 1 var_c = 4 var_d = 4 var_e = 0 var_f = 0 list_a= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_g = 6 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_g)) 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_h = 1 list_c=list_b.copy() list_c.sort() var_i = list_c[-var_h] var_j = 1 list_d=list_b.copy() list_d.sort() var_k = list_d[var_j-1] var_l = var_i - var_k print(int(var_l))
Arithmetic calculation
Truck A can carry a crate weighing 63.45 kg (kg), and truck B can load a crate weighing 13.6 kg (kg). If there are 20 trucks each, find how many kilograms (kg) each truck can carry.
1541
63.45 20 [OP_MUL] 13.6 20 [OP_MUL] [OP_ADD]
var_a = 63.45 var_b = 20 var_c = var_a * var_b var_d = 13.6 var_e = 20 var_f = var_d * var_e var_g = var_c + var_f print(int(var_g))
Arithmetic calculation
I turned on the tap that produces 200 milliliters (ml) of water per hour for 24 hours. How many milliliters (ml) of water overflows if you fill this water in a 4000 milliliter (ml) water tank?
800
200 24 [OP_MUL] 4000 [OP_SUB] [OP_ABS]
var_a = 200 var_b = 24 var_c = var_a * var_b var_d = 4000 var_e = var_c - var_d var_f = abs(var_e) print(int(var_f))
Geometry
There is a planar figure of a rectangular parallelepiped measuring 8 centimeters (cm) wide, 5 centimeters (cm) long, and 10 centimeters (cm) high. What is the area, in square centimeters (cm2), of the planar figure of the cuboid?
340
8 5 [OP_MUL] 8 10 [OP_MUL] [OP_ADD] 5 10 [OP_MUL] [OP_ADD] 2 [OP_MUL]
var_a = 8 var_b = 5 var_c = var_a * var_b var_d = 8 var_e = 10 var_f = var_d * var_e var_g = var_c + var_f var_h = 5 var_i = 10 var_j = var_h * var_i var_k = var_g + var_j var_l = 2 var_m = var_k * var_l print(int(var_m))
Correspondence
When 72 and 48 were divided by a certain number, there was no remainder. What is the largest possible number?
24
72 48 [OP_GCD]
var_a = 72 var_b = 48 var_c = math.gcd(int(var_b), int(var_a)) print(int(var_c))
Correspondence
There is a three-digit and two-digit number subtraction equation 9A6 - BB=BBB. If A and B are two different numbers, find the value of A+B
15
9A6-BB=BBB A [OP_DIGIT_UNK_SOLVER] 9A6-BB=BBB B [OP_DIGIT_UNK_SOLVER] [OP_ADD]
var_a = '9A6-BB=BBB' 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 = '9A6-BB=BBB' 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 = var_c + var_f print(int(var_g))
Correspondence
Jihyae bought school supplies by the amount that is 200 won more than half of the money she had, saved 300 won more than half of the rest, and was left with 350 won. How much money did Jihyae have at first?
3000
350 300 [OP_ADD] 1 1/2 [OP_SUB] [OP_DIV] 200 [OP_ADD] 1 1/2 [OP_SUB] [OP_DIV]
var_a = 350 var_b = 300 var_c = var_a + var_b var_d = 1 var_e = 0.5 var_f = var_d - var_e var_g = var_c / var_f var_h = 200 var_i = var_g + var_h var_j = 1 var_k = 0.5 var_l = var_j - var_k var_m = var_i / var_l print(int(var_m))
Correspondence
When you divide a number by 9 what should be multiplied, the quotient is 25 and the remainder is 7. How much do you get when you calculate correctly?
2088
25 9 [OP_MUL] 7 [OP_ADD] 9 [OP_MUL]
var_a = 25 var_b = 9 var_c = var_a * var_b var_d = 7 var_e = var_c + var_d var_f = 9 var_g = var_e * var_f print(int(var_g))
Correspondence
There was a mistake in the calculation, multiplying the number by 5 and then adding 7 instead of multiplying the sum of the number and 5 by 7. Then, the wrong result came out as 27. Find the correct calculated value.
63
27 7 [OP_SUB] 5 [OP_DIV] 5 [OP_ADD] 7 [OP_MUL]
var_a = 27 var_b = 7 var_c = var_a - var_b var_d = 5 var_e = var_c / var_d var_f = 5 var_g = var_e + var_f var_h = 7 var_i = var_g * var_h print(int(var_i))
Geometry
Find the sum of the vertices of a pentagonal prism and a hexagonal prism.
22
5 2 [OP_MUL] 6 2 [OP_MUL] [OP_ADD]
var_a = 5 var_b = 2 var_c = var_a * var_b var_d = 6 var_e = 2 var_f = var_d * var_e var_g = var_c + var_f print(int(var_g))
Geometry
I took several coins of the same size and lined them up so that there were 8 coins on each side, making a square. If you place coins around the perimeter of this square to make a square with a side 1 greater, how many more coins are needed?
17
8 2 [OP_MUL] 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))
Possibility
Among the numbers 1, 3, and 7, how many are three digits which each digit is different and between 150 and 700?
3
[OP_LIST_SOL] 1 3 7 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 150 [OP_LIST_MORE_EQUAL] 700 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN]
var_a = 1 var_b = 3 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 = 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 = 150 list_c = [] for i in list_b: if i >= var_e: list_c.append(i) var_f = 700 list_d = [] for i in list_c: if i <= var_f: list_d.append(i) var_g = len(list_d) print(int(var_g))
Arithmetic calculation
There are three numbers 10, 11, and 12. Which number is the second largest?
11
[OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 2 [OP_LIST_MAX]
var_a = 10 var_b = 11 var_c = 12 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 2 list_b=list_a.copy() list_b.sort() var_e = list_b[-var_d] print(int(var_e))
Comparison
There are a total of 4 numbers: 0.8, 1/2, 0.5, 1/3. What is the smallest number or the number that is equal to 0.1 out of numbers that are greater than or equal to 0.1?
0.33
[OP_LIST_SOL] 0.8 1/2 0.5 1/3 [OP_LIST_EOL] 0.1 [OP_LIST_MORE_EQUAL] 1 [OP_LIST_MIN]
var_a = 0.8 var_b = 0.5 var_c = 0.5 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.1 list_b = [] for i in list_a: if i >= var_e: list_b.append(i) var_f = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[var_f-1] print('{:.2f}'.format(round(var_g+1e-10,2)))
Correspondence
When you multiply a particular number by 6, you get 72. Find the result of adding 8 to that particular number.
20
72 6 [OP_DIV] 8 [OP_ADD]
var_a = 72 var_b = 6 var_c = var_a / var_b var_d = 8 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
What is the third largest number in 1231, 2311, 2131, 1312, 1123, 3112?
2131
[OP_LIST_SOL] 1231 2311 2131 1312 1123 3112 [OP_LIST_EOL] 3 [OP_LIST_MAX]
var_a = 1231 var_b = 2311 var_c = 2131 var_d = 1312 var_e = 1123 var_f = 3112 list_a= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_g = 3 list_b=list_a.copy() list_b.sort() var_h = list_b[-var_g] print(int(var_h))
Geometry
There are 45 streetlights on one side of the road, spaced at 60 meters (m) intervals. What is the distance in kilometers (km) from the first street lamp to the last lamp?
2.64
60 1000 [OP_DIV] 45 1 [OP_SUB] [OP_MUL]
var_a = 60 var_b = 1000 var_c = var_a / var_b var_d = 45 var_e = 1 var_f = var_d - var_e var_g = var_c * var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Correspondence
Subtracting 10 from a number resulted in 15. What is the result when the number is added by 5?
30
15 10 [OP_ADD] 5 [OP_ADD]
var_a = 15 var_b = 10 var_c = var_a + var_b var_d = 5 var_e = var_c + var_d print(int(var_e))
Comparison
How many three-digit decimal numbers exist that are greater than 3.006 and less than 3.01?
3
0 9 1 [OP_LIST_ARANGE] 6 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 0 var_b = 9 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 6 list_b = [] for i in list_a: if i > var_d: list_b.append(i) var_e = len(list_b) print(int(var_e))
Arithmetic calculation
How many three-digit numbers are divisible by the numbers 5, 8, and 2?
22
100 999 1 [OP_LIST_ARANGE] 5 [OP_LIST_DIVISIBLE] 8 [OP_LIST_DIVISIBLE] 2 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 100 var_b = 999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 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 = len(list_d) print(int(var_g))
Arithmetic calculation
A toy train takes 3 minutes to travel 5 meters (m). A toy car can travel the same distance in 2 minutes. If the start line of the toy car is 20 meters (m) behind the train and both toys start at the same time, how many minutes will it be before the two toys meet?
24
20 5 2 [OP_DIV] 5 3 [OP_DIV] [OP_SUB] [OP_DIV]
var_a = 20 var_b = 5 var_c = 2 var_d = var_b / var_c var_e = 5 var_f = 3 var_g = var_e / var_f var_h = var_d - var_g var_i = var_a / var_h print(int(eval('{:.2f}'.format(round(var_i+1e-10,2)))))
Geometry
In a right triangle, if the hypotenuse is 17 and the non-hypotenuse has length 15, what is the length of the other side?
8
17 2 [OP_POW] 15 2 [OP_POW] [OP_SUB] 1/2 [OP_POW]
var_a = 17 var_b = 2 var_c = var_a ** var_b var_d = 15 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))
Comparison
Hyunwoo is 1.32 meters (m) tall, and Jinhee is 1.3 meters (m) tall. Who is taller?
Hyunwoo
[OP_LIST_SOL] Hyunwoo Jinhee [OP_LIST_EOL] [OP_LIST_SOL] 1.32 1.3 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Hyunwoo' var_b = 'Jinhee' 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.32 var_d = 1.3 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)
Correspondence
Jiho spent 1/2 of the money he had at the fish shop and spent 5,000 won more than 1/3 of the remaining money at the fruit shop. If the amount of money left is 5,000 won, how much money did Jiho initially have?
30000
5000 5000 [OP_ADD] 1 1/3 [OP_SUB] [OP_DIV] 1 1/2 [OP_SUB] [OP_DIV]
var_a = 5000 var_b = 5000 var_c = var_a + var_b var_d = 1 var_e = 0.3333333333333333 var_f = var_d - var_e var_g = var_c / var_f var_h = 1 var_i = 0.5 var_j = var_h - var_i var_k = var_g / var_j print(int(eval('{:.2f}'.format(round(var_k+1e-10,2)))))
Correspondence
Write down the correct number for A in 3+A=4.
1
4 3 [OP_SUB]
var_a = 4 var_b = 3 var_c = var_a - var_b print(int(var_c))
Correspondence
You want to divide 12 by some number. If the answer when you mistakenly subtract 42 is 30, what is the correct calculation result?
6
30 42 [OP_ADD] 12 [OP_DIV]
var_a = 30 var_b = 42 var_c = var_a + var_b var_d = 12 var_e = var_c / var_d print(int(var_e))
Correspondence
When 3+6AB=691, what number should go in A, where 6AB is a three-digit number?
8
3+6AB=691 A [OP_DIGIT_UNK_SOLVER]
var_a = '3+6AB=691' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Possibility
When 6 people A, B, C, D, E, F are lined up in a line, find the number of ways to put E and F next to each other.
240
[OP_LIST_SOL] A B C D E F [OP_LIST_EOL] [OP_LIST_SOL] A [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_LIST_SOL] E F [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_MUL]
var_a = 'A' var_b = 'B' var_c = 'C' var_d = 'D' var_e = 'E' var_f = 'F' list_a= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_g = 'A' list_b= [] if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) list_b.reverse() list_c = list(set(list_a) - set(list_b)) var_h = len(list_c) var_i = len(list_c) var_j = 1 var_h = int(var_h) var_i = int(var_i) for i, elem in enumerate(range(var_i)): var_j = var_j * (var_h-i) var_k = 'E' var_l = 'F' list_d= [] if "/" in str(var_l): var_l = eval(str(var_l)) list_d.append(var_l) if "/" in str(var_k): var_k = eval(str(var_k)) list_d.append(var_k) list_d.reverse() var_m = len(list_d) var_n = len(list_d) var_o = 1 var_m = int(var_m) var_n = int(var_n) for i, elem in enumerate(range(var_n)): var_o = var_o * (var_m-i) var_p = var_j * var_o print(int(var_p))
Arithmetic calculation
Giljun ran 1.05 kilometers (km), and Siyeon ran 460 meters (m) less than Giljun. How many kilometers did Siyeon run?
0.59
1.05 460 1000 [OP_DIV] [OP_SUB]
var_a = 1.05 var_b = 460 var_c = 1000 var_d = var_b / var_c var_e = var_a - var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
Bomin walked 2 kilometers (km) and 600 meters (m) today, and Yunshik walked 3700 meters (m). How many meters (m) did Bomin and Yoonshik walk today?
6300
2 1000 [OP_MUL] 600 [OP_ADD] 3700 [OP_ADD]
var_a = 2 var_b = 1000 var_c = var_a * var_b var_d = 600 var_e = var_c + var_d var_f = 3700 var_g = var_e + var_f print(int(var_g))
Comparison
Jungkook is standing on the 19th stair. Yoojeong is 8 steps above Jungkook, and Seokjin is 5 steps below Yoojeong. How many steps does Seokjin stand above Jungkook?
3
19 8 [OP_ADD] 5 [OP_SUB] 19 [OP_SUB]
var_a = 19 var_b = 8 var_c = var_a + var_b var_d = 5 var_e = var_c - var_d var_f = 19 var_g = var_e - var_f print(int(var_g))
Arithmetic calculation
Namjoon wants to divide the marbles into 6 boxes of 6 each. If Namjoon currently has 3 sets of 7 marbles, how many marbles are missing?
15
6 6 [OP_MUL] 7 3 [OP_MUL] [OP_SUB]
var_a = 6 var_b = 6 var_c = var_a * var_b var_d = 7 var_e = 3 var_f = var_d * var_e var_g = var_c - var_f print(int(var_g))
Possibility
Minsu tries to put 2 Korean and 2 English workbooks in a row on the bookshelf. How many ways are there to put English workbooks side by side?
12
2 1 [OP_ADD] 2 1 [OP_ADD] [OP_PERM] 2 [OP_MUL]
var_a = 2 var_b = 1 var_c = var_a + var_b var_d = 2 var_e = 1 var_f = var_d + var_e var_g = 1 var_c = int(var_c) var_f = int(var_f) for i, elem in enumerate(range(var_f)): var_g = var_g * (var_c-i) var_h = 2 var_i = var_g * var_h print(int(var_i))
Arithmetic calculation
The distance between Seunghun's house and school is 1.05 kilometers (km), and the distance between Youngjun's house and school is 460 meters (m) closer than the distance between Seunghun's house and school. How many kilometers (km) is the distance between Youngjun's house and the school?
0.59
1.05 460 1000 [OP_DIV] [OP_SUB]
var_a = 1.05 var_b = 460 var_c = 1000 var_d = var_b / var_c var_e = var_a - var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Possibility
Using 3 of 4, 5, 8, and 9, what is the second smallest number whose tens place is 5?
459
[OP_LIST_SOL] 4 5 8 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 10 5 [OP_LIST_SEARCH_FIXED_DIGIT] 2 [OP_LIST_MIN]
var_a = 4 var_b = 5 var_c = 8 var_d = 9 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 10 var_g = 5 list_c = [] var_f = int(var_f) var_g = int(var_g) for i in list_b: i = int(i) if (i//var_f)%10 == var_g: list_c.append(i) var_h = 2 list_d=list_c.copy() list_d.sort() var_i = list_d[var_h-1] print(int(var_i))
Arithmetic calculation
Seokgi bought bananas for 800 won and kiwis for 400 won, and he bought 18 bananas and kiwis in total. He used 2,800 won less than 4/5 of the 16,000 won he had. Find how much money it cost to buy bananas.
5600
16000 4/5 [OP_MUL] 2800 [OP_SUB] 400 18 [OP_MUL] [OP_SUB] 800 400 [OP_SUB] [OP_DIV] 800 [OP_MUL]
var_a = 16000 var_b = 0.8 var_c = var_a * var_b var_d = 2800 var_e = var_c - var_d var_f = 400 var_g = 18 var_h = var_f * var_g var_i = var_e - var_h var_j = 800 var_k = 400 var_l = var_j - var_k var_m = var_i / var_l var_n = 800 var_o = var_m * var_n print(int(var_o))
Comparison
There are 4 buses A, B, C, and D. Bus D has the fewest passengers, and bus B has more passengers than bus A, and bus A has more passengers than bus C. Which bus has the most passengers?
B
[OP_LIST_SOL] A B C D [OP_LIST_EOL] [OP_LIST_SOL] A C > B A > D A < D B < D C < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'A' var_b = 'B' var_c = 'C' var_d = 'D' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 'A' var_f = 'C' var_g = '>' var_h = 'B' var_i = 'A' var_j = '>' var_k = 'D' var_l = 'A' var_m = '<' var_n = 'D' var_o = 'B' var_p = '<' var_q = 'D' var_r = 'C' var_s = '<' list_b= [] if "/" in str(var_s): var_s = eval(str(var_s)) list_b.append(var_s) if "/" in str(var_r): var_r = eval(str(var_r)) list_b.append(var_r) if "/" in str(var_q): var_q = eval(str(var_q)) list_b.append(var_q) if "/" in str(var_p): var_p = eval(str(var_p)) list_b.append(var_p) if "/" in str(var_o): var_o = eval(str(var_o)) list_b.append(var_o) if "/" in str(var_n): var_n = eval(str(var_n)) list_b.append(var_n) if "/" in str(var_m): var_m = eval(str(var_m)) list_b.append(var_m) if "/" in str(var_l): var_l = eval(str(var_l)) list_b.append(var_l) if "/" in str(var_k): var_k = eval(str(var_k)) list_b.append(var_k) if "/" in str(var_j): var_j = eval(str(var_j)) list_b.append(var_j) if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_t = 1 var_u = list_c[var_t-1] print(var_u)
Arithmetic calculation
The sum of 3 consecutive even numbers is 18 greater than the smallest of the 3 even numbers. Write the largest of the three even numbers.
10
18 2 1 [OP_MUL] 2 2 [OP_MUL] [OP_ADD] [OP_SUB] 3 1 [OP_SUB] [OP_DIV] 2 2 [OP_MUL] [OP_ADD]
var_a = 18 var_b = 2 var_c = 1 var_d = var_b * var_c var_e = 2 var_f = 2 var_g = var_e * var_f var_h = var_d + var_g var_i = var_a - var_h var_j = 3 var_k = 1 var_l = var_j - var_k var_m = var_i / var_l var_n = 2 var_o = 2 var_p = var_n * var_o var_q = var_m + var_p print(int(var_q))
Comparison
There is a square, equilateral-triangle, and circle. The length of a side of a square is 7 centimeters (cm), the length of a side of an equilateral-triangle is 9 centimeters (cm), and the radius of a circle is 5 centimeters (cm). Which shape has the longest perimeter when the circumference of a circle is 3?
circle
[OP_LIST_SOL] square equilateral-triangle circle [OP_LIST_EOL] [OP_LIST_SOL] 7 4 [OP_MUL] 9 3 [OP_MUL] 5 3 2 [OP_MUL] [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'square' var_b = 'equilateral-triangle' var_c = 'circle' 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 = 7 var_e = 4 var_f = var_d * var_e var_g = 9 var_h = 3 var_i = var_g * var_h var_j = 5 var_k = 3 var_l = 2 var_m = var_k * var_l var_n = var_j * var_m list_b= [] if "/" in str(var_n): var_n = eval(str(var_n)) list_b.append(var_n) if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) list_b.reverse() var_o = 1 list_c=list_b.copy() list_c.sort() var_p = list_c[-var_o] var_q = list_b.index(var_p)+1 var_r = list_a[var_q-1] print(var_r)
Possibility
You are trying to put 4 balls of different colors into 2 baskets. At this time, the ball may not be put in the basket. How many ways are there for you to put the ball into the basket?
16
2 4 [OP_POW]
var_a = 2 var_b = 4 var_c = var_a ** var_b print(int(var_c))
Possibility
Three male students and three female students sit on six chairs in a row. Figure out the probability of 3 female students sitting in a row.
144
3 3 [OP_ADD] 3 1 [OP_SUB] [OP_SUB] 3 3 [OP_ADD] 3 1 [OP_SUB] [OP_SUB] [OP_PERM] 3 3 [OP_PERM] [OP_MUL]
var_a = 3 var_b = 3 var_c = var_a + var_b var_d = 3 var_e = 1 var_f = var_d - var_e var_g = var_c - var_f var_h = 3 var_i = 3 var_j = var_h + var_i var_k = 3 var_l = 1 var_m = var_k - var_l var_n = var_j - var_m var_o = 1 var_g = int(var_g) var_n = int(var_n) for i, elem in enumerate(range(var_n)): var_o = var_o * (var_g-i) var_p = 3 var_q = 3 var_r = 1 var_p = int(var_p) var_q = int(var_q) for i, elem in enumerate(range(var_q)): var_r = var_r * (var_p-i) var_s = var_o * var_r print(int(var_s))
Correspondence
Jisoo had 6,000 won and she bought a ballpoint pen for 3,200 won, an eraser for 1,000 won, and candy for 500 won. Assuming that all remaining money is saved, find the amount saved.
1300
6000 3200 [OP_SUB] 1000 [OP_SUB] 500 [OP_SUB]
var_a = 6000 var_b = 3200 var_c = var_a - var_b var_d = 1000 var_e = var_c - var_d var_f = 500 var_g = var_e - var_f print(int(var_g))
Arithmetic calculation
One stroke is 12 pencils. Namjoon had two strokes of a pencil. Namjoon gave some pencils to Yoongi, and there were 15 left. How many pencils did you give Yoongi?
9
12 2 [OP_MUL] 15 [OP_SUB]
var_a = 12 var_b = 2 var_c = var_a * var_b var_d = 15 var_e = var_c - var_d print(int(var_e))
Comparison
Seokjin placed the 8th in the swimming competition. How many people got in the finish line faster than Seokjin?
7
8 1 [OP_SUB]
var_a = 8 var_b = 1 var_c = var_a - var_b print(int(var_c))
Arithmetic calculation
If the elements of set A are 1/2, 1/3, and 1/5, and the elements of set B are 0.2, 0.4, 0.5, and 0.7, find the number of elements in set A minus set B.
1
[OP_LIST_SOL] 1/2 1/3 1/5 [OP_LIST_EOL] [OP_LIST_SOL] 0.2 0.4 0.5 0.7 [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN]
var_a = 0.5 var_b = 0.3333333333333333 var_c = 0.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 = 0.2 var_e = 0.4 var_f = 0.5 var_g = 0.7 list_b= [] if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) 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() list_c = list(set(list_a) - set(list_b)) var_h = len(list_c) print(int(var_h))
Correspondence
A number needs to be multiplied by 69, but when you mistakenly divide a number by 96, the quotient is 5 and the remainder is 17. What is the correct answer?
34293
5 96 [OP_MUL] 17 [OP_ADD] 69 [OP_MUL]
var_a = 5 var_b = 96 var_c = var_a * var_b var_d = 17 var_e = var_c + var_d var_f = 69 var_g = var_e * var_f print(int(var_g))
Comparison
Hoseok and 16 of his friends are standing in a line. If 8 people are standing to the right of Hoseok, how many people are standing to the left of Hoseok?
7
16 8 [OP_SUB] 1 [OP_SUB]
var_a = 16 var_b = 8 var_c = var_a - var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Correspondence
When you add a number to 305 and divide it by 16, you get 31. Find the number.
191
31 16 [OP_MUL] 305 [OP_SUB]
var_a = 31 var_b = 16 var_c = var_a * var_b var_d = 305 var_e = var_c - var_d print(int(var_e))