category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Geometry
If the perimeter of a rectangular picture frame is 30 centimeters (cm) and the width is 10 centimeters (cm), how many centimeters (cm) is the length of the picture frame?
5
30 2 [OP_DIV] 10 [OP_SUB]
var_a = 30 var_b = 2 var_c = var_a / var_b var_d = 10 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
When the teacher writes the numbers 10 through 99 on the board, how many times does the number 8 appear?
19
10 99 1 [OP_LIST_ARANGE] [OP_LIST2NUM] [OP_NUM2LIST] 8 [OP_LIST_FIND_NUM]
var_a = 10 var_b = 99 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d="" for i in list_a: i = str(i) var_d = var_d + i list_b = [] var_d = int(var_d) while var_d//10 > 0: list_b.append(var_d%10) var_d = var_d//10 list_b.append(var_d%10) list_b = list_b[::-1] var_e = 8 var_f = 0 var_e = int(var_e) for i in list_b: i = int(i) if i == var_e: var_f = var_f + 1 print(int(var_f))
Comparison
Hanbyeol and Seulgi did a running exercise. Hanbyeol ran 10.2 kilometers (km) as much as 1/100, and Seulgi ran 100 meters (m). Who ran more?
Hanbyeol
[OP_LIST_SOL] Hanbyeol Seulgi [OP_LIST_EOL] [OP_LIST_SOL] 10.2 1000 [OP_MUL] 100 [OP_DIV] 100 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Hanbyeol' var_b = 'Seulgi' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 10.2 var_d = 1000 var_e = var_c * var_d var_f = 100 var_g = var_e / var_f var_h = 100 list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Arithmetic calculation
Half of the 30 students are girls, and 7 of them are not elementary school students. Find out how many female students are in elementary school.
8
30 2 [OP_DIV] 7 [OP_SUB]
var_a = 30 var_b = 2 var_c = var_a / var_b var_d = 7 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
Namjoon walks 1.2 kilometers (km) from home to school. Today, Namjoon walked 0.3 kilometers (km), went back home, got things ready, and went to school. How many more kilometers (km) did Namjoon walk than usual today? Find the answer including decimal points.
0.6
1.2 0.3 2 [OP_MUL] [OP_ADD] 1.2 [OP_SUB]
var_a = 1.2 var_b = 0.3 var_c = 2 var_d = var_b * var_c var_e = var_a + var_d var_f = 1.2 var_g = var_e - var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Arithmetic calculation
The length of the red string is 8 metres (m). The length of the white string is 5 times the length of the red string. The white string is 8 times as long as the blue string. How many metres (m) is the blue string?
5
8 5 [OP_MUL] 8 [OP_DIV]
var_a = 8 var_b = 5 var_c = var_a * var_b var_d = 8 var_e = var_c / var_d print(int(var_e))
Possibility
What is the unused card if two of the number cards 6, 9 and 2 are used all at once to make the smallest two-digit number?
9
[OP_LIST_SOL] 6 9 2 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] [OP_LIST_POP] [OP_NUM2LIST] [OP_SET_DIFFERENCE] 1 [OP_LIST_GET]
var_a = 6 var_b = 9 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 = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[var_e-1] list_d = [] var_f = int(var_f) while var_f//10 > 0: list_d.append(var_f%10) var_f = var_f//10 list_d.append(var_f%10) list_d = list_d[::-1] list_e = list(set(list_a) - set(list_d)) var_g = 1 var_h = list_e[var_g-1] print(int(var_h))
Arithmetic calculation
What is the number obtained by subtracting 35 times 4 and 6 times 3 from 240?
82
240 4 35 [OP_MUL] [OP_SUB] 3 6 [OP_MUL] [OP_SUB]
var_a = 240 var_b = 4 var_c = 35 var_d = var_b * var_c var_e = var_a - var_d var_f = 3 var_g = 6 var_h = var_f * var_g var_i = var_e - var_h print(int(var_i))
Correspondence
Subtracting from a two-digit natural number by exchanging its tens and ones digits is 36, and the sum of these two numbers is 68. Find the first two-digit number.
16
68 36 [OP_SUB] 2 [OP_DIV]
var_a = 68 var_b = 36 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Comparison
(a) is larger than (b) and smaller than (c). (e) is smaller than (d). (b) is greater than (d). Which number is the smallest among (a), (b), (c), (d), and (e)?
(e)
[OP_LIST_SOL] (a) (b) (c) (d) (e) [OP_LIST_EOL] [OP_LIST_SOL] (a) (b) > (a) (c) < (e) (d) < (b) (d) > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET]
var_a = '(a)' var_b = '(b)' var_c = '(c)' var_d = '(d)' 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 = '(a)' var_g = '(b)' var_h = '>' var_i = '(a)' var_j = '(c)' var_k = '<' var_l = '(e)' var_m = '(d)' var_n = '<' var_o = '(b)' var_p = '(d)' 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)
Correspondence
I am a three-digit number formed by using the digits 1 to 9 once each. 1 is in the tens place and 8 is in the ones place. I'm greater than 358 and less than 684. What number am I?
418
1 9 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PERM] 10 1 [OP_LIST_SEARCH_FIXED_DIGIT] 1 8 [OP_LIST_SEARCH_FIXED_DIGIT] 358 [OP_LIST_MORE] 684 [OP_LIST_LESS] 1 [OP_LIST_GET]
var_a = 1 var_b = 9 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = 10 var_f = 1 list_c = [] var_e = int(var_e) var_f = int(var_f) for i in list_b: i = int(i) if (i//var_e)%10 == var_f: list_c.append(i) var_g = 1 var_h = 8 list_d = [] var_g = int(var_g) var_h = int(var_h) for i in list_c: i = int(i) if (i//var_g)%10 == var_h: list_d.append(i) var_i = 358 list_e = [] for i in list_d: if i > var_i: list_e.append(i) var_j = 684 list_f = [] for i in list_e: if i < var_j: list_f.append(i) var_k = 1 var_l = list_f[var_k-1] print(int(var_l))
Geometry
Find the difference between the number of verticles of a hexagonal prism and the number of vertices of a pentagonal prism.
2
6 2 [OP_MUL] 5 2 [OP_MUL] [OP_SUB]
var_a = 6 var_b = 2 var_c = var_a * var_b var_d = 5 var_e = 2 var_f = var_d * var_e var_g = var_c - var_f print(int(var_g))
Arithmetic calculation
My mother wants to buy 4 bottles of honey weighing 3kg (kg) and distribute 3/4 kg (kg) to each neighbor. With how many people can she share?
16
3 4 [OP_MUL] 3/4 [OP_FDIV]
var_a = 3 var_b = 4 var_c = var_a * var_b var_d = 0.75 var_e = var_c // var_d print(int(var_e))
Arithmetic calculation
You want to divide 12 litres (L) 400 millilitres (ml) of milk between two classes. If you give class 1 2 litres (L) 600 millilitres (ml) more than class 2, how many litres (L) will you give to class 1?
1.3
12 400 1000 [OP_DIV] [OP_ADD] 2 600 1000 [OP_DIV] [OP_ADD] 2 [OP_DIV]
var_a = 12 var_b = 400 var_c = 1000 var_d = var_b / var_c var_e = var_a + var_d var_f = 2 var_g = 600 var_h = 1000 var_i = var_g / var_h var_j = var_f + var_i var_k = 2 var_l = var_j / var_k print('{:.2f}'.format(round(var_l+1e-10,2)))
Arithmetic calculation
Each box contains 3 red balls and 5 blue balls. When Jungkook has 2 boxes, how many blue balls does Jungkook have?
10
5 2 [OP_MUL]
var_a = 5 var_b = 2 var_c = var_a * var_b print(int(var_c))
Comparison
Nana and Gaeun did a long jump. Nana jumped 1.618 meters (m) and Gaeun jumped 162.3 centimeters (cm). Who jumped further?
Gaeun
[OP_LIST_SOL] Nana Gaeun [OP_LIST_EOL] [OP_LIST_SOL] 1.618 100 [OP_MUL] 162.3 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Nana' var_b = 'Gaeun' 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 = 1.618 var_d = 100 var_e = var_c * var_d var_f = 162.3 list_b= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Possibility
When A, B, C, and D are arranged lexicographically from ABCD to DCBA, find the number in which CABD comes.
13
[OP_LIST_SOL] A B C D [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] CABD [OP_LIST_INDEX]
var_a = 'A' var_b = 'B' var_c = 'C' var_d = 'D' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 4 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] var_f = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[var_f-1] var_h = 'CABD' var_i = list_b.index(var_h)+1 print(int(var_i))
Arithmetic calculation
Find the difference between the largest and smallest of 6 consecutive natural numbers.
5
6 1 [OP_SUB]
var_a = 6 var_b = 1 var_c = var_a - var_b print(int(var_c))
Possibility
Find the value of subtracting the smallest two-digit number from the largest two-digit number that can be formed by drawing two different numbers from 9, 4, 3, and 5.
61
[OP_LIST_SOL] 9 4 3 5 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB]
var_a = 9 var_b = 4 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 = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] var_h = 1 list_d=list_b.copy() list_d.sort() var_i = list_d[var_h-1] var_j = var_g - var_i print(int(var_j))
Comparison
The heights of the three planks A, B, and C are 2.4 centimeters (cm), 3.2 centimeters (cm), and 2.8 centimeters (cm), respectively. Eunji is standing on top of a stack of 8 A. Namjoon is standing on top of 4 B, and Hoseok is standing on top of 5 C. Who is standing on the lowest place from the earth?
Namjoon
[OP_LIST_SOL] Eunji Namjoon Hoseok [OP_LIST_EOL] [OP_LIST_SOL] 2.4 8 [OP_MUL] 3.2 4 [OP_MUL] 2.8 5 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Eunji' var_b = 'Namjoon' var_c = 'Hoseok' 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.4 var_e = 8 var_f = var_d * var_e var_g = 3.2 var_h = 4 var_i = var_g * var_h var_j = 2.8 var_k = 5 var_l = var_j * var_k list_b= [] if "/" in str(var_l): var_l = eval(str(var_l)) list_b.append(var_l) if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) list_b.reverse() var_m = 1 list_c=list_b.copy() list_c.sort() var_n = list_c[var_m-1] var_o = list_b.index(var_n)+1 var_p = list_a[var_o-1] print(var_p)
Arithmetic calculation
In math class, Taehyung solved 9 problems and kept working on doing 7 more problems. How many math problems did Taehyung solve today?
16
9 7 [OP_ADD]
var_a = 9 var_b = 7 var_c = var_a + var_b print(int(var_c))
Possibility
Seung-a had a group assignment with 5 friends and chose 1 leader, 1 secretary, and 2 presenters. Find the number of cases in which Seung-ah becomes the leader.
12
5 1 [OP_SUB] 1 1 1 [OP_SUB] [OP_ADD] 2 [OP_ADD] [OP_PERM] 2 2 [OP_PERM] [OP_DIV]
var_a = 5 var_b = 1 var_c = var_a - var_b var_d = 1 var_e = 1 var_f = 1 var_g = var_e - var_f var_h = var_d + var_g var_i = 2 var_j = var_h + var_i var_k = 1 var_c = int(var_c) var_j = int(var_j) for i, elem in enumerate(range(var_j)): var_k = var_k * (var_c-i) var_l = 2 var_m = 2 var_n = 1 var_l = int(var_l) var_m = int(var_m) for i, elem in enumerate(range(var_m)): var_n = var_n * (var_l-i) var_o = var_k / var_n print(int(var_o))
Comparison
Two friends decided to exercise hard. If Yeseul did 13/10 hours and Youngjun did 22/15 hours, which of the two worked out longer?
Youngjun
[OP_LIST_SOL] Yeseul Youngjun [OP_LIST_EOL] [OP_LIST_SOL] 13/10 22/15 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yeseul' var_b = 'Youngjun' 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 = 1.3 var_d = 1.4666666666666666 list_b= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_b.append(var_c) list_b.reverse() var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] var_g = list_b.index(var_f)+1 var_h = list_a[var_g-1] print(var_h)
Arithmetic calculation
There are 275 apples. I am going to put 20 apples in a box and sell them for 8,000 won each. If you sold all the boxes of apples, how much did you get after selling the apples?
104000
275 20 [OP_FDIV] 8000 [OP_MUL]
var_a = 275 var_b = 20 var_c = var_a // var_b var_d = 8000 var_e = var_c * var_d print(int(var_e))
Geometry
A cube-shaped box measures 11 centimeters (cm) at one edge. What is the surface area of this box?
726
11 2 [OP_POW] 6 [OP_MUL]
var_a = 11 var_b = 2 var_c = var_a ** var_b var_d = 6 var_e = var_c * var_d print(int(var_e))
Geometry
What is the length of the radius of a circle with an area equal to the surface area of a sphere with a radius of 2 cm (cm)?
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
If Chanhui walks 0.75 meters (m) per step and walks 70 steps straight for 1 minute, how many meters (m) does Chanhui's location after 13 minutes differ from his current location?
682.5
0.75 70 [OP_MUL] 13 [OP_MUL]
var_a = 0.75 var_b = 70 var_c = var_a * var_b var_d = 13 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Possibility
Minsu wants to put 2 Korean and 2 English workbooks next to each other on the bookshelf. If each workbook is different, how many ways can he put the Korean workbooks next to each other?
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))
Arithmetic calculation
Eunji, who had 9 pieces of green confetti and 1 piece of red confetti, gave 4 of her confetti to Yuna. How many pieces of confetti does Eunji have now?
6
1 9 [OP_ADD] 4 [OP_SUB]
var_a = 1 var_b = 9 var_c = var_a + var_b var_d = 4 var_e = var_c - var_d print(int(var_e))
Comparison
The four students, Yoongi, Jungkook, Yuna, and Yoojung, each have the numbers 7, 6, 9, and 8. Who has the 2nd largest number?
Yoojung
[OP_LIST_SOL] Yoongi Jungkook Yuna Yoojung [OP_LIST_EOL] [OP_LIST_SOL] 7 6 9 8 [OP_LIST_EOL] 2 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yoongi' var_b = 'Jungkook' var_c = 'Yuna' var_d = 'Yoojung' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 7 var_f = 6 var_g = 9 var_h = 8 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) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 2 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Correspondence
When you multiply a number by -2/3 and divide by -4/5, the result is -1/2. Find the number.
-0.6
-1/2 -4/5 [OP_MUL] -2/3 [OP_DIV]
var_a = -0.5 var_b = -0.8 var_c = var_a * var_b var_d = -0.6666666666666666 var_e = var_c / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Possibility
You are going to choose two people among Jungkook, Jimin, Yoongi, Yuna, and Taehyung and line them up. How many cases are there in all?
20
[OP_LIST_SOL] Jungkook Jimin Yoongi Yuna Taehyung [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_PERM]
var_a = 'Jungkook' var_b = 'Jimin' var_c = 'Yoongi' var_d = 'Yuna' var_e = 'Taehyung' 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))
Arithmetic calculation
Find how many two-digit numbers are greater than 45 and less than 54.
8
45 1 [OP_ADD] 54 1 [OP_SUB] 1 [OP_LIST_ARANGE] [OP_LIST_LEN]
var_a = 45 var_b = 1 var_c = var_a + var_b var_d = 54 var_e = 1 var_f = var_d - var_e var_g = 1 list_a = [i for i in range(var_c, var_f + 1, var_g)] var_h = len(list_a) print(int(var_h))
Comparison
Yuna, Yoojung, and Minyoung took number tickets at the bank. Minyoung's number is lower than Yuna's, and Yoojung's number is greater than Yuna's. Who has the smallest number?
Minyoung
[OP_LIST_SOL] Yuna Yoojung Minyoung [OP_LIST_EOL] [OP_LIST_SOL] Yuna Yoojung < Minyoung Yuna < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET]
var_a = 'Yuna' var_b = 'Yoojung' var_c = 'Minyoung' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 'Yuna' var_e = 'Yoojung' var_f = '<' var_g = 'Minyoung' var_h = 'Yuna' var_i = '<' list_b= [] if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_j = len(list_c) var_k = list_c[var_j-1] print(var_k)
Arithmetic calculation
(A) is a wooden block 5 meters (m) long and weighing 29/8 kg (kg), and (B) is a block of wood 4 meters (m) long and weighing 2.8 kg (kg). If you cut (A) and (B) by 2 meters (m) and weigh them together, how many kilograms (kg) are they?
2.85
29/8 5 [OP_DIV] 2 [OP_MUL] 2.8 4 [OP_DIV] 2 [OP_MUL] [OP_ADD]
var_a = 3.625 var_b = 5 var_c = var_a / var_b var_d = 2 var_e = var_c * var_d var_f = 2.8 var_g = 4 var_h = var_f / var_g var_i = 2 var_j = var_h * var_i var_k = var_e + var_j print('{:.2f}'.format(round(var_k+1e-10,2)))
Arithmetic calculation
You want to distribute the marbles equally among 15 students. How many more marbles do you need when there are 328 marbles?
2
15 328 15 [OP_MOD] [OP_SUB]
var_a = 15 var_b = 328 var_c = 15 var_d = var_b % var_c var_e = var_a - var_d print(int(var_e))
Arithmetic calculation
When creating a three-digit natural number by repeatedly using number cards with the numbers 1 to 9 written on them, find the average of the numbers whose remainder when divided by 3 is 2.
555
1 9 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PRODUCT] 3 2 [OP_LIST_DIVIDE_AND_REMAIN] [OP_LIST_MEAN]
var_a = 1 var_b = 9 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = 3 var_f = 2 list_c = [] var_e = int(var_e) var_f = int(var_f) if var_f < 0: var_f = var_f + var_e for i in list_b: i = int(i) if i%var_e == var_f: list_c.append(i) list_c = [float(i) for i in list_c] var_g = sum(list_c)/len(list_c) print(int(var_g))
Arithmetic calculation
There are four numbers 5.5, 9/2, 8.51 and 1/9. What is the sum of them all?
18.62
5.5 9/2 [OP_ADD] 8.51 [OP_ADD] 1/9 [OP_ADD]
var_a = 5.5 var_b = 4.5 var_c = var_a + var_b var_d = 8.51 var_e = var_c + var_d var_f = 0.1111111111111111 var_g = var_e + var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Possibility
You have to line up five different people A, B, C, D, and E. How many ways can A come first?
24
[OP_LIST_SOL] A B C D E [OP_LIST_EOL] [OP_LIST_SOL] A [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM]
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 = 'A' list_b= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) list_b.reverse() list_c = list(set(list_a) - set(list_b)) var_g = len(list_c) var_h = len(list_c) 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) print(int(var_i))
Possibility
How many different two-digit numbers can be formed using the three numbers 0, 2, and 5 only once?
4
[OP_LIST_SOL] 0 2 5 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 var_b = 2 var_c = 5 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = len(list_b) print(int(var_e))
Correspondence
A certain number has to be multiplied by 16, but I accidentally added 19 and the result was 50. What is the result if calculated correctly?
496
16 50 19 [OP_SUB] [OP_MUL]
var_a = 16 var_b = 50 var_c = 19 var_d = var_b - var_c var_e = var_a * var_d print(int(var_e))
Geometry
The widths, depths, and heights of a cuboid are 12 centimeters (cm), 16 centimeters (cm), and 14 centimeters (cm), respectively. What is the perimeter of the largest cube that can be formed by cutting this cuboid?
864
[OP_LIST_SOL] 12 16 14 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_POW] 6 [OP_MUL]
var_a = 12 var_b = 16 var_c = 14 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 1 list_b=list_a.copy() list_b.sort() var_e = list_b[var_d-1] var_f = 2 var_g = var_e ** var_f var_h = 6 var_i = var_g * var_h print(int(var_i))
Arithmetic calculation
Minho prepared some candies to give equally to the 8 people invited to the birthday party. However, since 2 people did not come, so he gave 1 extra candy to each person, and there were 4 candies left. How many candies did Minho prepare?
40
8 2 [OP_SUB] 4 [OP_ADD] 8 8 2 [OP_SUB] [OP_SUB] [OP_FDIV] 8 [OP_MUL]
var_a = 8 var_b = 2 var_c = var_a - var_b var_d = 4 var_e = var_c + var_d var_f = 8 var_g = 8 var_h = 2 var_i = var_g - var_h var_j = var_f - var_i var_k = var_e // var_j var_l = 8 var_m = var_k * var_l print(int(var_m))
Arithmetic calculation
Ki-tae bought 12 pens at a stationery store, including pencils that cost 1,000 won each and ballpoint pens that cost 1,300 won each. How many pencils did Ki-tae buy when he used all his money of 15,000 won?
2
1300 12 [OP_MUL] 15000 [OP_SUB] 1300 1000 [OP_SUB] [OP_DIV]
var_a = 1300 var_b = 12 var_c = var_a * var_b var_d = 15000 var_e = var_c - var_d var_f = 1300 var_g = 1000 var_h = var_f - var_g var_i = var_e / var_h print(int(var_i))
Geometry
There are two squares with side lengths of 8 and 10 respectively. Find the sum of the areas of the two squares.
164
8 2 [OP_POW] 10 2 [OP_POW] [OP_ADD]
var_a = 8 var_b = 2 var_c = var_a ** var_b var_d = 10 var_e = 2 var_f = var_d ** var_e var_g = var_c + var_f print(int(var_g))
Arithmetic calculation
At Seokmin's school, 7 cookies were distributed to 134 6th grade students who were about to graduate. How many boxes of cookies would the school buy if there were 28 cookies in each box?
34
134 7 [OP_MUL] 28 [OP_DIV] 1 [OP_CEIL]
var_a = 134 var_b = 7 var_c = var_a * var_b var_d = 28 var_e = var_c / var_d var_f = 1 var_g=int(((var_e+9*10**(var_f-2))//(10**(var_f-1)))*10**(var_f-1)) print(int(var_g))
Arithmetic calculation
Minyoung has four times as many flowers as Yoojung has. If Minyoung has 24 flowers, how many flowers do Minyoung and Yoojung have?
30
24 24 4 [OP_DIV] [OP_ADD]
var_a = 24 var_b = 24 var_c = 4 var_d = var_b / var_c var_e = var_a + var_d print(int(var_e))
Possibility
How many three-digit numbers are made up of 0, 1, 3, 5, and 6? However, each digit must be different.
36
[OP_LIST_SOL] 0 1 3 5 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 200 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 3 var_d = 5 var_e = 6 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = 200 list_c = [] for i in list_b: if i > var_g: list_c.append(i) var_h = len(list_c) print(int(var_h))
Arithmetic calculation
The father is 5 times Taehyung's age, and the mother is 4 times Taehyung's age. If Taehyung is 9 years old, how many years younger is his mother than his father?
9
9 5 [OP_MUL] 9 4 [OP_MUL] [OP_SUB]
var_a = 9 var_b = 5 var_c = var_a * var_b var_d = 9 var_e = 4 var_f = var_d * var_e var_g = var_c - var_f print(int(var_g))
Comparison
There are seven numbers 1.7, 1/5, 1/5, 1, 3/5, 3/8, and 1.4. When you write them down from the largest to the smallest, which number comes the fourth?
0.6
[OP_LIST_SOL] 1.7 1/5 1/5 1 3/5 3/8 1.4 [OP_LIST_EOL] 4 [OP_LIST_MAX]
var_a = 1.7 var_b = 0.2 var_c = 0.2 var_d = 1 var_e = 0.6 var_f = 0.375 var_g = 1.4 list_a= [] if "/" in str(var_g): var_g = eval(str(var_g)) list_a.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_h = 4 list_b=list_a.copy() list_b.sort() var_i = list_b[-var_h] print('{:.2f}'.format(round(var_i+1e-10,2)))
Comparison
Two different natural numbers, B and 36, are in a relationship of factors and multiples. B is greater than 3 and less than 150. Find the 5th number from the right when the numbers corresponding to B are written in order from smallest to smallest.
18
36 [OP_LIST_GET_DIVISOR] 36 150 1 [OP_SUB] 36 [OP_LIST_ARANGE] [OP_SET_UNION] 5 [OP_LIST_MAX]
var_a = 36 list_a = [] num_sqrt = int(math.sqrt(var_a)) for i in range(1, num_sqrt+1): if var_a % i == 0: list_a.append(i) list_a.append(int(var_a/i)) list_a = sorted(set(list_a)) var_b = 36 var_c = 150 var_d = 1 var_e = var_c - var_d var_f = 36 list_b = [i for i in range(var_b, var_e + 1, var_f)] list_c = list(set(list_a) | set(list_b)) var_g = 5 list_d=list_c.copy() list_d.sort() var_h = list_d[-var_g] print(int(var_h))
Arithmetic calculation
Jeongyeon's daily allowance is 300 won and Juho's daily allowance is 500 won. If Jeongyeon's current money is 12,000 won and Juho's money is 4,000 won, find how many days it will take for Jeongyeon and Juho's money to be the same.
40
12000 4000 [OP_SUB] 500 300 [OP_SUB] [OP_DIV]
var_a = 12000 var_b = 4000 var_c = var_a - var_b var_d = 500 var_e = 300 var_f = var_d - var_e var_g = var_c / var_f print(int(var_g))
Correspondence
Inside the box, there are blue, yellow and red marbles. By dividing the number of blue marbles by the number of yellow marbles, the result is 1.2, and dividing the number of yellow marbles by the number of red marbles, the result is 5/6. What is the result if you divide the number of blue marbles by the number of red marbles?
1
1.2 5/6 [OP_MUL]
var_a = 1.2 var_b = 0.8333333333333334 var_c = var_a * var_b print(int(var_c))
Correspondence
What single-digit number fits B in A85-2B=364?
1
A85-2B=364 B [OP_DIGIT_UNK_SOLVER]
var_a = 'A85-2B=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))
Comparison
Younghee and Jimin take a walk. Younghee walked 2 kilometers (km), and Jimin walked 1300 meters (m). Which of the two walked longer?
Younghee
[OP_LIST_SOL] Younghee Jimin [OP_LIST_EOL] [OP_LIST_SOL] 2 1000 [OP_MUL] 1300 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Younghee' var_b = 'Jimin' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 2 var_d = 1000 var_e = var_c * var_d var_f = 1300 list_b= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Possibility
Use the four number cards 0, 1, 4, and 8 once to form the sixth smallest four-digit number which has 8 in the ones, then find the sum of numbers on each digit.
12
[OP_LIST_SOL] 0 1 4 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 8 [OP_LIST_SEARCH_FIXED_DIGIT] 3 [OP_LIST_MIN] [OP_NUM2LIST] [OP_LIST_SUM]
var_a = 0 var_b = 1 var_c = 4 var_d = 8 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 1 var_g = 8 list_c = [] var_f = int(var_f) var_g = int(var_g) for i in list_b: i = int(i) if (i//var_f)%10 == var_g: list_c.append(i) var_h = 3 list_d=list_c.copy() list_d.sort() var_i = list_d[var_h-1] list_e = [] var_i = int(var_i) while var_i//10 > 0: list_e.append(var_i%10) var_i = var_i//10 list_e.append(var_i%10) list_e = list_e[::-1] list_e = [float(i) for i in list_e] var_j = sum(list_e) print(int(var_j))
Arithmetic calculation
You bought two roses at \3,000 each and some lilies at \2,800 each, paid \25,000 and got \2,200 in change. Work out how many lilies you bought.
6
25000 2200 [OP_SUB] 3000 2 [OP_MUL] [OP_SUB] 2800 [OP_DIV]
var_a = 25000 var_b = 2200 var_c = var_a - var_b var_d = 3000 var_e = 2 var_f = var_d * var_e var_g = var_c - var_f var_h = 2800 var_i = var_g / var_h print(int(var_i))
Correspondence
A fisherman catches fish and puts them in 15 boxes, leaving 6 fish. There are 20 fish in one box. How many fish has the fisherman caught?
306
15 20 [OP_MUL] 6 [OP_ADD]
var_a = 15 var_b = 20 var_c = var_a * var_b var_d = 6 var_e = var_c + var_d print(int(var_e))
Comparison
Three of the cards of numbers from 1 to 9 were selected to make the number 735. Add up all the numbers that are less than 6 among the selected cards of numbers.
8
735 [OP_NUM2LIST] 6 [OP_LIST_LESS] [OP_LIST_SUM]
var_a = 735 list_a = [] var_a = int(var_a) while var_a//10 > 0: list_a.append(var_a%10) var_a = var_a//10 list_a.append(var_a%10) list_a = list_a[::-1] var_b = 6 list_b = [] for i in list_a: if i < var_b: list_b.append(i) list_b = [float(i) for i in list_b] var_c = sum(list_b) print(int(var_c))
Arithmetic calculation
The zoo keeps 35 female (a) animals. Males outnumber females by 7. 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))
Comparison
In the Korean test, Minyoung scored 55 points and Yuna scored 57 points. Eunji scored higher than Minyoung but lower than Yuna. If Eunji's score is a natural number, what is it?
56
55 57 [OP_ADD] 2 [OP_FDIV]
var_a = 55 var_b = 57 var_c = var_a + var_b var_d = 2 var_e = var_c // var_d print(int(var_e))
Arithmetic calculation
There are three numbers 10, 11, and 12. What is the value of the multiplication of the smallest number and the next smallest number?
110
[OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_MUL]
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 = 1 list_b=list_a.copy() list_b.sort() var_e = list_b[var_d-1] 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))
Arithmetic calculation
There is a machine that produces 15 liters (l) of coke in 3 minutes at a constant rate. How many minutes does it take to get 140 liters (l) of Coke?
28
140 15 3 [OP_DIV] [OP_DIV]
var_a = 140 var_b = 15 var_c = 3 var_d = var_b / var_c var_e = var_a / var_d print(int(var_e))
Possibility
Of the three digit numbers that can be formed using the four natural numbers 7, 6, 2, and 0, find the sum of the third largest number with all different digits and the third smallest number with all different digits.
986
[OP_LIST_SOL] 7 6 2 0 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 3 [OP_LIST_MAX] 3 [OP_LIST_MIN] [OP_ADD]
var_a = 7 var_b = 6 var_c = 2 var_d = 0 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 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))
Possibility
You want to choose 3 people from Namjoon, Yoonki, Hoseok and Minyeong to send to Canada, the United States and Japan. What is the total number of cases you have selected three people?
24
[OP_LIST_SOL] Namjoon Yoongi Hoseok Minyoung [OP_LIST_EOL] [OP_LIST_LEN] 3 [OP_PERM]
var_a = 'Namjoon' var_b = 'Yoongi' var_c = 'Hoseok' var_d = 'Minyoung' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = len(list_a) var_f = 3 var_g = 1 var_e = int(var_e) var_f = int(var_f) for i, elem in enumerate(range(var_f)): var_g = var_g * (var_e-i) print(int(var_g))
Possibility
We are going to use 2 of our 3 number cards 1, 2 and 6 to form a two-digit number. How many multiples of 3 can you make?
2
[OP_LIST_SOL] 1 2 6 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 3 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 1 var_b = 2 var_c = 6 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 = 3 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 = len(list_c) print(int(var_f))
Correspondence
The number of zebras in the national park is currently 725. This year, 419 were born and 263 died or were hundred. Find how many zebras there were last year.
569
725 419 [OP_SUB] 263 [OP_ADD]
var_a = 725 var_b = 419 var_c = var_a - var_b var_d = 263 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
It took Doocheol 1 hour and 36 minutes to circle the park 5 times at a constant speed. Express as a decimal number the number of minutes it took to cycle one lap around the park.
19.2
1 60 [OP_MUL] 36 [OP_ADD] 5 [OP_DIV]
var_a = 1 var_b = 60 var_c = var_a * var_b var_d = 36 var_e = var_c + var_d var_f = 5 var_g = var_e / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Correspondence
I should have divided 21 by a particular number, but mistakingly divided 15 by that particular number, and as a result, I got 5. What is the correctly calculated value?
7
21 15 5 [OP_DIV] [OP_DIV]
var_a = 21 var_b = 15 var_c = 5 var_d = var_b / var_c var_e = var_a / var_d print(int(var_e))
Comparison
Ginkgo trees were planted on one side of a 364 metre (m) long road and pine trees on the other side, at a distance of 45.5 and 22.75 metres from the start and end of the road respectively. Find out which of the pine and ginkgo trees was planted more.
pine
[OP_LIST_SOL] pine ginkgo [OP_LIST_EOL] [OP_LIST_SOL] 364 22.75 [OP_DIV] 364 45.5 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'pine' var_b = 'ginkgo' 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 = 364 var_d = 22.75 var_e = var_c / var_d var_f = 364 var_g = 45.5 var_h = var_f / var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Comparison
Yu-Jung collected 5 and 8, and Yuna collected 7 and 9. Who has the greater number?
Yuna
[OP_LIST_SOL] Yu-Jung Yuna [OP_LIST_EOL] [OP_LIST_SOL] 5 8 [OP_ADD] 7 9 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yu-Jung' var_b = 'Yuna' 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 = 5 var_d = 8 var_e = var_c + var_d var_f = 7 var_g = 9 var_h = var_f + var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Comparison
There are 28 identical cartons of eggs in the supermarket. Each egg carton contains the same number of eggs. If you choose 14th from the front, 20th from the back, 3rd from the left, and 2nd from the right on the carton, find the number of eggs in the egg carton at this supermarket.
3696
14 20 [OP_ADD] 1 [OP_SUB] 3 2 [OP_ADD] 1 [OP_SUB] [OP_MUL] 28 [OP_MUL]
var_a = 14 var_b = 20 var_c = var_a + var_b var_d = 1 var_e = var_c - var_d var_f = 3 var_g = 2 var_h = var_f + var_g var_i = 1 var_j = var_h - var_i var_k = var_e * var_j var_l = 28 var_m = var_k * var_l print(int(var_m))
Arithmetic calculation
How many three-digit numbers are divisible by 2, 3, 7, and 5?
4
100 999 1 [OP_LIST_ARANGE] 2 [OP_LIST_DIVISIBLE] 3 [OP_LIST_DIVISIBLE] 7 [OP_LIST_DIVISIBLE] 5 [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 = 2 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 = 3 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 = 7 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 = 5 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))
Arithmetic calculation
It took a total of three hours for Sooyoung to walk at 2 kilometers (km) per hour when she climbed up and 4 kilometers (km) per hour when she came down the same road. Find the length of the hiking trail.
4
3 2 4 [OP_GCD] [OP_MUL] 2 4 [OP_GCD] 2 [OP_DIV] 2 4 [OP_GCD] 4 [OP_DIV] [OP_ADD] [OP_DIV]
var_a = 3 var_b = 2 var_c = 4 var_d = math.gcd(int(var_c), int(var_b)) var_e = var_a * var_d var_f = 2 var_g = 4 var_h = math.gcd(int(var_g), int(var_f)) var_i = 2 var_j = var_h / var_i var_k = 2 var_l = 4 var_m = math.gcd(int(var_l), int(var_k)) var_n = 4 var_o = var_m / var_n var_p = var_j + var_o var_q = var_e / var_p print(int(var_q))
Possibility
When the given numbers 2, 3, 7, and 8 are used once to form the second large three-digit number, which number is not used?
3
[OP_LIST_SOL] 2 3 7 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 2 [OP_LIST_MAX] [OP_LIST_POP] [OP_NUM2LIST] [OP_SET_DIFFERENCE] 1 [OP_LIST_GET]
var_a = 2 var_b = 3 var_c = 7 var_d = 8 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 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 = 2 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] list_d = [] var_g = int(var_g) while var_g//10 > 0: list_d.append(var_g%10) var_g = var_g//10 list_d.append(var_g%10) list_d = list_d[::-1] list_e = list(set(list_a) - set(list_d)) var_h = 1 var_i = list_e[var_h-1] print(int(var_i))
Comparison
In the race, Namjoon, Yoongi, and Hoseok crossed the finish line in that order. Namjoon placed 10th, and Hoseok placed 12th. What is Yoongi's rank?
11
10 12 [OP_ADD] 2 [OP_FDIV]
var_a = 10 var_b = 12 var_c = var_a + var_b var_d = 2 var_e = var_c // var_d print(int(var_e))
Comparison
Yoongi has 4 apples and Jungkook who had 6 apples got 3 more. When Yuna has 5 apples, who has the most apples?
Jungkook
[OP_LIST_SOL] Yoongi Jungkook Yuna [OP_LIST_EOL] [OP_LIST_SOL] 4 6 3 [OP_ADD] 5 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yoongi' var_b = 'Jungkook' var_c = 'Yuna' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 4 var_e = 6 var_f = 3 var_g = var_e + var_f var_h = 5 list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) 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)
Possibility
At a fruit store that sells apples, peaches, and pears, you want to purchase two fruits by allowing duplicates. How many possible cases are there?
6
[OP_LIST_SOL] apples peaches pears [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_ADD] 1 [OP_SUB] 2 [OP_COMB]
var_a = 'apples' var_b = 'peaches' var_c = 'pears' 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 = len(list_a) var_e = 2 var_f = var_d + var_e var_g = 1 var_h = var_f - var_g var_i = 2 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) for i, elem in enumerate(range(var_i)): var_j = var_j / (i+1) print(int(var_j))
Correspondence
I made a mistake of dividing 172 by a certain number when I had to divide by 4, and the resulting quotient was 28 less than the correctly calculated quotient, and the remainder was 7. Find this certain number.
11
172 7 [OP_SUB] 172 4 [OP_DIV] 28 [OP_SUB] [OP_DIV]
var_a = 172 var_b = 7 var_c = var_a - var_b var_d = 172 var_e = 4 var_f = var_d / var_e var_g = 28 var_h = var_f - var_g var_i = var_c / var_h print(int(var_i))
Possibility
How many numbers not more than 100 whose number at tens place and ones place is different have 0, 1, 7, and 9?
9
[OP_LIST_SOL] 0 1 7 9 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 7 var_d = 9 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = len(list_b) print(int(var_f))
Comparison
The hundreds digit is 2, and the tens digit is 5. How many numbers satisfy the condition of three-digit numbers 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))
Geometry
If the area of a triangular piece of paper folded in half is 7 square centimeter (cm2), what is the total area of the paper?
14
7 2 [OP_MUL]
var_a = 7 var_b = 2 var_c = var_a * var_b print(int(var_c))
Comparison
I'm trying to calculate probabilities. What is the probability of drawing a card with a number less than or equal to 9 when drawing one from the number cards 1, 3, 4, 6, 7, and 9?
1
[OP_LIST_SOL] 1 3 4 6 7 9 [OP_LIST_EOL] 9 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN] [OP_LIST_SOL] 1 3 4 6 7 9 [OP_LIST_EOL] [OP_LIST_LEN] [OP_DIV]
var_a = 1 var_b = 3 var_c = 4 var_d = 6 var_e = 7 var_f = 9 list_a= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_g = 9 list_b = [] for i in list_a: if i <= var_g: list_b.append(i) var_h = len(list_b) var_i = 1 var_j = 3 var_k = 4 var_l = 6 var_m = 7 var_n = 9 list_c= [] if "/" in str(var_n): var_n = eval(str(var_n)) list_c.append(var_n) if "/" in str(var_m): var_m = eval(str(var_m)) list_c.append(var_m) if "/" in str(var_l): var_l = eval(str(var_l)) list_c.append(var_l) if "/" in str(var_k): var_k = eval(str(var_k)) list_c.append(var_k) if "/" in str(var_j): var_j = eval(str(var_j)) list_c.append(var_j) if "/" in str(var_i): var_i = eval(str(var_i)) list_c.append(var_i) list_c.reverse() var_o = len(list_c) var_p = var_h / var_o print(int(var_p))
Possibility
There are 3 different colored marbles. One is red, one is blue, one is yellow. Find the number of ways to choose two of these and put each of them in each of the boxes of the same shape.
3
[OP_LIST_SOL] red blue yellow [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_COMB]
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 = len(list_a) var_e = 2 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) print(int(var_f))
Correspondence
AB+31=54. What is B?
3
AB+31=54 B [OP_DIGIT_UNK_SOLVER]
var_a = 'AB+31=54' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Possibility
How many ways can the sum of the digits be 10 when 0, 1, 2, and 3 are used repeatedly to form a four-digit number?
10
[OP_LIST_SOL] 0 1 2 3 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PRODUCT] [OP_LIST_NUM2SUM] 10 [OP_LIST_FIND_NUM]
var_a = 0 var_b = 1 var_c = 2 var_d = 3 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.product(list_b, repeat=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] list_c=[] for i in list_b: var_f = 0 i = int(i) while i//10 > 0: var_f = var_f + i%10 i = i//10 var_f = var_f + i%10 list_c.append(var_f) var_g = 10 var_h = 0 var_g = int(var_g) for i in list_c: i = int(i) if i == var_g: var_h = var_h + 1 print(int(var_h))
Arithmetic calculation
I bought 88 kilograms (kg) of tangerines and persimmons. The weight of a tangerine is 4 kg (kg) heavier than that of a persimmon. Find how many kilograms (kg) are all persimmons.
42
88 4 [OP_SUB] 2 [OP_DIV]
var_a = 88 var_b = 4 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
On a bridge over a river, there are street lights every 50 meters (m). If the total length of the bridge is 1650 meters (m) and there are also streetlights at the beginning and end of the bridge, what is the total number of streetlights on each side 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))
Geometry
Find the number of diagonals that can be drawn from one vertex of the decagon.
7
10 3 [OP_SUB]
var_a = 10 var_b = 3 var_c = var_a - var_b print(int(var_c))
Geometry
There is a cube with one edge 4 centimeters (cm) long. Suppose that the length and height of this cube are increased by 6 centimeters (cm), and the height is increased by an additional 5 centimeters (cm) to make a cuboid. What is the surface area of this shape?
600
4 4 6 [OP_ADD] [OP_MUL] 4 6 [OP_ADD] 5 [OP_ADD] [OP_MUL]
var_a = 4 var_b = 4 var_c = 6 var_d = var_b + var_c var_e = var_a * var_d var_f = 4 var_g = 6 var_h = var_f + var_g var_i = 5 var_j = var_h + var_i var_k = var_e * var_j print(int(var_k))
Correspondence
Find the value when 166.08 is divided by 4 twice.
10.38
166.08 4 [OP_DIV] 4 [OP_DIV]
var_a = 166.08 var_b = 4 var_c = var_a / var_b var_d = 4 var_e = var_c / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Comparison
When people in the park form 4 lines of 8 people to do gymnastics, find how many people are doing gymnastics in the park in total.
32
8 4 [OP_MUL]
var_a = 8 var_b = 4 var_c = var_a * var_b print(int(var_c))
Geometry
What is the area of the largest rectangle with a perimeter of 52 centimeters (cm)?
169
52 4 [OP_DIV] 2 [OP_POW]
var_a = 52 var_b = 4 var_c = var_a / var_b var_d = 2 var_e = var_c ** var_d print(int(var_e))
Arithmetic calculation
There are three numbers 10, 11, and 12. What is the value of the multiplication of the largest number and the smallest number?
120
[OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_MUL]
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 = 1 list_b=list_a.copy() list_b.sort() var_e = list_b[-var_d] var_f = 1 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
Choose the 2nd smallest number among 5, 8, 4, 3, and 2.
3
[OP_LIST_SOL] 5 8 4 3 2 [OP_LIST_EOL] 2 [OP_LIST_MIN]
var_a = 5 var_b = 8 var_c = 4 var_d = 3 var_e = 2 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 2 list_b=list_a.copy() list_b.sort() var_g = list_b[var_f-1] print(int(var_g))
Arithmetic calculation
It takes 0.84 meters (m) of ribbon tape to make one ribbon. If 50 centimeters (cm) remain after making 10 ribbons with the ribbon tape that Yujin has, find the length in meters (m) of the ribbon tape that Yujin had at first.
8.9
0.84 10 [OP_MUL] 50 100 [OP_DIV] [OP_ADD]
var_a = 0.84 var_b = 10 var_c = var_a * var_b var_d = 50 var_e = 100 var_f = var_d / var_e var_g = var_c + var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Comparison
In the final exam, Yooncheol scored 80 in Korean, 94 in Mathematics, 82 in Social studies, 76 in English, and 100 in Science. How many subjects did he score less than 80?
1
[OP_LIST_SOL] 80 94 82 76 100 [OP_LIST_EOL] 80 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = 80 var_b = 94 var_c = 82 var_d = 76 var_e = 100 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 = 80 list_b = [] for i in list_a: if i < var_f: list_b.append(i) var_g = len(list_b) print(int(var_g))
Arithmetic calculation
The average score for Korean, English, and science is 95 points, and if math scores are included, the average score falls by 3 points. What is math score?
83
95 3 [OP_SUB] 4 [OP_MUL] 95 3 [OP_MUL] [OP_SUB]
var_a = 95 var_b = 3 var_c = var_a - var_b var_d = 4 var_e = var_c * var_d var_f = 95 var_g = 3 var_h = var_f * var_g var_i = var_e - var_h print(int(var_i))
Correspondence
Find the sum of the largest value of A and the largest value of B that satisfies 32×A×A×A=B×4
9
32×A×A×A=B×4 A [OP_NUM_UNK_SOLVER] 1 [OP_LIST_MAX] 32×A×A×A=B×4 B [OP_NUM_UNK_SOLVER] 1 [OP_LIST_MAX] [OP_ADD]
var_a = '32×A×A×A=B×4' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = [] candidate_num = [i for i in range(51)] candi = list(itertools.product(candidate_num, repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): if term_list[i] == '': new_eq += str(term_list[i])+op_list[i] else: new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: if '=' in new_eq and '>' not in new_eq and '<' not in new_eq: new_eq=new_eq.replace('==','=') new_eq=new_eq.replace('>','') new_eq=new_eq.replace('<','') new_eq=new_eq.split('=') for i in range(len(new_eq)-1): eval_result = math.isclose(eval(new_eq[i]), eval(new_eq[i+1])) if not eval_result: break else: eval_result = eval(new_eq) except: eval_result = False pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k].append(int(c[i])) list_a = list(set(ans_dict[var_b])) var_c = 1 list_b=list_a.copy() list_b.sort() var_d = list_b[-var_c] var_e = '32×A×A×A=B×4' var_f = 'B' 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] = [] candidate_num = [i for i in range(51)] candi = list(itertools.product(candidate_num, 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)): if term_list[i] == '': new_eq += str(term_list[i])+op_list[i] else: new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: if '=' in new_eq and '>' not in new_eq and '<' not in new_eq: new_eq=new_eq.replace('==','=') new_eq=new_eq.replace('>','') new_eq=new_eq.replace('<','') new_eq=new_eq.split('=') for i in range(len(new_eq)-1): eval_result = math.isclose(eval(new_eq[i]), eval(new_eq[i+1])) if not eval_result: break else: eval_result = eval(new_eq) except: eval_result = False pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k].append(int(c[i])) list_c = list(set(ans_dict[var_f])) var_g = 1 list_d=list_c.copy() list_d.sort() var_h = list_d[-var_g] var_i = var_d + var_h print(int(var_i))
Comparison
Yujeong and Eunji live on the 17th and 25th floor of the apartment, respectively. Who lives on the higher floor?
Eunji
[OP_LIST_SOL] Yujeong Eunji [OP_LIST_EOL] [OP_LIST_SOL] 17 25 [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 = 17 var_d = 25 list_b= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_b.append(var_c) list_b.reverse() var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] var_g = list_b.index(var_f)+1 var_h = list_a[var_g-1] print(var_h)