category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Comparison
The least common multiple of any two numbers is 21. Write the common multiples of these two numbers in order, starting with the smallest number. What is the sum of the numbers between the 8th and the 12th from the left?
630
21 8 1 [OP_ADD] [OP_MUL] 21 12 -1 [OP_ADD] [OP_MUL] 21 [OP_LIST_ARANGE] [OP_LIST_SUM]
var_a = 21 var_b = 8 var_c = 1 var_d = var_b + var_c var_e = var_a * var_d var_f = 21 var_g = 12 var_h = -1 var_i = var_g + var_h var_j = var_f * var_i var_k = 21 list_a = [i for i in range(var_e, var_j + 1, var_k)] list_a = [float(i) for i in list_a] var_l = sum(list_a) print(int(var_l))
Arithmetic calculation
If you pour 1/6 of the milk, pour the remaining 2/5 of the milk, and then pour the remaining 2/3 of the milk, you have 120 milliliters (mL) left, how many milliliters (mL) of the original milk were there?
720
120 1 1/6 [OP_SUB] [OP_DIV] 1 2/5 [OP_SUB] [OP_DIV] 1 2/3 [OP_SUB] [OP_DIV]
var_a = 120 var_b = 1 var_c = 0.16666666666666666 var_d = var_b - var_c var_e = var_a / var_d var_f = 1 var_g = 0.4 var_h = var_f - var_g var_i = var_e / var_h var_j = 1 var_k = 0.6666666666666666 var_l = var_j - var_k var_m = var_i / var_l print(int(eval('{:.2f}'.format(round(var_m+1e-10,2)))))
Geometry
You have a square piece of paper with a side of 14 centimeters (cm). How many rectangular pieces of paper that are 8 centimeters (cm) long and 2 centimeters (cm) wide can be cut out of this piece of paper?
12
14 2 [OP_POW] 8 2 [OP_MUL] [OP_FDIV]
var_a = 14 var_b = 2 var_c = var_a ** var_b var_d = 8 var_e = 2 var_f = var_d * var_e var_g = var_c // var_f print(int(var_g))
Arithmetic calculation
The two players teamed up to participate in the competition. Gaga has to cross the river on a boat, and Nana has to ride a bicycle through a tunnel. Boats move at 3 kilometers (km) per hour, and bicycles move at 4 kilometers (km) per hour. If the tunnel is 2 kilometers (km) longer than the river, and the total time of two players is 4 hours, how long does Gaga cross the river?
2
4 2 4 [OP_DIV] [OP_SUB] 1 3 [OP_DIV] 1 4 [OP_DIV] [OP_ADD] [OP_DIV] 3 [OP_DIV]
var_a = 4 var_b = 2 var_c = 4 var_d = var_b / var_c var_e = var_a - var_d var_f = 1 var_g = 3 var_h = var_f / var_g var_i = 1 var_j = 4 var_k = var_i / var_j var_l = var_h + var_k var_m = var_e / var_l var_n = 3 var_o = var_m / var_n print(int(eval('{:.2f}'.format(round(var_o+1e-10,2)))))
Geometry
Hoseok made an equilateral triangle with a side length of 19 centimeters (cm) with the wire he had, and there was 15 centimeters (cm) of wire left. Find the length in centimeters (cm) of the wire that Hoseok had at first.
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))
Geometry
If you cut a rectangular piece of paper 34 centimeters (cm) wide into squares with a side of 4 centimeters (cm), there are 2 centimeters (cm) are left over and there are 24 squares in total. What is the minimum perimeter of the rectangle in centimeters (cm) before cutting?
92
24 34 4 [OP_FDIV] [OP_DIV] 4 [OP_MUL] 34 [OP_ADD] 2 [OP_MUL]
var_a = 24 var_b = 34 var_c = 4 var_d = var_b // var_c var_e = var_a / var_d var_f = 4 var_g = var_e * var_f var_h = 34 var_i = var_g + var_h var_j = 2 var_k = var_i * var_j print(int(var_k))
Correspondence
When you multiply 0.46 by a certain number twice, you get 0.72. What number is that?
3.4
0.72 0.46 [OP_DIV] 0.46 [OP_DIV]
var_a = 0.72 var_b = 0.46 var_c = var_a / var_b var_d = 0.46 var_e = var_c / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
You sold 15 bundles of ballpoint pens in 5 days. If there are 40 ballpoint pens in each bundle, how many did you sell on average?
120
15 40 [OP_MUL] 5 [OP_FDIV]
var_a = 15 var_b = 40 var_c = var_a * var_b var_d = 5 var_e = var_c // var_d print(int(var_e))
Comparison
There are seven number cards with the numbers 1.7, 1/5, 1/5, 1, 3/5, 3/8, and 1.4 respectively. If you arrange these cards in order from the card with the largest number, what number will be written on the fourth card?
0.6
[OP_LIST_SOL] 1.7 1/5 1/5 1 3 5 [OP_DIV] 3 8 [OP_DIV] 1.4 [OP_LIST_EOL] 4 [OP_LIST_MAX]
var_a = 1.7 var_b = 0.2 var_c = 0.2 var_d = 1 var_e = 3 var_f = 5 var_g = var_e / var_f var_h = 3 var_i = 8 var_j = var_h / var_i var_k = 1.4 list_a= [] if "/" in str(var_k): var_k = eval(str(var_k)) list_a.append(var_k) if "/" in str(var_j): var_j = eval(str(var_j)) list_a.append(var_j) if "/" in str(var_g): var_g = eval(str(var_g)) list_a.append(var_g) 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_l = 4 list_b=list_a.copy() list_b.sort() var_m = list_b[-var_l] print('{:.2f}'.format(round(var_m+1e-10,2)))
Arithmetic calculation
252 fifth-grade students and 8 teachers at Yeji's school are going on a field trip. If the cost of renting a 41-seater bus is 300,000 won and the highway toll per bus is 7,500 won, how much does it cost to rent the bus and pay the toll?
2152500
252 8 [OP_ADD] 41 [OP_DIV] 1 [OP_CEIL] 300000 7500 [OP_ADD] [OP_MUL]
var_a = 252 var_b = 8 var_c = var_a + var_b var_d = 41 var_e = var_c / var_d var_f = 1 var_g=int(((var_e+9*10**(var_f-2))//(10**(var_f-1)))*10**(var_f-1)) var_h = 300000 var_i = 7500 var_j = var_h + var_i var_k = var_g * var_j print(int(var_k))
Comparison
What is the largest number less than 0.5 among 1/4, 0.7, 2/3, 0.4, and 2/5?
0.4
[OP_LIST_SOL] 1/4 0.7 2/3 0.4 2/5 [OP_LIST_EOL] 0.5 [OP_LIST_LESS] 1 [OP_LIST_MAX]
var_a = 0.25 var_b = 0.7 var_c = 0.6666666666666666 var_d = 0.4 var_e = 0.4 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 0.5 list_b = [] for i in list_a: if i < var_f: list_b.append(i) var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] print('{:.2f}'.format(round(var_h+1e-10,2)))
Geometry
What is the total volume of the stacked dice if they are stacked 7 horizontally, 5 vertically, and 3 layers high, each measuring 1 centimeters (cm) in width, length, and height?
105
1 7 [OP_MUL] 1 5 [OP_MUL] [OP_MUL] 1 3 [OP_MUL] [OP_MUL]
var_a = 1 var_b = 7 var_c = var_a * var_b var_d = 1 var_e = 5 var_f = var_d * var_e var_g = var_c * var_f var_h = 1 var_i = 3 var_j = var_h * var_i var_k = var_g * var_j print(int(var_k))
Geometry
There is a cube with a edge length of 12 centimeters (cm). If you cut a cube from the middle of each edge with one edge being 4 centimeters (cm) long, what square centimeter (cm2) is the surface area of the remaining part?
1248
12 12 [OP_MUL] 6 [OP_MUL] 4 4 [OP_MUL] 2 [OP_MUL] 12 [OP_MUL] [OP_ADD]
var_a = 12 var_b = 12 var_c = var_a * var_b var_d = 6 var_e = var_c * var_d var_f = 4 var_g = 4 var_h = var_f * var_g var_i = 2 var_j = var_h * var_i var_k = 12 var_l = var_j * var_k var_m = var_e + var_l print(int(var_m))
Possibility
Among the six number cards 8, 3, 6, 5, 0, and 7, A is the largest two-digit number, and B is the smallest two-digit number. Find the value of (A-B)×6.
342
[OP_LIST_SOL] 8 3 6 5 0 7 [OP_LIST_EOL] 2 [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 = 2 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
You have 2 chances to draw from a basket containing 1 apple, 1 peach, 1 pear, and 1 melon. How many orders of fruit can exist while you draw from the basket?
12
[OP_LIST_SOL] apple peach pear melon [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_PERM]
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 = 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) print(int(var_g))
Correspondence
You made a mistake and multiplied a certain number by 10 when you should have multiplied it by 1/100, and got 2804. How much is it when you calculate correctly?
2.8
2804 10 [OP_DIV] 1/100 [OP_MUL]
var_a = 2804 var_b = 10 var_c = var_a / var_b var_d = 0.01 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
I need to add 32 to a number, but I mistakenly added 23, and I got 68. Find out this number
45
68 23 [OP_SUB]
var_a = 68 var_b = 23 var_c = var_a - var_b print(int(var_c))
Comparison
Find how many numbers are less than 1.1 among 1.4, 9/10, 1.2, 0.5, and 13/10.
2
[OP_LIST_SOL] 1.4 9/10 1.2 0.5 13/10 [OP_LIST_EOL] 1.1 [OP_LIST_LESS] [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))
Correspondence
A is a number that consists of 1, 16, and 28 times of 1000, 100, and 10, respectively. B jumps 3 times in increments of 245, the starting point being 355. Find the value of A-B.
1790
1000 1 [OP_MUL] 100 16 [OP_MUL] [OP_ADD] 10 28 [OP_MUL] [OP_ADD] 355 245 3 [OP_MUL] [OP_ADD] [OP_SUB]
var_a = 1000 var_b = 1 var_c = var_a * var_b var_d = 100 var_e = 16 var_f = var_d * var_e var_g = var_c + var_f var_h = 10 var_i = 28 var_j = var_h * var_i var_k = var_g + var_j var_l = 355 var_m = 245 var_n = 3 var_o = var_m * var_n var_p = var_l + var_o var_q = var_k - var_p print(int(var_q))
Possibility
Find the remainder when the number cards 4, 2, 8, 1, 9 are used only once to get the greatest quotient from the expression (three-digit number)/(two-digit number).
0
[OP_LIST_SOL] 4 2 8 1 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] [OP_LIST_POP] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] [OP_MOD]
var_a = 4 var_b = 2 var_c = 8 var_d = 1 var_e = 9 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 = 2 list_d = [str(i) for i in list_a] list_d = list(itertools.permutations(list_d, var_i)) list_d = [''.join(num_list) for num_list in list_d] list_d = [str_num for str_num in list_d if str_num[0] != '0'] list_d = [float(i) for i in list_d] var_j = 1 list_e=list_d.copy() list_e.sort() var_k = list_e[var_j-1] var_l = var_h % var_k print(int(var_l))
Correspondence
If you put 7 sugar cubes in the coffee, the amount of sugar in the coffee is 9.8 grams (g). Find how many grams (g) are in one sugar cube.
1.4
9.8 7 [OP_DIV]
var_a = 9.8 var_b = 7 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Geometry
There is a prism whose sum of the number of edges and the number of vertices is 40. How many faces does this prism have?
10
40 2 3 [OP_ADD] [OP_DIV] 2 [OP_ADD]
var_a = 40 var_b = 2 var_c = 3 var_d = var_b + var_c var_e = var_a / var_d var_f = 2 var_g = var_e + var_f print(int(var_g))
Comparison
There are numbers 0.8, 1/2, 0.9, and 1/3. Find the sum of all the numbers less than or equal to 0.3.
0
[OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 0.3 [OP_LIST_LESS_EQUAL] [OP_LIST_SUM]
var_a = 0.8 var_b = 0.5 var_c = 0.9 var_d = 0.3333333333333333 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 0.3 list_b = [] for i in list_a: if i <= var_e: list_b.append(i) list_b = [float(i) for i in list_b] var_f = sum(list_b) print(int(var_f))
Geometry
Junyeong's house has a fish tank measuring 50 centimeters (cm) wide, 16 centimeters (cm) long, and 25 centimeters (cm) high. The fishbowl was filled with water to a height of 15 centimeters (cm), and a cube-shaped piece of wood with one corner length of 10 centimeters (cm) was completely submerged in the water. At this time, find the height of the fish tank in centimeters (cm) including the decimal point.
16.25
15 10 10 [OP_MUL] 10 [OP_MUL] 50 16 [OP_MUL] [OP_DIV] [OP_ADD]
var_a = 15 var_b = 10 var_c = 10 var_d = var_b * var_c var_e = 10 var_f = var_d * var_e var_g = 50 var_h = 16 var_i = var_g * var_h var_j = var_f / var_i var_k = var_a + var_j print('{:.2f}'.format(round(var_k+1e-10,2)))
Arithmetic calculation
At Minyoung's house, there are four times as many chickens as ducks, and 17 fewer rabbits than ducks. If there are 8 rabbits in Minyoung's house, how many chickens, ducks, and rabbits are there in total in Minyoung's house?
133
8 8 17 [OP_ADD] [OP_ADD] 4 8 17 [OP_ADD] [OP_MUL] [OP_ADD]
var_a = 8 var_b = 8 var_c = 17 var_d = var_b + var_c var_e = var_a + var_d var_f = 4 var_g = 8 var_h = 17 var_i = var_g + var_h var_j = var_f * var_i var_k = var_e + var_j print(int(var_k))
Arithmetic calculation
The dice were thrown 5 times and the values that came out were 2, 4, 4, 1, and 5 in that order. Find how many times 4 came out.
2
[OP_LIST_SOL] 2 4 4 1 5 [OP_LIST_EOL] 4 [OP_LIST_FIND_NUM]
var_a = 2 var_b = 4 var_c = 4 var_d = 1 var_e = 5 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 = 0 var_f = int(var_f) for i in list_a: i = int(i) if i == var_f: var_g = var_g + 1 print(int(var_g))
Correspondence
Hoseok multiplied a certain number by 5 and got 100. Find out the value of that certain number divided by 10.
2
100 5 [OP_DIV] 10 [OP_DIV]
var_a = 100 var_b = 5 var_c = var_a / var_b var_d = 10 var_e = var_c / var_d print(int(var_e))
Comparison
Three classes A, B, and C took part in the reading competition. If the students in class C read more books than the students in class A, and the students in class A read more books than the students in class B, find which class read the fewest books.
B
[OP_LIST_SOL] A B C [OP_LIST_EOL] [OP_LIST_SOL] A B > C A > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET]
var_a = 'A' var_b = 'B' var_c = 'C' 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 = 'A' var_e = 'B' var_f = '>' var_g = 'C' var_h = 'A' 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 = len(list_c) var_k = list_c[var_j-1] print(var_k)
Comparison
Yuna, Eunji, and Minyoung are playing a rock-paper-scissors game. Yuna beat Minyoung and Eunji lost to Minyoung. Who's in last place?
Eunji
[OP_LIST_SOL] Yuna Eunji Minyoung [OP_LIST_EOL] [OP_LIST_SOL] Yuna Minyoung > Eunji Minyoung < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET]
var_a = 'Yuna' var_b = 'Eunji' var_c = 'Minyoung' 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 = 'Yuna' var_e = 'Minyoung' var_f = '>' var_g = 'Eunji' var_h = 'Minyoung' 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 = len(list_c) var_k = list_c[var_j-1] print(var_k)
Possibility
I'm trying to make a two-digit number using two different cards among those that have numbers 6, 7, and 8 written on them. How many possible numbers are there?
6
[OP_LIST_SOL] 6 7 8 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 6 var_b = 7 var_c = 8 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 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))
Possibility
Find the number of three-digit numbers where each digit is odd.
125
1 9 [OP_LIST_ODD] 3 [OP_LIST_GET_PRODUCT] [OP_LIST_LEN]
var_a = 1 var_b = 9 list_a = [] if var_a%2==0: for i in range(var_a+1, var_b+1, 2): list_a.append(i) else: for i in range(var_a, var_b+1, 2): list_a.append(i) var_c = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=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 = len(list_b) print(int(var_d))
Correspondence
Subtracting 7 from a number equals 9 multiplied by 8. Find the quotient of the number divided by 6.
13
8 9 [OP_MUL] 7 [OP_ADD] 6 [OP_FDIV]
var_a = 8 var_b = 9 var_c = var_a * var_b var_d = 7 var_e = var_c + var_d var_f = 6 var_g = var_e // var_f print(int(var_g))
Comparison
Jungkook has 6 erasers. If Jimin has 4 more erasers than Jungkook and Seokjin has 3 less than Jimin, who has the fewest erasers?
Jungkook
[OP_LIST_SOL] Jungkook Jimin Seokjin [OP_LIST_EOL] [OP_LIST_SOL] 6 6 4 [OP_ADD] 6 4 [OP_ADD] 3 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jungkook' var_b = 'Jimin' var_c = 'Seokjin' 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 = 6 var_f = 4 var_g = var_e + var_f var_h = 6 var_i = 4 var_j = var_h + var_i var_k = 3 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_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() var_m = 1 list_c=list_b.copy() list_c.sort() var_n = list_c[var_m-1] var_o = list_b.index(var_n)+1 var_p = list_a[var_o-1] print(var_p)
Geometry
The base of a triangular prism is an equilateral triangle with a side of 3 centimeters (cm) and a height of 6 centimeters (cm). Find the sum of the areas of the sides.
21
3 6 3 [OP_MUL] [OP_ADD]
var_a = 3 var_b = 6 var_c = 3 var_d = var_b * var_c var_e = var_a + var_d print(int(var_e))
Comparison
Jungkook collects the number 6 minus 3, Yoongi collects 4, and Yuna collects 5. Who has the biggest number?
Yuna
[OP_LIST_SOL] Jungkook Yoongi Yuna [OP_LIST_EOL] [OP_LIST_SOL] 6 3 [OP_SUB] 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)
Correspondence
I want to find the quotient of a number divided by 3, but I mistakenly divided it by 7, and the quotient became 12 with the remainder 4. Find the correctly calculated value.
29
7 12 [OP_MUL] 4 [OP_ADD] 3 [OP_FDIV]
var_a = 7 var_b = 12 var_c = var_a * var_b var_d = 4 var_e = var_c + var_d var_f = 3 var_g = var_e // var_f print(int(var_g))
Comparison
Yoongi's classmates are queuing up. If there are 15 students in front of Yoongi and 12 students behind him, what is the total number of students in line?
28
15 1 [OP_ADD] 12 [OP_ADD]
var_a = 15 var_b = 1 var_c = var_a + var_b var_d = 12 var_e = var_c + var_d print(int(var_e))
Correspondence
If you put 6 sweets in bag, there will be 4 left. If you put 8 in a bag, there are 6 left, and if you put 10 in a bag, there are 8 left. Find the smallest number that can be the number of sweets
118
0 9999 1 [OP_LIST_ARANGE] 6 4 [OP_LIST_DIVIDE_AND_REMAIN] 8 6 [OP_LIST_DIVIDE_AND_REMAIN] 10 8 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_MIN]
var_a = 0 var_b = 9999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 6 var_e = 4 list_b = [] var_d = int(var_d) var_e = int(var_e) if var_e < 0: var_e = var_e + var_d for i in list_a: i = int(i) if i%var_d == var_e: list_b.append(i) var_f = 8 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 = 10 var_i = 8 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))
Correspondence
If Changhyeon spent half of his money on apples at the fruit shop and 300 won on the plastic bag, and then spent half of his remaining money and 400 won on mackerel at the fish shop, how much money did Changhyeon have at the beginning?
2200
0 400 [OP_ADD] 1 1/2 [OP_SUB] [OP_DIV] 300 [OP_ADD] 1 1/2 [OP_SUB] [OP_DIV]
var_a = 0 var_b = 400 var_c = var_a + var_b var_d = 1 var_e = 0.5 var_f = var_d - var_e var_g = var_c / var_f var_h = 300 var_i = var_g + var_h var_j = 1 var_k = 0.5 var_l = var_j - var_k var_m = var_i / var_l print(int(var_m))
Arithmetic calculation
There were thirty-four candies divided equally among seven boxes, resulting in one candy shortage. How many candies are there in one box?
5
34 1 [OP_ADD] 7 [OP_FDIV]
var_a = 34 var_b = 1 var_c = var_a + var_b var_d = 7 var_e = var_c // var_d print(int(var_e))
Comparison
Yuna, Eunji, and Minyoung are standing in order of height. Yuna is taller than Eunji and Minyoung is shorter than Eunji. If the shortest student is standing at the front, find out who is standing at the front.
Minyoung
[OP_LIST_SOL] Yuna Eunji Minyoung [OP_LIST_EOL] [OP_LIST_SOL] Yuna Eunji > Minyoung Eunji < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET]
var_a = 'Yuna' var_b = 'Eunji' var_c = 'Minyoung' 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 = 'Yuna' var_e = 'Eunji' var_f = '>' var_g = 'Minyoung' var_h = 'Eunji' 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 = len(list_c) var_k = list_c[var_j-1] print(var_k)
Arithmetic calculation
How many odd numbers are there between 1 and 6 and between 11 and 16?
6
1 6 [OP_LIST_ODD] [OP_LIST_LEN] 11 16 [OP_LIST_ODD] [OP_LIST_LEN] [OP_ADD]
var_a = 1 var_b = 6 list_a = [] if var_a%2==0: for i in range(var_a+1, var_b+1, 2): list_a.append(i) else: for i in range(var_a, var_b+1, 2): list_a.append(i) var_c = len(list_a) var_d = 11 var_e = 16 list_b = [] if var_d%2==0: for i in range(var_d+1, var_e+1, 2): list_b.append(i) else: for i in range(var_d, var_e+1, 2): list_b.append(i) var_f = len(list_b) var_g = var_c + var_f print(int(var_g))
Correspondence
There are two different natural numbers, A and B. When A is divided by 29, the quotient is 31 and the remainder is B. Find A when the remainder B is the smallest number.
899
29 31 [OP_MUL]
var_a = 29 var_b = 31 var_c = var_a * var_b print(int(var_c))
Correspondence
You had to divide a number by 3 and then add 12, but mistakenly multiplied 3 and subtracted 12 instead, which resulted in 60. What is the result of the correct calculation?
20
60 12 [OP_ADD] 3 [OP_DIV] 3 [OP_DIV] 12 [OP_ADD]
var_a = 60 var_b = 12 var_c = var_a + var_b var_d = 3 var_e = var_c / var_d var_f = 3 var_g = var_e / var_f var_h = 12 var_i = var_g + var_h print(int(var_i))
Geometry
There is a park in the shape of a square. If the length of one side of this park is 30 meters (m), what is the area in square meters (m2) of this park?
900
30 2 [OP_POW]
var_a = 30 var_b = 2 var_c = var_a ** var_b print(int(var_c))
Comparison
Which number among 0.8, 1/2, 0.3, 1/3 is less than or equal to 0.4?
0.33
[OP_LIST_SOL] 0.8 1/2 0.3 1/3 [OP_LIST_EOL] 0.4 [OP_LIST_LESS_EQUAL] 1 [OP_LIST_MAX]
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 = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] print('{:.2f}'.format(round(var_g+1e-10,2)))
Correspondence
After filling the large water container by adding a small cup full of water 8 times, another 5400 milliliters (㎖) of water was added again. When this water was divided into 12 small buckets, each small bucket contained 530 milliliters (㎖). Find the volume of the small cup.
120
530 12 [OP_MUL] 5400 [OP_SUB] 8 [OP_DIV]
var_a = 530 var_b = 12 var_c = var_a * var_b var_d = 5400 var_e = var_c - var_d var_f = 8 var_g = var_e / var_f print(int(var_g))
Geometry
If the surface area of a cube-shaped gift box is 600, find the volume of this gift box.
1000
600 6 [OP_DIV] 1/2 [OP_POW] 3 [OP_POW]
var_a = 600 var_b = 6 var_c = var_a / var_b var_d = 0.5 var_e = var_c ** var_d var_f = 3 var_g = var_e ** var_f print(int(var_g))
Possibility
What is the largest number using 3 of 4, 6, 5, 0 with 5 in the tens' digit?
654
[OP_LIST_SOL] 4 6 5 0 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 10 5 [OP_LIST_SEARCH_FIXED_DIGIT] 1 [OP_LIST_MAX]
var_a = 4 var_b = 6 var_c = 5 var_d = 0 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 10 var_g = 5 list_c = [] var_f = int(var_f) var_g = int(var_g) for i in list_b: i = int(i) if (i//var_f)%10 == var_g: list_c.append(i) var_h = 1 list_d=list_c.copy() list_d.sort() var_i = list_d[-var_h] print(int(var_i))
Geometry
Using wire 50 centimeters (cm) long, a regular hexagon whose one side is 8 centimeters (cm) long was made. How many centimeters (cm) is the length of the remaining wire?
2
50 8 6 [OP_MUL] [OP_SUB]
var_a = 50 var_b = 8 var_c = 6 var_d = var_b * var_c var_e = var_a - var_d print(int(var_e))
Comparison
There are 4 marbles - (a), (b), (c), (d). (a) Marble is larger than (d) Marble. (b) marble is smaller than (c) marble. (c) marble is smaller than (d) marble. Which marble is the smallest in size?
(b)
[OP_LIST_SOL] (a) (b) (c) (d) [OP_LIST_EOL] [OP_LIST_SOL] (a) (d) > (b) (c) < (c) (d) < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET]
var_a = '(a)' var_b = '(b)' var_c = '(c)' var_d = '(d)' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = '(a)' var_f = '(d)' var_g = '>' var_h = '(b)' var_i = '(c)' var_j = '<' var_k = '(c)' var_l = '(d)' 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)
Correspondence
When A is divided by 7, the quotient is 5 and the remainder is 3. Find A.
38
5 7 [OP_MUL] 3 [OP_ADD]
var_a = 5 var_b = 7 var_c = var_a * var_b var_d = 3 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
An odd number or multiple of 5 is said to be less than or equal to 30. What is the sum of all possible A's?
285
1 30 1 [OP_LIST_ARANGE] 5 [OP_LIST_DIVISIBLE] 1 30 [OP_LIST_ODD] [OP_SET_UNION] [OP_LIST_SUM]
var_a = 1 var_b = 30 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 5 list_b = [] var_d = int(var_d) for i in list_a: i = int(i) if i % var_d == 0: list_b.append(i) var_e = 1 var_f = 30 list_c = [] if var_e%2==0: for i in range(var_e+1, var_f+1, 2): list_c.append(i) else: for i in range(var_e, var_f+1, 2): list_c.append(i) list_d = list(set(list_b) | set(list_c)) list_d = [float(i) for i in list_d] var_g = sum(list_d) print(int(var_g))
Arithmetic calculation
(A) car travels at 60 kilometers (km) per hour, and (B) car travels at 45 kilometers (km) per hour. If (A) car and (B) car travel at the same speed for 5 hours, how many kilometers will (A) travel more than (B) car?
75
60 5 [OP_MUL] 45 5 [OP_MUL] [OP_SUB]
var_a = 60 var_b = 5 var_c = var_a * var_b var_d = 45 var_e = 5 var_f = var_d * var_e var_g = var_c - var_f print(int(var_g))
Arithmetic calculation
Grandmother wants to buy 21 boxes of 6kilograms (kg) sugar and distribute 32/41kilograms (kg) each to her neighbors. How many people can you share?
161
6 21 [OP_MUL] 32/41 [OP_FDIV]
var_a = 6 var_b = 21 var_c = var_a * var_b var_d = 0.7804878048780488 var_e = var_c // var_d print(int(var_e))
Arithmetic calculation
School A has 217 boys and School B has 196 girls. If the sum of the number of male students in school A and the number of male students in school B is equal to the total number of female students in school A and school B, what is the difference between the number of male students in school B and the number of female students in school A?
21
217 196 [OP_SUB] [OP_ABS]
var_a = 217 var_b = 196 var_c = var_a - var_b var_d = abs(var_c) print(int(var_d))
Geometry
If a cone-shaped solid figure with a polygonal base and triangular sides has 10 edges, how many vertices are there?
6
10 2 [OP_DIV] 1 [OP_ADD]
var_a = 10 var_b = 2 var_c = var_a / var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
There are bacteria that multiply twice as fast as they do every minute. The sum of the weight of the first beaker and the 100 bacteria in it was 23.97 grams (g), and the sum of the weight of the beaker and the bacteria in it after 5 minutes was 155.1 grams (g). How many grams (g) do 10000 cloned bacteria weigh?
423
155.1 23.97 [OP_SUB] 100 2 5 [OP_POW] [OP_MUL] 100 [OP_SUB] [OP_DIV] 10000 [OP_MUL]
var_a = 155.1 var_b = 23.97 var_c = var_a - var_b var_d = 100 var_e = 2 var_f = 5 var_g = var_e ** var_f var_h = var_d * var_g var_i = 100 var_j = var_h - var_i var_k = var_c / var_j var_l = 10000 var_m = var_k * var_l print(int(var_m))
Correspondence
Yong-hee stood on the scale holding a bag weighing 1 kilogram (kg) and 750 grams (g), and the scale indicated 35 kilograms (kg) and 500 grams (g). When Yong-hee's younger brother climbed on the scale with a bag weighing 2 kilograms (kg) and 550 grams (g), the scale indicated 27 kilograms (kg) and 200 grams (g). How many kilograms (kg) will the scale show when Yong-hee stands on the scale with her younger brother on her back?
58.4
35 500 1000 [OP_DIV] [OP_ADD] 1 750 1000 [OP_DIV] [OP_ADD] [OP_SUB] 27 200 1000 [OP_DIV] [OP_ADD] 2 550 1000 [OP_DIV] [OP_ADD] [OP_SUB] [OP_ADD]
var_a = 35 var_b = 500 var_c = 1000 var_d = var_b / var_c var_e = var_a + var_d var_f = 1 var_g = 750 var_h = 1000 var_i = var_g / var_h var_j = var_f + var_i var_k = var_e - var_j var_l = 27 var_m = 200 var_n = 1000 var_o = var_m / var_n var_p = var_l + var_o var_q = 2 var_r = 550 var_s = 1000 var_t = var_r / var_s var_u = var_q + var_t var_v = var_p - var_u var_w = var_k + var_v print('{:.2f}'.format(round(var_w+1e-10,2)))
Arithmetic calculation
There is a tape measure with a length of 2 meters (m) and 80 centimeters (cm). If you cut all the 40 centimeters (cm) lengths of this tape measure, how many times do you have to cut all of them?
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))
Correspondence
I mistakenly subtracted what number should be multiplied by 423, and I got 421. Find the sum of the correctly calculated value and the incorrectly calculated value.
1267
421 423 423 421 [OP_SUB] [OP_MUL] [OP_ADD]
var_a = 421 var_b = 423 var_c = 423 var_d = 421 var_e = var_c - var_d var_f = var_b * var_e var_g = var_a + var_f print(int(var_g))
Arithmetic calculation
There are 7 ducks and 6 chickens. How many ducks and chickens are there?
13
7 6 [OP_ADD]
var_a = 7 var_b = 6 var_c = var_a + var_b print(int(var_c))
Correspondence
There are nine square-shaped plots of land measuring 6 meters (m) in length and width. Find the total area of the land in square meters (m2).
324
6 6 [OP_MUL] 9 [OP_MUL]
var_a = 6 var_b = 6 var_c = var_a * var_b var_d = 9 var_e = var_c * var_d print(int(var_e))
Possibility
Consider 40 candies should be distributed into several baskets. Find the number of ways to divide the candies. (However, all 40 candies should not be put in one basket.)
7
40 [OP_LIST_GET_DIVISOR] [OP_LIST_SOL] 1 [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN]
var_a = 40 list_a = [] num_sqrt = int(math.sqrt(var_a)) for i in range(1, num_sqrt+1): if var_a % i == 0: list_a.append(i) list_a.append(int(var_a/i)) list_a = sorted(set(list_a)) var_b = 1 list_b= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_b.append(var_b) list_b.reverse() list_c = list(set(list_a) - set(list_b)) var_c = len(list_c) print(int(var_c))
Arithmetic calculation
Yoongi ate 7 of the 15 apples his grandfather bought. How many apples did Grandpa buy remain?
8
15 7 [OP_SUB]
var_a = 15 var_b = 7 var_c = var_a - var_b print(int(var_c))
Arithmetic calculation
It takes 6.64 grams (g) of glutinous rice flour to make one glutinous rice cake. Find how many kilograms (kg) of glutinous rice flour are left after making glutinous rice cakes with 202.66 grams (g) of glutinous rice flour.
0
202.66 6.64 [OP_MOD] 1000 [OP_DIV]
var_a = 202.66 var_b = 6.64 var_c = var_a % var_b var_d = 1000 var_e = var_c / var_d print(int(eval('{:.2f}'.format(round(var_e+1e-10,2)))))
Correspondence
Dividing 197 by a certain number leaves a remainder of 2, dividing 160 leaves a remainder of 4, and dividing 229 leaves a remainder of 5. Find the largest of these possible numbers.
39
197 2 [OP_SUB] 160 4 [OP_SUB] [OP_GCD] 229 5 [OP_ADD] [OP_GCD]
var_a = 197 var_b = 2 var_c = var_a - var_b var_d = 160 var_e = 4 var_f = var_d - var_e var_g = math.gcd(int(var_f), int(var_c)) var_h = 229 var_i = 5 var_j = var_h + var_i var_k = math.gcd(int(var_j), int(var_g)) print(int(var_k))
Arithmetic calculation
Company (A) hires only one security guard, but when the security guard is replaced, two security guards work together for a short time to instruct the work. In the meantime, there were a total of 3 guards, and the number of days each guard worked was the same as 217 days. If the number of days from the day the first guard was hired to the day the last guard quit was 627, find how many days the first and second guards worked together.
12
217 3 [OP_MUL] 627 [OP_SUB] 3 1 [OP_SUB] [OP_DIV]
var_a = 217 var_b = 3 var_c = var_a * var_b var_d = 627 var_e = var_c - var_d var_f = 3 var_g = 1 var_h = var_f - var_g var_i = var_e / var_h print(int(var_i))
Arithmetic calculation
30 trees are planted on two pavements in the street, 9 metres (m) apart. If trees are planted at the beginning and at the end, how many metres (m) is this road?
126
30 2 [OP_DIV] 1 [OP_SUB] 9 [OP_MUL]
var_a = 30 var_b = 2 var_c = var_a / var_b var_d = 1 var_e = var_c - var_d var_f = 9 var_g = var_e * var_f print(int(var_g))
Arithmetic calculation
There were 13 flowers in the vase. Seven of them withered and were thrown away. How many flowers are left in the vase?
6
13 7 [OP_SUB]
var_a = 13 var_b = 7 var_c = var_a - var_b print(int(var_c))
Possibility
If you are trying to choose 6 out of 7 black pens, find the number of ways in which you can choose.
7
7 6 [OP_COMB]
var_a = 7 var_b = 6 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))
Comparison
Heejin has 10 red balloons, 8 blue balloons, 5 yellow balloons, and 6 green balloons. Of the 7 or more balloons, how many balloons have the smallest number?
8
[OP_LIST_SOL] 10 8 5 6 [OP_LIST_EOL] 7 [OP_LIST_MORE_EQUAL] 1 [OP_LIST_MIN]
var_a = 10 var_b = 8 var_c = 5 var_d = 6 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 7 list_b = [] for i in list_a: if i >= var_e: list_b.append(i) var_f = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[var_f-1] print(int(var_g))
Possibility
Ji-woo and Ji-hyeon have one coin each. How many ways can each person flip a coin?
2
2 2 [OP_PERM]
var_a = 2 var_b = 2 var_c = 1 var_a = int(var_a) var_b = int(var_b) for i, elem in enumerate(range(var_b)): var_c = var_c * (var_a-i) print(int(var_c))
Correspondence
When you divide the number by -2/3 and multiply it by -4/5, the result is -1/2. Find the unknown number at the beginning.
0.42
-1/2 -4/5 [OP_DIV] -2/3 [OP_MUL]
var_a = -0.5 var_b = -0.8 var_c = var_a / var_b var_d = -0.6666666666666666 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
Seungmin and Hyoju went for a walk. When Seungmin gave Hyoju 0.43 liters (l) of water, the difference in the amount of water they had was 0.88 liters (l). Find the difference in the amount of water they had before Seungmin gave Hyoju water. However, Seungmin has more water than Heoju.
1.74
0.88 0.43 [OP_ADD] 0.43 [OP_ADD]
var_a = 0.88 var_b = 0.43 var_c = var_a + var_b var_d = 0.43 var_e = var_c + var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Possibility
Find how many 3-digit natural numbers that can be formed by multiplying odd numbers from 1 to 9 are less than 500.
12750
1 9 [OP_LIST_ODD] 3 [OP_LIST_GET_PRODUCT] 500 [OP_LIST_LESS] [OP_LIST_SUM]
var_a = 1 var_b = 9 list_a = [] if var_a%2==0: for i in range(var_a+1, var_b+1, 2): list_a.append(i) else: for i in range(var_a, var_b+1, 2): list_a.append(i) var_c = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=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 = 500 list_c = [] for i in list_b: if i < var_d: list_c.append(i) list_c = [float(i) for i in list_c] var_e = sum(list_c) print(int(var_e))
Arithmetic calculation
Multiplying 12 plus 3 by 12 minus A gives 120. Find A.
4
12 120 12 3 [OP_ADD] [OP_DIV] [OP_SUB]
var_a = 12 var_b = 120 var_c = 12 var_d = 3 var_e = var_c + var_d var_f = var_b / var_e var_g = var_a - var_f print(int(var_g))
Comparison
There are numbers 0.8, 1/2, and 0.9. Find the sum of the numbers greater than or equal to 0.3.
2.2
[OP_LIST_SOL] 0.8 1/2 0.9 [OP_LIST_EOL] 0.3 [OP_LIST_MORE_EQUAL] [OP_LIST_SUM]
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.3 list_b = [] for i in list_a: if i >= var_d: list_b.append(i) list_b = [float(i) for i in list_b] var_e = sum(list_b) print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
A is the number of 8 groups of 10 and 13 groups of 1. B is the number that is decreased by 9 for three times from 30. Find the quotient of A divided by B.
31
10 8 [OP_MUL] 1 13 [OP_MUL] [OP_ADD] 30 9 3 [OP_MUL] [OP_SUB] [OP_DIV]
var_a = 10 var_b = 8 var_c = var_a * var_b var_d = 1 var_e = 13 var_f = var_d * var_e var_g = var_c + var_f var_h = 30 var_i = 9 var_j = 3 var_k = var_i * var_j var_l = var_h - var_k var_m = var_g / var_l print(int(var_m))
Correspondence
There are 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 of A divided by 9?
4
13 9 [OP_SUB]
var_a = 13 var_b = 9 var_c = var_a - var_b print(int(var_c))
Possibility
How many edges are there in a regular tetrahedron?
6
3 2 [OP_MUL]
var_a = 3 var_b = 2 var_c = var_a * var_b print(int(var_c))
Correspondence
Subtract 300 from half of a number and you can get 350. What is the vaule of adding 200 to this number and multiplying it by 2?
3000
350 300 [OP_ADD] 1 1/2 [OP_SUB] [OP_DIV] 200 [OP_ADD] 2 [OP_MUL]
var_a = 350 var_b = 300 var_c = var_a + var_b var_d = 1 var_e = 0.5 var_f = var_d - var_e var_g = var_c / var_f var_h = 200 var_i = var_g + var_h var_j = 2 var_k = var_i * var_j print(int(var_k))
Comparison
Jaeho and Kyunghwan took a walk at the same time. Jaeho walked 1/100 of 10.2 kilometers (km), and Kyunghwan walked 100 meters (m). Who has gone farther?
Jaeho
[OP_LIST_SOL] Jaeho Kyunghwan [OP_LIST_EOL] [OP_LIST_SOL] 10.2 1000 [OP_MUL] 100 [OP_DIV] 100 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jaeho' var_b = 'Kyunghwan' 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 = 10.2 var_d = 1000 var_e = var_c * var_d var_f = 100 var_g = var_e / var_f var_h = 100 list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Arithmetic calculation
What is the smallest four-digit number divisible by two numbers - 3 and 5?
1005
1000 9999 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 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 = 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))
Geometry
Find the sum of the areas of two squares with side lengths of 8 and 10 respectively.
164
8 2 [OP_POW] 10 2 [OP_POW] [OP_ADD]
var_a = 8 var_b = 2 var_c = var_a ** var_b var_d = 10 var_e = 2 var_f = var_d ** var_e var_g = var_c + var_f print(int(var_g))
Geometry
If the sum of the lengths of the four sides of a square is 24 meters (m), what is the length of one side of the square in meters (m)?
6
24 4 [OP_DIV]
var_a = 24 var_b = 4 var_c = var_a / var_b print(int(var_c))
Possibility
There are four pieces of paper with the numbers 1, 3, 7, and 8 written on them. If two cards are drawn in order and the first number drawn is the tens place, and the second number drawn is the ones place, how many total numbers are less than 40?
6
[OP_LIST_SOL] 1 3 7 8 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 40 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN]
var_a = 1 var_b = 3 var_c = 7 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 = 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 = 40 list_c = [] for i in list_b: if i <= var_f: list_c.append(i) var_g = len(list_c) print(int(var_g))
Correspondence
A certain number needs to be multiplied by 1.36, but you mistakenly divided it and the quotient is 0.5. How much do you calculate correctly?
0.92
0.5 1.36 [OP_MUL] 1.36 [OP_MUL]
var_a = 0.5 var_b = 1.36 var_c = var_a * var_b var_d = 1.36 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
How many 3-digit numbers are there where each digit is different and the sum of each digit is 9?
34
0 9 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] 9 [OP_LIST_MORE_EQUAL] 9 [OP_LIST_LESS_EQUAL] [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 = 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 = 9 list_d = [] for i in list_c: if i >= var_f: list_d.append(i) var_g = 9 list_e = [] for i in list_d: if i <= var_g: list_e.append(i) var_h = len(list_e) print(int(var_h))
Correspondence
When a number plus 2 is 8 less than 3 times the number, find the number.
5
2 8 [OP_ADD] 3 1 [OP_SUB] [OP_DIV]
var_a = 2 var_b = 8 var_c = var_a + var_b var_d = 3 var_e = 1 var_f = var_d - var_e var_g = var_c / var_f print(int(var_g))
Correspondence
Seungwoo took 35 liters (L) and 500 milliliters (㎖) of coke and 27 liters (L) and 200 milliliters (㎖) of cider while traveling. Among them, he drank 1 liter (L) and 750 milliliters (㎖) of coke. How many liters (L) are all the drinks left for Seungwoo?
60.95
35 500 1000 [OP_DIV] [OP_ADD] 1 750 1000 [OP_DIV] [OP_ADD] [OP_SUB] 27 200 1000 [OP_DIV] [OP_ADD] [OP_ADD]
var_a = 35 var_b = 500 var_c = 1000 var_d = var_b / var_c var_e = var_a + var_d var_f = 1 var_g = 750 var_h = 1000 var_i = var_g / var_h var_j = var_f + var_i var_k = var_e - var_j var_l = 27 var_m = 200 var_n = 1000 var_o = var_m / var_n var_p = var_l + var_o var_q = var_k + var_p print('{:.2f}'.format(round(var_q+1e-10,2)))
Arithmetic calculation
With 25,000 won, you bought two roses for 3,000 won and several lilies for 2,800 won. To get 2,200 won in change, find how many lilies you need to buy.
6
25000 2200 [OP_SUB] 3000 2 [OP_MUL] [OP_SUB] 2800 [OP_DIV]
var_a = 25000 var_b = 2200 var_c = var_a - var_b var_d = 3000 var_e = 2 var_f = var_d * var_e var_g = var_c - var_f var_h = 2800 var_i = var_g / var_h print(int(var_i))
Geometry
What is the perimeter of a regular hexagon with a side length of 5 centimeters (cm), in centimeters (cm)?
30
5 6 [OP_MUL]
var_a = 5 var_b = 6 var_c = var_a * var_b print(int(var_c))
Comparison
Which circle has the greater area: circle A with a diameter of 10 centimeters (cm) and circle B with a radius of 4 centimeters (cm)?
A
[OP_LIST_SOL] A B [OP_LIST_EOL] [OP_LIST_SOL] 10 2 [OP_DIV] 4 [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 = 10 var_d = 2 var_e = var_c / var_d var_f = 4 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)
Arithmetic calculation
Find the difference between the sum of even numbers less than or equal to 100 and the sum of odd numbers less than or equal to 30.
2325
0 100 [OP_LIST_EVEN] [OP_LIST_SUM] 0 30 [OP_LIST_ODD] [OP_LIST_SUM] [OP_SUB]
var_a = 0 var_b = 100 list_a = [] if var_a%2!=0: for i in range(var_a+1, var_b+1, 2): list_a.append(i) else: for i in range(var_a, var_b+1, 2): list_a.append(i) list_a = [float(i) for i in list_a] var_c = sum(list_a) var_d = 0 var_e = 30 list_b = [] if var_d%2==0: for i in range(var_d+1, var_e+1, 2): list_b.append(i) else: for i in range(var_d, var_e+1, 2): list_b.append(i) list_b = [float(i) for i in list_b] var_f = sum(list_b) var_g = var_c - var_f print(int(var_g))
Possibility
Nine digits from 1 to 9 are used once to form a nine-digit number. If this number is a multiple of 55, find the smallest 9-digit number.
126374985
1 9 1 [OP_LIST_ARANGE] 9 [OP_LIST_GET_PERM] 55 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN]
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 = 9 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 = 55 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
The toy robot can transform into 3 different shapes and can be painted in 4 different colors. How many possible types of robots are there in all?
12
3 4 [OP_MUL]
var_a = 3 var_b = 4 var_c = var_a * var_b print(int(var_c))
Geometry
The height of a rectangle is 36 centimeters (cm) and the length of its width is 64 centimeters (cm). There is a square with a perimeter equal to the perimeter of this rectangle. Find the value of dividing the perimeter of this square into 4 equal parts.
50
36 64 [OP_ADD] 2 [OP_MUL] 4 [OP_DIV]
var_a = 36 var_b = 64 var_c = var_a + var_b var_d = 2 var_e = var_c * var_d var_f = 4 var_g = var_e / var_f print(int(var_g))
Correspondence
There are equations of 3×A-A=10, B+A=12, C-B=6. If A, B, and C are different natural numbers, what value of C satisfies the equation?
13
12 3×A-A=10 A [OP_NUM_UNK_SOLVER] [OP_SUB] 6 [OP_ADD]
var_a = 12 var_b = '3×A-A=10' var_c = 'A' ans_dict = dict() var_b = var_b.replace('×','*') var_b = var_b.replace('x','*') var_b = var_b.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_b): 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_b 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_d = ans_dict[var_c] var_e = var_a - var_d var_f = 6 var_g = var_e + var_f print(int(var_g))
Arithmetic calculation
Among the 6 numbers 3/2, 2.3, 1/5, 1.1, 5/2, and 4/5, select the numbers greater than 1 and less than 2 and count them.
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))