category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Geometry
Find the number of vertices of a pentagonal prism.
10
5 2 [OP_MUL]
var_a = 5 var_b = 2 var_c = var_a * var_b print(int(var_c))
Possibility
Choose 3 of the following number cards 5, 3, 6, 8 to form a three-digit number. When writing the numbers in order from smallest, find the 10th number.
568
[OP_LIST_SOL] 5 3 6 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 10 [OP_LIST_MIN]
var_a = 5 var_b = 3 var_c = 6 var_d = 8 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 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 list_c=list_b.copy() list_c.sort() var_g = list_c[var_f-1] print(int(var_g))
Correspondence
A number needs to be multiplied by 3, but you accidentally multiplied it by 6 and it ended up being 42. What is the correct calculation result?
21
42 6 [OP_DIV] 3 [OP_MUL]
var_a = 42 var_b = 6 var_c = var_a / var_b var_d = 3 var_e = var_c * var_d print(int(var_e))
Correspondence
How many A's are there when 3×4<3×A<40, and 4/3>4/A>4/6?
1
3×4<3×A<40 A [OP_NUM_UNK_SOLVER] 4/3>4/A>4/6 A [OP_NUM_UNK_SOLVER] [OP_SET_INTERSECT] [OP_LIST_LEN]
var_a = '3×4<3×A<40' 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] = [] candidate_num = [i for i in range(51)] candi = list(itertools.product(candidate_num, 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)): if term_list[i] == '': new_eq += str(term_list[i])+op_list[i] else: new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: if '=' in new_eq and '>' not in new_eq and '<' not in new_eq: new_eq=new_eq.replace('==','=') new_eq=new_eq.replace('>','') new_eq=new_eq.replace('<','') new_eq=new_eq.split('=') for i in range(len(new_eq)-1): eval_result = math.isclose(eval(new_eq[i]), eval(new_eq[i+1])) if not eval_result: break else: eval_result = eval(new_eq) except: eval_result = False pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k].append(int(c[i])) list_a = list(set(ans_dict[var_b])) var_c = '4/3>4/A>4/6' var_d = 'A' ans_dict = dict() var_c = var_c.replace('×','*') var_c = var_c.replace('x','*') var_c = var_c.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_c): if v in variable_candi: ans_dict[v] = [] candidate_num = [i for i in range(51)] candi = list(itertools.product(candidate_num, repeat=len(ans_dict))) for c in candi: temp = var_c for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): if term_list[i] == '': new_eq += str(term_list[i])+op_list[i] else: new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: if '=' in new_eq and '>' not in new_eq and '<' not in new_eq: new_eq=new_eq.replace('==','=') new_eq=new_eq.replace('>','') new_eq=new_eq.replace('<','') new_eq=new_eq.split('=') for i in range(len(new_eq)-1): eval_result = math.isclose(eval(new_eq[i]), eval(new_eq[i+1])) if not eval_result: break else: eval_result = eval(new_eq) except: eval_result = False pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k].append(int(c[i])) list_b = list(set(ans_dict[var_d])) list_c = list(set(list_a) & set(list_b)) var_e = len(list_c) print(int(var_e))
Correspondence
There are pigs and chickens on Seungwoo's farm. Chickens outnumber pigs by 12. Also, the sum of the number of chickens and the number of pigs is 40 more than 12. Find the product of the number of chickens and the number of pigs.
640
40 2 [OP_DIV] 12 [OP_ADD] 40 2 [OP_DIV] [OP_MUL]
var_a = 40 var_b = 2 var_c = var_a / var_b var_d = 12 var_e = var_c + var_d var_f = 40 var_g = 2 var_h = var_f / var_g var_i = var_e * var_h print(int(var_i))
Correspondence
Hyejin's monthly evaluation score is 82 for ethics, 90 for Korean language, 88 for science, and 84 for social studies. The score for mathematics is unknown. When the average score is 88, what is the score for mathematics?
96
88 5 [OP_MUL] 82 [OP_SUB] 90 [OP_SUB] 88 [OP_SUB] 84 [OP_SUB]
var_a = 88 var_b = 5 var_c = var_a * var_b var_d = 82 var_e = var_c - var_d var_f = 90 var_g = var_e - var_f var_h = 88 var_i = var_g - var_h var_j = 84 var_k = var_i - var_j print(int(var_k))
Comparison
Jisoo and Yoongi rode bicycles. The two started from the same place, Yoongi ran 22 kilometers (km) in one hour, and Jisoo ran 19,000 meters (m) in one hour. Who rode more?
Jisoo
[OP_LIST_SOL] Jisoo Yoongi [OP_LIST_EOL] [OP_LIST_SOL] 22 1000 [OP_MUL] 19000 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jisoo' var_b = 'Yoongi' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 22 var_d = 1000 var_e = var_c * var_d var_f = 19000 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
Some polygons are said to have six diagonals drawn from one vertex. How many vertices does this polygon have?
9
6 3 [OP_ADD]
var_a = 6 var_b = 3 var_c = var_a + var_b print(int(var_c))
Geometry
There is a bill with a width of 3 centimeters (cm) and an area of 1.77 square centimeters (cm2). How many centimeters (cm) is the length of this bill?
0.59
1.77 3 [OP_DIV]
var_a = 1.77 var_b = 3 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
Three of the number cards from 1 to 9 were drawn to make the number 735. How many number cards drawn have a value greater than 4?
2
735 [OP_NUM2LIST] 4 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 735 list_a = [] var_a = int(var_a) while var_a//10 > 0: list_a.append(var_a%10) var_a = var_a//10 list_a.append(var_a%10) list_a = list_a[::-1] var_b = 4 list_b = [] for i in list_a: if i > var_b: list_b.append(i) var_c = len(list_b) print(int(var_c))
Geometry
One piece of colored paper is a square with sides measuring 30 centimeters (cm). What is the area of this piece of colored paper?
900
30 2 [OP_POW]
var_a = 30 var_b = 2 var_c = var_a ** var_b print(int(var_c))
Correspondence
The equation A85-2B=364 makes. What number should go in A?
3
A85-2B=364 A [OP_DIGIT_UNK_SOLVER]
var_a = 'A85-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))
Geometry
The diameter of a circle is 26 centimeters (cm). Then how long is the radius in centimeters (cm)?
13
26 2 [OP_DIV]
var_a = 26 var_b = 2 var_c = var_a / var_b print(int(var_c))
Comparison
4 students said one number each. The sum is 531, and the sum of the numbers uttered by the first student and the second student is 31 greater than the sum of the numbers spoken by the third and fourth students, and the third student said a number 22 greater than that of the fourth student. What number did the third student say?
136
531 31 [OP_SUB] 2 [OP_DIV] 22 [OP_SUB] 2 [OP_DIV] 22 [OP_ADD]
var_a = 531 var_b = 31 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d var_f = 22 var_g = var_e - var_f var_h = 2 var_i = var_g / var_h var_j = 22 var_k = var_i + var_j print(int(var_k))
Arithmetic calculation
If we divide the father's age by the son's age, the result was 3, 7 years ago. Their ages will combine to 74 after 8 years. What will be the age of the father in 8 years' time?
48
74 8 2 [OP_MUL] [OP_SUB] 7 2 [OP_MUL] [OP_SUB] 3 1 [OP_ADD] [OP_FDIV] 3 [OP_MUL] 7 [OP_ADD] 8 [OP_ADD]
var_a = 74 var_b = 8 var_c = 2 var_d = var_b * var_c var_e = var_a - var_d var_f = 7 var_g = 2 var_h = var_f * var_g var_i = var_e - var_h var_j = 3 var_k = 1 var_l = var_j + var_k var_m = var_i // var_l var_n = 3 var_o = var_m * var_n var_p = 7 var_q = var_o + var_p var_r = 8 var_s = var_q + var_r print(int(var_s))
Correspondence
I need to subtract 32 from a certain number, but I mistakenly subtracted 23, so I got 14. Find the number.
37
14 23 [OP_ADD]
var_a = 14 var_b = 23 var_c = var_a + var_b print(int(var_c))
Correspondence
What number must be in B to make A3B-41=591?
2
A3B-41=591 B [OP_DIGIT_UNK_SOLVER]
var_a = 'A3B-41=591' 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))
Geometry
There are three points that are not on a straight line. How many straight lines are possible with these three points?
3
3 2 [OP_COMB]
var_a = 3 var_b = 2 var_c = 1 var_a = int(var_a) var_b = int(var_b) for i, elem in enumerate(range(var_b)): var_c = var_c * (var_a-i) for i, elem in enumerate(range(var_b)): var_c = var_c / (i+1) print(int(var_c))
Possibility
What is the largest number that can be made by using the number cards 7 and 3 all once?
73
[OP_LIST_SOL] 7 3 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 1 [OP_LIST_MAX]
var_a = 7 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))
Correspondence
If you multiply a variable by 5 and then by 7, you get 5 and 4/9. Find the variable to two decimal places.
0.16
5 4/9 [OP_ADD] 7 [OP_DIV] 5 [OP_DIV]
var_a = 5 var_b = 0.4444444444444444 var_c = var_a + var_b var_d = 7 var_e = var_c / var_d var_f = 5 var_g = var_e / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Arithmetic calculation
What is the largest two-digit number that is both a multiple of 3 and a multiple of 5?
90
10 99 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX]
var_a = 10 var_b = 99 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 3 list_b = [] var_d = int(var_d) for i in list_a: i = int(i) if i % var_d == 0: list_b.append(i) var_e = 5 list_c = [] var_e = int(var_e) for i in list_b: i = int(i) if i % var_e == 0: list_c.append(i) var_f = 1 list_d=list_c.copy() list_d.sort() var_g = list_d[-var_f] print(int(var_g))
Possibility
Among the single-digit natural numbers A, B, and C, count the number of A, B, and C that satisfies A + B + C < 7.
20
1 9 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PRODUCT] [OP_LIST_NUM2SUM] 7 [OP_LIST_LESS] [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] list_c=[] for i in list_b: var_e = 0 i = int(i) while i//10 > 0: var_e = var_e + i%10 i = i//10 var_e = var_e + i%10 list_c.append(var_e) var_f = 7 list_d = [] for i in list_c: if i < var_f: list_d.append(i) var_g = len(list_d) print(int(var_g))
Geometry
There is a flower garden in the shape of a rectangle measuring 5 meters (m) long and 17/20 meters (m) wide. Find the area in square centimeters (cm2) of this flower field.
42500
5 17/20 [OP_MUL] 100 100 [OP_MUL] [OP_MUL]
var_a = 5 var_b = 0.85 var_c = var_a * var_b var_d = 100 var_e = 100 var_f = var_d * var_e var_g = var_c * var_f print(int(var_g))
Arithmetic calculation
There are six numbers 3/2, 2.3, 1/5, 1.1, 5/2, 4/5. How many of these numbers are greater than 1 and less than 2?
2
[OP_LIST_SOL] 3/2 2.3 1/5 1.1 5/2 4/5 [OP_LIST_EOL] 1 [OP_LIST_MORE] 2 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = 1.5 var_b = 2.3 var_c = 0.2 var_d = 1.1 var_e = 2.5 var_f = 0.8 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 = 1 list_b = [] for i in list_a: if i > var_g: list_b.append(i) var_h = 2 list_c = [] for i in list_b: if i < var_h: list_c.append(i) var_i = len(list_c) print(int(var_i))
Correspondence
Find the value, including the decimal point, of subtracting the possible smallest from the largest of the two decimal numbers that becomes 1.7 when rounded to two decimal places.
0.09
1.74 1.65 [OP_SUB]
var_a = 1.74 var_b = 1.65 var_c = var_a - var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
What is the sum of 8 groups of 100 and 7 groups of 10 and count it 5 jumps in increments of 10?
920
100 8 [OP_MUL] 10 7 [OP_MUL] [OP_ADD] 10 5 [OP_MUL] [OP_ADD]
var_a = 100 var_b = 8 var_c = var_a * var_b var_d = 10 var_e = 7 var_f = var_d * var_e var_g = var_c + var_f var_h = 10 var_i = 5 var_j = var_h * var_i var_k = var_g + var_j print(int(var_k))
Arithmetic calculation
How many natural numbers from 1 to 100 have a remainder of 2 when divided by 5?
20
1 100 1 [OP_LIST_ARANGE] 5 2 [OP_LIST_DIVIDE_AND_REMAIN] [OP_LIST_LEN]
var_a = 1 var_b = 100 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 5 var_e = 2 list_b = [] var_d = int(var_d) var_e = int(var_e) if var_e < 0: var_e = var_e + var_d for i in list_a: i = int(i) if i%var_d == var_e: list_b.append(i) var_f = len(list_b) print(int(var_f))
Arithmetic calculation
Machine A makes 8 products per minute, and machine B makes 10 products per minute. When started making products at the same time, machine B made 100 products. How many more products did machine B make than machine A?
20
100 100 10 [OP_DIV] 8 [OP_MUL] [OP_SUB]
var_a = 100 var_b = 100 var_c = 10 var_d = var_b / var_c var_e = 8 var_f = var_d * var_e var_g = var_a - var_f print(int(var_g))
Comparison
Jungkook collected 6 divided by 3, Yoongi collected 4, and Yuna collected 5. Who got the biggest number?
Yuna
[OP_LIST_SOL] Jungkook Yoongi Yuna [OP_LIST_EOL] [OP_LIST_SOL] 6 3 [OP_FDIV] 4 5 [OP_LIST_EOL] 1 [OP_LIST_MAX] [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] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Comparison
There are 15 consecutive natural numbers between 52 and a certain number. If the certain number is greater than 52, which number is in the middle between 52 and the certain number?
60
52 15 [OP_ADD] 1 [OP_ADD] 52 [OP_ADD] 2 [OP_DIV]
var_a = 52 var_b = 15 var_c = var_a + var_b var_d = 1 var_e = var_c + var_d var_f = 52 var_g = var_e + var_f var_h = 2 var_i = var_g / var_h print(int(var_i))
Comparison
The academy is on the 7th floor. The reading room is 4 floors higher than the academy, and the bookstore is 9 floors lower than the reading room. What floor is the bookstore on?
2
7 4 [OP_ADD] 9 [OP_SUB]
var_a = 7 var_b = 4 var_c = var_a + var_b var_d = 9 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
The number of questions answered by 6 people in Dongwoo's group is 16, 22, 30, 26, 18, and 20. On average, how many questions did Dongwoo's group get right?
22
[OP_LIST_SOL] 16 22 30 26 18 20 [OP_LIST_EOL] [OP_LIST_MEAN]
var_a = 16 var_b = 22 var_c = 30 var_d = 26 var_e = 18 var_f = 20 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() list_a = [float(i) for i in list_a] var_g = sum(list_a)/len(list_a) print(int(var_g))
Correspondence
The four-digit number 2A3A is a multiple of 9. What is A?
2
2A3A [OP_GEN_POSSIBLE_LIST] 9 [OP_LIST_DIVISIBLE] 2A3A A [OP_LIST_FIND_UNK]
var_a = '2A3A' 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 = 9 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 = '2A3A' var_d = 'A' 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))
Correspondence
Subtract 263 from a certain number and add 419, resulting in 725. Find the number.
569
725 419 [OP_SUB] 263 [OP_ADD]
var_a = 725 var_b = 419 var_c = var_a - var_b var_d = 263 var_e = var_c + var_d print(int(var_e))
Correspondence
A factory is trying to pack pencils, but if you pack them in 5 units, 4 will remain, if you pack in 7 units, 6 units will remain, and if you pack in 8 units, 7 units will remain. If the number of pencils made by this factory is the smallest natural number between 1000 and 9999, how many pencils are there?
1119
1000 9999 1 [OP_LIST_ARANGE] 8 7 [OP_LIST_DIVIDE_AND_REMAIN] 7 6 [OP_LIST_DIVIDE_AND_REMAIN] 5 -1 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_MIN]
var_a = 1000 var_b = 9999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 8 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 = 7 var_g = 6 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 = 5 var_i = -1 list_d = [] var_h = int(var_h) var_i = int(var_i) if var_i < 0: var_i = var_i + var_h for i in list_c: i = int(i) if i%var_h == var_i: list_d.append(i) var_j = 1 list_e=list_d.copy() list_e.sort() var_k = list_e[var_j-1] print(int(var_k))
Geometry
A friend gave the following problem to Taewon. "One of the edges of the regular hexagonal pyramid is 8 centimeters (cm) and the other is 13 centimeters (cm). So what is the sum of all the edges of the regular hexagonal pyramid?" What should Taewon answer to get the problem right?
126
13 6 [OP_MUL] 8 6 [OP_MUL] [OP_ADD]
var_a = 13 var_b = 6 var_c = var_a * var_b var_d = 8 var_e = 6 var_f = var_d * var_e var_g = var_c + var_f print(int(var_g))
Comparison
Four students: Jimin, Yoongi, Taehyung, and Namjoon, are standing in a line. Yoongi stands ahead of Namjoon, and Jimin is ahead of Yoongi. If Taehyung is behind Namjoon, who stands at the very last?
Taehyung
[OP_LIST_SOL] Jimin Yoongi Taehyung Namjoon [OP_LIST_EOL] [OP_LIST_SOL] Jimin Yoongi > Taehyung Namjoon < Yoongi Namjoon > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET]
var_a = 'Jimin' var_b = 'Yoongi' var_c = 'Taehyung' var_d = 'Namjoon' 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 = 'Jimin' var_f = 'Yoongi' var_g = '>' var_h = 'Taehyung' var_i = 'Namjoon' var_j = '<' var_k = 'Yoongi' var_l = 'Namjoon' 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)
Arithmetic calculation
On Halloween, Jimin gave 25 candies to Yuna and gave all the remaining 13 candies to her sister. How many candies did Jimin have at first?
38
13 25 [OP_ADD]
var_a = 13 var_b = 25 var_c = var_a + var_b print(int(var_c))
Correspondence
Rounding 6AB3 to the nearest hundred results in 6200. What does 'A' refer to?
1
6AB3 [OP_GEN_POSSIBLE_LIST] 6200 100 [OP_SUB] [OP_LIST_MORE] 6200 [OP_LIST_LESS_EQUAL] 6AB3 A [OP_LIST_FIND_UNK]
var_a = '6AB3' 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 = 6200 var_c = 100 var_d = var_b - var_c list_b = [] for i in list_a: if i > var_d: list_b.append(i) var_e = 6200 list_c = [] for i in list_b: if i <= var_e: list_c.append(i) var_f = '6AB3' var_g = 'A' var_f = str(var_f) var_g = str(var_g) unk_idx = var_f.index(var_g) var_h = 0 for elem in list_c: elem = str(elem) var_h = int(elem[unk_idx]) print(int(var_h))
Comparison
Dongwoo, Minyeop, and Seongjeong each received a cookie box containing equal amounts of cookies. If Dongwoo shared it with 7 meals, Minyeop with 8 meals, and Seongjeong with 5 meals, who ate the most cookies at one time?
Seongjeong
[OP_LIST_SOL] Dongwoo Minyeop Seongjeong [OP_LIST_EOL] [OP_LIST_SOL] 1 7 [OP_DIV] 1 8 [OP_DIV] 1 5 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Dongwoo' var_b = 'Minyeop' var_c = 'Seongjeong' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 1 var_e = 7 var_f = var_d / var_e var_g = 1 var_h = 8 var_i = var_g / var_h var_j = 1 var_k = 5 var_l = var_j / var_k list_b= [] if "/" in str(var_l): var_l = eval(str(var_l)) list_b.append(var_l) if "/" in str(var_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_m = 1 list_c=list_b.copy() list_c.sort() var_n = list_c[-var_m] var_o = list_b.index(var_n)+1 var_p = list_a[var_o-1] print(var_p)
Comparison
Yuna is having a total of 20 days of summer vacation. If the number of vacation days excluding today is 11, how many vacation days are left excluding today?
8
20 11 [OP_SUB] 1 [OP_SUB]
var_a = 20 var_b = 11 var_c = var_a - var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Geometry
If a brick is 9 centimeters (cm) wide, 4 centimeters (cm) long, and 7 centimeters (cm) high, how many cubic centimeters (cm3) of volume does it have?
252
9 4 [OP_MUL] 7 [OP_MUL]
var_a = 9 var_b = 4 var_c = var_a * var_b var_d = 7 var_e = var_c * var_d print(int(var_e))
Correspondence
If the quotient of the four-digit number A614 divided by 6 is a four-digit number, find how many numbers fit in A.
4
A614 [OP_GEN_POSSIBLE_LIST] 6000 [OP_LIST_MORE_EQUAL] 60000 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = 'A614' 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 = 6000 list_b = [] for i in list_a: if i >= var_b: list_b.append(i) var_c = 60000 list_c = [] for i in list_b: if i < var_c: list_c.append(i) var_d = len(list_c) print(int(var_d))
Comparison
If the common multiples of 27 and 45 are written in order from smallest to largest, what is the product of all the numbers between the 7th and 10th numbers from the left?
1312200
27 45 [OP_LCM] 8 [OP_MUL] 27 45 [OP_LCM] 9 [OP_MUL] [OP_MUL]
var_a = 27 var_b = 45 var_c = var_b * var_a / math.gcd(int(var_b), int(var_a)) var_d = 8 var_e = var_c * var_d var_f = 27 var_g = 45 var_h = var_g * var_f / math.gcd(int(var_g), int(var_f)) var_i = 9 var_j = var_h * var_i var_k = var_e * var_j print(int(var_k))
Comparison
A car runs at 92 kilometers (km) per hour, and B car runs at 1500 meters (m) per minute. Which of the two is faster?
A
[OP_LIST_SOL] A B [OP_LIST_EOL] [OP_LIST_SOL] 92 1500 1000 [OP_DIV] 60 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'A' var_b = 'B' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 92 var_d = 1500 var_e = 1000 var_f = var_d / var_e var_g = 60 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_c): var_c = eval(str(var_c)) list_b.append(var_c) 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 a number is divided by 5, the quotient is 248 and the remainder is 4. When this number is divided by 9, what is the sum of the quotient and the remainder?
140
248 5 [OP_MUL] 4 [OP_ADD] 9 [OP_FDIV] 248 5 [OP_MUL] 4 [OP_ADD] 9 [OP_MOD] [OP_ADD]
var_a = 248 var_b = 5 var_c = var_a * var_b var_d = 4 var_e = var_c + var_d var_f = 9 var_g = var_e // var_f var_h = 248 var_i = 5 var_j = var_h * var_i var_k = 4 var_l = var_j + var_k var_m = 9 var_n = var_l % var_m var_o = var_g + var_n print(int(var_o))
Possibility
Hyeonjeong, Seulgi, Miran, and Hocheol are trying to stand in one line. How many different ways are there to line up?
24
[OP_LIST_SOL] Hyeonjeong Seulgi Miran Hocheol [OP_LIST_EOL] [OP_LIST_LEN] 4 [OP_PERM]
var_a = 'Hyeonjeong' var_b = 'Seulgi' var_c = 'Miran' var_d = 'Hocheol' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = len(list_a) var_f = 4 var_g = 1 var_e = int(var_e) var_f = int(var_f) for i, elem in enumerate(range(var_f)): var_g = var_g * (var_e-i) print(int(var_g))
Arithmetic calculation
When writing the numbers 10 through 99, find how many times the number 8 is written.
19
10 99 1 [OP_LIST_ARANGE] [OP_LIST2NUM] [OP_NUM2LIST] 8 [OP_LIST_FIND_NUM]
var_a = 10 var_b = 99 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d="" for i in list_a: i = str(i) var_d = var_d + i list_b = [] var_d = int(var_d) while var_d//10 > 0: list_b.append(var_d%10) var_d = var_d//10 list_b.append(var_d%10) list_b = list_b[::-1] var_e = 8 var_f = 0 var_e = int(var_e) for i in list_b: i = int(i) if i == var_e: var_f = var_f + 1 print(int(var_f))
Comparison
Yena and Yesol are following a dietary plan. Within a month, Yena lost 0.41 times 6 kilograms (kg) and Yesol lost 2.3 kilograms (kg). Which of them has lost more weight?
Yena
[OP_LIST_SOL] Yena Yesol [OP_LIST_EOL] [OP_LIST_SOL] 6 0.41 [OP_MUL] 2.3 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yena' var_b = 'Yesol' 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 = 0.41 var_e = var_c * var_d var_f = 2.3 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
In a factory, cuboid-shaped parts boxes measuring 8 centimeters (cm) in width, 12 centimeters (cm) in length, and 30 centimeters (cm) in height were stacked tightly to fill a cube-shaped room. At this time, if the size of the room is the smallest possible size, find how many boxes are stacked.
600
8 12 [OP_LCM] 30 [OP_LCM] 8 [OP_DIV] 8 12 [OP_LCM] 30 [OP_LCM] 12 [OP_DIV] 8 12 [OP_LCM] 30 [OP_LCM] 30 [OP_DIV] [OP_MUL] [OP_MUL]
var_a = 8 var_b = 12 var_c = var_b * var_a / math.gcd(int(var_b), int(var_a)) var_d = 30 var_e = var_d * var_c / math.gcd(int(var_d), int(var_c)) var_f = 8 var_g = var_e / var_f var_h = 8 var_i = 12 var_j = var_i * var_h / math.gcd(int(var_i), int(var_h)) var_k = 30 var_l = var_k * var_j / math.gcd(int(var_k), int(var_j)) var_m = 12 var_n = var_l / var_m var_o = 8 var_p = 12 var_q = var_p * var_o / math.gcd(int(var_p), int(var_o)) var_r = 30 var_s = var_r * var_q / math.gcd(int(var_r), int(var_q)) var_t = 30 var_u = var_s / var_t var_v = var_n * var_u var_w = var_g * var_v print(int(var_w))
Possibility
There are cards with numbers from 1 to 6. Find the number of ways Yuni chooses a card with an even number inscribed.
3
3
var_a = 3 print(int(var_a))
Geometry
I am trying to make the smallest square by arranging rectangular cards that are 5 centimeters (cm) wide and 7 centimeters (cm) tall without overlapping them. How many centimeters (cm) is one side of this square?
35
5 7 [OP_LCM]
var_a = 5 var_b = 7 var_c = var_b * var_a / math.gcd(int(var_b), int(var_a)) print(int(var_c))
Geometry
There is a regular octagonal prism whose sum of the lengths of its edges is 240 centimeters (cm). If the height of this prism is 12 centimeters (cm), what is the length of one side of the base?
9
240 12 8 [OP_MUL] [OP_SUB] 8 [OP_DIV] 2 [OP_DIV]
var_a = 240 var_b = 12 var_c = 8 var_d = var_b * var_c var_e = var_a - var_d var_f = 8 var_g = var_e / var_f var_h = 2 var_i = var_g / var_h print(int(var_i))
Comparison
Among five numbers of 1.4, 9/10, 1, 0.5, 13/10, how many are greater than 1?
2
[OP_LIST_SOL] 1.4 9/10 1 0.5 13/10 [OP_LIST_EOL] 1 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 1.4 var_b = 0.9 var_c = 1 var_d = 0.5 var_e = 1.3 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 1 list_b = [] for i in list_a: if i > var_f: list_b.append(i) var_g = len(list_b) print(int(var_g))
Possibility
You want to create a three-digit number by drawing three of 2, 0, 5, 9, and 6 and using them only once. Find the product of the largest number and the smallest number that can be made.
197825
[OP_LIST_SOL] 2 0 5 9 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_MUL]
var_a = 2 var_b = 0 var_c = 5 var_d = 9 var_e = 6 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = 1 list_d=list_b.copy() list_d.sort() var_j = list_d[var_i-1] var_k = var_h * var_j print(int(var_k))
Arithmetic calculation
You will need a 40 centimeters (cm) block of wood. If you have a block of wood which is 2 meters (m) 80 centimeters (cm) long, how many times do you have to cut it?
6
2 100 [OP_MUL] 80 [OP_ADD] 40 [OP_DIV] 1 [OP_SUB]
var_a = 2 var_b = 100 var_c = var_a * var_b var_d = 80 var_e = var_c + var_d var_f = 40 var_g = var_e / var_f var_h = 1 var_i = var_g - var_h print(int(var_i))
Comparison
In the multiplication of two-digit numbers, the 5 in the ones place of the number was misinterpreted as 2, so you mismultiplied it, resulting 704. If the correctly calculated value is 800, write the larger digit of the two two-digit numbers.
32
[OP_LIST_SOL] 704 800 [OP_SUB] 2 5 [OP_SUB] [OP_DIV] 800 704 800 [OP_SUB] 2 5 [OP_SUB] [OP_DIV] [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX]
var_a = 704 var_b = 800 var_c = var_a - var_b var_d = 2 var_e = 5 var_f = var_d - var_e var_g = var_c / var_f var_h = 800 var_i = 704 var_j = 800 var_k = var_i - var_j var_l = 2 var_m = 5 var_n = var_l - var_m var_o = var_k / var_n var_p = var_h / var_o list_a= [] if "/" in str(var_p): var_p = eval(str(var_p)) list_a.append(var_p) if "/" in str(var_g): var_g = eval(str(var_g)) list_a.append(var_g) list_a.reverse() var_q = 1 list_b=list_a.copy() list_b.sort() var_r = list_b[-var_q] print(int(var_r))
Arithmetic calculation
Eunji solved 12 questions in the exam A and 15 questions in the exam B. She got 4 questions wrong in the exam A, and got 2 more questions right in exam B than in exam A. How many questions did Eunji get wrong in exam A and exam B in total?
9
4 15 12 4 [OP_SUB] 2 [OP_ADD] [OP_SUB] [OP_ADD]
var_a = 4 var_b = 15 var_c = 12 var_d = 4 var_e = var_c - var_d var_f = 2 var_g = var_e + var_f var_h = var_b - var_g var_i = var_a + var_h print(int(var_i))
Arithmetic calculation
Jimin has 41 pieces of colored paper, and Jimin has 1 more than Seokjin. How many pieces of colored paper does Seokjin have?
40
41 1 [OP_SUB]
var_a = 41 var_b = 1 var_c = var_a - var_b print(int(var_c))
Arithmetic calculation
Namjoon gave Yoongi 18 candies, and there are 16 left over. How many candies did Namjoon have in the beginning?
34
18 16 [OP_ADD]
var_a = 18 var_b = 16 var_c = var_a + var_b print(int(var_c))
Arithmetic calculation
Yeonjeong and Donghun started at the same place and walked in opposite directions around the circumference of the lake with a circumference of 3 kilometers (km). If Yeonjeong walks at a speed of 100 meters (m) per minute and Donghun walks at a speed of 150 meters (m) per minute, find how many minutes later they meet again for the first time.
12
3 100 1000 [OP_DIV] 150 1000 [OP_DIV] [OP_ADD] [OP_DIV]
var_a = 3 var_b = 100 var_c = 1000 var_d = var_b / var_c var_e = 150 var_f = 1000 var_g = var_e / var_f var_h = var_d + var_g var_i = var_a / var_h print(int(var_i))
Possibility
Minji wants to choose a top and a bottom to wear on a field trip. If there are 3 types of tops and 5 types of bottoms, choose how many combinations of clothes Minji can wear.
15
3 1 [OP_COMB] 5 1 [OP_COMB] [OP_MUL]
var_a = 3 var_b = 1 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 = 5 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 = var_c * var_f print(int(var_g))
Possibility
Round up the smallest six-digit number that you can make by using the six number cards 0, 1, 3, 5, 7, and 9 once, to the thousandth place.
104000
[OP_LIST_SOL] 0 1 3 5 7 9 [OP_LIST_EOL] 6 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] 4 [OP_CEIL]
var_a = 0 var_b = 1 var_c = 3 var_d = 5 var_e = 7 var_f = 9 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-1] var_j = 4 var_k=int(((var_i+9*10**(var_j-2))//(10**(var_j-1)))*10**(var_j-1)) print(int(var_k))
Arithmetic calculation
There are 4 crates with 16 sweets each. How many sweets are there in all?
64
16 4 [OP_MUL]
var_a = 16 var_b = 4 var_c = var_a * var_b print(int(var_c))
Possibility
There is one volleyball, one soccerball, one basketball, and one baseball. How many different ways can there be to choose 2 different balls out of 4 balls?
6
[OP_LIST_SOL] volleyball soccerball basketball baseball [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_COMB]
var_a = 'volleyball' var_b = 'soccerball' var_c = 'basketball' var_d = 'baseball' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = len(list_a) var_f = 2 var_g = 1 var_e = int(var_e) var_f = int(var_f) for i, elem in enumerate(range(var_f)): var_g = var_g * (var_e-i) for i, elem in enumerate(range(var_f)): var_g = var_g / (i+1) print(int(var_g))
Arithmetic calculation
Jungkook's average score in Korean, math, and science is 92 points. If Jungkook's average score increased by 2 points after taking the English test, what is Jungkook's English score?
100
92 2 [OP_ADD] 4 [OP_MUL] 92 3 [OP_MUL] [OP_SUB]
var_a = 92 var_b = 2 var_c = var_a + var_b var_d = 4 var_e = var_c * var_d var_f = 92 var_g = 3 var_h = var_f * var_g var_i = var_e - var_h print(int(var_i))
Correspondence
The number of sheep is 6/11 of chickens, and the number of cows is 1/8 of sheeps in the farm. If there are 48 chickens, how many cows are there?
11
48 6/11 [OP_DIV] 1/8 [OP_MUL]
var_a = 48 var_b = 0.5454545454545454 var_c = var_a / var_b var_d = 0.125 var_e = var_c * var_d print(int(var_e))
Possibility
I am trying to draw two different numbers at the same time from the natural numbers from 1 to 9. Find the number of cases the sum of two numbers is less than 9.
24
1 9 1 [OP_LIST_ARANGE] 2 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] 9 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = 1 var_b = 9 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] list_c=[] for i in list_b: var_e = 0 i = int(i) while i//10 > 0: var_e = var_e + i%10 i = i//10 var_e = var_e + i%10 list_c.append(var_e) var_f = 9 list_d = [] for i in list_c: if i < var_f: list_d.append(i) var_g = len(list_d) print(int(var_g))
Geometry
There are several cuboids. When the sum of the number of edges and the number of faces of all cuboids is 216, find the sum of the number of vertices of all cuboids.
96
216 12 6 [OP_ADD] [OP_DIV] 8 [OP_MUL]
var_a = 216 var_b = 12 var_c = 6 var_d = var_b + var_c var_e = var_a / var_d var_f = 8 var_g = var_e * var_f print(int(var_g))
Arithmetic calculation
There are 240 third grade students at Heesu's school. If the number of third grade students who were glasses is 3/5 of the number of students who do not were glasses, how may third grade students do not were glasses?
150
240 1 3/5 [OP_ADD] [OP_DIV]
var_a = 240 var_b = 1 var_c = 0.6 var_d = var_b + var_c var_e = var_a / var_d print(int(var_e))
Arithmetic calculation
Five chrysanthemums and two roses are in the pot. How many flowers are in the pot?
7
5 2 [OP_ADD]
var_a = 5 var_b = 2 var_c = var_a + var_b print(int(var_c))
Comparison
The height of the seven students in Hyungjun's class is 161.5 centimeters (cm), 154.3 centimeters (cm), 143.7 centimeters (cm), 160.1 centimeters (cm), 158.0 centimeters (cm), 153.5 centimeters (cm), 147.8 centimeters (cm) Find out how many of these students are over 1 meter (m) and 50 centimeters (cm).
5
[OP_LIST_SOL] 161.5 154.3 143.7 160.1 158.0 153.5 147.8 [OP_LIST_EOL] 1 100 [OP_MUL] 50 [OP_ADD] [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 161.5 var_b = 154.3 var_c = 143.7 var_d = 160.1 var_e = 158 var_f = 153.5 var_g = 147.8 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 = 1 var_i = 100 var_j = var_h * var_i var_k = 50 var_l = var_j + var_k list_b = [] for i in list_a: if i > var_l: list_b.append(i) var_m = len(list_b) print(int(var_m))
Geometry
We are going to make a rectangular parallelepiped 10 centimeters (cm) wide, 8 centimeters (cm) long, and 5 centimeters (cm) high with wire. At least how many centimeters (cm) of wire do you need?
92
10 4 [OP_MUL] 8 4 [OP_MUL] [OP_ADD] 5 4 [OP_MUL] [OP_ADD]
var_a = 10 var_b = 4 var_c = var_a * var_b var_d = 8 var_e = 4 var_f = var_d * var_e var_g = var_c + var_f var_h = 5 var_i = 4 var_j = var_h * var_i var_k = var_g + var_j print(int(var_k))
Geometry
I drew the smallest circle enclosing a rhombus and the smallest square enclosing the circle. If the side of this square is 16 centimeters (cm), what is the area of the rhombus?
128
16 16 [OP_MUL] 2 [OP_DIV]
var_a = 16 var_b = 16 var_c = var_a * var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Correspondence
Subtract 74 from a number, multiply by 15, divide by 5, add 16, then subtract 15 to get 58. Find this number.
93
58 15 [OP_ADD] 16 [OP_SUB] 5 [OP_MUL] 15 [OP_DIV] 74 [OP_ADD]
var_a = 58 var_b = 15 var_c = var_a + var_b var_d = 16 var_e = var_c - var_d var_f = 5 var_g = var_e * var_f var_h = 15 var_i = var_g / var_h var_j = 74 var_k = var_i + var_j print(int(var_k))
Arithmetic calculation
In Yuna's house, there are 12 tangerines. If Yoo-jung ate 3 of them, how many tangerines are there at Yuna's house?
9
12 3 [OP_SUB]
var_a = 12 var_b = 3 var_c = var_a - var_b print(int(var_c))
Correspondence
It is said that the equation 632-AB1=41 holds. What number should be in A?
5
632-AB1=41 A [OP_DIGIT_UNK_SOLVER]
var_a = '632-AB1=41' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Arithmetic calculation
The red colored pencil is 5/9 of the total, and the blue colored pencil is 5/12 of the total. If the total number of colored pencils is 36, what is the number of red colored pencils minus the number of blue colored pencils?
5
36 5/9 [OP_MUL] 36 5/12 [OP_MUL] [OP_SUB]
var_a = 36 var_b = 0.5555555555555556 var_c = var_a * var_b var_d = 36 var_e = 0.4166666666666667 var_f = var_d * var_e var_g = var_c - var_f print(int(var_g))
Arithmetic calculation
We are trying to load 2153 chairs onto a truck. How many times should a truck carry at least if it can load up to 100 at a time?
22
2153 100 [OP_DIV] 1 [OP_CEIL]
var_a = 2153 var_b = 100 var_c = var_a / var_b var_d = 1 var_e=int(((var_c+9*10**(var_d-2))//(10**(var_d-1)))*10**(var_d-1)) print(int(var_e))
Comparison
There are three people: Hyunsoo, Seungah, and Kiyoon. Hyunsoo is taller than Kiyoon, and Kiyoon is taller than Seungah. Who is the tallest?
Hyunsoo
[OP_LIST_SOL] Hyunsoo Seungah Kiyoon [OP_LIST_EOL] [OP_LIST_SOL] Hyunsoo Kiyoon > Kiyoon Seungah > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'Hyunsoo' var_b = 'Seungah' var_c = 'Kiyoon' 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 = 'Hyunsoo' var_e = 'Kiyoon' var_f = '>' var_g = 'Kiyoon' var_h = 'Seungah' var_i = '>' list_b= [] if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_j = 1 var_k = list_c[var_j-1] print(var_k)
Comparison
8 people lined up. How many people are there between the person standing 4th from the back and the person standing 1st from the front?
3
8 1 [OP_SUB] 4 [OP_SUB]
var_a = 8 var_b = 1 var_c = var_a - var_b var_d = 4 var_e = var_c - var_d print(int(var_e))
Geometry
A square was made from a piece of string that is 32 centimeters (cm) long. What is the maximum area of the rectangle created in square centimeters (cm2)?
64
32 4 [OP_DIV] 2 [OP_POW]
var_a = 32 var_b = 4 var_c = var_a / var_b var_d = 2 var_e = var_c ** var_d print(int(var_e))
Arithmetic calculation
There are 2 boxes with 3 and 4 balls respectively. How many balls are there in both boxes?
7
3 4 [OP_ADD]
var_a = 3 var_b = 4 var_c = var_a + var_b print(int(var_c))
Correspondence
For two natural numbers A and B, if the quotient of A divided by B is 9 and the remainder is 13, what is the remainder if A is divided by 9?
4
13 9 [OP_MOD]
var_a = 13 var_b = 9 var_c = var_a % var_b print(int(var_c))
Arithmetic calculation
My father has 45 chickens. If there are 8 fewer ducks than chickens, how many chickens and ducks does the father have?
82
45 45 8 [OP_SUB] [OP_ADD]
var_a = 45 var_b = 45 var_c = 8 var_d = var_b - var_c var_e = var_a + var_d print(int(var_e))
Possibility
There are multiples of 123 that are greater than or equal to 1620006 and less than or equal to 1629996. Find the largest of these numbers.
1629996
1620006 1629996 1 [OP_LIST_ARANGE] 123 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX]
var_a = 1620006 var_b = 1629996 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 123 list_b = [] var_d = int(var_d) for i in list_a: i = int(i) if i % var_d == 0: list_b.append(i) var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] print(int(var_f))
Arithmetic calculation
There are 23 males and 9 females. How many more men are there than women?
14
23 9 [OP_SUB]
var_a = 23 var_b = 9 var_c = var_a - var_b print(int(var_c))
Correspondence
You had to multiply a number by 2 but instead multiplied by 5 to get 40. Find the correctly calculated vlaue.
16
40 5 [OP_DIV] 2 [OP_MUL]
var_a = 40 var_b = 5 var_c = var_a / var_b var_d = 2 var_e = var_c * var_d print(int(var_e))
Comparison
Naeun, Leejun, Yoonseo, Seohyun, and Soyul are interviewed in order. When Yoonseo and Seohyeon switched, who will be the 4th person being interviewed?
Yoonseo
[OP_LIST_SOL] Naeun Leejun Seohyun Yoonseo Soyul [OP_LIST_EOL] 4 [OP_LIST_GET]
var_a = 'Naeun' var_b = 'Leejun' var_c = 'Seohyun' var_d = 'Yoonseo' var_e = 'Soyul' list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 4 var_g = list_a[var_f-1] print(var_g)
Arithmetic calculation
Seungchan used 3/5 of the money he had yesterday and used 2/3 of the remaining money today. How many fractions of the money he had left?
0.13
1 3/5 [OP_SUB] 1 2/3 [OP_SUB] [OP_MUL]
var_a = 1 var_b = 0.6 var_c = var_a - var_b var_d = 1 var_e = 0.6666666666666666 var_f = var_d - var_e var_g = var_c * var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Possibility
How many times do you choose 3 subjects out of math, science, Korean, social studies, and music?
10
5 3 [OP_COMB]
var_a = 5 var_b = 3 var_c = 1 var_a = int(var_a) var_b = int(var_b) for i, elem in enumerate(range(var_b)): var_c = var_c * (var_a-i) for i, elem in enumerate(range(var_b)): var_c = var_c / (i+1) print(int(var_c))
Correspondence
If 5A+13=64, what number should be in A?
1
5A+13=64 A [OP_DIGIT_UNK_SOLVER]
var_a = '5A+13=64' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Arithmetic calculation
It took 4 days to solve all the problems in the workbook. On the first day, I solved 1/2 of the total. On the second day, I solved 1/4 of the total. On the third day, I solved 1/6 of the total. When I solved 20 problems on the last day, find the total number of problems in the workbook.
240
20 1 1/2 1/4 [OP_ADD] 1/6 [OP_ADD] [OP_SUB] [OP_DIV]
var_a = 20 var_b = 1 var_c = 0.5 var_d = 0.25 var_e = var_c + var_d var_f = 0.16666666666666666 var_g = var_e + var_f var_h = var_b - var_g var_i = var_a / var_h print(int(eval('{:.2f}'.format(round(var_i+1e-10,2)))))
Correspondence
The number of mackerel is 6/11 of croakers in the fish shop, and the number of croakers is 1/8 of tunas in the fish market. Find how many tunas are there when there are 48 mackerels.
704
48 6/11 [OP_DIV] 1/8 [OP_DIV]
var_a = 48 var_b = 0.5454545454545454 var_c = var_a / var_b var_d = 0.125 var_e = var_c / var_d print(int(var_e))
Possibility
How many different ways can you place 2 white and 1 black go stones in a row?
3
2 1 [OP_ADD] 2 [OP_COMB]
var_a = 2 var_b = 1 var_c = var_a + var_b var_d = 2 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))
Possibility
At the airport, 3 foreigners and 2 Koreans are lining up at the checkpoint. At this time, when it is said that foreigners must pass continuously, find the number of cases.
36
2 1 [OP_ADD] 2 1 [OP_ADD] [OP_PERM] 3 3 [OP_PERM] [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 = 3 var_i = 3 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 = var_g * var_j print(int(var_k))
Arithmetic calculation
There are 5, 1, 9, 0, 6, and 8. How many of them are between 4 and 8?
3
[OP_LIST_SOL] 5 1 9 0 6 8 [OP_LIST_EOL] 4 [OP_LIST_MORE_EQUAL] 8 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN]
var_a = 5 var_b = 1 var_c = 9 var_d = 0 var_e = 6 var_f = 8 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 = 4 list_b = [] for i in list_a: if i >= var_g: list_b.append(i) var_h = 8 list_c = [] for i in list_b: if i <= var_h: list_c.append(i) var_i = len(list_c) print(int(var_i))
Geometry
Six sheets of colored paper in the shape of a square with a side length of 30 centimeters (cm) were overlapped in a row by 7 centimeters (cm) and painted with glue. Find the area of the connected colored paper in square centimeters (cm2).
4350
30 6 [OP_MUL] 7 6 1 [OP_SUB] [OP_MUL] [OP_SUB] 30 [OP_MUL]
var_a = 30 var_b = 6 var_c = var_a * var_b var_d = 7 var_e = 6 var_f = 1 var_g = var_e - var_f var_h = var_d * var_g var_i = var_c - var_h var_j = 30 var_k = var_i * var_j print(int(var_k))
Correspondence
When you divide a certain number by 10, the result is 6. What is the value of the certain number minus 15?
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))
Geometry
How many more bases are there in an octagonal prism than there are bases in a square prism?
4
8 4 [OP_SUB]
var_a = 8 var_b = 4 var_c = var_a - var_b print(int(var_c))