category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Comparison
At Ha-gyeom's school, there are 221 students who are taller than 150 centimeters (cm) and 255 students who are not taller than 150 centimeters (cm). At Myeonghun's school, there are 275 students who wear glasses and 226 students who do not wear glasses. Which school has more students?
Myeonghun
[OP_LIST_SOL] Ha-gyeom Myeonghun [OP_LIST_EOL] [OP_LIST_SOL] 221 255 [OP_ADD] 275 226 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Ha-gyeom' var_b = 'Myeonghun' 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 = 221 var_d = 255 var_e = var_c + var_d var_f = 275 var_g = 226 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
You want to multiply a number by 12. When you mistakenly multiplied by 14 to get 42, what is the correctly calculated value?
36
42 14 [OP_DIV] 12 [OP_MUL]
var_a = 42 var_b = 14 var_c = var_a / var_b var_d = 12 var_e = var_c * var_d print(int(var_e))
Comparison
Choose a number greater than 1.1 among 1.4, 9/10, 1.2, 0.5, and 13/10, and count the number of selected numbers.
3
[OP_LIST_SOL] 1.4 9/10 1.2 0.5 13/10 [OP_LIST_EOL] 1.1 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 1.4 var_b = 0.9 var_c = 1.2 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.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
Numbers are given: 2, 4, 5, 1, 3, 7, 6, and 0. Find the smallest number using all cards only once.
10234567
[OP_LIST_SOL] 2 4 5 1 3 7 6 0 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 1 [OP_LIST_MIN]
var_a = 2 var_b = 4 var_c = 5 var_d = 1 var_e = 3 var_f = 7 var_g = 6 var_h = 0 list_a= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_a.append(var_h) 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_i = len(list_a) list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_i)) 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_j = 1 list_c=list_b.copy() list_c.sort() var_k = list_c[var_j-1] print(int(var_k))
Correspondence
632-AB1=41 is valid. What is B?
9
632-AB1=41 B [OP_DIGIT_UNK_SOLVER]
var_a = '632-AB1=41' 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))
Possibility
Choose 3 of the number cards from 1 to 9 and find the number of combination of numbers that makes 19.
30
1 9 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] 19 [OP_LIST_FIND_NUM]
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.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 = 19 var_g = 0 var_f = int(var_f) for i in list_c: i = int(i) if i == var_f: var_g = var_g + 1 print(int(var_g))
Arithmetic calculation
Which five-digit number is the smallest common multiple of 3 and 5?
10005
10000 99999 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN]
var_a = 10000 var_b = 99999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 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-1] print(int(var_g))
Possibility
3 different boxes each contain 4 types of balls. Find the number of ways Yongwoo chooses the ball.
12
3 4 [OP_MUL]
var_a = 3 var_b = 4 var_c = var_a * var_b print(int(var_c))
Possibility
If A is the largest and B is the smallest three-digit number made by drawing three out of six number cards 8, 3, 6, 5, 0, 7, find the value of (A-B) × 6 .
3426
[OP_LIST_SOL] 8 3 6 5 0 7 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] 6 [OP_MUL]
var_a = 8 var_b = 3 var_c = 6 var_d = 5 var_e = 0 var_f = 7 list_a= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_g = 3 list_b = [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 var_m = 6 var_n = var_l * var_m print(int(var_n))
Possibility
How many number of cases do you get a 4, 5, or 6 when you throw a die?
3
1 6 1 [OP_LIST_ARANGE] [OP_LIST_SOL] 4 5 6 [OP_LIST_EOL] [OP_SET_INTERSECT] [OP_LIST_LEN]
var_a = 1 var_b = 6 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 4 var_e = 5 var_f = 6 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) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() list_c = list(set(list_a) & set(list_b)) var_g = len(list_c) print(int(var_g))
Possibility
Find the largest four-digit number that can be formed by using the numbers 9, 4, 1, and 5 once each.
9541
[OP_LIST_SOL] 1 4 9 5 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX]
var_a = 1 var_b = 4 var_c = 9 var_d = 5 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 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 = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] print(int(var_g))
Comparison
Several children are standing in a circle equally spaced apart. Based on one child, the 6th child and the 11th child are standing facing each other in a clockwise direction. How many children are there in total?
10
11 6 [OP_SUB] 2 [OP_MUL]
var_a = 11 var_b = 6 var_c = var_a - var_b var_d = 2 var_e = var_c * var_d print(int(var_e))
Arithmetic calculation
When Haebin and 11 of his friends high-five each other once, how many high-fives are there?
66
11 1 [OP_ADD] 11 [OP_MUL] 2 [OP_DIV]
var_a = 11 var_b = 1 var_c = var_a + var_b var_d = 11 var_e = var_c * var_d var_f = 2 var_g = var_e / var_f print(int(var_g))
Arithmetic calculation
Minhyung went for a run with his friends. If it takes 20 seconds for Minhyung to run 150 meters (m), find how many meters (m) he can run in 1 minute.
450
1 60 [OP_MUL] 20 [OP_DIV] 150 [OP_MUL]
var_a = 1 var_b = 60 var_c = var_a * var_b var_d = 20 var_e = var_c / var_d var_f = 150 var_g = var_e * var_f print(int(var_g))
Comparison
Eunji was the 10th to arrive at school. If Taehyung arrived after Eunji and then Namjoon arrived, in which order did Namjoon arrive at school?
12
10 1 [OP_ADD] 1 [OP_ADD]
var_a = 10 var_b = 1 var_c = var_a + var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
Jungkook owns 3 balls and Yoongi owns 2 balls. How many balls are the two players owning?
5
3 2 [OP_ADD]
var_a = 3 var_b = 2 var_c = var_a + var_b print(int(var_c))
Geometry
A square was made by arranging 12 beads of the same size, 12 by 12, without gaps. How many marbles are on one side?
12
12
var_a = 12 print(int(var_a))
Arithmetic calculation
On the road, cars stand equally spaced from the front to the back. If the distance between the first car and the last car is 242 meters (m), and the distance between the cars is 5.5 meters (m), how many cars are there in the street?
45
242 5.5 [OP_FDIV] 1 [OP_ADD]
var_a = 242 var_b = 5.5 var_c = var_a // var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Possibility
From a fruit basket containing apple, peach, pear and melon, when a total of 3 fruits are taken out in order, allowing picking the same type of fruit, how many possible cases are there?
64
[OP_LIST_SOL] apple peach pear melon [OP_LIST_EOL] [OP_LIST_LEN] 3 [OP_POW]
var_a = 'apple' var_b = 'peach' var_c = 'pear' var_d = 'melon' 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 = 3 var_g = var_e ** var_f print(int(var_g))
Possibility
Seung-a had a group assignment with 5 friends and had to choose 1 leader, 1 secretary, and 2 presenters. Find the number of cases in which Seung-a becomes a clerk.
12
5 1 [OP_SUB] 1 1 1 [OP_SUB] [OP_ADD] 2 [OP_ADD] [OP_PERM] 2 2 [OP_PERM] [OP_DIV]
var_a = 5 var_b = 1 var_c = var_a - var_b var_d = 1 var_e = 1 var_f = 1 var_g = var_e - var_f var_h = var_d + var_g var_i = 2 var_j = var_h + var_i var_k = 1 var_c = int(var_c) var_j = int(var_j) for i, elem in enumerate(range(var_j)): var_k = var_k * (var_c-i) var_l = 2 var_m = 2 var_n = 1 var_l = int(var_l) var_m = int(var_m) for i, elem in enumerate(range(var_m)): var_n = var_n * (var_l-i) var_o = var_k / var_n print(int(var_o))
Arithmetic calculation
If the elements of set A are 1/2, 1/3, 1/5 and the elements of set B are 0.2, 0.4, 0.5, 0.7, find the number of elements in the intersection of set A and B.
2
[OP_LIST_SOL] 1/2 1/3 1/5 [OP_LIST_EOL] [OP_LIST_SOL] 0.2 0.4 0.5 0.7 [OP_LIST_EOL] [OP_SET_INTERSECT] [OP_LIST_LEN]
var_a = 0.5 var_b = 0.3333333333333333 var_c = 0.2 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 0.2 var_e = 0.4 var_f = 0.5 var_g = 0.7 list_b= [] if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() list_c = list(set(list_a) & set(list_b)) var_h = len(list_c) print(int(var_h))
Possibility
I want to choose 15 fruits from 4 types of fruits: apples, persimmons, pears, and tangerines. When I am trying to choose at least two from each type of fruit, how many ways can i choose?
120
4 15 [OP_ADD] 4 2 [OP_MUL] [OP_SUB] 1 [OP_SUB] 15 4 2 [OP_MUL] [OP_SUB] [OP_COMB]
var_a = 4 var_b = 15 var_c = var_a + var_b var_d = 4 var_e = 2 var_f = var_d * var_e var_g = var_c - var_f var_h = 1 var_i = var_g - var_h var_j = 15 var_k = 4 var_l = 2 var_m = var_k * var_l var_n = var_j - var_m var_o = 1 var_i = int(var_i) var_n = int(var_n) for i, elem in enumerate(range(var_n)): var_o = var_o * (var_i-i) for i, elem in enumerate(range(var_n)): var_o = var_o / (i+1) print(int(var_o))
Geometry
If there is a quadrangular pyramid, what is the number of faces?
5
4 1 [OP_ADD]
var_a = 4 var_b = 1 var_c = var_a + var_b print(int(var_c))
Arithmetic calculation
There are 16, 22, 30, 26, 18, and 20 candies each of the 6 members of the Si-gyeong's group have. On average, how many candies does Si-gyeong's group have?
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))
Comparison
Students are standing in a line to get tested for corona. Yeonji stands right behind Jeongsu, Jeongsu stands 24th from the back, and Yeonji stands 18th from the front. Find how many students are in line.
42
18 24 [OP_ADD]
var_a = 18 var_b = 24 var_c = var_a + var_b print(int(var_c))
Comparison
20 students were lined up, and Jungkook took the first place in the line. Yoongi stood right behind Jungkook. Find the number of students standing behind Yoongi.
18
20 1 [OP_SUB] 1 [OP_SUB]
var_a = 20 var_b = 1 var_c = var_a - var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
There are eight 15-story buildings in Joa's apartment complex. Half of these buildings have four families per floor, and the rest have five families per floor. If each household has two emergency flashlights installed, find out how many emergency flashlights are installed in Joa's apartment complex.
1080
15 8 [OP_MUL] 2 [OP_DIV] 4 [OP_MUL] 15 8 [OP_MUL] 2 [OP_DIV] 5 [OP_MUL] [OP_ADD] 2 [OP_MUL]
var_a = 15 var_b = 8 var_c = var_a * var_b var_d = 2 var_e = var_c / var_d var_f = 4 var_g = var_e * var_f var_h = 15 var_i = 8 var_j = var_h * var_i var_k = 2 var_l = var_j / var_k var_m = 5 var_n = var_l * var_m var_o = var_g + var_n var_p = 2 var_q = var_o * var_p print(int(var_q))
Comparison
There are 28 identical bookcases in the library. Each bookcase has 6 shelves, and the number of books on each shelf is the same at 19. How many books are there in the library?
3192
28 6 [OP_MUL] 19 [OP_MUL]
var_a = 28 var_b = 6 var_c = var_a * var_b var_d = 19 var_e = var_c * var_d print(int(var_e))
Geometry
We are trying to divide red beans filled in a rectangular parallelepiped container with two side lengths of the bottom each 6 meters (m) 40 centimeters (cm) and 9 meters (m) into several boxes whose volume is 1 cubic meter (m3). Find at least how many boxes you need.
300
6 40 100 [OP_DIV] [OP_ADD] 9 [OP_MUL] 5 20 100 [OP_DIV] [OP_ADD] [OP_MUL] 1 [OP_DIV] 1 [OP_CEIL]
var_a = 6 var_b = 40 var_c = 100 var_d = var_b / var_c var_e = var_a + var_d var_f = 9 var_g = var_e * var_f var_h = 5 var_i = 20 var_j = 100 var_k = var_i / var_j var_l = var_h + var_k var_m = var_g * var_l var_n = 1 var_o = var_m / var_n var_p = 1 var_q=int(((var_o+9*10**(var_p-2))//(10**(var_p-1)))*10**(var_p-1)) print(int(var_q))
Correspondence
There are 82 apples, 90 pears, 88 tangerines, and 84 melons at the fruit store, and the number of watermelons is unknown. If you divide the total number of fruits in the fruit store by 88, the quotient is 5 with no remainder. Find the number of watermelons.
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))
Geometry
I have a picture frame in the shape of a rectangle measuring 59.6 square centimeters (cm²). When four photos of the same size are inserted into this frame without overlapping, find the maximum size in square centimeters (cm2) of one photo.
14.9
59.6 4 [OP_DIV]
var_a = 59.6 var_b = 4 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Comparison
20 students were lined up. Eleven students are standing in front of Yoongi, and Hoseok is standing right in front of Yoongi. How many students are standing behind Hoseok?
10
20 11 [OP_SUB] 1 [OP_ADD]
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))
Possibility
What is the value of the smallest subtracted from the largest two-digit number that can be formed by drawing two different numbers from 1, 4, 7, and 9?
83
[OP_LIST_SOL] 1 4 7 9 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB]
var_a = 1 var_b = 4 var_c = 7 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 = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] var_h = 1 list_d=list_b.copy() list_d.sort() var_i = list_d[var_h-1] var_j = var_g - var_i print(int(var_j))
Correspondence
A number that is multiplied by 7 and subtracted 14 was 115.15. How much is it when this number is divided by 7?
2.64
115.15 14 [OP_ADD] 7 [OP_DIV] 7 [OP_DIV]
var_a = 115.15 var_b = 14 var_c = var_a + var_b var_d = 7 var_e = var_c / var_d var_f = 7 var_g = var_e / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Arithmetic calculation
How many out of 18, 15, 11, 19, and 10 are less than 15?
2
[OP_LIST_SOL] 18 15 11 19 10 [OP_LIST_EOL] 15 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = 18 var_b = 15 var_c = 11 var_d = 19 var_e = 10 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 = 15 list_b = [] for i in list_a: if i < var_f: list_b.append(i) var_g = len(list_b) print(int(var_g))
Geometry
A quadrilateral has a pair of parallel sides. If the length of one of the two parallel sides is 23 centimeters (cm), the distance between the two sides is 12 centimeters (cm), and the area of this rectangle is 222 square cm (cm2), how many centimeters (cm) is the length of the other side?
14
222 2 [OP_MUL] 12 [OP_DIV] 23 [OP_SUB]
var_a = 222 var_b = 2 var_c = var_a * var_b var_d = 12 var_e = var_c / var_d var_f = 23 var_g = var_e - var_f print(int(var_g))
Geometry
What is the volume of the largest cube that can be made by cutting a cuboid measuring 4 centimeters (cm) wide by 6 centimeters (cm) long by 5 centimeters (cm) high?
64
[OP_LIST_SOL] 4 6 4 [OP_LIST_EOL] 1 [OP_LIST_MIN] 1 [OP_LIST_MIN] 3 [OP_POW]
var_a = 4 var_b = 6 var_c = 4 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-1] var_f = 1 list_c=list_a.copy() list_c.sort() var_g = list_c[var_f-1] var_h = 3 var_i = var_g ** var_h print(int(var_i))
Correspondence
Seojun misunderstood the teacher's words to bring a 7/3 pizza from the next class and gave the 7/3 pizza to the next class. After giving the pizza, Seojun now has 3/2 pizza. If Seojun did the teacher's errand correctly, how many pizzas should Seojun have?
6.17
3/2 7/3 [OP_ADD] 7/3 [OP_ADD]
var_a = 1.5 var_b = 2.3333333333333335 var_c = var_a + var_b var_d = 2.3333333333333335 var_e = var_c + var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
There are 3 kilograms (kg) and 300 grams (g) of strawberries. How many grams (g) of strawberries will be left if you give 1 kg (kg) and 900 grams (g) to your friend?
1400
3 1000 [OP_MUL] 300 [OP_ADD] 1 1000 [OP_MUL] 900 [OP_ADD] [OP_SUB]
var_a = 3 var_b = 1000 var_c = var_a * var_b var_d = 300 var_e = var_c + var_d var_f = 1 var_g = 1000 var_h = var_f * var_g var_i = 900 var_j = var_h + var_i var_k = var_e - var_j print(int(var_k))
Correspondence
You were supposed to divide a certain number by 8 and add 7, but you mistakenly multiply by 8 and add 8, and you get 56. If you calculate correctly, find a value indicating the number to two decimal places.
7.75
56 8 [OP_SUB] 8 [OP_DIV] 8 [OP_DIV] 7 [OP_ADD]
var_a = 56 var_b = 8 var_c = var_a - var_b var_d = 8 var_e = var_c / var_d var_f = 8 var_g = var_e / var_f var_h = 7 var_i = var_g + var_h print('{:.2f}'.format(round(var_i+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 once, find the height of the elevator 20 seconds after starting in meters (m).
40
120 4 20 [OP_MUL] [OP_SUB]
var_a = 120 var_b = 4 var_c = 20 var_d = var_b * var_c var_e = var_a - var_d print(int(var_e))
Geometry
You drew a right triangle on drawing paper. If the length of one non-hypotenuse is 5 and the length of the other non-hypotenuse is 12, how much would the hypotenuse's length be?
13
12 2 [OP_POW] 5 2 [OP_POW] [OP_ADD] 1/2 [OP_POW]
var_a = 12 var_b = 2 var_c = var_a ** var_b var_d = 5 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
A number added to 9/7 is 13/5. What do you get when 13/5 is added to the number?
3.91
13/5 9/7 [OP_SUB] 13/5 [OP_ADD]
var_a = 2.6 var_b = 1.2857142857142858 var_c = var_a - var_b var_d = 2.6 var_e = var_c + var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
A total of 55 students participated in the game, and when counted the number of students who participated in A and B game, there were 38 and 42 students respectively. Find how many students participated in both A and B game.
25
38 42 [OP_ADD] 55 [OP_SUB]
var_a = 38 var_b = 42 var_c = var_a + var_b var_d = 55 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
There are four numbers: 10, 11, 12, and 13. What is the sum of the smallest number and the second smallest number?
21
[OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_ADD]
var_a = 10 var_b = 11 var_c = 12 var_d = 13 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 1 list_b=list_a.copy() list_b.sort() var_f = list_b[var_e-1] var_g = 2 list_c=list_a.copy() list_c.sort() var_h = list_c[var_g-1] var_i = var_f + var_h print(int(var_i))
Correspondence
What is the largest multiple of 12, a three-digit number with 5 in the hundreds place?
588
5 100 [OP_MUL] 5 1 [OP_ADD] 100 [OP_MUL] 1 [OP_SUB] 1 [OP_LIST_ARANGE] 12 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX]
var_a = 5 var_b = 100 var_c = var_a * var_b var_d = 5 var_e = 1 var_f = var_d + var_e var_g = 100 var_h = var_f * var_g var_i = 1 var_j = var_h - var_i var_k = 1 list_a = [i for i in range(var_c, var_j + 1, var_k)] var_l = 12 list_b = [] var_l = int(var_l) for i in list_a: i = int(i) if i % var_l == 0: list_b.append(i) var_m = 1 list_c=list_b.copy() list_c.sort() var_n = list_c[-var_m] print(int(var_n))
Correspondence
ABC+ABC+ABC+ABC=1436. Find A+B+C when A, B, and C are three different numbers.
17
[OP_LIST_SOL] ABC+ABC+ABC+ABC=1436 A [OP_DIGIT_UNK_SOLVER] ABC+ABC+ABC+ABC=1436 B [OP_DIGIT_UNK_SOLVER] ABC+ABC+ABC+ABC=1436 C [OP_DIGIT_UNK_SOLVER] [OP_LIST_EOL] [OP_LIST_SUM]
var_a = 'ABC+ABC+ABC+ABC=1436' 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 = 'ABC+ABC+ABC+ABC=1436' 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 = 'ABC+ABC+ABC+ABC=1436' var_h = 'C' ans_dict = dict() var_g = var_g.replace('×','*') var_g = var_g.replace('x','*') var_g = var_g.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_g): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_g for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_g): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_i = ans_dict[var_h] list_a= [] if "/" in str(var_i): var_i = eval(str(var_i)) list_a.append(var_i) if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) list_a.reverse() list_a = [float(i) for i in list_a] var_j = sum(list_a) print(int(var_j))
Arithmetic calculation
There are 52 hens on the farm. Hens are 16 fewer than roosters. How many chickens are there on the farm?
120
52 52 16 [OP_ADD] [OP_ADD]
var_a = 52 var_b = 52 var_c = 16 var_d = var_b + var_c var_e = var_a + var_d print(int(var_e))
Geometry
When a cuboid-shaped block of wood measuring 18 centimeters (cm) wide, 6 centimeters (cm) long, and 6 cm (height) is cut into three cubes with a side of 6 centimeters (cm) long, How many the surface area cm2 does it increase?
288
3 6 3 [OP_POW] [OP_MUL] 18 6 [OP_MUL] 6 6 [OP_MUL] [OP_ADD] 6 6 [OP_MUL] [OP_ADD] 2 [OP_MUL] [OP_SUB]
var_a = 3 var_b = 6 var_c = 3 var_d = var_b ** var_c var_e = var_a * var_d var_f = 18 var_g = 6 var_h = var_f * var_g var_i = 6 var_j = 6 var_k = var_i * var_j var_l = var_h + var_k var_m = 6 var_n = 6 var_o = var_m * var_n var_p = var_l + var_o var_q = 2 var_r = var_p * var_q var_s = var_e - var_r print(int(var_s))
Geometry
You built a cuboid-shaped pond with a length of 18 meters (m), a width of 10 meters (m), and a height of 2 meters (m). If you are going to paint the inner side of the pond, how many square meters (㎡) of the pond could be painted?
292
18 10 [OP_MUL] 10 2 [OP_MUL] 2 18 [OP_MUL] [OP_ADD] 2 [OP_MUL] [OP_ADD]
var_a = 18 var_b = 10 var_c = var_a * var_b var_d = 10 var_e = 2 var_f = var_d * var_e var_g = 2 var_h = 18 var_i = var_g * var_h var_j = var_f + var_i var_k = 2 var_l = var_j * var_k var_m = var_c + var_l print(int(var_m))
Comparison
Jungkook puts 4 and 4 together. Jimin puts 3 and 6 together. Who has the greater number?
Jimin
[OP_LIST_SOL] Jungkook Jimin [OP_LIST_EOL] [OP_LIST_SOL] 4 4 [OP_ADD] 3 6 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jungkook' var_b = 'Jimin' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 4 var_d = 4 var_e = var_c + var_d var_f = 3 var_g = 6 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)
Comparison
Joo-hee and Jun-seong want to share 25 chocolates. Find how many chocolates Joo-hee ate when Joo-hee ate 1 more chocolate than twice Jun-seong ate.
17
25 1 [OP_SUB] 2 1 [OP_ADD] [OP_DIV] 2 [OP_MUL] 1 [OP_ADD]
var_a = 25 var_b = 1 var_c = var_a - var_b var_d = 2 var_e = 1 var_f = var_d + var_e var_g = var_c / var_f var_h = 2 var_i = var_g * var_h var_j = 1 var_k = var_i + var_j print(int(var_k))
Geometry
The diamond-shaped roof drawn by Jaewoong has a diagonal of 16 centimeters (cm) and an area of 80 square centimeters (cm2). How many centimeters (cm) is the length of the other diagonal of this roof?
10
80 2 [OP_MUL] 16 [OP_DIV]
var_a = 80 var_b = 2 var_c = var_a * var_b var_d = 16 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
How many two-digit numbers are less than 36 and greater than 29?
6
29 1 [OP_ADD] 36 1 [OP_SUB] 1 [OP_LIST_ARANGE] [OP_LIST_LEN]
var_a = 29 var_b = 1 var_c = var_a + var_b var_d = 36 var_e = 1 var_f = var_d - var_e var_g = 1 list_a = [i for i in range(var_c, var_f + 1, var_g)] var_h = len(list_a) print(int(var_h))
Correspondence
A is a single-digit number. Find A when the multiplication of single-digit numbers A×A×A is the same as 21A.
6
A×A×A=21A A [OP_DIGIT_UNK_SOLVER]
var_a = 'A×A×A=21A' 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
There are 194 men and 235 women in the museum, and 68 of them got free admission. Find how many more people paid for admission to the museum than those who got free admission.
293
194 235 [OP_ADD] 68 [OP_SUB] 68 [OP_SUB]
var_a = 194 var_b = 235 var_c = var_a + var_b var_d = 68 var_e = var_c - var_d var_f = 68 var_g = var_e - var_f print(int(var_g))
Comparison
Find the number of numbers greater than 0.4 among 0.8, 1/2, 0.3, and 1/3.
2
[OP_LIST_SOL] 0.8 1/2 0.3 1/3 [OP_LIST_EOL] 0.4 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 0.8 var_b = 0.5 var_c = 0.3 var_d = 0.3333333333333333 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 0.4 list_b = [] for i in list_a: if i > var_e: list_b.append(i) var_f = len(list_b) print(int(var_f))
Correspondence
If the four numbers A, B, C, and D satisfy the four-digit subtraction formula A05B-1C04=30D8, find the value of A+B-C+D.
10
A05B-1C04=30D8 A [OP_DIGIT_UNK_SOLVER] A05B-1C04=30D8 B [OP_DIGIT_UNK_SOLVER] [OP_ADD] A05B-1C04=30D8 C [OP_DIGIT_UNK_SOLVER] [OP_SUB] A05B-1C04=30D8 D [OP_DIGIT_UNK_SOLVER] [OP_ADD]
var_a = 'A05B-1C04=30D8' 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 = 'A05B-1C04=30D8' 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 var_h = 'A05B-1C04=30D8' var_i = 'C' ans_dict = dict() var_h = var_h.replace('×','*') var_h = var_h.replace('x','*') var_h = var_h.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_h): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_h 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_h): 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_j = ans_dict[var_i] var_k = var_g - var_j var_l = 'A05B-1C04=30D8' var_m = 'D' ans_dict = dict() var_l = var_l.replace('×','*') var_l = var_l.replace('x','*') var_l = var_l.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_l): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_l 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_l): 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_n = ans_dict[var_m] var_o = var_k + var_n print(int(var_o))
Possibility
There are 3 blue balls and 5 red balls in the box. When 2 red balls are placed inside the box, how many blue balls are in the box?
3
3
var_a = 3 print(int(var_a))
Correspondence
Yeongsoo gave Hyogeun 200 won, Hyogeun gave Woong 500 won, and Woong gave Yeongsoo 1000 won. As a result, they have 2000 won respectively. How much money did Yeongsoo have at first?
1200
2000 1000 [OP_SUB] 200 [OP_ADD]
var_a = 2000 var_b = 1000 var_c = var_a - var_b var_d = 200 var_e = var_c + var_d print(int(var_e))
Geometry
Given a map with a scale of 1/250000, find the distance in centimeters (cm) on the map of two points whose actual distance is 5 kilometers (km).
2
5 100 1000 [OP_MUL] [OP_MUL] 1/250000 [OP_MUL]
var_a = 5 var_b = 100 var_c = 1000 var_d = var_b * var_c var_e = var_a * var_d var_f = 4e-06 var_g = var_e * var_f print(int(var_g))
Geometry
If you multiply a number by 2 and divide it by 16, the quotient is 25. Find what the number is.
200
25 16 [OP_MUL] 2 [OP_DIV]
var_a = 25 var_b = 16 var_c = var_a * var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Geometry
There is a rectangular farm. The length of the long side is 1 kilometer (km), and the length of the short side is 2/8 km (km) shorter than the length of the long side. How many kilometers (km) will you have to walk if you walk around the farm once?
3.5
1 1 2/8 [OP_SUB] [OP_ADD] 2 [OP_MUL]
var_a = 1 var_b = 1 var_c = 0.25 var_d = var_b - var_c var_e = var_a + var_d var_f = 2 var_g = var_e * var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Geometry
Mihyang cut the colored paper into regular hexagons so that each side is 5 centimeters (cm) long. What is the perimeter of this regular hexagon in centimeters (cm)?
30
5 6 [OP_MUL]
var_a = 5 var_b = 6 var_c = var_a * var_b print(int(var_c))
Geometry
There is a rhombus with an area of 24.48 square centimeters (cm2). If one diagonal of this rhombus is 8 centimeters (cm), find the difference between the length of this diagonal and the other diagonal.
1.88
8 24.48 2 [OP_MUL] 8 [OP_DIV] [OP_SUB] [OP_ABS]
var_a = 8 var_b = 24.48 var_c = 2 var_d = var_b * var_c var_e = 8 var_f = var_d / var_e var_g = var_a - var_f var_h = abs(var_g) print('{:.2f}'.format(round(var_h+1e-10,2)))
Comparison
There are a total of 4 numbers: 0.8, 1/2, 0.5, 1/3. What is the largest of these numbers that are less than 3?
0.8
[OP_LIST_SOL] 0.8 1/2 0.5 1/3 [OP_LIST_EOL] 3 [OP_LIST_LESS] 1 [OP_LIST_MAX]
var_a = 0.8 var_b = 0.5 var_c = 0.5 var_d = 0.3333333333333333 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 list_b = [] for i in list_a: if i < var_e: list_b.append(i) var_f = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] print('{:.2f}'.format(round(var_g+1e-10,2)))
Comparison
Seokjin and Taehyung jumped ropes for two days yesterday and today. Seokjin did 15 more today than yesterday, and Taehyung did 12 fewer today than yesterday. If Seokjin and Taehyung jumped ropes 32 times and 58 times respectively yesterday, then find out who skipped more ropes today.
Seokjin
[OP_LIST_SOL] Seokjin Taehyung [OP_LIST_EOL] [OP_LIST_SOL] 32 15 [OP_ADD] 58 12 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Seokjin' var_b = 'Taehyung' 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 = 32 var_d = 15 var_e = var_c + var_d var_f = 58 var_g = 12 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 box, which had 12 identical children's books inside, weighed 11.48 kilograms (kg). When 4 children's books were removed from the box, it weighed 8.12 kilograms (kg). What is the weight of the empty box in kilograms (kg)?
1.4
11.48 11.48 8.12 [OP_SUB] 4 [OP_DIV] 12 [OP_MUL] [OP_SUB]
var_a = 11.48 var_b = 11.48 var_c = 8.12 var_d = var_b - var_c var_e = 4 var_f = var_d / var_e var_g = 12 var_h = var_f * var_g var_i = var_a - var_h print('{:.2f}'.format(round(var_i+1e-10,2)))
Comparison
Find out how many three-digit prime numbers exist, which are less than 3.01 but greater than 3, and have 3 as its units digit, 0 and 6 as the 1st and 2nd decimal place, and 6 as the 3rd decimal place.
3
0 9 1 [OP_LIST_ARANGE] 6 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 0 var_b = 9 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 6 list_b = [] for i in list_a: if i > var_d: list_b.append(i) var_e = len(list_b) print(int(var_e))
Arithmetic calculation
If you write down the numbers 1 through 50 once on a piece of paper, find how many times you write 1.
15
1 50 1 [OP_LIST_ARANGE] [OP_LIST2NUM] [OP_NUM2LIST] 1 [OP_LIST_FIND_NUM]
var_a = 1 var_b = 50 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 = 1 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))
Possibility
Jungkook bought two boxes each containing three red balls. How many red balls does Jungkook have?
6
3 2 [OP_MUL]
var_a = 3 var_b = 2 var_c = var_a * var_b print(int(var_c))
Arithmetic calculation
You are trying to pack 24 tangerines and 18 apples in one box. If there are no remaining apples or tangerines and each box contains the same number, find the maximum number of boxes you can make.
6
24 18 [OP_GCD]
var_a = 24 var_b = 18 var_c = math.gcd(int(var_b), int(var_a)) print(int(var_c))
Geometry
Junyoung has a hoop with a diameter of 50 centimeters (cm). After rolling this hoop several times, it moved forward by 6 meters (m) and 28 centimeters (cm). If the pi is 3.14, how many times does the hoop need to be rolled?
4
6 100 [OP_MUL] 28 [OP_ADD] 50 3.14 [OP_MUL] [OP_DIV]
var_a = 6 var_b = 100 var_c = var_a * var_b var_d = 28 var_e = var_c + var_d var_f = 50 var_g = 3.14 var_h = var_f * var_g var_i = var_e / var_h print(int(var_i))
Arithmetic calculation
Aunt Yujeong gave three carrots to her nephew, Yoongi. Yoongi's older sister received 4, but she gave 2 to Yoongi again. How many carrots does Yoongi have?
5
3 2 [OP_ADD]
var_a = 3 var_b = 2 var_c = var_a + var_b print(int(var_c))
Correspondence
Jimin is trying to subtract a number from 34. If the result of mistakenly dividing 96 by a number is 6, find the correct result.
18
34 96 6 [OP_DIV] [OP_SUB]
var_a = 34 var_b = 96 var_c = 6 var_d = var_b / var_c var_e = var_a - var_d print(int(var_e))
Possibility
Four non-overlapping numbers from 0 to 9 were drawn and made a four-digit number. What is the difference between the second largest and the second smallest possible cases?
8851
0 9 1 [OP_LIST_ARANGE] 4 [OP_LIST_GET_PERM] 2 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_SUB]
var_a = 0 var_b = 9 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 4 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = 2 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] var_g = 2 list_d=list_b.copy() list_d.sort() var_h = list_d[var_g-1] var_i = var_f - var_h print(int(var_i))
Possibility
If there are 6 students in the auditorium, find the number of cases in which 1 class president, 1 moderator, 1 vice-president, and 1 assistant moderator are selected.
360
6 1 1 [OP_ADD] 1 [OP_ADD] 1 [OP_ADD] [OP_PERM]
var_a = 6 var_b = 1 var_c = 1 var_d = var_b + var_c var_e = 1 var_f = var_d + var_e var_g = 1 var_h = var_f + var_g var_i = 1 var_a = int(var_a) var_h = int(var_h) for i, elem in enumerate(range(var_h)): var_i = var_i * (var_a-i) print(int(var_i))
Comparison
How many of 0.9, 5/10, 1, 7/10, and 1.2 are greater than 0.8?
3
[OP_LIST_SOL] 0.9 5/10 1 7/10 1.2 [OP_LIST_EOL] 0.8 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 0.9 var_b = 0.5 var_c = 1 var_d = 0.7 var_e = 1.2 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 0.8 list_b = [] for i in list_a: if i > var_f: list_b.append(i) var_g = len(list_b) print(int(var_g))
Comparison
There are numbers 0.8, 1/2, and 0.9. Find the greatest number among the given numbers less than or equal to 0.6.
0.5
[OP_LIST_SOL] 0.8 1/2 0.9 [OP_LIST_EOL] 0.6 [OP_LIST_LESS_EQUAL] 1 [OP_LIST_MAX]
var_a = 0.8 var_b = 0.5 var_c = 0.9 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 0.6 list_b = [] for i in list_a: if i <= var_d: list_b.append(i) var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] print('{:.2f}'.format(round(var_f+1e-10,2)))
Possibility
You took three number jellies from the vending machine and they were numbered 0, 1, and 5. If you use two out of three jellies, how many two-digit numbers can you create?
4
[OP_LIST_SOL] 0 1 5 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 5 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))
Geometry
What is the surface area of a cuboid that is 8 centimeters (cm) wide, 5 centimeters (cm) long, and 10 centimeters (cm) height?
340
8 5 [OP_MUL] 8 10 [OP_MUL] [OP_ADD] 5 10 [OP_MUL] [OP_ADD] 2 [OP_MUL]
var_a = 8 var_b = 5 var_c = var_a * var_b var_d = 8 var_e = 10 var_f = var_d * var_e var_g = var_c + var_f var_h = 5 var_i = 10 var_j = var_h * var_i var_k = var_g + var_j var_l = 2 var_m = var_k * var_l print(int(var_m))
Comparison
Find the sum of the numbers that are greater than or equal to 1.1 among the five numbers 1.4, 9/10, 1.2, 0.5, and 13/10.
3.9
[OP_LIST_SOL] 1.4 9/10 1.2 0.5 13/10 [OP_LIST_EOL] 1.1 [OP_LIST_MORE_EQUAL] [OP_LIST_SUM]
var_a = 1.4 var_b = 0.9 var_c = 1.2 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.1 list_b = [] for i in list_a: if i >= var_f: list_b.append(i) list_b = [float(i) for i in list_b] var_g = sum(list_b) print('{:.2f}'.format(round(var_g+1e-10,2)))
Geometry
In a right triangle, if the length of the non-hypotenuse is 6 and the length of the hypotenuse is 10, what is the length of the other side?
8
10 2 [OP_POW] 6 2 [OP_POW] [OP_SUB] 1/2 [OP_POW]
var_a = 10 var_b = 2 var_c = var_a ** var_b var_d = 6 var_e = 2 var_f = var_d ** var_e var_g = var_c - var_f var_h = 0.5 var_i = var_g ** var_h print(int(var_i))
Arithmetic calculation
A truck travels 2.1 kilometers (km) in 1 minute at a constant speed, while a taxi covers 10.5 km in 4 minutes. Which vehicle is quicker, the taxi or truck, by how many times?
1.25
10.5 4 [OP_DIV] 2.1 1 [OP_DIV] [OP_DIV]
var_a = 10.5 var_b = 4 var_c = var_a / var_b var_d = 2.1 var_e = 1 var_f = var_d / var_e var_g = var_c / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Correspondence
Subtracting 2 twice from a certain number results in 5. What is the certain number?
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))
Comparison
Seungmin picked up 4.56 kilograms (kg) of chestnuts and Hyein picked up 10 times as much as 462 grams (g). Who picked up more chestnuts, Seungmin or Hyein?
Hyein
[OP_LIST_SOL] Seungmin Hyein [OP_LIST_EOL] [OP_LIST_SOL] 4.56 462 10 [OP_MUL] 1000 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Seungmin' var_b = 'Hyein' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 4.56 var_d = 462 var_e = 10 var_f = var_d * var_e var_g = 1000 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
While Yoongi was subtracting 57 from the four digit number, Yoongi mistakenly saw the 9 in the ones digit of the four digit number as 6. If Yoongi got 1819 from this, what is the correct calculation result?
1822
1819 57 [OP_ADD] 6 9 [OP_SUB] [OP_SUB] 57 [OP_SUB]
var_a = 1819 var_b = 57 var_c = var_a + var_b var_d = 6 var_e = 9 var_f = var_d - var_e var_g = var_c - var_f var_h = 57 var_i = var_g - var_h print(int(var_i))
Geometry
Hosok bought a few centimeters (cm) of wire and cut a length equal to the circumference of an equilateral triangle with a side length of 19 centimeters (cm). If the wire left after cutting is 15 centimeters (cm), what is the length in centimeters (cm) of the wire that Hoseok bought?
72
19 3 [OP_MUL] 15 [OP_ADD]
var_a = 19 var_b = 3 var_c = var_a * var_b var_d = 15 var_e = var_c + var_d print(int(var_e))
Comparison
Heejin and Heechul are collecting books. Heechul has 2 more books than Heejin. Dongkyun has fewer books than Heejin. Which of the three has the most books?
Heechul
[OP_LIST_SOL] Heejin Heechul Dongkyun [OP_LIST_EOL] [OP_LIST_SOL] Heechul Heejin > Dongkyun Heejin < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'Heejin' var_b = 'Heechul' var_c = 'Dongkyun' 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 = 'Heechul' var_e = 'Heejin' var_f = '>' var_g = 'Dongkyun' var_h = 'Heejin' 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)
Arithmetic calculation
Find how many grams (g) of water evaporated from 300 grams (g) of 4% sugar water to make 10% sugar water.
180
300 300 4 100 [OP_DIV] [OP_MUL] 100 10 [OP_DIV] [OP_MUL] [OP_SUB]
var_a = 300 var_b = 300 var_c = 4 var_d = 100 var_e = var_c / var_d var_f = var_b * var_e var_g = 100 var_h = 10 var_i = var_g / var_h var_j = var_f * var_i var_k = var_a - var_j print(int(var_k))
Geometry
If you double the length of each edge of a cube, how many times bigger does the cube's surface area become?
4
2 2 [OP_POW]
var_a = 2 var_b = 2 var_c = var_a ** var_b print(int(var_c))
Arithmetic calculation
What is the smallest five-digit number that is a multiple of 9 and a multiple of 6 and a multiple of 2?
10008
10000 99999 1 [OP_LIST_ARANGE] 9 [OP_LIST_DIVISIBLE] 6 [OP_LIST_DIVISIBLE] 2 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN]
var_a = 10000 var_b = 99999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 9 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 = 6 list_c = [] var_e = int(var_e) for i in list_b: i = int(i) if i % var_e == 0: list_c.append(i) var_f = 2 list_d = [] var_f = int(var_f) for i in list_c: i = int(i) if i % var_f == 0: list_d.append(i) var_g = 1 list_e=list_d.copy() list_e.sort() var_h = list_e[var_g-1] print(int(var_h))
Arithmetic calculation
You have 200 grams (g) of salt water with a concentration of 25%, and 60 grams (g) of salt are dissolved in another 300 grams (g) of salt water. What is the percent concentration of the salt water when these two salt water are mixed?
22
200 25 100 [OP_DIV] [OP_MUL] 60 [OP_ADD] 200 300 [OP_ADD] [OP_DIV] 100 [OP_MUL]
var_a = 200 var_b = 25 var_c = 100 var_d = var_b / var_c var_e = var_a * var_d var_f = 60 var_g = var_e + var_f var_h = 200 var_i = 300 var_j = var_h + var_i var_k = var_g / var_j var_l = 100 var_m = var_k * var_l print(int(var_m))
Arithmetic calculation
The subway is moving 1.6 kilometers (km) per minute. If the distance between the previous station and this station is 4.85 kilometers (km), and it took 3 minutes and 15 seconds to pass this station completely from the previous station, how long is the subway in meters (m)?
350
1.6 3 15 60 [OP_DIV] [OP_ADD] [OP_MUL] 4.85 [OP_SUB] 1000 [OP_MUL]
var_a = 1.6 var_b = 3 var_c = 15 var_d = 60 var_e = var_c / var_d var_f = var_b + var_e var_g = var_a * var_f var_h = 4.85 var_i = var_g - var_h var_j = 1000 var_k = var_i * var_j print(int(eval('{:.2f}'.format(round(var_k+1e-10,2)))))
Arithmetic calculation
Minseok started reading a storybook and read 1/3 of it yesterday and 2/5 of it today. What is the total number of unread parts?
0.27
1 1/3 [OP_SUB] 2/5 [OP_SUB]
var_a = 1 var_b = 0.3333333333333333 var_c = var_a - var_b var_d = 0.4 var_e = var_c - var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
Subtracting 27 from a number gives 46. What is the number multiplied by 46?
3358
27 46 [OP_ADD] 46 [OP_MUL]
var_a = 27 var_b = 46 var_c = var_a + var_b var_d = 46 var_e = var_c * var_d print(int(var_e))
Correspondence
Subtracting 174 from a number and multiplying it by 19 yields 3439. What is a number?
355
3439 19 [OP_DIV] 174 [OP_ADD]
var_a = 3439 var_b = 19 var_c = var_a / var_b var_d = 174 var_e = var_c + var_d print(int(var_e))
Correspondence
There are different numbers A, B, C, and D. Given that A+A=6, BA=4, C+B=9, and D-C=7. Find out what D is.
9
A+A=6 A [OP_NUM_UNK_SOLVER] 4 [OP_ADD] 9 [OP_SUB] 7 [OP_SUB] -1 [OP_MUL]
var_a = 'A+A=6' 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] = 0 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] = int(c[i]) var_c = ans_dict[var_b] var_d = 4 var_e = var_c + var_d var_f = 9 var_g = var_e - var_f var_h = 7 var_i = var_g - var_h var_j = -1 var_k = var_i * var_j print(int(var_k))
Correspondence
You can take 40 peaches and 34 cherries in separate bags. I am going to put 8 peaches and 5 cherries in bags, but I will not put the leftovers in bags. Find how many handles there are in the bags full of peaches and cherries.
14
40 8 [OP_FDIV] 34 12 [OP_FDIV] [OP_ADD] 2 [OP_MUL]
var_a = 40 var_b = 8 var_c = var_a // var_b var_d = 34 var_e = 12 var_f = var_d // var_e var_g = var_c + var_f var_h = 2 var_i = var_g * var_h print(int(var_i))
Possibility
If 5 students, 2 of whom are elementary school students, are lined up, how many ways can the elementary school students stand at either end?
12
5 2 [OP_SUB] 5 2 [OP_SUB] [OP_PERM] 2 [OP_MUL]
var_a = 5 var_b = 2 var_c = var_a - var_b var_d = 5 var_e = 2 var_f = var_d - var_e var_g = 1 var_c = int(var_c) var_f = int(var_f) for i, elem in enumerate(range(var_f)): var_g = var_g * (var_c-i) var_h = 2 var_i = var_g * var_h print(int(var_i))