category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Correspondence
Dividing a number by 8, adding 8, subtracting 30, and multiplying by 6 equals 12. Find the number.
192
12 6 [OP_DIV] 30 [OP_ADD] 8 [OP_SUB] 8 [OP_MUL]
var_a = 12 var_b = 6 var_c = var_a / var_b var_d = 30 var_e = var_c + var_d var_f = 8 var_g = var_e - var_f var_h = 8 var_i = var_g * var_h print(int(var_i))
Comparison
There are two circles of A and B. The area of A is 198.4 square centimeters (cm2), and the area of B is 251.1 square centimeters (cm2). On the condition that pi is calculated as 3.1, what is the number of centimeters (cm) when you subtract the circumference of A from the circumference of B, including the decimal point?
6.2
198.4 3.1 [OP_DIV] 1 2 [OP_DIV] [OP_POW] 2 [OP_MUL] 3.1 [OP_MUL] 251.1 3.1 [OP_DIV] 1 2 [OP_DIV] [OP_POW] 2 [OP_MUL] 3.1 [OP_MUL] [OP_SUB] [OP_ABS]
var_a = 198.4 var_b = 3.1 var_c = var_a / var_b var_d = 1 var_e = 2 var_f = var_d / var_e var_g = var_c ** var_f var_h = 2 var_i = var_g * var_h var_j = 3.1 var_k = var_i * var_j var_l = 251.1 var_m = 3.1 var_n = var_l / var_m var_o = 1 var_p = 2 var_q = var_o / var_p var_r = var_n ** var_q var_s = 2 var_t = var_r * var_s var_u = 3.1 var_v = var_t * var_u var_w = var_k - var_v var_x = abs(var_w) print('{:.2f}'.format(round(var_x+1e-10,2)))
Arithmetic calculation
Find the sum of the sum of all even numbers and the sum of all odd numbers from 1 to 50.
1275
1 50 [OP_LIST_EVEN] [OP_LIST_SUM] 1 50 [OP_LIST_ODD] [OP_LIST_SUM] [OP_ADD]
var_a = 1 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) list_a = [float(i) for i in list_a] var_c = sum(list_a) var_d = 1 var_e = 50 list_b = [] if var_d%2==0: for i in range(var_d+1, var_e+1, 2): list_b.append(i) else: for i in range(var_d, var_e+1, 2): list_b.append(i) list_b = [float(i) for i in list_b] var_f = sum(list_b) var_g = var_c + var_f print(int(var_g))
Arithmetic calculation
What is the smallest three-digit number that is divisible by the numbers 4 and 5?
100
100 999 1 [OP_LIST_ARANGE] 4 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN]
var_a = 100 var_b = 999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 4 list_b = [] var_d = int(var_d) for i in list_a: i = int(i) if i % var_d == 0: list_b.append(i) var_e = 5 list_c = [] var_e = int(var_e) for i in list_b: i = int(i) if i % var_e == 0: list_c.append(i) var_f = 1 list_d=list_c.copy() list_d.sort() var_g = list_d[var_f-1] print(int(var_g))
Comparison
There are four numbers 0.8, 1/2, 0.9, 1/3. How many numbers are greater than 3?
0
[OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 3 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 0.8 var_b = 0.5 var_c = 0.9 var_d = 0.3333333333333333 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 list_b = [] for i in list_a: if i > var_e: list_b.append(i) var_f = len(list_b) print(int(var_f))
Arithmetic calculation
You can make 60 toys in 5 days. How many days will it take to make 540?
45
540 60 [OP_DIV] 5 [OP_MUL]
var_a = 540 var_b = 60 var_c = var_a / var_b var_d = 5 var_e = var_c * var_d print(int(var_e))
Possibility
You are going to use 2 of 4 number cards 3, 5, 6, and 7 to create a two-digit number. How many multiples of 7 can you make?
3
[OP_LIST_SOL] 3 5 6 7 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 7 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 3 var_b = 5 var_c = 6 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 = 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 = 7 list_c = [] var_f = int(var_f) for i in list_b: i = int(i) if i % var_f == 0: list_c.append(i) var_g = len(list_c) print(int(var_g))
Comparison
Minyoung jumped rope 52 times yesterday, and today she jumped 19 fewer times than yesterday. Yoojung jumped rope 18 times yesterday, and today she jumped 21 times more than yesterday. Who jumped more ropes today?
Yoojung
[OP_LIST_SOL] Minyoung Yoojung [OP_LIST_EOL] [OP_LIST_SOL] 52 19 [OP_SUB] 18 21 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Minyoung' var_b = 'Yoojung' 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 = 52 var_d = 19 var_e = var_c - var_d var_f = 18 var_g = 21 var_h = var_f + var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Arithmetic calculation
The average score for Korean, English, social studies, and science is 90 points, and when math scores are included, the average score drops by 3 points. What is math score?
75
90 3 [OP_SUB] 5 [OP_MUL] 90 4 [OP_MUL] [OP_SUB]
var_a = 90 var_b = 3 var_c = var_a - var_b var_d = 5 var_e = var_c * var_d var_f = 90 var_g = 4 var_h = var_f * var_g var_i = var_e - var_h print(int(var_i))
Arithmetic calculation
Namjoon took the test of 3 subjects: Korean, Mathematics, and English. If his math score is 100, his English 95, and the average score of 3 subjects is 95, what score did Namjoon's get in his Korean test?
90
95 3 [OP_MUL] 100 [OP_SUB] 95 [OP_SUB]
var_a = 95 var_b = 3 var_c = var_a * var_b var_d = 100 var_e = var_c - var_d var_f = 95 var_g = var_e - var_f print(int(var_g))
Correspondence
If A and B are different numbers and A2-5A=B3 is true, find the value of AxB.
27
A2-5A=B3 A [OP_DIGIT_UNK_SOLVER] A2-5A=B3 B [OP_DIGIT_UNK_SOLVER] [OP_MUL]
var_a = 'A2-5A=B3' 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 = 'A2-5A=B3' 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))
Possibility
A three-digit number was created by choosing three unequal numbers from 0 to 4. How many of these numbers have a remainder of 0 when divided by 2, 3, or 5?
4
[OP_LIST_SOL] 0 1 2 3 4 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 2 3 [OP_LCM] 5 [OP_LCM] [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 2 var_d = 3 var_e = 4 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 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 = 2 var_h = 3 var_i = var_h * var_g / math.gcd(int(var_h), int(var_g)) var_j = 5 var_k = var_j * var_i / math.gcd(int(var_j), int(var_i)) list_c = [] var_k = int(var_k) for i in list_b: i = int(i) if i % var_k == 0: list_c.append(i) var_l = len(list_c) print(int(var_l))
Arithmetic calculation
The total number of students at Yerin's school is 32 fewer than eight times the number of 5th graders, and there are 10 more 5th grade boys than 5th grade girls. If the total number of students in Yerin's school is 1152, how many female students are there in the 5th grade?
69
1152 32 [OP_ADD] 8 [OP_DIV] 10 [OP_SUB] 2 [OP_DIV]
var_a = 1152 var_b = 32 var_c = var_a + var_b var_d = 8 var_e = var_c / var_d var_f = 10 var_g = var_e - var_f var_h = 2 var_i = var_g / var_h print(int(var_i))
Arithmetic calculation
Find the sum of three-digit even natural numbers.
247050
100 999 [OP_LIST_EVEN] [OP_LIST_SUM]
var_a = 100 var_b = 999 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) list_a = [float(i) for i in list_a] var_c = sum(list_a) print(int(var_c))
Possibility
Gwangho has four number magnets of 2, 6, 0, and 7. When playing the game of making three-digit numbers by choosing three of those magnets, find the difference between the third largest number and the third smallest number that he can make.
466
[OP_LIST_SOL] 2 6 0 7 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 3 [OP_LIST_MAX] 3 [OP_LIST_MIN] [OP_SUB]
var_a = 2 var_b = 6 var_c = 0 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 = 3 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] var_h = 3 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))
Arithmetic calculation
Mingi solves 256 questions in 4 hours. If Somin can solve 111 questions in 3 hours, how many questions did Mingi and Somin solve in 3 hours?
303
256 3 4 [OP_DIV] [OP_MUL] 111 [OP_ADD]
var_a = 256 var_b = 3 var_c = 4 var_d = var_b / var_c var_e = var_a * var_d var_f = 111 var_g = var_e + var_f print(int(var_g))
Arithmetic calculation
There are 58 cucumbers in the mart. There are 24 fewer carrots than cucumbers, and 49 more tomatoes than cucumbers. The number of radishes equals the number of carrots. How many cucumbers, carrots, tomatoes, and radishes are in the mart in total?
233
58 58 24 [OP_SUB] [OP_ADD] 58 49 [OP_ADD] [OP_ADD] 58 24 [OP_SUB] [OP_ADD]
var_a = 58 var_b = 58 var_c = 24 var_d = var_b - var_c var_e = var_a + var_d var_f = 58 var_g = 49 var_h = var_f + var_g var_i = var_e + var_h var_j = 58 var_k = 24 var_l = var_j - var_k var_m = var_i + var_l print(int(var_m))
Arithmetic calculation
Yoojung is 5 years old this year. In the year when Yoojung turns 10, her grandmother is 60. Find what age is her grandmother this year.
55
60 10 5 [OP_SUB] [OP_SUB]
var_a = 60 var_b = 10 var_c = 5 var_d = var_b - var_c var_e = var_a - var_d print(int(var_e))
Geometry
Find the value of adding 3 to the number of diagonals in the rectangle.
5
4 4 3 [OP_SUB] [OP_MUL] 2 [OP_DIV] 3 [OP_ADD]
var_a = 4 var_b = 4 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 = 3 var_i = var_g + var_h print(int(var_i))
Possibility
You want to arrange 4 identical ballpoint pens and 1 mechanical pencil in a line. What is the number of cases to arrange them?
5
4 1 [OP_ADD]
var_a = 4 var_b = 1 var_c = var_a + var_b print(int(var_c))
Correspondence
The eight-digit number 757AB384 is divisible by 357. Get A.
5
757AB384 [OP_GEN_POSSIBLE_LIST] 357 [OP_LIST_DIVISIBLE] 757AB384 B [OP_LIST_FIND_UNK]
var_a = '757AB384' ans_dict = dict() var_a = str(var_a) list_a = [] variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 0 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) if len(var_a) == len(str(int(temp))): new_elem = int(temp) list_a.append(new_elem) var_b = 357 list_b = [] var_b = int(var_b) for i in list_a: i = int(i) if i % var_b == 0: list_b.append(i) var_c = '757AB384' var_d = 'B' var_c = str(var_c) var_d = str(var_d) unk_idx = var_c.index(var_d) var_e = 0 for elem in list_b: elem = str(elem) var_e = int(elem[unk_idx]) print(int(var_e))
Possibility
In Hyunseung's closet, there are 3 types of tops, 2 types of bottoms, and 5 types of shoes. How many types of tops, bottoms, and shoes can Hyunseung wear?
30
3 2 [OP_MUL] 5 [OP_MUL]
var_a = 3 var_b = 2 var_c = var_a * var_b var_d = 5 var_e = var_c * var_d print(int(var_e))
Arithmetic calculation
The money Minyoung had was enough to buy A pieces of candy worth 90 won. If he bought A pieces of 60 won candies instead of 90 won candies, and he had 270 won left, how much money does Minyoung have at first?
810
270 90 60 [OP_SUB] [OP_DIV] 90 [OP_MUL]
var_a = 270 var_b = 90 var_c = 60 var_d = var_b - var_c var_e = var_a / var_d var_f = 90 var_g = var_e * var_f print(int(var_g))
Arithmetic calculation
There is 13/4 liter (L) of water in the water tank. From this water tank, 12/5 liter (L) was scooped out and 11/6 liter (L) was put back in. Find how many liters (L) of water are left in the water tank.
2.68
13/4 12/5 [OP_SUB] 11/6 [OP_ADD]
var_a = 3.25 var_b = 2.4 var_c = var_a - var_b var_d = 1.8333333333333333 var_e = var_c + var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Geometry
A regular hexagon with an area of 54.3 square centimeters (cm2) is divided into 6 equal parts. How many square centimeters (cm2) is the area of one of the 6 equal parts?
9.05
54.3 6 [OP_DIV]
var_a = 54.3 var_b = 6 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
A number multiplied by 2 minus 3 equals 7. After finding the number, find the remainder when dividing the number by 2.
1
7 3 [OP_ADD] 2 [OP_DIV] 2 [OP_MOD]
var_a = 7 var_b = 3 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))
Arithmetic calculation
There are three numbers: 3/8, 0.125, and 9.51. What is the sum of all three numbers?
10.01
3/8 0.125 [OP_ADD] 9.51 [OP_ADD]
var_a = 0.375 var_b = 0.125 var_c = var_a + var_b var_d = 9.51 var_e = var_c + var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
There is a machine that makes 32 toys per hour. Find how many boxes are needed to put 4 of the toys the machine made for 3 hours into each box.
24
32 3 [OP_MUL] 4 [OP_DIV]
var_a = 32 var_b = 3 var_c = var_a * var_b var_d = 4 var_e = var_c / var_d print(int(var_e))
Correspondence
A is 680. A is greater than B by 157. B is greater than C by 185. Find what number C is.
338
680 157 [OP_SUB] 185 [OP_SUB]
var_a = 680 var_b = 157 var_c = var_a - var_b var_d = 185 var_e = var_c - var_d print(int(var_e))
Correspondence
The number of students entering an art school is the same every year, and there are more female students than male students. This year, compared to last year, 16 more female students entered the school, and 64 more female students enrolled this year than male students enrolled. Find how many more female students entered school than male students last year.
32
64 16 [OP_SUB] 16 [OP_SUB]
var_a = 64 var_b = 16 var_c = var_a - var_b var_d = 16 var_e = var_c - var_d print(int(var_e))
Geometry
A coin has a diameter of 100 millimeters (mm) and a circumference of 314 millimeters (mm). How many times bigger is the circumference compared to the diameter of this coin?
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)))
Arithmetic calculation
There are 7 bundles of 10 pencils each. There are 3 more colored pencils than pencils. Find how many colored pencils there are.
73
7 10 [OP_MUL] 3 [OP_ADD]
var_a = 7 var_b = 10 var_c = var_a * var_b var_d = 3 var_e = var_c + var_d print(int(var_e))
Correspondence
There are three natural numbers A, B and C. When A is divided by 9, the quotient is B and the remainder is C. In this expression, the remainder is 3 less than the quotient. Find the smallest number that can fit A.
27
9 3 [OP_MUL] 0 [OP_ADD]
var_a = 9 var_b = 3 var_c = var_a * var_b var_d = 0 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
There were 8 rabbits. The next day, 5 new rabbits were born. How many rabbits are there now in total?
13
8 5 [OP_ADD]
var_a = 8 var_b = 5 var_c = var_a + var_b print(int(var_c))
Correspondence
I need to subtract 4 from a certain number, but I mistakenly subtracted 5 and it became 4. Find this certain number.
9
4 5 [OP_ADD]
var_a = 4 var_b = 5 var_c = var_a + var_b print(int(var_c))
Comparison
Jungkook collected the quotient of 6 divided by 3, Yoongi collected 4, and Yuna collected 5. Who collected the smallest number?
Jungkook
[OP_LIST_SOL] Jungkook Yoongi Yuna [OP_LIST_EOL] [OP_LIST_SOL] 6 3 [OP_FDIV] 4 5 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jungkook' var_b = 'Yoongi' var_c = 'Yuna' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 6 var_e = 3 var_f = var_d // var_e var_g = 4 var_h = 5 list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[var_i-1] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Comparison
There are 20 rabbits in a row. How many rabbits are there between the 13th from the left and the 19th from the left?
5
19 13 [OP_SUB] 1 [OP_SUB]
var_a = 19 var_b = 13 var_c = var_a - var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
Kyu-yeon and Na-eun are going to share 12 liters (L) and 400 milliliters (㎖) of apple juice for a week. If Kyu-yeon drank 2 liters (L) and 600 meters (m) liters (L) more than Na-eun when comparing the amount of apple juice she drank in a week, how many liters (L) of apple juice did Kyu-yeon drink?
7.5
12 400 1000 [OP_DIV] [OP_ADD] 2 600 1000 [OP_DIV] [OP_ADD] [OP_ADD] 2 [OP_DIV]
var_a = 12 var_b = 400 var_c = 1000 var_d = var_b / var_c var_e = var_a + var_d var_f = 2 var_g = 600 var_h = 1000 var_i = var_g / var_h var_j = var_f + var_i var_k = var_e + var_j var_l = 2 var_m = var_k / var_l print('{:.2f}'.format(round(var_m+1e-10,2)))
Possibility
There are number cards from 1 to 9. If you make a 3-digit natural number by picking it by allowing duplicates, find how many possible numbers there are.
729
1 9 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PRODUCT] [OP_LIST_LEN]
var_a = 1 var_b = 9 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = len(list_b) print(int(var_e))
Geometry
When you make a square by arranging 12 beads of the same size, 12 by 12 vertically and horizontally, find the number of beads placed around the perimeter.
44
12 2 [OP_SUB] 4 [OP_MUL] 4 [OP_ADD]
var_a = 12 var_b = 2 var_c = var_a - var_b var_d = 4 var_e = var_c * var_d var_f = 4 var_g = var_e + var_f print(int(var_g))
Arithmetic calculation
Pillars are embedded at intervals of 30 meters (m) along the circular track. If the length of the circular track is 1 kilometer (km) and 200 meters (m), how many poles are there?
40
1 1000 [OP_MUL] 200 [OP_ADD] 30 [OP_DIV]
var_a = 1 var_b = 1000 var_c = var_a * var_b var_d = 200 var_e = var_c + var_d var_f = 30 var_g = var_e / var_f print(int(var_g))
Possibility
How many different ways can father, mother, and Hoseok stand side by side?
6
[OP_LIST_SOL] father mother Hoseok [OP_LIST_EOL] [OP_LIST_LEN] 3 [OP_PERM]
var_a = 'father' var_b = 'mother' var_c = 'Hoseok' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = len(list_a) var_e = 3 var_f = 1 var_d = int(var_d) var_e = int(var_e) for i, elem in enumerate(range(var_e)): var_f = var_f * (var_d-i) print(int(var_f))
Correspondence
76 is the result of subtracting 29 from and adding 64 to a particular number. What is that particular number?
41
76 64 [OP_SUB] 29 [OP_ADD]
var_a = 76 var_b = 64 var_c = var_a - var_b var_d = 29 var_e = var_c + var_d print(int(var_e))
Correspondence
Seung-hyeon gave Su-yeon 2 pieces of pizza, and Seung-hyeon had 5 more pieces of pizza than Su-yeon had. Find how many more pieces Seung-hyeon had before giving them.
9
5 2 [OP_ADD] 2 [OP_ADD]
var_a = 5 var_b = 2 var_c = var_a + var_b var_d = 2 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
Find the two-digit number from 2 to 56.
47
10 56 1 [OP_LIST_ARANGE] [OP_LIST_LEN]
var_a = 10 var_b = 56 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))
Correspondence
Rounding down the number A567 to the nearest tens gives 2560. What is A?
2
A567 [OP_GEN_POSSIBLE_LIST] 2560 [OP_LIST_MORE_EQUAL] 2560 10 [OP_ADD] [OP_LIST_LESS] A567 A [OP_LIST_FIND_UNK]
var_a = 'A567' 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 = 2560 list_b = [] for i in list_a: if i >= var_b: list_b.append(i) var_c = 2560 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 = 'A567' var_g = 'A' var_f = str(var_f) var_g = str(var_g) unk_idx = var_f.index(var_g) var_h = 0 for elem in list_c: elem = str(elem) var_h = int(elem[unk_idx]) print(int(var_h))
Geometry
You made a round loop by gluing twelve sheets of paper tape that are each 18 centimeters (cm) long. If they are overlapped by the same length and the shape has a perimeter of 210 centimeters (cm), how many millimeters (mm) are the overlapped parts?
5
18 12 [OP_MUL] 210 [OP_SUB] 12 [OP_DIV] 10 [OP_MUL]
var_a = 18 var_b = 12 var_c = var_a * var_b var_d = 210 var_e = var_c - var_d var_f = 12 var_g = var_e / var_f var_h = 10 var_i = var_g * var_h print(int(var_i))
Correspondence
Subtract a number from 48, multiply it by 4, subtract 26, and divide it by 2. Then, the result is 37. Find the number.
23
48 37 2 [OP_MUL] 26 [OP_ADD] 4 [OP_DIV] [OP_SUB]
var_a = 48 var_b = 37 var_c = 2 var_d = var_b * var_c var_e = 26 var_f = var_d + var_e var_g = 4 var_h = var_f / var_g var_i = var_a - var_h print(int(var_i))
Comparison
Which number is greater, 70 or 68?
70
[OP_LIST_SOL] 70 68 [OP_LIST_EOL] 1 [OP_LIST_MAX]
var_a = 70 var_b = 68 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 list_b=list_a.copy() list_b.sort() var_d = list_b[-var_c] print(int(var_d))
Arithmetic calculation
There are 6 cucumbers and 8 tomatoes on the farm. There are also 2 apples and 4 bananas. Find the number of vegetables on the farm minus the number of fruits.
8
6 8 [OP_ADD] 2 4 [OP_ADD] [OP_SUB]
var_a = 6 var_b = 8 var_c = var_a + var_b var_d = 2 var_e = 4 var_f = var_d + var_e var_g = var_c - var_f print(int(var_g))
Correspondence
When you add 3 to a number, you get 6. What number is it when you add 5 to the number?
8
6 3 [OP_SUB] 5 [OP_ADD]
var_a = 6 var_b = 3 var_c = var_a - var_b var_d = 5 var_e = var_c + var_d print(int(var_e))
Comparison
The distance from Bogyeom's house to Haneul's house is 150 meters (m) farther than 3 kilometers (km), and the distance to Seongju's house is 3096 meters (m). Of the two friends, Haneul and Seongju, who lives farther away from Bogyeom?
Haneul
[OP_LIST_SOL] Haneul Seongju [OP_LIST_EOL] [OP_LIST_SOL] 3 1000 [OP_MUL] 150 [OP_ADD] 3096 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Haneul' var_b = 'Seongju' 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 = 3 var_d = 1000 var_e = var_c * var_d var_f = 150 var_g = var_e + var_f var_h = 3096 list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Comparison
Nine people stand in a line in ascending order according to their heights. Hoseok is third from the front, and Yuna is 2 position before Hoseok. If you line them up again in descending order, in what position will Yuna be? Answer in ordinal number.
9
9 3 [OP_SUB] 2 [OP_ADD] 1 [OP_ADD]
var_a = 9 var_b = 3 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))
Comparison
There is a regular-pentagon with a length of 7 centimeters (cm) on one side and a regular-hexagon with a length of 6 centimeters (cm) on one side. Which shape has the greater perimeter?
regular-hexagon
[OP_LIST_SOL] regular-hexagon regular-pentagon [OP_LIST_EOL] [OP_LIST_SOL] 6 6 [OP_MUL] 7 5 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'regular-hexagon' var_b = 'regular-pentagon' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 6 var_d = 6 var_e = var_c * var_d var_f = 7 var_g = 5 var_h = var_f * var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Correspondence
When I wrongly multiplied a number by 12 that should actually be divided by 12, I got 84.6. Find out how much it is if you calculate it correctly.
0.59
84.6 12 [OP_DIV] 12 [OP_DIV]
var_a = 84.6 var_b = 12 var_c = var_a / var_b var_d = 12 var_e = var_c / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
If an elevator starts at 120 meters (m) above the ground and descends at a speed of 4 meters (m) per second without stopping, find how many seconds after departure it will reach 20 meters (m) above the ground.
25
120 20 [OP_SUB] 4 [OP_DIV]
var_a = 120 var_b = 20 var_c = var_a - var_b var_d = 4 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
The chicken laid 30 eggs today and 19 eggs yesterday. How many eggs did it lay in total?
49
30 19 [OP_ADD]
var_a = 30 var_b = 19 var_c = var_a + var_b print(int(var_c))
Correspondence
At Seoul Elementary School, milk is distributed equally to the students, but when milk was distributed to 6 classes that should have been distributed to 8 classes, 124 packs were given to each class and 4 packs left over. Calculate how many milks are left if divided normally.
4
124 6 [OP_MUL] 4 [OP_ADD] 8 [OP_MOD]
var_a = 124 var_b = 6 var_c = var_a * var_b var_d = 4 var_e = var_c + var_d var_f = 8 var_g = var_e % var_f print(int(var_g))
Possibility
What is the largest minus the smallest six-digit number that can be formed using 1, 4, and 0 twice?
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))
Correspondence
If you divide a number by 10, the result is 6. Find the exact result of subtracting 15 from the number.
45
6 10 [OP_MUL] 15 [OP_SUB]
var_a = 6 var_b = 10 var_c = var_a * var_b var_d = 15 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
When Minhyuk asked Kihyun's math test score, Kihyun answered it would be 90 if he rounded it off to 10 digits. What is the biggest number possible with Kihyun's math score?
94
[OP_LIST_SOL] 9 A [OP_LIST_EOL] [OP_LIST2NUM] [OP_GEN_POSSIBLE_LIST] 90 5 [OP_ADD] [OP_LIST_LESS] 1 [OP_LIST_MAX]
var_a = 9 var_b = 'A' 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="" for i in list_a: i = str(i) var_c = var_c + i ans_dict = dict() var_c = str(var_c) list_b = [] 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] = 0 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])) if len(var_c) == len(str(int(temp))): new_elem = int(temp) list_b.append(new_elem) var_d = 90 var_e = 5 var_f = var_d + var_e list_c = [] for i in list_b: if i < var_f: list_c.append(i) var_g = 1 list_d=list_c.copy() list_d.sort() var_h = list_d[-var_g] print(int(var_h))
Possibility
You can place a magnet with the natural numbers 6 and 3 on it, one in the tens place and one in the ones place. What is the largest number you can make?
63
[OP_LIST_SOL] 6 3 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 1 [OP_LIST_MAX]
var_a = 6 var_b = 3 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 = len(list_a) list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_c)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_d = 1 list_c=list_b.copy() list_c.sort() var_e = list_c[-var_d] print(int(var_e))
Possibility
How many two-digit numbers can be made with 0, 6, and 3? Note that the tens and ones places must be different.
4
[OP_LIST_SOL] 6 0 3 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 6 var_b = 0 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 = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = len(list_b) print(int(var_e))
Correspondence
There are 3 boxes of carrots which contains 32 of them each, and you are going to put 4 of these carrots in each basket. How many baskets do you need to put carrots in?
24
32 3 [OP_MUL] 4 [OP_DIV]
var_a = 32 var_b = 3 var_c = var_a * var_b var_d = 4 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
There is a box with 3 cabbages and 2 radishes. How many vegetables are in the box?
5
3 2 [OP_ADD]
var_a = 3 var_b = 2 var_c = var_a + var_b print(int(var_c))
Arithmetic calculation
One pear weighs 0.36 kilograms (kg). When a basket contains 30 pears, the weight of the entire basket is 11.26 kilograms (kg). Find the weight in kilograms (kg) of the empty basket.
0.46
11.26 0.36 30 [OP_MUL] [OP_SUB]
var_a = 11.26 var_b = 0.36 var_c = 30 var_d = var_b * var_c var_e = var_a - var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
The bag contains 2 fewer blue marbles than yellow marbles. If the sum of the yellow and blue marbles is 240, how many yellow marbles are there?
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))
Arithmetic calculation
Hyeonil rode a bicycle and moved for an hour at a speed of 4.25 meters (m) per minute. After that, if he moved 29.75 meters (m) at the same speed, find how many minutes Hyunil rode the bicycle.
67
29.75 4.25 [OP_DIV] 1 60 [OP_MUL] [OP_ADD]
var_a = 29.75 var_b = 4.25 var_c = var_a / var_b var_d = 1 var_e = 60 var_f = var_d * var_e var_g = var_c + var_f print(int(var_g))
Possibility
If all divisors of 75 are written once, how many times the number 5 must be written?
4
75 [OP_LIST_GET_DIVISOR] [OP_LIST2NUM] [OP_NUM2LIST] 5 [OP_LIST_FIND_NUM]
var_a = 75 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="" for i in list_a: i = str(i) var_b = var_b + i list_b = [] var_b = int(var_b) while var_b//10 > 0: list_b.append(var_b%10) var_b = var_b//10 list_b.append(var_b%10) list_b = list_b[::-1] var_c = 5 var_d = 0 var_c = int(var_c) for i in list_b: i = int(i) if i == var_c: var_d = var_d + 1 print(int(var_d))
Geometry
There is a rhombic hairpin with two diagonals measuring 9 centimeters (cm) and 14 centimeters (cm), respectively. How wide is this hairpin?
63
9 14 [OP_MUL] 2 [OP_DIV]
var_a = 9 var_b = 14 var_c = var_a * var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
There are 2180 tangerines. You distribute them in boxes of 200 and 150 to have organized 12 boxes in total, and then 30 tangerines are left. How many boxes of 200 are there?
7
2180 30 [OP_SUB] 150 12 [OP_MUL] [OP_SUB] 200 150 [OP_SUB] [OP_DIV]
var_a = 2180 var_b = 30 var_c = var_a - var_b var_d = 150 var_e = 12 var_f = var_d * var_e var_g = var_c - var_f var_h = 200 var_i = 150 var_j = var_h - var_i var_k = var_g / var_j print(int(var_k))
Comparison
There are 9/10 liters (L) of milk. Suyeon drank 1/3 of the total, and Hyunwoo 4/9 of the total. Who drank more milk, Suyeon or Hyunwoo?
Hyunwoo
[OP_LIST_SOL] Suyeon Hyunwoo [OP_LIST_EOL] [OP_LIST_SOL] 1 3 [OP_DIV] 4 9 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Suyeon' var_b = 'Hyunwoo' 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 = 3 var_e = var_c / var_d var_f = 4 var_g = 9 var_h = var_f / var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Correspondence
6A5+B03=748. How much is B?
1
6A5+B03=748 B [OP_DIGIT_UNK_SOLVER]
var_a = '6A5+B03=748' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Arithmetic calculation
How many of the numbers between 40 and 80 are multiples of 8?
6
40 80 1 [OP_LIST_ARANGE] 8 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 40 var_b = 80 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 8 list_b = [] var_d = int(var_d) for i in list_a: i = int(i) if i % var_d == 0: list_b.append(i) var_e = len(list_b) print(int(var_e))
Possibility
Jungkook wants to buy two different fruits and give them to Jimin and Yoongi as a present. If the fruits sold at the fruit store are apples, peaches, and pears, in how many ways can you gift them?
6
[OP_LIST_SOL] apples peaches pears [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_PERM]
var_a = 'apples' var_b = 'peaches' var_c = 'pears' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = len(list_a) var_e = 2 var_f = 1 var_d = int(var_d) var_e = int(var_e) for i, elem in enumerate(range(var_e)): var_f = var_f * (var_d-i) print(int(var_f))
Comparison
Taehyung, Minju, Sangmin, Yoonjeong, and Yoojung crossed the finish line in turn. Who came in last?
Yoojung
[OP_LIST_SOL] Taehyung Minju Sangmin Yoonjeong Yoojung [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET]
var_a = 'Taehyung' var_b = 'Minju' var_c = 'Sangmin' var_d = 'Yoonjeong' var_e = 'Yoojung' 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 = list_a[var_f-1] print(var_g)
Possibility
You want to create a four-digit number where the sum of each digit is 15. How many numbers can you make in total?
519
1000 9999 1 [OP_LIST_ARANGE] [OP_LIST_NUM2SUM] 15 [OP_LIST_LESS_EQUAL] 15 [OP_LIST_MORE_EQUAL] [OP_LIST_LEN]
var_a = 1000 var_b = 9999 var_c = 1 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) var_e = 15 list_c = [] for i in list_b: if i <= var_e: list_c.append(i) var_f = 15 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
A hybrid car has two or more types of power units. Jaeho's family rode a hybrid car and arrived at his aunt's house, which is 120 kilometers (km) away, in an hour and 50 minutes. At first, they used electricity only, and later on gasoline only for an hour and ten minutes. This car needs 6 liters of gasoline to go 40.8 kilometers (km), and if Jaeho's family used 14 liters of gasoline to go to his aunt's house, how many kilometers (km) is the distance that this car used only electricity for 1 minute?
0.62
120 40.8 6 [OP_DIV] 14 [OP_MUL] [OP_SUB] 1 60 [OP_MUL] 50 [OP_ADD] 1 60 [OP_MUL] 10 [OP_ADD] [OP_SUB] [OP_DIV]
var_a = 120 var_b = 40.8 var_c = 6 var_d = var_b / var_c var_e = 14 var_f = var_d * var_e var_g = var_a - var_f var_h = 1 var_i = 60 var_j = var_h * var_i var_k = 50 var_l = var_j + var_k var_m = 1 var_n = 60 var_o = var_m * var_n var_p = 10 var_q = var_o + var_p var_r = var_l - var_q var_s = var_g / var_r print('{:.2f}'.format(round(var_s+1e-10,2)))
Correspondence
397 is 236 lesser than a certain number. What is the value of a number that is 496 lesser than this certain number?
137
397 236 [OP_ADD] 496 [OP_SUB]
var_a = 397 var_b = 236 var_c = var_a + var_b var_d = 496 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
There are three numbers 10, 11 and 12. What is the quotient of the largest number divided by the smallest number?
1
[OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_FDIV]
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 = 1 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))
Correspondence
Subtract 5 from a number and divide by 3. Find the number for the result to be 4.
17
4 3 [OP_MUL] 5 [OP_ADD]
var_a = 4 var_b = 3 var_c = var_a * var_b var_d = 5 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
There are 7 different boxes with 2, 3, 3, 2, 1, 2, 1 chocolates, respectively. How many boxes contain 2 chocolates?
3
[OP_LIST_SOL] 2 3 3 2 1 2 1 [OP_LIST_EOL] 2 [OP_LIST_FIND_NUM]
var_a = 2 var_b = 3 var_c = 3 var_d = 2 var_e = 1 var_f = 2 var_g = 1 list_a= [] if "/" in str(var_g): var_g = eval(str(var_g)) list_a.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_h = 2 var_i = 0 var_h = int(var_h) for i in list_a: i = int(i) if i == var_h: var_i = var_i + 1 print(int(var_i))
Geometry
I used all 12/25 meters (m) of wire to make one of the largest squares. What is the side length of this square in meters (m)?
0.12
12/25 4 [OP_DIV]
var_a = 0.48 var_b = 4 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
The fee for renting a bicycle for 30 minutes is 4,000 won. How much does one person get to pay when renting 4 bikes for 3 hours with 6 people paying equally?
16000
3 60 [OP_MUL] 30 [OP_DIV] 4000 [OP_MUL] 4 [OP_MUL] 6 [OP_DIV]
var_a = 3 var_b = 60 var_c = var_a * var_b var_d = 30 var_e = var_c / var_d var_f = 4000 var_g = var_e * var_f var_h = 4 var_i = var_g * var_h var_j = 6 var_k = var_i / var_j print(int(var_k))
Possibility
When you ask a passerby to pick random two numbers from 1 to 4, what is the number of cases where they pick two even numbers or only one even number?
5
2 2 [OP_COMB] 2 1 [OP_COMB] 2 1 [OP_COMB] [OP_MUL] [OP_ADD]
var_a = 2 var_b = 2 var_c = 1 var_a = int(var_a) var_b = int(var_b) for i, elem in enumerate(range(var_b)): var_c = var_c * (var_a-i) for i, elem in enumerate(range(var_b)): var_c = var_c / (i+1) var_d = 2 var_e = 1 var_f = 1 var_d = int(var_d) var_e = int(var_e) for i, elem in enumerate(range(var_e)): var_f = var_f * (var_d-i) for i, elem in enumerate(range(var_e)): var_f = var_f / (i+1) var_g = 2 var_h = 1 var_i = 1 var_g = int(var_g) var_h = int(var_h) for i, elem in enumerate(range(var_h)): var_i = var_i * (var_g-i) for i, elem in enumerate(range(var_h)): var_i = var_i / (i+1) var_j = var_f * var_i var_k = var_c + var_j print(int(var_k))
Correspondence
Of the 15 people, 7 are women. If only men carry 48 loads, find how many loads each person can carry if they all share the same load.
6
48 15 7 [OP_SUB] [OP_DIV]
var_a = 48 var_b = 15 var_c = 7 var_d = var_b - var_c var_e = var_a / var_d print(int(var_e))
Arithmetic calculation
Sunmi scored 75 points in Korean, 85 points in math, 90 points in science, and 65 points in English in the midterm exam. In how many subjects was Sunmi above the midterm average?
2
[OP_LIST_SOL] 75 85 90 65 [OP_LIST_EOL] [OP_LIST_MEAN] [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 75 var_b = 85 var_c = 90 var_d = 65 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)/len(list_a) list_b = [] for i in list_a: if i > var_e: list_b.append(i) var_f = len(list_b) print(int(var_f))
Comparison
Youngbin and Yechan are playing knocking down cans with a slingshot. Youngbin fired 25 shots and knocked down 19, and Yechan shot 16 and knocked down 10. Which of the two has a higher success rate?
Youngbin
[OP_LIST_SOL] Youngbin Yechan [OP_LIST_EOL] [OP_LIST_SOL] 19 25 [OP_DIV] 10 16 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Youngbin' var_b = 'Yechan' 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 = 19 var_d = 25 var_e = var_c / var_d var_f = 10 var_g = 16 var_h = var_f / var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Correspondence
The quotient of 59 divided by 8 is A and the remainder is 3. What is the value of A?
7
59 3 [OP_SUB] 8 [OP_DIV]
var_a = 59 var_b = 3 var_c = var_a - var_b var_d = 8 var_e = var_c / var_d print(int(var_e))
Correspondence
I made a mistake in dividing a number by 4, and instead added by 4 to get 40. Find the correctly calculated value.
9
40 4 [OP_SUB] 4 [OP_DIV]
var_a = 40 var_b = 4 var_c = var_a - var_b var_d = 4 var_e = var_c / var_d print(int(var_e))
Correspondence
There are two different numbers A and B. Find the sum of A and B in the two-digit subtraction formula, A5-2A=B7.
13
A5-2A=B7 A [OP_DIGIT_UNK_SOLVER] A5-2A=B7 B [OP_DIGIT_UNK_SOLVER] [OP_ADD]
var_a = 'A5-2A=B7' 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 = 'A5-2A=B7' 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))
Possibility
I want to paint the 4 parts A, B, C,and D with 4 colors red, yellow, blue and green. Find the number of ways to color each part with a different color.
24
4 4 [OP_PERM]
var_a = 4 var_b = 4 var_c = 1 var_a = int(var_a) var_b = int(var_b) for i, elem in enumerate(range(var_b)): var_c = var_c * (var_a-i) print(int(var_c))
Comparison
Dongguk drinks water 5 times a day and drinks 0.2 liters (L) each time. Yoonji drinks water 6 times a day and drinks 0.3 liters (L) per drink. Heejin drinks water 4 times a day and drinks 500 milliliters (ml) per drink. Who drinks the most water per day?
Heejin
[OP_LIST_SOL] Dongguk Yoonji Heejin [OP_LIST_EOL] [OP_LIST_SOL] 5 0.2 1000 [OP_MUL] [OP_MUL] 6 0.3 1000 [OP_MUL] [OP_MUL] 4 500 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Dongguk' var_b = 'Yoonji' var_c = 'Heejin' 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 = 5 var_e = 0.2 var_f = 1000 var_g = var_e * var_f var_h = var_d * var_g var_i = 6 var_j = 0.3 var_k = 1000 var_l = var_j * var_k var_m = var_i * var_l var_n = 4 var_o = 500 var_p = var_n * var_o list_b= [] if "/" in str(var_p): var_p = eval(str(var_p)) list_b.append(var_p) if "/" in str(var_m): var_m = eval(str(var_m)) list_b.append(var_m) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) list_b.reverse() var_q = 1 list_c=list_b.copy() list_c.sort() var_r = list_c[-var_q] var_s = list_b.index(var_r)+1 var_t = list_a[var_s-1] print(var_t)
Geometry
There is a rectangular frame with a width of 81/4 centimeters (cm) and a depth of 148/9 centimeters (cm). Find the area of this frame.
333
81/4 148/9 [OP_MUL]
var_a = 20.25 var_b = 16.444444444444443 var_c = var_a * var_b print(int(eval('{:.2f}'.format(round(var_c+1e-10,2)))))
Possibility
You want to create a four-digit number using all 4, 5, 8, and 9. When you made the third smallest number, two numbers in the middle were swapped, resulting in 4958. Find the sum of the number created and the number changed.
9817
[OP_LIST_SOL] 4 5 8 9 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 3 [OP_LIST_MIN] 4958 [OP_ADD]
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 = 4 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 3 list_c=list_b.copy() list_c.sort() var_g = list_c[var_f-1] var_h = 4958 var_i = var_g + var_h print(int(var_i))
Correspondence
Ji-woo used half of his money and 2,000 won to buy snacks at the mart. Then, he used half of the remaining money to buy chocolate, and 2,000 won and 1,000 won to buy drinks and water. How much money does Ji-woo have at first if he has no money left?
16000
0 2000 [OP_ADD] 1000 [OP_ADD] 2 [OP_MUL] 2000 [OP_ADD] 2 [OP_MUL]
var_a = 0 var_b = 2000 var_c = var_a + var_b var_d = 1000 var_e = var_c + var_d var_f = 2 var_g = var_e * var_f var_h = 2000 var_i = var_g + var_h var_j = 2 var_k = var_i * var_j print(int(var_k))
Correspondence
A fisherman catches three fish per one fishing line. Out of 226 fishing lines, 3 were broken and discarded. How many fish did the fisherman catch?
669
226 3 [OP_SUB] 3 [OP_MUL]
var_a = 226 var_b = 3 var_c = var_a - var_b var_d = 3 var_e = var_c * var_d print(int(var_e))
Geometry
Jimin randomly picked 4 numbers between 50 and 200, and 3 of them were 75, 80, and 120, respectively. What should be the other number so that the sum of them is equal to interior angles of the quadrilateral?
85
360 75 [OP_SUB] 80 [OP_SUB] 120 [OP_SUB]
var_a = 360 var_b = 75 var_c = var_a - var_b var_d = 80 var_e = var_c - var_d var_f = 120 var_g = var_e - var_f print(int(var_g))
Geometry
What is the length of the other side of a right triangle with hypotenuse and non-hypotenuse sides equal to 5 and 3 respectively?
4
5 2 [OP_POW] 3 2 [OP_POW] [OP_SUB] 1/2 [OP_POW]
var_a = 5 var_b = 2 var_c = var_a ** var_b var_d = 3 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))
Correspondence
When you add 8 and multiply by 3 to this number it becomes 36. Find the number.
4
36 3 [OP_DIV] 8 [OP_SUB]
var_a = 36 var_b = 3 var_c = var_a / var_b var_d = 8 var_e = var_c - var_d print(int(var_e))