category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Geometry
A rectangle whose width divided by its height equals 0.875. Find the area of this rectangle when its height is 24 centimeters (cm).
504
24 0.875 [OP_MUL] 24 [OP_MUL]
var_a = 24 var_b = 0.875 var_c = var_a * var_b var_d = 24 var_e = var_c * var_d print(int(var_e))
Geometry
There is a rectangle with a width of 36 centimeters (cm) and a length of 64 centimeters (cm) and a square whose sum of four sides is equal to the sum of a rectangle's four sides. Find how many centimeters (cm) the length of one side of this square is.
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))
Arithmetic calculation
It is said that the taxi fare in a city is 2,400 won for up to 3 kilometers (km), and 300 won is added for every 200 meters (km) beyond 3 kilometers (km). When a customer rides 4 kilometers (km), how much does he have to pay?
3900
2400 4 3 [OP_SUB] 1000 [OP_MUL] 200 [OP_DIV] 300 [OP_MUL] [OP_ADD]
var_a = 2400 var_b = 4 var_c = 3 var_d = var_b - var_c var_e = 1000 var_f = var_d * var_e var_g = 200 var_h = var_f / var_g var_i = 300 var_j = var_h * var_i var_k = var_a + var_j print(int(var_k))
Arithmetic calculation
How many numbers that are both multiples of 6 and 15 are less than 200?
6
1 200 1 [OP_LIST_ARANGE] 6 [OP_LIST_DIVISIBLE] 15 [OP_LIST_DIVISIBLE] 200 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = 1 var_b = 200 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 = 15 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 = 200 list_d = [] for i in list_c: if i < var_f: list_d.append(i) var_g = len(list_d) print(int(var_g))
Geometry
The area of a circle is equal to the sum of the areas of 4 circles of radius 2cm (cm). Find the radius of the circle.
4
4 2 2 [OP_POW] [OP_MUL] 1/2 [OP_POW]
var_a = 4 var_b = 2 var_c = 2 var_d = var_b ** var_c var_e = var_a * var_d var_f = 0.5 var_g = var_e ** var_f print(int(var_g))
Arithmetic calculation
Out of 1000 grams (g) of bread, if Bomi ate 350 grams (g) and Yejun ate 500 grams (g), how many grams (g) of bread are left?
150
1000 350 [OP_SUB] 500 [OP_SUB]
var_a = 1000 var_b = 350 var_c = var_a - var_b var_d = 500 var_e = var_c - var_d print(int(var_e))
Comparison
Jungkook has 6 erasers. Jimin has 4 more erasers than Jungkook and Seokjin has 3 fewer 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
There are pretty blankets whose shape is the same as a regular tetradecagon. When the length of all corners is 154 centimeters (cm). Find the length of one edge of the blanket.
11
154 14 [OP_DIV]
var_a = 154 var_b = 14 var_c = var_a / var_b print(int(var_c))
Correspondence
The quotient of the three-digit number A63 divided by 7 is a three-digit number. Find the number of possible A.
3
A63 [OP_GEN_POSSIBLE_LIST] 700 [OP_LIST_MORE_EQUAL] 7000 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = 'A63' 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 = 7000 list_c = [] for i in list_b: if i < var_c: list_c.append(i) var_d = len(list_c) print(int(var_d))
Arithmetic calculation
What is the smallest natural number excluding 1 that has the same remainder of 1 when divided by 3 and 5?
16
0 9999 1 [OP_LIST_ARANGE] 3 1 [OP_LIST_DIVIDE_AND_REMAIN] 5 1 [OP_LIST_DIVIDE_AND_REMAIN] 2 [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 = 3 var_e = 1 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 = 5 var_g = 1 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 = 2 list_d=list_c.copy() list_d.sort() var_i = list_d[var_h-1] print(int(var_i))
Arithmetic calculation
How many four-digit numbers less than 4000 are divisible by the five numbers of 2, 3, 5, 9, and 11?
3
1000 4000 1 [OP_SUB] 1 [OP_LIST_ARANGE] 2 [OP_LIST_DIVISIBLE] 3 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 9 [OP_LIST_DIVISIBLE] 11 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 1000 var_b = 4000 var_c = 1 var_d = var_b - var_c var_e = 1 list_a = [i for i in range(var_a, var_d + 1, var_e)] var_f = 2 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 = 3 list_c = [] var_g = int(var_g) for i in list_b: i = int(i) if i % var_g == 0: list_c.append(i) var_h = 5 list_d = [] var_h = int(var_h) for i in list_c: i = int(i) if i % var_h == 0: list_d.append(i) var_i = 5 list_e = [] var_i = int(var_i) for i in list_d: i = int(i) if i % var_i == 0: list_e.append(i) var_j = 9 list_f = [] var_j = int(var_j) for i in list_e: i = int(i) if i % var_j == 0: list_f.append(i) var_k = 11 list_g = [] var_k = int(var_k) for i in list_f: i = int(i) if i % var_k == 0: list_g.append(i) var_l = len(list_g) print(int(var_l))
Comparison
Among 1.4, 9/10, 1.2, 0.5, and 13/10, how many of these 5 numbers are greater than 1.1?
3
[OP_LIST_SOL] 1.4 9/10 1.2 0.5 13/10 [OP_LIST_EOL] 1.1 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 1.4 var_b = 0.9 var_c = 1.2 var_d = 0.5 var_e = 1.3 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 1.1 list_b = [] for i in list_a: if i > var_f: list_b.append(i) var_g = len(list_b) print(int(var_g))
Comparison
Jaewoong, Seongmin, and Eunseong are track and field athletes. When three people ran for 10 minutes, Jaewoong ran 20 kilometers (km), Sungmin ran 2600 meters (m), and Eunseong ran 5000 meters (m). Who has run the most?
Jaewoong
[OP_LIST_SOL] Jaewoong Seongmin Eunseong [OP_LIST_EOL] [OP_LIST_SOL] 20 1000 [OP_MUL] 2600 5000 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jaewoong' var_b = 'Seongmin' var_c = 'Eunseong' 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 = 20 var_e = 1000 var_f = var_d * var_e var_g = 2600 var_h = 5000 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)
Geometry
Find the sum of the lengths of all the edges of a cube with a surface area of 150 square centimeters (cm2).
60
150 6 [OP_DIV] 1/2 [OP_POW] 4 3 [OP_MUL] [OP_MUL]
var_a = 150 var_b = 6 var_c = var_a / var_b var_d = 0.5 var_e = var_c ** var_d var_f = 4 var_g = 3 var_h = var_f * var_g var_i = var_e * var_h print(int(var_i))
Comparison
People are queuing up to enter the amusement park. If Eunji is standing at the 6th from the back, and there are 7 people in front of Eunji, how many people are all in line?
13
6 7 [OP_ADD]
var_a = 6 var_b = 7 var_c = var_a + var_b print(int(var_c))
Geometry
The width of a rectangular parallelepiped is 7 centimeters (cm) and the length is 8 centimeters (cm). If the surface area is 442 square centimeters (cm2), how many centimeters (cm) is the height of this cuboid?
11
442 2 [OP_DIV] 7 8 [OP_MUL] [OP_SUB] 7 8 [OP_ADD] [OP_DIV]
var_a = 442 var_b = 2 var_c = var_a / var_b var_d = 7 var_e = 8 var_f = var_d * var_e var_g = var_c - var_f var_h = 7 var_i = 8 var_j = var_h + var_i var_k = var_g / var_j print(int(var_k))
Arithmetic calculation
There were 55 cars in the parking lot. After 16 cars went out, another 19 came in. How many more cars are there in the parking lot?
3
55 16 [OP_SUB] 19 [OP_ADD] 55 [OP_SUB]
var_a = 55 var_b = 16 var_c = var_a - var_b var_d = 19 var_e = var_c + var_d var_f = 55 var_g = var_e - var_f print(int(var_g))
Arithmetic calculation
Jimin's science score is 87, and his social studies score is 6 points higher than his science score. How many English points does he need to get an average score of 92 in science, social studies, and English?
96
92 3 [OP_MUL] 87 87 6 [OP_ADD] [OP_ADD] [OP_SUB]
var_a = 92 var_b = 3 var_c = var_a * var_b var_d = 87 var_e = 87 var_f = 6 var_g = var_e + var_f var_h = var_d + var_g var_i = var_c - var_h print(int(var_i))
Geometry
You are about to buy apples and pears, and give out 4 apples and 3 pears, and there should be no leftovers. If you buy the same number of apples and pears, find the minimum number you need to buy.
12
3 4 [OP_LCM]
var_a = 3 var_b = 4 var_c = var_b * var_a / math.gcd(int(var_b), int(var_a)) print(int(var_c))
Geometry
There is a cube with the sum of the lengths of all its edges equal to 82.8 centimeters (cm). A new cube was created by shortening the length of one edge of this cube by 1/3. How many centimeters (cm) is the sum of the length of one edge of the newly created cube and the length of one edge of the original cube?
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
The perimeter of an equilateral triangle is 2 meters (m). Find how many meters (m) is the side length of this equilateral triangle in decimal numbers.
0.67
2 3 [OP_DIV]
var_a = 2 var_b = 3 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
There are 6000 Go stones in total. There are more white Go stones than black Go stones. When the difference between the number of white and black stones is subtracted from the total number of stones, the result is 4800. How many white Go stones are there?
3600
6000 4800 2 [OP_DIV] [OP_SUB]
var_a = 6000 var_b = 4800 var_c = 2 var_d = var_b / var_c var_e = var_a - var_d print(int(var_e))
Arithmetic calculation
There are three times as many pears as apples in the supermarket. If there are 240 kilograms (kg) of apples, how many kilograms (kg) do the apples and pears weigh?
960
240 240 3 [OP_MUL] [OP_ADD]
var_a = 240 var_b = 240 var_c = 3 var_d = var_b * var_c var_e = var_a + var_d print(int(var_e))
Geometry
I painted a trapezoidal roof. The upper side of the roof is 3.4 centimeters (cm) longer than the lower side, the height is 5.2 centimeters (cm) and the area is 100.62 square centimeters (cm2). How many centimeters (cm) is the length of the lower side of the roof?
17.65
100.62 2 [OP_MUL] 5.2 [OP_DIV] 3.4 [OP_SUB] 2 [OP_DIV]
var_a = 100.62 var_b = 2 var_c = var_a * var_b var_d = 5.2 var_e = var_c / var_d var_f = 3.4 var_g = var_e - var_f var_h = 2 var_i = var_g / var_h print('{:.2f}'.format(round(var_i+1e-10,2)))
Arithmetic calculation
There is a machine that makes 180 toys in 30 minutes. Find how many toys this machine made in 1 hour.
360
1 60 [OP_MUL] 30 [OP_DIV] 180 [OP_MUL]
var_a = 1 var_b = 60 var_c = var_a * var_b var_d = 30 var_e = var_c / var_d var_f = 180 var_g = var_e * var_f print(int(var_g))
Comparison
20 students lined up in a single line. Eleven students are standing in front of Yoongi, and Hoseok is standing right behind Yoongi. How many students are standing behind Hoseok?
7
20 11 [OP_SUB] 1 [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 var_f = 1 var_g = var_e - var_f print(int(var_g))
Correspondence
When 57A-2B4=364, what number should go in B?
1
57A-2B4=364 B [OP_DIGIT_UNK_SOLVER]
var_a = '57A-2B4=364' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Geometry
There is a square-shaped colored paper with each side measuring 6 centimeters (cm). What is the area in square centimeters (cm2) of this sheet of paper?
36
6 2 [OP_POW]
var_a = 6 var_b = 2 var_c = var_a ** var_b print(int(var_c))
Correspondence
8A4 rounded up to the tens place is 870. Find A.
6
8A4 [OP_GEN_POSSIBLE_LIST] 870 [OP_LIST_LESS_EQUAL] 870 10 [OP_SUB] [OP_LIST_MORE] 8A4 A [OP_LIST_FIND_UNK]
var_a = '8A4' 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 = 870 list_b = [] for i in list_a: if i <= var_b: list_b.append(i) var_c = 870 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 = '8A4' var_g = 'A' var_f = str(var_f) var_g = str(var_g) unk_idx = var_f.index(var_g) var_h = 0 for elem in list_c: elem = str(elem) var_h = int(elem[unk_idx]) print(int(var_h))
Comparison
Eunji had 13 erasers. Yujeong had 4 erasers, and she got 3 more from her sister. Eunji gave her sister 7 erasers. Who has more erasers among Yujeong and Eunji?
Yujeong
[OP_LIST_SOL] Yujeong Eunji [OP_LIST_EOL] [OP_LIST_SOL] 4 3 [OP_ADD] 13 7 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yujeong' var_b = 'Eunji' 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 = 3 var_e = var_c + var_d var_f = 13 var_g = 7 var_h = var_f - var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Arithmetic calculation
Find the greatest common divisor of 32 and 24.
8
32 24 [OP_GCD]
var_a = 32 var_b = 24 var_c = math.gcd(int(var_b), int(var_a)) print(int(var_c))
Arithmetic calculation
Students rode the 15-seater ride once over 18 times. If each ride has 3 empty seats, what is the total number of students?
216
15 3 [OP_SUB] 18 [OP_MUL]
var_a = 15 var_b = 3 var_c = var_a - var_b var_d = 18 var_e = var_c * var_d print(int(var_e))
Correspondence
There are three different natural numbers A, B, and C. When A is divided by 11, the quotient is B and the remainder is C. Find the largest number that can be C.
10
11 1 [OP_SUB]
var_a = 11 var_b = 1 var_c = var_a - var_b print(int(var_c))
Comparison
There are two straps with a difference of 72 centimeters (cm). When I put these two in a row and measured the length, I got 3 meters (m) and 48 centimeters (cm). Find the length of the longer string.
210
3 100 [OP_MUL] 48 [OP_ADD] 72 [OP_SUB] 2 [OP_DIV] 72 [OP_ADD]
var_a = 3 var_b = 100 var_c = var_a * var_b var_d = 48 var_e = var_c + var_d var_f = 72 var_g = var_e - var_f var_h = 2 var_i = var_g / var_h var_j = 72 var_k = var_i + var_j print(int(var_k))
Correspondence
Suppose that the number multiplied by 15 minus 7 is 48. Find what the number is.
6
48 15 7 [OP_SUB] [OP_DIV]
var_a = 48 var_b = 15 var_c = 7 var_d = var_b - var_c var_e = var_a / var_d print(int(var_e))
Arithmetic calculation
There are four numbers 10, 11, 12, and 13. What is the remainder when divided by the smallest number and the second smallest number?
10
[OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_MOD]
var_a = 10 var_b = 11 var_c = 12 var_d = 13 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 1 list_b=list_a.copy() list_b.sort() var_f = list_b[var_e-1] var_g = 2 list_c=list_a.copy() list_c.sort() var_h = list_c[var_g-1] var_i = var_f % var_h print(int(var_i))
Geometry
There is a regular pentagon with a perimeter of 23.4 centimeters (cm). How many centimeters (cm) is one side of this regular pentagon?
4.68
23.4 5 [OP_DIV]
var_a = 23.4 var_b = 5 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
The four-digit number 7A2B is divisible by the least common multiple of 2, 3, and 5, and A and B represent different numbers. Find the largest of these four-digit numbers.
7920
7A2B [OP_GEN_POSSIBLE_LIST] 2 [OP_LIST_DIVISIBLE] 3 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX]
var_a = '7A2B' 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 = 2 list_b = [] var_b = int(var_b) for i in list_a: i = int(i) if i % var_b == 0: list_b.append(i) var_c = 3 list_c = [] var_c = int(var_c) for i in list_b: i = int(i) if i % var_c == 0: list_c.append(i) var_d = 5 list_d = [] var_d = int(var_d) for i in list_c: i = int(i) if i % var_d == 0: list_d.append(i) var_e = 1 list_e=list_d.copy() list_e.sort() var_f = list_e[-var_e] print(int(var_f))
Arithmetic calculation
Seoyeon has 4 blocks with numbers on them. Find the sum of the numbers on two blocks that maximize the difference between the numbers written in the block. The blocks are numbered 1, 3, 7, and 9.
10
[OP_LIST_SOL] 1 3 7 9 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD]
var_a = 1 var_b = 3 var_c = 7 var_d = 9 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 1 list_b=list_a.copy() list_b.sort() var_f = list_b[-var_e] var_g = 1 list_c=list_a.copy() list_c.sort() var_h = list_c[var_g-1] var_i = var_f + var_h print(int(var_i))
Arithmetic calculation
There were 34 people on the bus. At this stop, 11 people got off and 24 people got on. How many people are on the bus right now?
47
34 11 [OP_SUB] 24 [OP_ADD]
var_a = 34 var_b = 11 var_c = var_a - var_b var_d = 24 var_e = var_c + var_d print(int(var_e))
Correspondence
A number plus 14, multiply by 14, subtract by 24, and divide by 24 equals 13. If the calculation proceeds in order, find the initial number.
10
13 24 [OP_MUL] 24 [OP_ADD] 14 [OP_DIV] 14 [OP_SUB]
var_a = 13 var_b = 24 var_c = var_a * var_b var_d = 24 var_e = var_c + var_d var_f = 14 var_g = var_e / var_f var_h = 14 var_i = var_g - var_h print(int(var_i))
Comparison
Find how many three-digit numbers with 2 in the hundreds digit and 5 in the tens digit are greater than 256.
3
[OP_LIST_SOL] 2 5 A [OP_LIST_EOL] [OP_LIST2NUM] [OP_GEN_POSSIBLE_LIST] 256 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 2 var_b = 5 var_c = 'A' 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="" for i in list_a: i = str(i) var_d = var_d + i ans_dict = dict() var_d = str(var_d) list_b = [] variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_d): if v in variable_candi: ans_dict[v] = 0 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_d for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) if len(var_d) == len(str(int(temp))): new_elem = int(temp) list_b.append(new_elem) var_e = 256 list_c = [] for i in list_b: if i > var_e: list_c.append(i) var_f = len(list_c) print(int(var_f))
Arithmetic calculation
Minyoung bought the same number of candies at 60 won each with the money he could buy same number of candies at 90 won each, and he had 270 won left. Find how much money Minyoung had.
540
270 90 60 [OP_SUB] [OP_DIV] 60 [OP_MUL]
var_a = 270 var_b = 90 var_c = 60 var_d = var_b - var_c var_e = var_a / var_d var_f = 60 var_g = var_e * var_f print(int(var_g))
Correspondence
You originally planned to subtract 1264 from a number, but you mistakenly subtracted 2152. What is the difference between the correct and incorrect answers?
888
2152 1264 [OP_SUB]
var_a = 2152 var_b = 1264 var_c = var_a - var_b print(int(var_c))
Comparison
In two-digit multiplication, the digit 5 in the tens place of this number was incorrectly considered to be 3, resulting in a computed value of 1485. If the correct value is 2385, write the smaller of the two 2-digit numbers.
53
[OP_LIST_SOL] 1485 2385 [OP_SUB] 3 5 [OP_SUB] 10 [OP_MUL] [OP_DIV] 2385 1485 2385 [OP_SUB] 3 5 [OP_SUB] 10 [OP_MUL] [OP_DIV] [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX]
var_a = 1485 var_b = 2385 var_c = var_a - var_b var_d = 3 var_e = 5 var_f = var_d - var_e var_g = 10 var_h = var_f * var_g var_i = var_c / var_h var_j = 2385 var_k = 1485 var_l = 2385 var_m = var_k - var_l var_n = 3 var_o = 5 var_p = var_n - var_o var_q = 10 var_r = var_p * var_q var_s = var_m / var_r var_t = var_j / var_s list_a= [] if "/" in str(var_t): var_t = eval(str(var_t)) list_a.append(var_t) if "/" in str(var_i): var_i = eval(str(var_i)) list_a.append(var_i) list_a.reverse() var_u = 1 list_b=list_a.copy() list_b.sort() var_v = list_b[-var_u] print(int(var_v))
Arithmetic calculation
There are 120 liters (L) of water in the water tank. When you open the faucet in this water tank, 4 liters (L) of water flow out per minute. A few minutes after opening the faucet, 20 liters (L) of water remained in the water tank. Find how many minutes the faucet was left open.
25
120 20 [OP_SUB] 4 [OP_DIV]
var_a = 120 var_b = 20 var_c = var_a - var_b var_d = 4 var_e = var_c / var_d print(int(var_e))
Geometry
There is a milk carton in the shape of a cube. When all of these milk cartons were unfolded, the area was 600. Find the volume of this milk carton.
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))
Correspondence
When you collected 96 marbles in the bag, 5 groups came out, and the remainder was 17. What is the number of marbles multiplied by 69?
34293
5 96 [OP_MUL] 17 [OP_ADD] 69 [OP_MUL]
var_a = 5 var_b = 96 var_c = var_a * var_b var_d = 17 var_e = var_c + var_d var_f = 69 var_g = var_e * var_f print(int(var_g))
Possibility
How many 3-digit integers can be made by drawing 3 out of 4 marbles numbered 2, 3, 4, 5?
24
[OP_LIST_SOL] 2 3 4 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 2 var_b = 3 var_c = 4 var_d = 5 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 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 = len(list_b) print(int(var_f))
Correspondence
When you add 36 to a certain number, you get 71. What is the value when you add 10 to that certain number?
45
71 36 [OP_SUB] 10 [OP_ADD]
var_a = 71 var_b = 36 var_c = var_a - var_b var_d = 10 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
It took 10 minutes to go 15.5 kilometers (km) by car driven by Hyun-soo's father. How many kilometers (km) he can go in 46 minutes at this speed?
71.3
15.5 10 [OP_DIV] 46 [OP_MUL]
var_a = 15.5 var_b = 10 var_c = var_a / var_b var_d = 46 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Comparison
The average math score of 5 students in the competition class was 81.6. Calculating the average without the highest score is said to be 6 points lower than the average without the lowest score. Let's say that the scores of the other 3 people excluding the highest and lowest, are 88, 84, and 76. Find the lowest score.
68
81.6 5 [OP_MUL] 88 84 [OP_ADD] 76 [OP_ADD] [OP_SUB] 6 4 [OP_MUL] [OP_SUB] 2 [OP_DIV]
var_a = 81.6 var_b = 5 var_c = var_a * var_b var_d = 88 var_e = 84 var_f = var_d + var_e var_g = 76 var_h = var_f + var_g var_i = var_c - var_h var_j = 6 var_k = 4 var_l = var_j * var_k var_m = var_i - var_l var_n = 2 var_o = var_m / var_n print(int(var_o))
Arithmetic calculation
You want to place 6 flagpoles on the street at regular intervals. The length of the street is 11.5 meters (m), and it is said that there are flagpoles at both ends. How many meters (m) should the distance between flagpoles be?
2.3
11.5 6 1 [OP_SUB] [OP_DIV]
var_a = 11.5 var_b = 6 var_c = 1 var_d = var_b - var_c var_e = var_a / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Comparison
Jungwook ran 3.97 kilometers (km), and Yongun ran 4028 meters (m). Who ran the longer distance?
Yongun
[OP_LIST_SOL] Jungwook Yongun [OP_LIST_EOL] [OP_LIST_SOL] 3.97 4028 1000 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jungwook' var_b = 'Yongun' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 3.97 var_d = 4028 var_e = 1000 var_f = var_d / var_e list_b= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_c): var_c = eval(str(var_c)) list_b.append(var_c) 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)
Correspondence
When 2 times 2 plus the number is equal to 6, what number is it?
2
6 2 2 [OP_MUL] [OP_SUB]
var_a = 6 var_b = 2 var_c = 2 var_d = var_b * var_c var_e = var_a - var_d print(int(var_e))
Arithmetic calculation
Thick books are 14/15 centimeters (cm) thick, and thin books are 1/10 centimeters (cm) thinner than thick books. Find the sum of the thicknesses of the two books in centimeters (cm).
1.77
14/15 2 [OP_MUL] 1/10 [OP_SUB]
var_a = 0.9333333333333333 var_b = 2 var_c = var_a * var_b var_d = 0.1 var_e = var_c - var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
Multiplying 107.8 by some number gives 9.8. Find out what the number is.
0.09
9.8 107.8 [OP_DIV]
var_a = 9.8 var_b = 107.8 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
Some numbers are in between 5 and 9 and are single-digits greater than 7. Find which number satisfies the condition.
8
5 1 [OP_ADD] 9 1 [OP_SUB] 1 [OP_LIST_ARANGE] 7 [OP_LIST_MORE] 1 [OP_LIST_GET]
var_a = 5 var_b = 1 var_c = var_a + var_b var_d = 9 var_e = 1 var_f = var_d - var_e var_g = 1 list_a = [i for i in range(var_c, var_f + 1, var_g)] var_h = 7 list_b = [] for i in list_a: if i > var_h: list_b.append(i) var_i = 1 var_j = list_b[var_i-1] print(int(var_j))
Geometry
Make each square and rectangle from two pieces of wire of 52 centimeters (cm) long. If the width of the rectangle is 15 centimeters (cm), what is the difference between the areas of the two figures?
4
52 4 [OP_DIV] 2 [OP_POW] 52 2 [OP_DIV] 15 [OP_SUB] 15 [OP_MUL] [OP_SUB] [OP_ABS]
var_a = 52 var_b = 4 var_c = var_a / var_b var_d = 2 var_e = var_c ** var_d var_f = 52 var_g = 2 var_h = var_f / var_g var_i = 15 var_j = var_h - var_i var_k = 15 var_l = var_j * var_k var_m = var_e - var_l var_n = abs(var_m) print(int(var_n))
Arithmetic calculation
There are three numbers 10, 11 and 12. What is the sum of the second largest number and the second smallest number?
22
[OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 2 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_ADD]
var_a = 10 var_b = 11 var_c = 12 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 2 list_b=list_a.copy() list_b.sort() var_e = list_b[-var_d] var_f = 2 list_c=list_a.copy() list_c.sort() var_g = list_c[var_f-1] var_h = var_e + var_g print(int(var_h))
Comparison
5 balls are placed side by side. (e) ball is placed to the right of (c) and (e) to the left of (d). To the right of (a) is the ball (c), and to the left of (b) is the ball (d). Find the ball that is placed on the far left.
(a)
[OP_LIST_SOL] (a) (b) (c) (d) (e) [OP_LIST_EOL] [OP_LIST_SOL] (e) (c) > (e) (d) < (c) (a) > (d) (b) < [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)' 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 = '(e)' var_g = '(c)' var_h = '>' var_i = '(e)' var_j = '(d)' var_k = '<' var_l = '(c)' var_m = '(a)' var_n = '>' var_o = '(d)' var_p = '(b)' 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 = len(list_c) var_s = list_c[var_r-1] print(var_s)
Geometry
You can make a cuboid by attaching three cubes, each of which has a side of 6 centimeters (cm) long. How much did the surface area after pasting decrease compared to before pasting?
288
3 6 3 [OP_POW] [OP_MUL] 18 6 [OP_MUL] 6 6 [OP_MUL] [OP_ADD] 6 6 [OP_MUL] [OP_ADD] 2 [OP_MUL] [OP_SUB]
var_a = 3 var_b = 6 var_c = 3 var_d = var_b ** var_c var_e = var_a * var_d var_f = 18 var_g = 6 var_h = var_f * var_g var_i = 6 var_j = 6 var_k = var_i * var_j var_l = var_h + var_k var_m = 6 var_n = 6 var_o = var_m * var_n var_p = var_l + var_o var_q = 2 var_r = var_p * var_q var_s = var_e - var_r print(int(var_s))
Possibility
There is a chicken pizza set menu in which you can choose one of four kinds of chicken and one of three kinds of pizza. When Eunsung and Sungmin are ordering the set menus, what is the number of cases in which they order only one same kind of menu among pizza and chicken?
60
4 3 2 [OP_PERM] [OP_MUL] 3 4 2 [OP_PERM] [OP_MUL] [OP_ADD]
var_a = 4 var_b = 3 var_c = 2 var_d = 1 var_b = int(var_b) var_c = int(var_c) for i, elem in enumerate(range(var_c)): var_d = var_d * (var_b-i) var_e = var_a * var_d var_f = 3 var_g = 4 var_h = 2 var_i = 1 var_g = int(var_g) var_h = int(var_h) for i, elem in enumerate(range(var_h)): var_i = var_i * (var_g-i) var_j = var_f * var_i var_k = var_e + var_j print(int(var_k))
Geometry
When all the students were lined up in a square, there were 36 students left out. I extended the line in width and length by one column but there were still three people left. How many students are there?
292
36 3 [OP_SUB] 1 [OP_SUB] 2 [OP_DIV] 2 [OP_POW] 36 [OP_ADD]
var_a = 36 var_b = 3 var_c = var_a - var_b var_d = 1 var_e = var_c - var_d var_f = 2 var_g = var_e / var_f var_h = 2 var_i = var_g ** var_h var_j = 36 var_k = var_i + var_j print(int(var_k))
Possibility
You have 2 chances to draw from the basket. How many ways exist to draw a fruit from a basket containing 1 apple, 1 peach, 1 pear, 1 melon, and 1 strawberry while also considering the order of draw?
20
[OP_LIST_SOL] apple peach pear melon strawberry [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_PERM]
var_a = 'apple' var_b = 'peach' var_c = 'pear' var_d = 'melon' var_e = 'strawberry' list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = len(list_a) var_g = 2 var_h = 1 var_f = int(var_f) var_g = int(var_g) for i, elem in enumerate(range(var_g)): var_h = var_h * (var_f-i) print(int(var_h))
Comparison
Which number is less than or equal to 0.8, 1/2, 0.3 and greater than or equal to 0.4?
0.5
[OP_LIST_SOL] 0.8 1/2 0.3 [OP_LIST_EOL] 0.4 [OP_LIST_MORE_EQUAL] 1 [OP_LIST_MIN]
var_a = 0.8 var_b = 0.5 var_c = 0.3 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 0.4 list_b = [] for i in list_a: if i >= var_d: list_b.append(i) var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[var_e-1] print('{:.2f}'.format(round(var_f+1e-10,2)))
Correspondence
Subtracting 7 from a number gives 9 as a result. What is the result of the number being multiplied by 5?
80
9 7 [OP_ADD] 5 [OP_MUL]
var_a = 9 var_b = 7 var_c = var_a + var_b var_d = 5 var_e = var_c * var_d print(int(var_e))
Possibility
You want to create a three-digit number by using three from 0, 2, 4, and 6 and using them only once. Find the value of the sum of the largest and smallest possible numbers.
846
[OP_LIST_SOL] 0 2 4 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD]
var_a = 0 var_b = 2 var_c = 4 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 = 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 = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] var_h = 1 list_d=list_b.copy() list_d.sort() var_i = list_d[var_h-1] var_j = var_g + var_i print(int(var_j))
Geometry
There is a trapezoid with an upper side of 12 centimeters (cm) and a lower side that is 4 centimeters (cm) longer than the upper side. If the height of this trapezoid is 10 centimeters (cm), how many square centimeters (cm2) is its area?
140
12 12 4 [OP_ADD] [OP_ADD] 10 [OP_MUL] 2 [OP_DIV]
var_a = 12 var_b = 12 var_c = 4 var_d = var_b + var_c var_e = var_a + var_d var_f = 10 var_g = var_e * var_f var_h = 2 var_i = var_g / var_h print(int(var_i))
Arithmetic calculation
There are 35 female (a) animals at the zoo. The number of female animals is 7 less than the male animals. How many (a) animals are there in all?
77
35 35 7 [OP_ADD] [OP_ADD]
var_a = 35 var_b = 35 var_c = 7 var_d = var_b + var_c var_e = var_a + var_d print(int(var_e))
Arithmetic calculation
The salt water concentration in a 200-gram (g) cup is 25%. Another cup containing 300 grams (g) contains 60 grams (g) of salt. What is the concentration of salt water when two cups of salt water are mixed?
22
200 25 100 [OP_DIV] [OP_MUL] 60 [OP_ADD] 200 300 [OP_ADD] [OP_DIV] 100 [OP_MUL]
var_a = 200 var_b = 25 var_c = 100 var_d = var_b / var_c var_e = var_a * var_d var_f = 60 var_g = var_e + var_f var_h = 200 var_i = 300 var_j = var_h + var_i var_k = var_g / var_j var_l = 100 var_m = var_k * var_l print(int(var_m))
Comparison
The students in Eunji's class stand in three lines with the same number of students in each line each time they do exercise (A). Eunji is always 3rd from the front and 6th from the back in a row. How many students are there in Eunji's class?
24
3 6 [OP_ADD] 1 [OP_SUB] 3 [OP_MUL]
var_a = 3 var_b = 6 var_c = var_a + var_b var_d = 1 var_e = var_c - var_d var_f = 3 var_g = var_e * var_f print(int(var_g))
Correspondence
There are three different numbers A, B and C. Find A from the three-digit addition formula ABC+ABC+ABC=954.
3
ABC+ABC+ABC=954 A [OP_DIGIT_UNK_SOLVER]
var_a = 'ABC+ABC+ABC=954' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Correspondence
Add 45 to a number, divide by 2, then divide by 2 again and add 45 to get 85. Find this number.
115
85 45 [OP_SUB] 2 [OP_MUL] 2 [OP_MUL] 45 [OP_SUB]
var_a = 85 var_b = 45 var_c = var_a - var_b var_d = 2 var_e = var_c * var_d var_f = 2 var_g = var_e * var_f var_h = 45 var_i = var_g - var_h print(int(var_i))
Possibility
When 6 people A, B, C, D, E, and F are to be lined up in a line, find the number of ways to put C, D, E next to each other.
144
[OP_LIST_SOL] A B C D E F [OP_LIST_EOL] [OP_LIST_SOL] B C [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_LIST_SOL] C D E [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_MUL]
var_a = 'A' var_b = 'B' var_c = 'C' var_d = 'D' var_e = 'E' var_f = 'F' 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 = 'B' var_h = 'C' 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() list_c = list(set(list_a) - set(list_b)) var_i = len(list_c) var_j = len(list_c) var_k = 1 var_i = int(var_i) var_j = int(var_j) for i, elem in enumerate(range(var_j)): var_k = var_k * (var_i-i) var_l = 'C' var_m = 'D' var_n = 'E' list_d= [] if "/" in str(var_n): var_n = eval(str(var_n)) list_d.append(var_n) if "/" in str(var_m): var_m = eval(str(var_m)) list_d.append(var_m) if "/" in str(var_l): var_l = eval(str(var_l)) list_d.append(var_l) list_d.reverse() var_o = len(list_d) var_p = len(list_d) var_q = 1 var_o = int(var_o) var_p = int(var_p) for i, elem in enumerate(range(var_p)): var_q = var_q * (var_o-i) var_r = var_k * var_q print(int(var_r))
Possibility
I am trying to draw one out of 0, 1, 3, and 5 to make a 3-digit number. Add the largest and smallest possible numbers.
634
[OP_LIST_SOL] 0 1 3 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD]
var_a = 0 var_b = 1 var_c = 3 var_d = 5 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 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 = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] var_h = 1 list_d=list_b.copy() list_d.sort() var_i = list_d[var_h-1] var_j = var_g + var_i print(int(var_j))
Possibility
There are 1 green ball and 3 indistinguishable yellow balls. How many different ways can you place these 4 balls in a row?
4
1 3 [OP_ADD] 1 3 [OP_ADD] [OP_PERM] 3 3 [OP_PERM] [OP_DIV]
var_a = 1 var_b = 3 var_c = var_a + var_b var_d = 1 var_e = 3 var_f = var_d + var_e var_g = 1 var_c = int(var_c) var_f = int(var_f) for i, elem in enumerate(range(var_f)): var_g = var_g * (var_c-i) var_h = 3 var_i = 3 var_j = 1 var_h = int(var_h) var_i = int(var_i) for i, elem in enumerate(range(var_i)): var_j = var_j * (var_h-i) var_k = var_g / var_j print(int(var_k))
Arithmetic calculation
When there are four numbers 10, 11, 12, and 13, which number is the second largest?
12
[OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 2 [OP_LIST_MAX]
var_a = 10 var_b = 11 var_c = 12 var_d = 13 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 2 list_b=list_a.copy() list_b.sort() var_f = list_b[-var_e] print(int(var_f))
Possibility
The four toy trains are numbered 7, 6, 8, and 5. When you put them in order to make a four-digit number, what is the sum of the third largest number and the third smallest number you can make?
14443
[OP_LIST_SOL] 7 6 8 5 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 3 [OP_LIST_MAX] 3 [OP_LIST_MIN] [OP_ADD]
var_a = 7 var_b = 6 var_c = 8 var_d = 5 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = len(list_a) list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 3 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] var_h = 3 list_d=list_b.copy() list_d.sort() var_i = list_d[var_h-1] var_j = var_g + var_i print(int(var_j))
Comparison
There are the same number of cars in each row. Red cars are in the 14th row from the front, 19th row from the left, 11th row from the back, and 16th row from the right. How many cars are there in total?
816
19 16 [OP_ADD] 1 [OP_SUB] 14 11 [OP_ADD] 1 [OP_SUB] [OP_MUL]
var_a = 19 var_b = 16 var_c = var_a + var_b var_d = 1 var_e = var_c - var_d var_f = 14 var_g = 11 var_h = var_f + var_g var_i = 1 var_j = var_h - var_i var_k = var_e * var_j print(int(var_k))
Comparison
Minji has 0.74 meters (m), Seungyeon has 13/20 meters (m), and Hyesu has 4/5 meters (m) of colored tape. Who has the longest colored tape?
Hyesu
[OP_LIST_SOL] Minji Seungyeon Hyesu [OP_LIST_EOL] [OP_LIST_SOL] 0.74 13 20 [OP_DIV] 4 5 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Minji' var_b = 'Seungyeon' var_c = 'Hyesu' 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.74 var_e = 13 var_f = 20 var_g = var_e / var_f var_h = 4 var_i = 5 var_j = var_h / var_i list_b= [] if "/" in str(var_j): var_j = eval(str(var_j)) list_b.append(var_j) 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_k = 1 list_c=list_b.copy() list_c.sort() var_l = list_c[-var_k] var_m = list_b.index(var_l)+1 var_n = list_a[var_m-1] print(var_n)
Geometry
You are going to cut a rectangular wooden plank which is 112 centimeters (cm) wide and 63 centimeters (cm) long to make square wooden planks with a side length of 7 centimeters (cm). How many can you make in total?
144
112 7 [OP_FDIV] 63 7 [OP_FDIV] [OP_MUL]
var_a = 112 var_b = 7 var_c = var_a // var_b var_d = 63 var_e = 7 var_f = var_d // var_e var_g = var_c * var_f print(int(var_g))
Comparison
Dongkyun, Youngtak, and Seunghwan have snacks. If Dongkyun has more cookies than Youngtak and Seunghwan has more than Dongkyun, who has the most cookies?
Seunghwan
[OP_LIST_SOL] Dongkyun Youngtak Seunghwan [OP_LIST_EOL] [OP_LIST_SOL] Dongkyun Youngtak > Seunghwan Dongkyun > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'Dongkyun' var_b = 'Youngtak' var_c = 'Seunghwan' 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 = 'Dongkyun' var_e = 'Youngtak' var_f = '>' var_g = 'Seunghwan' var_h = 'Dongkyun' var_i = '>' list_b= [] if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_j = 1 var_k = list_c[var_j-1] print(var_k)
Arithmetic calculation
Jimin planted 6 flowers, Seokjin planted 14 flowers, Minyoung planted 9 flowers, and Taehyung planted 15 flowers. How many more flowers did the person who planted the most plants than the person who planted the second least?
6
[OP_LIST_SOL] 6 14 9 15 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_SUB]
var_a = 6 var_b = 14 var_c = 9 var_d = 15 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 = 2 list_c=list_a.copy() list_c.sort() var_h = list_c[var_g-1] var_i = var_f - var_h print(int(var_i))
Geometry
There is a rectangular wall. If the width of this wall is 5.4 meters (m) and the length is 2.5 meters (m), what is the area in square meters (m2)?
13.5
5.4 2.5 [OP_MUL]
var_a = 5.4 var_b = 2.5 var_c = var_a * var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
Jimin had 27 books. His father bought 8 more books and his mother bought 12 more books. How many books does Jimin have now compared to the beginning?
20
8 12 [OP_ADD]
var_a = 8 var_b = 12 var_c = var_a + var_b print(int(var_c))
Correspondence
Adding 36 to a number gives 71. How much is a number plus 10?
45
71 36 [OP_SUB] 10 [OP_ADD]
var_a = 71 var_b = 36 var_c = var_a - var_b var_d = 10 var_e = var_c + var_d print(int(var_e))
Correspondence
Adding 19 to A gives 47. How much is A?
28
47 19 [OP_SUB]
var_a = 47 var_b = 19 var_c = var_a - var_b print(int(var_c))
Arithmetic calculation
There are 12 frogs inside the pond and 6 frogs outside the pond. How many frogs are there in all?
18
12 6 [OP_ADD]
var_a = 12 var_b = 6 var_c = var_a + var_b print(int(var_c))
Possibility
If 2, 6, and 9 are used only once to form a three-digit number, what is the largest number?
962
[OP_LIST_SOL] 2 6 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX]
var_a = 2 var_b = 6 var_c = 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 = 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] var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] print(int(var_f))
Arithmetic calculation
A mobile can be made with 4 millimetres (mm) of wire. After making several mobiles of the same size using 117.6 millimetres (mm) of wire, how many centimetres (cm) of wire are left?
0.16
117.6 4 [OP_MOD] 10 [OP_DIV]
var_a = 117.6 var_b = 4 var_c = var_a % var_b var_d = 10 var_e = var_c / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
If Jeong-hyeok's age is 1 year less than 1/4 of his uncle's age and his uncle's age is 5 years less than 5 times Jeong-hyeok's age, how old is Jeong-hyeok?
9
1/4 5 [OP_MUL] 1 [OP_ADD] 1/4 5 [OP_MUL] 1 [OP_SUB] [OP_DIV]
var_a = 0.25 var_b = 5 var_c = var_a * var_b var_d = 1 var_e = var_c + var_d var_f = 0.25 var_g = 5 var_h = var_f * var_g var_i = 1 var_j = var_h - var_i var_k = var_e / var_j print(int(var_k))
Geometry
How many circles with a radius of 2 centimeters (cm) can be drawn on a piece of paper that is 20 centimeters (cm) wide and 16 centimeters (cm) long?
20
20 2 2 [OP_MUL] [OP_FDIV] 16 2 2 [OP_MUL] [OP_FDIV] [OP_MUL]
var_a = 20 var_b = 2 var_c = 2 var_d = var_b * var_c var_e = var_a // var_d var_f = 16 var_g = 2 var_h = 2 var_i = var_g * var_h var_j = var_f // var_i var_k = var_e * var_j print(int(var_k))
Geometry
In a cube-shaped box, how many edges are there?
12
4 3 [OP_MUL]
var_a = 4 var_b = 3 var_c = var_a * var_b print(int(var_c))
Comparison
There are 4 numbers: 0.8, 1/2, 0.5, and 1/3. What is the sum of all numbers less than or equal to 3?
2.13
[OP_LIST_SOL] 0.8 1/2 0.5 1/3 [OP_LIST_EOL] 3 [OP_LIST_LESS_EQUAL] [OP_LIST_SUM]
var_a = 0.8 var_b = 0.5 var_c = 0.5 var_d = 0.3333333333333333 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 list_b = [] for i in list_a: if i <= var_e: list_b.append(i) list_b = [float(i) for i in list_b] var_f = sum(list_b) print('{:.2f}'.format(round(var_f+1e-10,2)))
Arithmetic calculation
To make a ribbon loop, you want to cut the ribbons into 0.82 kilometers (km) long pieces. Find the length of the remaining ribbon length after making ribbon loops out of 53.73 kilometers (km) of ribbon.
430
53.73 0.82 [OP_MOD] 1000 [OP_MUL]
var_a = 53.73 var_b = 0.82 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)))))
Arithmetic calculation
In two-digit addition, the digit 9 in the ones place of the number added was incorrectly viewed as 2. Also, when the number 3 in the tens place of the number being added was mistakenly calculated as 6, the value was 119. Find the result of the correct calculation.
96
119 1 9 2 [OP_SUB] [OP_MUL] [OP_ADD] 10 3 6 [OP_SUB] [OP_MUL] [OP_ADD]
var_a = 119 var_b = 1 var_c = 9 var_d = 2 var_e = var_c - var_d var_f = var_b * var_e var_g = var_a + var_f var_h = 10 var_i = 3 var_j = 6 var_k = var_i - var_j var_l = var_h * var_k var_m = var_g + var_l print(int(var_m))
Geometry
54 square-shaped pieces of colored paper were attached to dice with a side of 12 centimeters (cm) and then there was no empty space. Find the length of one side of this colored paper.
4
12 2 [OP_POW] 6 [OP_MUL] 54 [OP_DIV] 1/2 [OP_POW]
var_a = 12 var_b = 2 var_c = var_a ** var_b var_d = 6 var_e = var_c * var_d var_f = 54 var_g = var_e / var_f var_h = 0.5 var_i = var_g ** var_h print(int(var_i))
Arithmetic calculation
A farmer raises 49 chickens and 37 ducks on a farm. The combined number of ducks and rabbits is 9 more than the number of chickens. How many rabbits are there?
21
49 9 [OP_ADD] 37 [OP_SUB]
var_a = 49 var_b = 9 var_c = var_a + var_b var_d = 37 var_e = var_c - var_d print(int(var_e))
Geometry
The amount of paint used to paint a sphere with a radius of 3 centimeters (cm) equals the amount of paint used to paint a circle. Find the radius of the circle.
6
4 3 2 [OP_POW] [OP_MUL] 1/2 [OP_POW]
var_a = 4 var_b = 3 var_c = 2 var_d = var_b ** var_c var_e = var_a * var_d var_f = 0.5 var_g = var_e ** var_f print(int(var_g))