category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Arithmetic calculation
How many times does the number 3 appear from 1 to 31?
6
1 31 1 [OP_LIST_ARANGE] [OP_LIST2NUM] [OP_NUM2LIST] 3 [OP_LIST_FIND_NUM] 1 [OP_ADD]
var_a = 1 var_b = 31 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 = 3 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 var_g = 1 var_h = var_f + var_g print(int(var_h))
Geometry
What is the area in square centimeters (cm2) of a rectangle that can be formed by attaching 3.2 squares with sides of 8.5 centimeters (cm) in a row?
231.2
8.5 2 [OP_POW] 3.2 [OP_MUL]
var_a = 8.5 var_b = 2 var_c = var_a ** var_b var_d = 3.2 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
24 sheets of colored paper and 18 sheets of drawing paper will be distributed equally to as many students as possible. How many people can get the papers?
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))
Comparison
In a line of 27 people, if Minyoung is standing in the13th from the back, where is she placed from the front?
15
27 13 [OP_SUB] 1 [OP_ADD]
var_a = 27 var_b = 13 var_c = var_a - var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Possibility
If one blue ball is removed from a box containing 3 red balls, 2 blue balls and 5 yellow balls, what is the number of red balls?
3
3
var_a = 3 print(int(var_a))
Possibility
How many four-digit numbers can be formed by using all even numbers less than or equal to 9 once?
96
0 9 [OP_LIST_EVEN] 4 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 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 = 4 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_c)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_d = len(list_b) print(int(var_d))
Arithmetic calculation
There were some tangerines in the basket. Eunji ate 9 pieces, and mother put 5 more in the basket, and it became 20 pieces. How many tangerines were in the basket at the beginning?
24
20 9 [OP_ADD] 5 [OP_SUB]
var_a = 20 var_b = 9 var_c = var_a + var_b var_d = 5 var_e = var_c - var_d print(int(var_e))
Comparison
If you weigh on the moon, it is said to be 1/6 of your weight on Earth. Yeonjin weighed 50 kilograms (kg) on Earth, and Hodong weighed 8 and 4/6 kilograms (kg) when measured on the moon. Find the answer of who weighs more on the moon.
Hodong
[OP_LIST_SOL] Yeonjin Hodong [OP_LIST_EOL] [OP_LIST_SOL] 50 1/6 [OP_MUL] 8 4/6 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yeonjin' var_b = 'Hodong' 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 = 50 var_d = 0.16666666666666666 var_e = var_c * var_d var_f = 8 var_g = 0.6666666666666666 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
Among the natural numbers between 200 and 500, find the value whose remainder when divided by 5 is 2, when divided by 8 is 3, and when divided by 9 is 0.
387
200 500 1 [OP_LIST_ARANGE] 5 2 [OP_LIST_DIVIDE_AND_REMAIN] 8 3 [OP_LIST_DIVIDE_AND_REMAIN] 9 0 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_GET]
var_a = 200 var_b = 500 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 5 var_e = 2 list_b = [] var_d = int(var_d) var_e = int(var_e) if var_e < 0: var_e = var_e + var_d for i in list_a: i = int(i) if i%var_d == var_e: list_b.append(i) var_f = 8 var_g = 3 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 = 9 var_i = 0 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 var_k = list_d[var_j-1] print(int(var_k))
Possibility
How many two-digit natural numbers can be formed by choosing two figures among 0, 1, and 2?
4
[OP_LIST_SOL] 0 1 2 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 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 = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = len(list_b) print(int(var_e))
Correspondence
The three-digit number A76 rounded down to the hundreds place is 700. Find the value of A.
7
A76 [OP_GEN_POSSIBLE_LIST] 700 [OP_LIST_MORE_EQUAL] 700 100 [OP_ADD] [OP_LIST_LESS] A76 A [OP_LIST_FIND_UNK]
var_a = 'A76' ans_dict = dict() var_a = str(var_a) list_a = [] variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 0 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) if len(var_a) == len(str(int(temp))): new_elem = int(temp) list_a.append(new_elem) var_b = 700 list_b = [] for i in list_a: if i >= var_b: list_b.append(i) var_c = 700 var_d = 100 var_e = var_c + var_d list_c = [] for i in list_b: if i < var_e: list_c.append(i) var_f = 'A76' var_g = 'A' var_f = str(var_f) var_g = str(var_g) unk_idx = var_f.index(var_g) var_h = 0 for elem in list_c: elem = str(elem) var_h = int(elem[unk_idx]) print(int(var_h))
Correspondence
If a three-digit number has a hundredth place of 9 and is divisible by 7, how many three-digit numbers satisfy this condition?
14
9 100 [OP_MUL] 9 100 [OP_MUL] 99 [OP_ADD] 1 [OP_LIST_ARANGE] 7 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 9 var_b = 100 var_c = var_a * var_b var_d = 9 var_e = 100 var_f = var_d * var_e var_g = 99 var_h = var_f + var_g var_i = 1 list_a = [i for i in range(var_c, var_h + 1, var_i)] var_j = 7 list_b = [] var_j = int(var_j) for i in list_a: i = int(i) if i % var_j == 0: list_b.append(i) var_k = len(list_b) print(int(var_k))
Possibility
Find the number of possibilities when choosing to buy 3 out of 5 different sweets.
10
5 3 [OP_COMB]
var_a = 5 var_b = 3 var_c = 1 var_a = int(var_a) var_b = int(var_b) for i, elem in enumerate(range(var_b)): var_c = var_c * (var_a-i) for i, elem in enumerate(range(var_b)): var_c = var_c / (i+1) print(int(var_c))
Geometry
Jeong Su's house has a rectangular flower garden with an area of 143.2 square meters (㎡). If the length of this flower field is 4 meters (m), how many meters (m) is the width?
35.8
143.2 4 [OP_DIV]
var_a = 143.2 var_b = 4 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Geometry
Hyunji bought 25 bags having 16 candies. If Hyunji shared candy with Soohyeon equally, how many candies did Hyunji get?
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))
Arithmetic calculation
Among the students in class (A), 25 students like social studies, 32 students like music, and 27 students like both social studies and music. If there is no student who dislikes both social studies and music, how many students are in class (A)?
30
25 32 [OP_ADD] 27 [OP_SUB]
var_a = 25 var_b = 32 var_c = var_a + var_b var_d = 27 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
There are 7 crates of apples of the same weight in the mart. After removing 20 kilograms (kg) of apples from each box, the weight of the 7 boxes of apples was equal to the weight of the original 3 boxes of apples. How many kilograms (kg) does one original box of apples weigh?
35
20 7 [OP_MUL] 7 3 [OP_SUB] [OP_DIV]
var_a = 20 var_b = 7 var_c = var_a * var_b var_d = 7 var_e = 3 var_f = var_d - var_e var_g = var_c / var_f print(int(var_g))
Correspondence
Cheolsu adds -5/12 to a certain number and then subtracted -5/2 from it and got 1/3. Find out that certain number.
-1.75
1/3 -5/2 [OP_ADD] -5/12 [OP_SUB]
var_a = 0.3333333333333333 var_b = -2.5 var_c = var_a + var_b var_d = -0.4166666666666667 var_e = var_c - var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
At a math academy, 120 students participated in a math olympiad. If there are 36 more students who received certificates than those who did not, find how many students received certificates.
78
120 36 [OP_SUB] 2 [OP_DIV] 36 [OP_ADD]
var_a = 120 var_b = 36 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d var_f = 36 var_g = var_e + var_f print(int(var_g))
Correspondence
If you divide 66 strawberries and 49 grapes equally into a bag, there will be 6 strawberries left and 4 grapes left. Find how many bags there are.
15
49 4 [OP_SUB] 66 6 [OP_SUB] [OP_GCD]
var_a = 49 var_b = 4 var_c = var_a - var_b var_d = 66 var_e = 6 var_f = var_d - var_e var_g = math.gcd(int(var_f), int(var_c)) print(int(var_g))
Geometry
How many balls are left when 3 balls are removed from a box of 10 balls?
7
10 3 [OP_SUB]
var_a = 10 var_b = 3 var_c = var_a - var_b print(int(var_c))
Geometry
Ye-jin stacked boxes 53 centimeters (cm) 7 millimeters (mm) high to take out books, climbed on top of them, and measured her height from the floor. It was 190 centimeters (cm). However, if the height is not enough, pile up more boxes, stand on top of them, and measure her height from the floor. It was 232 centimeters (cm) and 5 millimeters (mm), find out how tall the boxes are now stacked.
96.2
232 5 10 [OP_DIV] [OP_ADD] 190 [OP_SUB] 53 7 10 [OP_DIV] [OP_ADD] [OP_ADD]
var_a = 232 var_b = 5 var_c = 10 var_d = var_b / var_c var_e = var_a + var_d var_f = 190 var_g = var_e - var_f var_h = 53 var_i = 7 var_j = 10 var_k = var_i / var_j var_l = var_h + var_k var_m = var_g + var_l print('{:.2f}'.format(round(var_m+1e-10,2)))
Geometry
A rectangular parallelepiped water container with two sides of the base each measuring 6 meters (m) 40 centimeters (cm) and 9 meters (m), and a height of 5 meters (m) 20 centimeters (cm) is filled with water. You want to divide water into several water containers whose volume is 1 cubic meter (m3). How many water containers do you need at least?
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))
Arithmetic calculation
There is a box containing 3 blue balls and 2 red balls. How many balls are in the box?
5
3 2 [OP_ADD]
var_a = 3 var_b = 2 var_c = var_a + var_b print(int(var_c))
Arithmetic calculation
There is a virus that reproduces twice as many times as the first time every second. Initially, the sum of the weight of the beaker and 100 viruses contained in the beaker was 23.97 grams (g), and after 5 seconds, the sum of the weight of the beaker and the viruses contained in the beaker was 155.1 grams (g). How many grams (g) are 10000 replicated viruses?
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))
Possibility
Find the number of ways to draw two cards out of nine cards numbered 1 through 9 so that the sum becomes an odd number.
40
1 9 1 [OP_LIST_ARANGE] 2 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] 2 1 [OP_LIST_DIVIDE_AND_REMAIN] [OP_LIST_LEN]
var_a = 1 var_b = 9 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] list_c=[] for i in list_b: var_e = 0 i = int(i) while i//10 > 0: var_e = var_e + i%10 i = i//10 var_e = var_e + i%10 list_c.append(var_e) var_f = 2 var_g = 1 list_d = [] var_f = int(var_f) var_g = int(var_g) if var_g < 0: var_g = var_g + var_f for i in list_c: i = int(i) if i%var_f == var_g: list_d.append(i) var_h = len(list_d) print(int(var_h))
Arithmetic calculation
Three friends are about to share a strawberry juice. Seonghwa drank 1/6 of the total and Siyeon drank 2/5 of the rest. And if the amount of juice after Youngmin drank 2/3 of the remaining juice was 120 milliliters (㎖), how many milliliters (㎖) of strawberry juice was there at the beginning?
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)))))
Arithmetic calculation
It takes 5 minutes for Jeong-woo and 3 minutes for Shin-ji to complete one lap around the playground. In a situation where Jeong-woo and Shin-ji add their number of completed laps, how many minutes will it take them to reach a total of 16 laps?
30
1 16 [OP_MUL] 1 5 [OP_DIV] 1 3 [OP_DIV] [OP_ADD] [OP_DIV]
var_a = 1 var_b = 16 var_c = var_a * var_b var_d = 1 var_e = 5 var_f = var_d / var_e var_g = 1 var_h = 3 var_i = var_g / var_h var_j = var_f + var_i var_k = var_c / var_j print(int(var_k))
Geometry
The library at Hyunwoo's school is square with a side measuring 14.25 meters (m). Find the area of the library.
203.06
14.25 2 [OP_POW]
var_a = 14.25 var_b = 2 var_c = var_a ** var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
Adding 4.372 to a number and subtracting 43.72 gives us 16.398. Find out what the number is.
55.75
16.398 43.72 [OP_ADD] 4.372 [OP_SUB]
var_a = 16.398 var_b = 43.72 var_c = var_a + var_b var_d = 4.372 var_e = var_c - var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Possibility
Find the quotient of making the smallest quotient (three digit number)/(double digit number) using the cards 4, 2, 8, 1, 9 and each card can be used only once.
10
[OP_LIST_SOL] 4 2 8 1 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] [OP_LIST_POP] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] [OP_FDIV]
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-1] 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))
Geometry
I made a square by arranging colored paper of the same size without gaps. There are a total of 36 colored paper placed around the perimeter of this square. How many pieces of colored paper are on the outermost of one side?
10
36 4 [OP_DIV] 1 [OP_ADD]
var_a = 36 var_b = 4 var_c = var_a / var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Geometry
There are 2 different cards. When held upright and released, how many cases will be there for the cards to fall facing up?
1
1
var_a = 1 print(int(var_a))
Geometry
The living room of Eugene's house is said to be rectangular. If the width of the living room is 14 meters (m) and the area is 215.6 square meters (m2), what is the length of the living room in meters (m)?
15.4
215.6 14 [OP_DIV]
var_a = 215.6 var_b = 14 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
You want to subtract 24 from a number. If the answer when you mistakenly subtract 42 from it is 50, what would be the result if you correctly calculate it?
68
50 42 [OP_ADD] 24 [OP_SUB]
var_a = 50 var_b = 42 var_c = var_a + var_b var_d = 24 var_e = var_c - var_d print(int(var_e))
Comparison
Several children stand in a circle equally spaced apart. The 11th child and the 6th child are facing each other counterclockwise from one child. 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
If there are 10 boxes and there are 100 marbles per box, what is the total number of marbles?
1000
100 10 [OP_MUL]
var_a = 100 var_b = 10 var_c = var_a * var_b print(int(var_c))
Comparison
There are 24 colored pencils. The red colored pencils are 1/4 of the total, the blue colored pencils are 6 more than the red colored pencils, and the rest are yellow colored pencils. Find which colored pencils have the most.
blue
[OP_LIST_SOL] red blue yellow [OP_LIST_EOL] [OP_LIST_SOL] 24 4 [OP_DIV] 24 4 [OP_DIV] 6 [OP_ADD] 24 24 4 [OP_DIV] 6 [OP_ADD] [OP_SUB] 24 4 [OP_DIV] [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'red' var_b = 'blue' var_c = 'yellow' 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 = 24 var_e = 4 var_f = var_d / var_e var_g = 24 var_h = 4 var_i = var_g / var_h var_j = 6 var_k = var_i + var_j var_l = 24 var_m = 24 var_n = 4 var_o = var_m / var_n var_p = 6 var_q = var_o + var_p var_r = var_l - var_q var_s = 24 var_t = 4 var_u = var_s / var_t var_v = var_r - var_u list_b= [] if "/" in str(var_v): var_v = eval(str(var_v)) list_b.append(var_v) if "/" in str(var_k): var_k = eval(str(var_k)) list_b.append(var_k) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) list_b.reverse() var_w = 1 list_c=list_b.copy() list_c.sort() var_x = list_c[-var_w] var_y = list_b.index(var_x)+1 var_z = list_a[var_y-1] print(var_z)
Possibility
I'm trying to line up two elementary school students and two middle school students. In how many ways can elementary school students stand side by side?
12
2 1 [OP_ADD] 2 1 [OP_ADD] [OP_PERM] 2 [OP_MUL]
var_a = 2 var_b = 1 var_c = var_a + var_b var_d = 2 var_e = 1 var_f = var_d + var_e var_g = 1 var_c = int(var_c) var_f = int(var_f) for i, elem in enumerate(range(var_f)): var_g = var_g * (var_c-i) var_h = 2 var_i = var_g * var_h print(int(var_i))
Comparison
Nine people stand in a line in order from shortest to tallest. Hoseok stands at the front, and Yuna stands right behind Hoseok. If they line up again in order of tallest people, what number will Yuna stand from the front?
8
9 1 [OP_SUB] 1 [OP_SUB] 1 [OP_ADD]
var_a = 9 var_b = 1 var_c = var_a - var_b var_d = 1 var_e = var_c - var_d var_f = 1 var_g = var_e + var_f print(int(var_g))
Arithmetic calculation
There are numbers 36, 17, 32, 54, 28, and 3. Find the sum of the numbers.
170
[OP_LIST_SOL] 36 17 32 54 28 3 [OP_LIST_EOL] [OP_LIST_SUM]
var_a = 36 var_b = 17 var_c = 32 var_d = 54 var_e = 28 var_f = 3 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) print(int(var_g))
Correspondence
I had to divide 96 by a number but mistakenly subtracted 9 by the number to get 3. Find the correctly calculated value.
16
96 9 3 [OP_SUB] [OP_DIV]
var_a = 96 var_b = 9 var_c = 3 var_d = var_b - var_c var_e = var_a / var_d print(int(var_e))
Possibility
I'm trying to pick the class president and vice president from Minhyung's class. There are 3 candidates for class president and 5 candidates for vice president. How many ways can you choose one class president and one vice president?
15
3 1 [OP_COMB] 5 1 [OP_COMB] [OP_MUL]
var_a = 3 var_b = 1 var_c = 1 var_a = int(var_a) var_b = int(var_b) for i, elem in enumerate(range(var_b)): var_c = var_c * (var_a-i) for i, elem in enumerate(range(var_b)): var_c = var_c / (i+1) var_d = 5 var_e = 1 var_f = 1 var_d = int(var_d) var_e = int(var_e) for i, elem in enumerate(range(var_e)): var_f = var_f * (var_d-i) for i, elem in enumerate(range(var_e)): var_f = var_f / (i+1) var_g = var_c * var_f print(int(var_g))
Arithmetic calculation
Seojun did 1/3 of the homework yesterday and 2/5 of the total today. Find the total amount of homework remaining.
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)))
Comparison
A total of 20 students are running a race. Yoongi reached the finish line before the 11 students. How many students came in before Yoongi?
8
20 11 [OP_SUB] 1 [OP_SUB]
var_a = 20 var_b = 11 var_c = var_a - var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
There is a string that is 90 centimeters (cm) long. 30 centimeters (cm) of the string was given to Yoojung, and 8/15 of the remaining string was used to tie the box. How many centimeters (cm) is the string used to tie the box?
32
90 30 [OP_SUB] 8/15 [OP_MUL]
var_a = 90 var_b = 30 var_c = var_a - var_b var_d = 0.5333333333333333 var_e = var_c * var_d print(int(var_e))
Arithmetic calculation
I rode a bicycle back and forth between the two points A and B, traveling at 15 kilometers per hour (km) on the way and 10 kilometers (km) per hour on the way back, and it took 30 minutes longer to come back. Find the total time it took to come back.
1.5
10 30 60 [OP_DIV] [OP_MUL] 15 10 [OP_SUB] [OP_DIV] 30 60 [OP_DIV] [OP_ADD]
var_a = 10 var_b = 30 var_c = 60 var_d = var_b / var_c var_e = var_a * var_d var_f = 15 var_g = 10 var_h = var_f - var_g var_i = var_e / var_h var_j = 30 var_k = 60 var_l = var_j / var_k var_m = var_i + var_l print('{:.2f}'.format(round(var_m+1e-10,2)))
Arithmetic calculation
Jungkook has 4 fewer marbles than Jimin. If Jungkook has 3 marbles, how many marbles do both of them have?
10
3 3 4 [OP_ADD] [OP_ADD]
var_a = 3 var_b = 3 var_c = 4 var_d = var_b + var_c var_e = var_a + var_d print(int(var_e))
Correspondence
Seonwoo wants to combine 35 pencils and 5 erasers and hand them out to 5 friends in equal numbers. Find how many of them should he hand out to each friend.
8
35 5 [OP_ADD] 5 [OP_DIV]
var_a = 35 var_b = 5 var_c = var_a + var_b var_d = 5 var_e = var_c / var_d print(int(var_e))
Comparison
We filled a 1 liter (l) 400 milliliter (ml) vase and a 2800 milliliter (ml) milk bottle with water, and then poured it all into a basin, which made the basin full. Between this basin a tank with 4 liters (L) and 100 milliliters (ml), which one can have more water inside?
basin
[OP_LIST_SOL] tank basin [OP_LIST_EOL] [OP_LIST_SOL] 4 1000 [OP_MUL] 100 [OP_ADD] 2800 1 1000 [OP_MUL] 400 [OP_ADD] [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'tank' var_b = 'basin' 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 = 1000 var_e = var_c * var_d var_f = 100 var_g = var_e + var_f var_h = 2800 var_i = 1 var_j = 1000 var_k = var_i * var_j var_l = 400 var_m = var_k + var_l var_n = var_h + var_m list_b= [] if "/" in str(var_n): var_n = eval(str(var_n)) list_b.append(var_n) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) list_b.reverse() var_o = 1 list_c=list_b.copy() list_c.sort() var_p = list_c[-var_o] var_q = list_b.index(var_p)+1 var_r = list_a[var_q-1] print(var_r)
Arithmetic calculation
How many three-digit numbers are divisible by the four numbers 6, 5, 8, and 9?
2
100 999 1 [OP_LIST_ARANGE] 6 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 8 [OP_LIST_DIVISIBLE] 9 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 100 var_b = 999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 6 list_b = [] var_d = int(var_d) for i in list_a: i = int(i) if i % var_d == 0: list_b.append(i) var_e = 5 list_c = [] var_e = int(var_e) for i in list_b: i = int(i) if i % var_e == 0: list_c.append(i) var_f = 8 list_d = [] var_f = int(var_f) for i in list_c: i = int(i) if i % var_f == 0: list_d.append(i) var_g = 9 list_e = [] var_g = int(var_g) for i in list_d: i = int(i) if i % var_g == 0: list_e.append(i) var_h = len(list_e) print(int(var_h))
Comparison
There are five types of shapes: triangular-prism, quadrangular-prism, triangular-pyramid, quadrangular-pyramid, and truncated-quadrangular-pyramid. Given that you place a sticker on the center of each face of each shape, which shape needs the least number of stickers?
triangular-pyramid
[OP_LIST_SOL] triangular-prism quadrangular-prism triangular-pyramid quadrangular-pyramid truncated-quadrangular-pyramid [OP_LIST_EOL] [OP_LIST_SOL] 3 2 [OP_ADD] 4 2 [OP_ADD] 3 1 [OP_ADD] 4 1 [OP_ADD] 4 2 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'triangular-prism' var_b = 'quadrangular-prism' var_c = 'triangular-pyramid' var_d = 'quadrangular-pyramid' var_e = 'truncated-quadrangular-pyramid' list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 3 var_g = 2 var_h = var_f + var_g var_i = 4 var_j = 2 var_k = var_i + var_j var_l = 3 var_m = 1 var_n = var_l + var_m var_o = 4 var_p = 1 var_q = var_o + var_p var_r = 4 var_s = 2 var_t = var_r + var_s list_b= [] if "/" in str(var_t): var_t = eval(str(var_t)) list_b.append(var_t) if "/" in str(var_q): var_q = eval(str(var_q)) list_b.append(var_q) if "/" in str(var_n): var_n = eval(str(var_n)) list_b.append(var_n) if "/" in str(var_k): var_k = eval(str(var_k)) list_b.append(var_k) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) list_b.reverse() var_u = 1 list_c=list_b.copy() list_c.sort() var_v = list_c[var_u-1] var_w = list_b.index(var_v)+1 var_x = list_a[var_w-1] print(var_x)
Geometry
There are two cubes of different sizes. When the sum of the lengths of all edges of the large cube is 82.8 centimeters (cm), and the length of one edge of the small cube is 1/3 of the length of one edge of the large cube, select each one of the edges of the two cubes and determine its length. Add up to how many centimeters (cm)?
9.2
82.8 4 3 [OP_MUL] [OP_DIV] 1/3 [OP_MUL] 82.8 4 3 [OP_MUL] [OP_DIV] [OP_ADD]
var_a = 82.8 var_b = 4 var_c = 3 var_d = var_b * var_c var_e = var_a / var_d var_f = 0.3333333333333333 var_g = var_e * var_f var_h = 82.8 var_i = 4 var_j = 3 var_k = var_i * var_j var_l = var_h / var_k var_m = var_g + var_l print('{:.2f}'.format(round(var_m+1e-10,2)))
Arithmetic calculation
Which four-digit number is the smallest common multiple of 5, 6, and 2?
1020
1000 9999 1 [OP_LIST_ARANGE] 5 [OP_LIST_DIVISIBLE] 6 [OP_LIST_DIVISIBLE] 2 [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 = 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 = 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))
Correspondence
Yoongi wants to subtract 57 from a three-digit number. Yoongi misread the three-digit ones digit 9 as a 6. When Yoongi's car is 819, find the correct calculation result.
822
819 57 [OP_ADD] 6 9 [OP_SUB] [OP_SUB] 57 [OP_SUB]
var_a = 819 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))
Comparison
Suzy has a wire of 9 centimeters (cm) 8 millimeters (mm), Yeongju has 8.9 centimeters (cm), and Youngho has 9.3 centimeters (cm). Who has the shortest wire length?
Yeongju
[OP_LIST_SOL] Suzy Yeongju Youngho [OP_LIST_EOL] [OP_LIST_SOL] 9 8 10 [OP_DIV] [OP_ADD] 8.9 9.3 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Suzy' var_b = 'Yeongju' var_c = 'Youngho' 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 = 9 var_e = 8 var_f = 10 var_g = var_e / var_f var_h = var_d + var_g var_i = 8.9 var_j = 9.3 list_b= [] 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) list_b.reverse() var_k = 1 list_c=list_b.copy() list_c.sort() var_l = list_c[var_k-1] var_m = list_b.index(var_l)+1 var_n = list_a[var_m-1] print(var_n)
Comparison
Jungkook has 0.8, Yoongi has 1/2, Yoojeong has 0.9, and Yuna has 1/3 written on their cards. How many people have cards with numbers less than 0.3 written?
0
[OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 0.3 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = 0.8 var_b = 0.5 var_c = 0.9 var_d = 0.3333333333333333 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 0.3 list_b = [] for i in list_a: if i < var_e: list_b.append(i) var_f = len(list_b) print(int(var_f))
Arithmetic calculation
When Jimin counted the money he had, there were 5 100 won coins and 1 50 won coin. If Seok-jin, who was next to him, had 2 100-won coins and 7 10-won coins, what would be the most expensive item the two of them could buy with the money they had?
820
100 5 [OP_MUL] 50 1 [OP_MUL] [OP_ADD] 100 2 [OP_MUL] [OP_ADD] 10 7 [OP_MUL] [OP_ADD]
var_a = 100 var_b = 5 var_c = var_a * var_b var_d = 50 var_e = 1 var_f = var_d * var_e var_g = var_c + var_f var_h = 100 var_i = 2 var_j = var_h * var_i var_k = var_g + var_j var_l = 10 var_m = 7 var_n = var_l * var_m var_o = var_k + var_n print(int(var_o))
Arithmetic calculation
You are trying to find a two-digit number that is divisible by 3 and 4 and divided by 5 has a remainder of 4. What is the smallest two-digit number you can make?
24
10 99 1 [OP_LIST_ARANGE] 3 4 [OP_LCM] [OP_LIST_DIVISIBLE] 5 4 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_MIN]
var_a = 10 var_b = 99 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 3 var_e = 4 var_f = var_e * var_d / math.gcd(int(var_e), int(var_d)) list_b = [] var_f = int(var_f) for i in list_a: i = int(i) if i % var_f == 0: list_b.append(i) var_g = 5 var_h = 4 list_c = [] var_g = int(var_g) var_h = int(var_h) if var_h < 0: var_h = var_h + var_g for i in list_b: i = int(i) if i%var_g == var_h: list_c.append(i) var_i = 1 list_d=list_c.copy() list_d.sort() var_j = list_d[var_i-1] print(int(var_j))
Possibility
What is the largest possible sum that can be calculated in an addition expression comprised of two-digit numbers that were made using 1, 7, 9, and 2 once?
163
[OP_LIST_SOL] 1 7 9 2 [OP_LIST_EOL] 1 [OP_LIST_MAX] 10 [OP_MUL] 1 [OP_LIST_MIN] [OP_ADD] 2 [OP_LIST_MAX] 10 [OP_MUL] 2 [OP_LIST_MIN] [OP_ADD] [OP_ADD]
var_a = 1 var_b = 7 var_c = 9 var_d = 2 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 1 list_b=list_a.copy() list_b.sort() var_f = list_b[-var_e] var_g = 10 var_h = var_f * var_g var_i = 1 list_c=list_a.copy() list_c.sort() var_j = list_c[var_i-1] var_k = var_h + var_j var_l = 2 list_d=list_a.copy() list_d.sort() var_m = list_d[-var_l] var_n = 10 var_o = var_m * var_n var_p = 2 list_e=list_a.copy() list_e.sort() var_q = list_e[var_p-1] var_r = var_o + var_q var_s = var_k + var_r print(int(var_s))
Comparison
1000 marbles are divided between class 1 and 2, but class 1 has 50 more marbles. Then, the students in class 2 were divided into two teams of boys and girls and shared the marbles they brought, and the boys got 35 more. If 17 male students in class 2 share the marbles equally, find how many marbles each male student in class 2 has.
15
1000 50 [OP_SUB] 2 [OP_DIV] 35 [OP_SUB] 2 [OP_DIV] 35 [OP_ADD] 17 [OP_DIV]
var_a = 1000 var_b = 50 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d var_f = 35 var_g = var_e - var_f var_h = 2 var_i = var_g / var_h var_j = 35 var_k = var_i + var_j var_l = 17 var_m = var_k / var_l print(int(var_m))
Correspondence
When 632-AB1=41, what number should go in 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))
Arithmetic calculation
Minyoung drank 7/9 liters (L) of water, and Yuna drank 2 liters (L). Find how many times the amount of water Minyoung drank compared to the amount of water Yuna drank.
0.39
7/9 2 [OP_DIV]
var_a = 0.7777777777777778 var_b = 2 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Comparison
There are a total of three numbers: 0.8, 1/2, and 0.5. How many of these numbers are less than or equal to 3?
3
[OP_LIST_SOL] 0.8 1/2 0.5 [OP_LIST_EOL] 3 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN]
var_a = 0.8 var_b = 0.5 var_c = 0.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 = 3 list_b = [] for i in list_a: if i <= var_d: list_b.append(i) var_e = len(list_b) print(int(var_e))
Correspondence
27 times a number plus 143 is 9693. Find the number.
216
9693 27 [OP_DIV] 143 [OP_SUB]
var_a = 9693 var_b = 27 var_c = var_a / var_b var_d = 143 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
Yulgi and Dongmin had 5,000 won in total. Yulgi paid all the money he had, and Dongmin paid 300 won more than Yulgi to buy a doll of 4,500 won. How much money did Dongmin have at first?
2900
5000 4500 300 [OP_SUB] 2 [OP_DIV] [OP_SUB]
var_a = 5000 var_b = 4500 var_c = 300 var_d = var_b - var_c var_e = 2 var_f = var_d / var_e var_g = var_a - var_f print(int(var_g))
Arithmetic calculation
Roosters outnumber hens by 16. How many chickens are there on the farm when there are 52 hens?
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))
Arithmetic calculation
Street lamps are erected on a bridge over a river that is 1650 meters (m) at intervals of 50 meters (m). If there are street lamps from the beginning to the end of the bridge, how many lamps are there on both sides of the bridge?
68
1650 50 [OP_DIV] 1 [OP_ADD] 2 [OP_MUL]
var_a = 1650 var_b = 50 var_c = var_a / var_b var_d = 1 var_e = var_c + var_d var_f = 2 var_g = var_e * var_f print(int(var_g))
Comparison
Nine people stand in a line in order from shortest to tallest. Hoseok is the tallest, and Yuna stands 5th ahead of Hoseok. If you line up again in order of tallest people, what number will Yuna stand from the front?
6
9 9 [OP_SUB] 5 [OP_ADD] 1 [OP_ADD]
var_a = 9 var_b = 9 var_c = var_a - var_b var_d = 5 var_e = var_c + var_d var_f = 1 var_g = var_e + var_f print(int(var_g))
Correspondence
A and B are single-digit numbers. A is 3 greater than 5, and B is 2 less than A. Calculate the sum of A and B.
14
5 3 [OP_ADD] 5 3 [OP_ADD] 2 [OP_SUB] [OP_ADD]
var_a = 5 var_b = 3 var_c = var_a + var_b var_d = 5 var_e = 3 var_f = var_d + var_e var_g = 2 var_h = var_f - var_g var_i = var_c + var_h print(int(var_i))
Correspondence
You had to add 2 to a certain number, but you mistakenly subtracted it, and the result was 5. What is the value if it is correctly calculated?
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))
Geometry
When the entire school students were arranged in a large square, there were 240 students standing at the perimeter. How many students were there in all?
3721
240 4 [OP_DIV] 1 [OP_ADD] 2 [OP_POW]
var_a = 240 var_b = 4 var_c = var_a / var_b var_d = 1 var_e = var_c + var_d var_f = 2 var_g = var_e ** var_f print(int(var_g))
Geometry
A large square was created by arranging the square-shaped tiles regularly without any gaps. If the number of tiles arranged at the perimeter was 240, how many tiles in total were used?
3721
240 4 [OP_DIV] 1 [OP_ADD] 2 [OP_POW]
var_a = 240 var_b = 4 var_c = var_a / var_b var_d = 1 var_e = var_c + var_d var_f = 2 var_g = var_e ** var_f print(int(var_g))
Arithmetic calculation
There are 2.3 liters (L) of Coke extract. It is said that 3 bottles of cola are made with 400 milliliters (ml) of cola extract. How many bottles of Coke can you make? (However, 3 bottles of Coke can be made at a time.)
15
2.3 1000 [OP_MUL] 400 [OP_FDIV] 3 [OP_MUL]
var_a = 2.3 var_b = 1000 var_c = var_a * var_b var_d = 400 var_e = var_c // var_d var_f = 3 var_g = var_e * var_f print(int(var_g))
Arithmetic calculation
I'm going to distribute 400 notebooks to each of the Yellow, Red, and Blue class students. If the number of students in each class is 30, 27, and 28, how many notebooks are left?
60
400 30 27 [OP_ADD] 28 [OP_ADD] 4 [OP_MUL] [OP_SUB]
var_a = 400 var_b = 30 var_c = 27 var_d = var_b + var_c var_e = 28 var_f = var_d + var_e var_g = 4 var_h = var_f * var_g var_i = var_a - var_h print(int(var_i))
Arithmetic calculation
Find the average of the natural numbers that are divisible by 6 and are between 30 and 50.
39
30 50 1 [OP_LIST_ARANGE] 6 [OP_LIST_DIVISIBLE] [OP_LIST_MEAN]
var_a = 30 var_b = 50 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 6 list_b = [] var_d = int(var_d) for i in list_a: i = int(i) if i % var_d == 0: list_b.append(i) list_b = [float(i) for i in list_b] var_e = sum(list_b)/len(list_b) print(int(var_e))
Comparison
(c) fruit is heavier than (b) fruit and lighter than (a) fruit. What is the heaviest fruit?
(a)
[OP_LIST_SOL] (a) (b) (c) [OP_LIST_EOL] [OP_LIST_SOL] (c) (b) > (c) (a) < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [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 = '(c)' 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 = 1 var_k = list_c[var_j-1] print(var_k)
Comparison
Choose a number less than 1.1 from 1.4, 9/10, 1.2, 0.5, 13/10 and find the sum of the selected numbers
1.4
[OP_LIST_SOL] 1.4 9/10 1.2 0.5 13/10 [OP_LIST_EOL] 1.1 [OP_LIST_LESS] [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
There is a prism with the sum of the number of edges and vertices equal to 30. What is the number of sides of this prism plus 2?
8
30 2 3 [OP_ADD] [OP_DIV] 2 [OP_ADD]
var_a = 30 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))
Correspondence
A is a number from 1 to 9. What is the sum of all As that satisfy 0.4<0.A, 6.A<6.8, and 3.A<A.4?
18
0.4<0.A A [OP_DIGIT_UNK_SOLVER] 6.A<6.8 A [OP_DIGIT_UNK_SOLVER] [OP_SET_INTERSECT] 3.A<A.4 A [OP_DIGIT_UNK_SOLVER] [OP_SET_INTERSECT] [OP_LIST_SUM]
var_a = '0.4<0.A' 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] = [] 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].append(int(c[i])) list_a = list(set(ans_dict[var_b])) var_c = '6.A<6.8' var_d = 'A' ans_dict = dict() var_c = var_c.replace('×','*') var_c = var_c.replace('x','*') var_c = var_c.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_c): if v in variable_candi: ans_dict[v] = [] candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_c for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) 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_c): 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].append(int(c[i])) list_b = list(set(ans_dict[var_d])) list_c = list(set(list_a) & set(list_b)) var_e = '3.A<A.4' var_f = 'A' ans_dict = dict() var_e = var_e.replace('×','*') var_e = var_e.replace('x','*') var_e = var_e.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_e): if v in variable_candi: ans_dict[v] = [] candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_e 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_e): 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].append(int(c[i])) list_d = list(set(ans_dict[var_f])) list_e = list(set(list_c) & set(list_d)) list_e = [float(i) for i in list_e] var_g = sum(list_e) print(int(var_g))
Comparison
At a constant speed, a taxi travels a distance of 17.28 kilometers (km) in 16 minutes, and a car travels a distance of 8.52 kilometers (km) in 6 minutes. If you start from the same place and drive for 15 minutes, which goes farther: a taxi or a car?
car
[OP_LIST_SOL] taxi car [OP_LIST_EOL] [OP_LIST_SOL] 17.28 16 [OP_DIV] 15 [OP_MUL] 8.52 6 [OP_DIV] 15 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'taxi' var_b = 'car' 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 = 17.28 var_d = 16 var_e = var_c / var_d var_f = 15 var_g = var_e * var_f var_h = 8.52 var_i = 6 var_j = var_h / var_i var_k = 15 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) list_b.reverse() var_m = 1 list_c=list_b.copy() list_c.sort() var_n = list_c[-var_m] var_o = list_b.index(var_n)+1 var_p = list_a[var_o-1] print(var_p)
Correspondence
When 9A3B was rounded up to the tens place, it was 9430. What is A?
4
9A3B [OP_GEN_POSSIBLE_LIST] 9430 [OP_LIST_MORE_EQUAL] 9430 10 [OP_ADD] [OP_LIST_LESS] 9A3B A [OP_LIST_FIND_UNK]
var_a = '9A3B' ans_dict = dict() var_a = str(var_a) list_a = [] variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 0 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) if len(var_a) == len(str(int(temp))): new_elem = int(temp) list_a.append(new_elem) var_b = 9430 list_b = [] for i in list_a: if i >= var_b: list_b.append(i) var_c = 9430 var_d = 10 var_e = var_c + var_d list_c = [] for i in list_b: if i < var_e: list_c.append(i) var_f = '9A3B' var_g = 'A' var_f = str(var_f) var_g = str(var_g) unk_idx = var_f.index(var_g) var_h = 0 for elem in list_c: elem = str(elem) var_h = int(elem[unk_idx]) print(int(var_h))
Arithmetic calculation
Hoseok jumped the rope 34 times and Minyoung jumped it 51 times. How many more times does Hoseok have to jump to get the same number of jumps as Minyoung?
17
51 34 [OP_SUB]
var_a = 51 var_b = 34 var_c = var_a - var_b print(int(var_c))
Arithmetic calculation
There are 5 consecutive natural numbers whose sum is 100. What is the smallest of these numbers?
18
100 5 [OP_DIV] 5 2 [OP_FDIV] [OP_SUB]
var_a = 100 var_b = 5 var_c = var_a / var_b var_d = 5 var_e = 2 var_f = var_d // var_e var_g = var_c - var_f print(int(var_g))
Comparison
There are five boxes: A, B, C, D, and E. D box is larger than B box and smaller than A box. B box is larger than E box. A box is smaller than C box. Which box is the largest?
C
[OP_LIST_SOL] A B C D E [OP_LIST_EOL] [OP_LIST_SOL] D B > D A < B E > A C < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'A' var_b = 'B' var_c = 'C' var_d = 'D' var_e = 'E' 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 = 'D' var_g = 'B' var_h = '>' var_i = 'D' var_j = 'A' var_k = '<' var_l = 'B' var_m = 'E' var_n = '>' var_o = 'A' var_p = 'C' var_q = '<' list_b= [] if "/" in str(var_q): var_q = eval(str(var_q)) list_b.append(var_q) if "/" in str(var_p): var_p = eval(str(var_p)) list_b.append(var_p) if "/" in str(var_o): var_o = eval(str(var_o)) list_b.append(var_o) if "/" in str(var_n): var_n = eval(str(var_n)) list_b.append(var_n) if "/" in str(var_m): var_m = eval(str(var_m)) list_b.append(var_m) if "/" in str(var_l): var_l = eval(str(var_l)) list_b.append(var_l) if "/" in str(var_k): var_k = eval(str(var_k)) list_b.append(var_k) if "/" in str(var_j): var_j = eval(str(var_j)) list_b.append(var_j) if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_r = 1 var_s = list_c[var_r-1] print(var_s)
Correspondence
The quotient of a number divided by 8 is 0.65. Find the value of the quotient of the number divided by 5 multiplied by 7.
7
0.65 8 [OP_MUL] 5 [OP_FDIV] 7 [OP_MUL]
var_a = 0.65 var_b = 8 var_c = var_a * var_b var_d = 5 var_e = var_c // var_d var_f = 7 var_g = var_e * var_f print(int(var_g))
Arithmetic calculation
There were 7 buses in the parking lot and 6 more came a few minutes later. How many buses are in the parking lot right now?
13
7 6 [OP_ADD]
var_a = 7 var_b = 6 var_c = var_a + var_b print(int(var_c))
Correspondence
A number subtracted by 5 multiplied by 4 equals the number multiplied by 2. Find the number.
10
5 4 [OP_MUL] 4 2 [OP_SUB] [OP_DIV]
var_a = 5 var_b = 4 var_c = var_a * var_b var_d = 4 var_e = 2 var_f = var_d - var_e var_g = var_c / var_f print(int(var_g))
Arithmetic calculation
There are 5 tuna and 2 spearfish in the sea. What is the total number of fish in the sea?
7
5 2 [OP_ADD]
var_a = 5 var_b = 2 var_c = var_a + var_b print(int(var_c))
Geometry
A large cube was made out of eight dices of the same size. If the surface area of one die is 96 square centimeters (cm2), find the volume in cubic centimeters (cm3) of the cube created.
512
96 6 [OP_DIV] 1/2 [OP_POW] 8 2 [OP_DIV] 2 [OP_DIV] [OP_MUL] 3 [OP_POW]
var_a = 96 var_b = 6 var_c = var_a / var_b var_d = 0.5 var_e = var_c ** var_d var_f = 8 var_g = 2 var_h = var_f / var_g var_i = 2 var_j = var_h / var_i var_k = var_e * var_j var_l = 3 var_m = var_k ** var_l print(int(var_m))
Comparison
The number of students at Sejeong's School is 1443. However, there are 141 more male students than female students. How many male students are there?
792
1443 141 [OP_SUB] 2 [OP_DIV] 141 [OP_ADD]
var_a = 1443 var_b = 141 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d var_f = 141 var_g = var_e + var_f print(int(var_g))
Arithmetic calculation
Taehyung is 5 years older than his younger brother, and this year Taehyung's younger brother is 7 years old. How old is his mother when the age difference between Taehyung and his mother is 31 years?
43
7 5 [OP_ADD] 31 [OP_ADD]
var_a = 7 var_b = 5 var_c = var_a + var_b var_d = 31 var_e = var_c + var_d print(int(var_e))
Correspondence
A and B are two natural numbers. If B is the number obtained by multiplying A by 9 and then adding 13, what is the remainder when B is divided by 9?
4
13 9 [OP_MOD]
var_a = 13 var_b = 9 var_c = var_a % var_b print(int(var_c))
Possibility
How many ways are possible to make a three-digit number by selecting three of 1, 3, 5, 7, and 9?
60
[OP_LIST_SOL] 1 3 5 7 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 1 var_b = 3 var_c = 5 var_d = 7 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 = len(list_b) print(int(var_g))
Possibility
Jungkook has 5 red balls, 4 blue balls, and 3 yellow balls. When Yoongi gives Jungkook one red ball, how many yellow balls does Jungkook have?
3
3
var_a = 3 print(int(var_a))
Geometry
If you bend a 12 centimeters (cm) wire in half, and then bend the bent wire in half again, how many centimeters (cm) is the current length of the wire?
3
12 2 [OP_DIV] 2 [OP_DIV]
var_a = 12 var_b = 2 var_c = var_a / var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Correspondence
If you add 10 to A, you get 15. How much is A?
5
15 10 [OP_SUB]
var_a = 15 var_b = 10 var_c = var_a - var_b print(int(var_c))
Correspondence
Students are trying to line up on the playground. When they are stood in 5 lines, 2 students were left out, when stood in 8 lines, 3 students were left, and when stood in 9 lines, it fit perfectly. Find how many students there are in total. However, the number of students in the playground is between 200 and 500.
387
200 500 1 [OP_LIST_ARANGE] 5 2 [OP_LIST_DIVIDE_AND_REMAIN] 8 3 [OP_LIST_DIVIDE_AND_REMAIN] 9 0 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_GET]
var_a = 200 var_b = 500 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 5 var_e = 2 list_b = [] var_d = int(var_d) var_e = int(var_e) if var_e < 0: var_e = var_e + var_d for i in list_a: i = int(i) if i%var_d == var_e: list_b.append(i) var_f = 8 var_g = 3 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 = 9 var_i = 0 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 var_k = list_d[var_j-1] print(int(var_k))
Arithmetic calculation
There are 6 (A) animals, 8 (B) animals, and 4 (C) animals. How many animals are there in all?
18
6 8 [OP_ADD] 4 [OP_ADD]
var_a = 6 var_b = 8 var_c = var_a + var_b var_d = 4 var_e = var_c + var_d print(int(var_e))
Geometry
There is a cube with a side with an area of 64 square centimeters (cm2). What is the volume of this cube?
512
64 1/2 [OP_POW] 3 [OP_POW]
var_a = 64 var_b = 0.5 var_c = var_a ** var_b var_d = 3 var_e = var_c ** var_d print(int(var_e))