category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Geometry
Fifteen pieces of colored paper in the shape of a rectangle, 9.4 cm (cm) wide and 3.7 cm (cm) long, overlap each other by 0.6 centimeters (cm). What is the total area of the colored paper glued together?
490.62
9.4 15 [OP_MUL] 15 1 [OP_SUB] 0.6 [OP_MUL] [OP_SUB] 3.7 [OP_MUL]
var_a = 9.4 var_b = 15 var_c = var_a * var_b var_d = 15 var_e = 1 var_f = var_d - var_e var_g = 0.6 var_h = var_f * var_g var_i = var_c - var_h var_j = 3.7 var_k = var_i * var_j print('{:.2f}'.format(round(var_k+1e-10,2)))
Geometry
Some parks are shaped like a regular hexagon with sides measuring 5 meters (m). Find the length of the perimeter of this park.
30
5 6 [OP_MUL]
var_a = 5 var_b = 6 var_c = var_a * var_b print(int(var_c))
Geometry
What is the length in centimeters (cm) of the radius of a bicycle wheel with a diameter of 26 centimeters (cm)?
13
26 2 [OP_DIV]
var_a = 26 var_b = 2 var_c = var_a / var_b print(int(var_c))
Correspondence
There is a company with a total of 450 people. Among them, employees working abroad accounted for 0.06 of the total number of employees. How many employees work abroad?
27
450 0.06 [OP_MUL]
var_a = 450 var_b = 0.06 var_c = var_a * var_b print(int(var_c))
Arithmetic calculation
Find how many times the number 2 appears in a list of all natural numbers less than or equal to 50 that are multiples of 5 or 2.
11
1 50 1 [OP_LIST_ARANGE] 5 [OP_LIST_DIVISIBLE] 1 50 [OP_LIST_EVEN] [OP_SET_UNION] [OP_LIST2NUM] [OP_NUM2LIST] 2 [OP_LIST_FIND_NUM]
var_a = 1 var_b = 50 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 5 list_b = [] var_d = int(var_d) for i in list_a: i = int(i) if i % var_d == 0: list_b.append(i) var_e = 1 var_f = 50 list_c = [] if var_e%2!=0: for i in range(var_e+1, var_f+1, 2): list_c.append(i) else: for i in range(var_e, var_f+1, 2): list_c.append(i) list_d = list(set(list_b) | set(list_c)) var_g="" for i in list_d: i = str(i) var_g = var_g + i list_e = [] var_g = int(var_g) while var_g//10 > 0: list_e.append(var_g%10) var_g = var_g//10 list_e.append(var_g%10) list_e = list_e[::-1] var_h = 2 var_i = 0 var_h = int(var_h) for i in list_e: i = int(i) if i == var_h: var_i = var_i + 1 print(int(var_i))
Arithmetic calculation
Potatoes were planted in 3/5 of Woojin's field, and sweet potatoes were planted in 2/3 of the remaining. What fraction of the whole is the unplanted part?
0.13
1 3/5 [OP_SUB] 1 2/3 [OP_SUB] [OP_MUL]
var_a = 1 var_b = 0.6 var_c = var_a - var_b var_d = 1 var_e = 0.6666666666666666 var_f = var_d - var_e var_g = var_c * var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Possibility
How many three-digit integers can be made with 4 cards each numbered 0, 1, 2, 3?
18
[OP_LIST_SOL] 0 1 2 3 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN]
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 = 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))
Arithmetic calculation
There are 225 students in class giraffe, and class elephant as 48 more students than class giraffe. Class rabbit has 24 less students than class giraffe. How many students are in the three classes of this kindergarten on average?
233
225 225 48 [OP_ADD] [OP_ADD] 225 24 [OP_SUB] [OP_ADD] 3 [OP_DIV]
var_a = 225 var_b = 225 var_c = 48 var_d = var_b + var_c var_e = var_a + var_d var_f = 225 var_g = 24 var_h = var_f - var_g var_i = var_e + var_h var_j = 3 var_k = var_i / var_j print(int(var_k))
Possibility
There are five number cards 1, 3, 5, 7, and 9. What is the sum of the three-digit natural numbers that can be made using these cards that are greater than 500? (However, the card can be used repeatedly.)
56625
[OP_LIST_SOL] 1 3 5 7 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PRODUCT] 500 [OP_LIST_MORE] [OP_LIST_SUM]
var_a = 1 var_b = 3 var_c = 5 var_d = 7 var_e = 9 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=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 = 500 list_c = [] for i in list_b: if i > var_g: list_c.append(i) list_c = [float(i) for i in list_c] var_h = sum(list_c) print(int(var_h))
Possibility
You are going to create a two-digit number by drawing two cards among 2, 4, 6, 8, and 9 and you can use them only once. Find the product of the largest and smallest two-digit numbers that can be made.
2352
[OP_LIST_SOL] 2 4 6 8 9 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_MUL]
var_a = 2 var_b = 4 var_c = 6 var_d = 8 var_e = 9 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = 1 list_d=list_b.copy() list_d.sort() var_j = list_d[var_i-1] var_k = var_h * var_j print(int(var_k))
Comparison
There are 5 boxes of 50 yellow balls each weighing 50 grams (g). There are 6 boxes of 60 white balls each weighing 45 grams (g). There are also 4 boxes of 40 blue balls each weighing 55 grams (g). All the empty boxes weigh the same. What is the color of the ball in the box with the lightest weight?
blue
[OP_LIST_SOL] yellow white blue [OP_LIST_EOL] [OP_LIST_SOL] 50 50 [OP_MUL] 45 60 [OP_MUL] 55 40 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'yellow' var_b = 'white' var_c = 'blue' 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 = 50 var_e = 50 var_f = var_d * var_e var_g = 45 var_h = 60 var_i = var_g * var_h var_j = 55 var_k = 40 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)
Comparison
The distance from Sol's house to the community-center is 2 kilometers (km) and 280 meters (m), and the distance to the nearest subway-station is 4125 meters (m). Which is closer to Sol's house, the community-center or the subway-station?
community-center
[OP_LIST_SOL] community-center subway-station [OP_LIST_EOL] [OP_LIST_SOL] 2 1000 [OP_MUL] 280 [OP_ADD] 4125 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'community-center' var_b = 'subway-station' 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 = 280 var_g = var_e + var_f var_h = 4125 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-1] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Possibility
You want to buy 2 fruits by combining apple, peach, pear, melon, and banana. How many possible combinations are there when allowing duplicates?
15
[OP_LIST_SOL] apple peach pear melon banana [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_ADD] 1 [OP_SUB] 2 [OP_COMB]
var_a = 'apple' var_b = 'peach' var_c = 'pear' var_d = 'melon' var_e = 'banana' 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 = var_f + var_g var_i = 1 var_j = var_h - var_i var_k = 2 var_l = 1 var_j = int(var_j) var_k = int(var_k) for i, elem in enumerate(range(var_k)): var_l = var_l * (var_j-i) for i, elem in enumerate(range(var_k)): var_l = var_l / (i+1) print(int(var_l))
Geometry
If the perimeter of a rectangle whose length is 2 centimeters (cm) shorter than its width is 16 centimeters (cm), what is its width?
5
16 2 [OP_DIV] 2 [OP_SUB] 2 [OP_DIV] 2 [OP_ADD]
var_a = 16 var_b = 2 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 = 2 var_i = var_g + var_h print(int(var_i))
Comparison
Pine trees were planted 22.75 meters (m) on one side of the 364-meter (m) long road, and ginkgo trees were planted on the other side at intervals of 45.5 meters (m) from start to finish. Find out which of the pine trees or 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)
Arithmetic calculation
I want to plant street trees. If street trees are planted from the beginning to the end, equally divided into 4 sections from the 0.35 km (km) point to the 0.37 km (km) point, indicate the kilometers (km) of the position of the street tree planted at the fourth point as a decimal number.
0.37
0.35 0.37 0.35 [OP_SUB] 4 [OP_DIV] 4 1 [OP_SUB] [OP_MUL] [OP_ADD]
var_a = 0.35 var_b = 0.37 var_c = 0.35 var_d = var_b - var_c var_e = 4 var_f = var_d / var_e var_g = 4 var_h = 1 var_i = var_g - var_h var_j = var_f * var_i var_k = var_a + var_j print('{:.2f}'.format(round(var_k+1e-10,2)))
Geometry
Find the number of diagonals in a nine-sided polygon.
27
9 9 3 [OP_SUB] [OP_MUL] 2 [OP_DIV]
var_a = 9 var_b = 9 var_c = 3 var_d = var_b - var_c var_e = var_a * var_d var_f = 2 var_g = var_e / var_f print(int(var_g))
Arithmetic calculation
In two-digit addition, the number 3 in the tens place of the number added was incorrectly counted as 6. Again, the numbers being added incorrectly read the ones digit as 9 to 2. If the result of the calculation is 119, what is 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))
Possibility
Three numbers from 2, 0, 7, 5, and 9 were used to create a three-digit number with different digits. If the numbers made in this way are arranged from left to right in ascending order, what will be the sum of the leftmost number and the fourth number from the left?
455
[OP_LIST_SOL] 2 0 7 5 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] 4 [OP_LIST_MIN] [OP_ADD]
var_a = 2 var_b = 0 var_c = 7 var_d = 5 var_e = 9 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[var_g-1] var_i = 4 list_d=list_b.copy() list_d.sort() var_j = list_d[var_i-1] var_k = var_h + var_j print(int(var_k))
Geometry
There is a rectangular parallelepiped-shaped lake with a length of 9 meters (m) wide and a length of 7 meters (m) long. If the volume of this lake is 315 square centimeters (cm2), how deep is this lake in centimeters (cm)?
5
315 9 [OP_DIV] 7 [OP_DIV]
var_a = 315 var_b = 9 var_c = var_a / var_b var_d = 7 var_e = var_c / var_d print(int(var_e))
Correspondence
When a number is multiplied by 3 twice, it is 18. Find the number.
2
18 3 [OP_DIV] 3 [OP_DIV]
var_a = 18 var_b = 3 var_c = var_a / var_b var_d = 3 var_e = var_c / var_d print(int(var_e))
Comparison
There are tangerine trees (a), (b), (c), and (d). (a) has more tangerines than (d), and (d) has more tangerines than (c). If (b) has more tangerines than (a), which tangerine tree has the most tangerines?
(b)
[OP_LIST_SOL] (a) (b) (c) (d) [OP_LIST_EOL] [OP_LIST_SOL] (a) (d) > (d) (c) > (b) (a) > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = '(a)' var_b = '(b)' var_c = '(c)' var_d = '(d)' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = '(a)' var_f = '(d)' var_g = '>' var_h = '(d)' var_i = '(c)' var_j = '>' var_k = '(b)' var_l = '(a)' var_m = '>' list_b= [] if "/" in str(var_m): var_m = eval(str(var_m)) list_b.append(var_m) if "/" in str(var_l): var_l = eval(str(var_l)) list_b.append(var_l) if "/" in str(var_k): var_k = eval(str(var_k)) list_b.append(var_k) if "/" in str(var_j): var_j = eval(str(var_j)) list_b.append(var_j) if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_n = 1 var_o = list_c[var_n-1] print(var_o)
Correspondence
632-5AB=41. How much is B?
1
632-5AB=41 B [OP_DIGIT_UNK_SOLVER]
var_a = '632-5AB=41' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Possibility
Dohun is playing a numbers game with Changu and Chanhee. It is a game in which ranks are ranked according to the size of the number made using all the number-written cards you have, and Dohun has numbers of 3, 9, and 8. When Changu made 850 and Chanhee made 920, what is the number of cases in which Dohun rank in second place?
1
[OP_LIST_SOL] 3 9 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 850 [OP_LIST_MORE] 920 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = 3 var_b = 9 var_c = 8 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 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 = 850 list_c = [] for i in list_b: if i > var_e: list_c.append(i) var_f = 920 list_d = [] for i in list_c: if i < var_f: list_d.append(i) var_g = len(list_d) print(int(var_g))
Correspondence
9A6-BB=BBB is true and A and B are not the same numbers. Find the sum of A and B.
15
9A6-BB=BBB A [OP_DIGIT_UNK_SOLVER] 9A6-BB=BBB B [OP_DIGIT_UNK_SOLVER] [OP_ADD]
var_a = '9A6-BB=BBB' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] var_d = '9A6-BB=BBB' var_e = 'B' ans_dict = dict() var_d = var_d.replace('×','*') var_d = var_d.replace('x','*') var_d = var_d.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_d): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_d for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_d): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_f = ans_dict[var_e] var_g = var_c + var_f print(int(var_g))
Geometry
Coins of the same size are arranged without gaps to form a square so that there are 36 coins placed around the perimeter. Find the number of coins lying on the outermost of one side.
10
36 4 [OP_DIV] 1 [OP_ADD]
var_a = 36 var_b = 4 var_c = var_a / var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Geometry
A rectangle has a side length of 4 centimeters (cm) and an area of 25/2 square centimeters (cm2). Find the length in centimeters (cm) of the side of this rectangle that is not 4 centimeters (cm) long.
3.13
25/2 4 [OP_DIV]
var_a = 12.5 var_b = 4 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Possibility
There is a clothing store that sells red, blue and black clothes. When purchasing two sets of clothes, find the number of all possible choices, allowing duplicates.
6
[OP_LIST_SOL] red blue black [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_ADD] 1 [OP_SUB] 2 [OP_COMB]
var_a = 'red' var_b = 'blue' var_c = 'black' 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))
Arithmetic calculation
How many numbers greater than 50 and less than 100 are not divisible by 8 and have a remainder of 4?
6
50 1 [OP_ADD] 100 1 [OP_SUB] 1 [OP_LIST_ARANGE] 8 4 [OP_LIST_DIVIDE_AND_REMAIN] [OP_LIST_LEN]
var_a = 50 var_b = 1 var_c = var_a + var_b var_d = 100 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 = 8 var_i = 4 list_b = [] var_h = int(var_h) var_i = int(var_i) if var_i < 0: var_i = var_i + var_h for i in list_a: i = int(i) if i%var_h == var_i: list_b.append(i) var_j = len(list_b) print(int(var_j))
Correspondence
A number multiplied by 6 plus 17 divided by 5 equals 25. Find the number.
18
25 5 [OP_MUL] 17 [OP_SUB] 6 [OP_DIV]
var_a = 25 var_b = 5 var_c = var_a * var_b var_d = 17 var_e = var_c - var_d var_f = 6 var_g = var_e / var_f print(int(var_g))
Arithmetic calculation
As a result of the long jump in PE class, Eunseol's record was 1 meter (m) 35 centimeters (cm), and Jeongyeon jumped 9 centimeters (cm) more than Eunseol. How many meters (m) was Jeongyeon's long jump record as a decimal number?
1.44
1 35 100 [OP_DIV] [OP_ADD] 9 100 [OP_DIV] [OP_ADD]
var_a = 1 var_b = 35 var_c = 100 var_d = var_b / var_c var_e = var_a + var_d var_f = 9 var_g = 100 var_h = var_f / var_g var_i = var_e + var_h print('{:.2f}'.format(round(var_i+1e-10,2)))
Arithmetic calculation
How many natural numbers are greater than 40 and less than or equal to 70?
30
70 40 [OP_SUB]
var_a = 70 var_b = 40 var_c = var_a - var_b print(int(var_c))
Comparison
I made a cake with 3 and 2/6 tablespoons of blueberry syrup and 21/6 tablespoons of grapefruit syrup. Find which one is contained more in the cake.
grapefruit
[OP_LIST_SOL] blueberry grapefruit [OP_LIST_EOL] [OP_LIST_SOL] 3 2 6 [OP_DIV] [OP_ADD] 21 6 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'blueberry' var_b = 'grapefruit' 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 var_d = 2 var_e = 6 var_f = var_d / var_e var_g = var_c + var_f var_h = 21 var_i = 6 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) 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
There is a cube with the sum of the lengths of all its edges equal to 132 centimeters (cm). What is the area of one side of this cube in square centimeters (cm2)?
121
132 12 [OP_DIV] 132 12 [OP_DIV] [OP_MUL]
var_a = 132 var_b = 12 var_c = var_a / var_b var_d = 132 var_e = 12 var_f = var_d / var_e var_g = var_c * var_f print(int(var_g))
Arithmetic calculation
32 apples were divided into 7 boxes, leaving 4 apples. How many apples are there in one box?
4
32 4 [OP_SUB] 7 [OP_DIV]
var_a = 32 var_b = 4 var_c = var_a - var_b var_d = 7 var_e = var_c / var_d print(int(var_e))
Correspondence
81 is the result of adding 43 to some number. What number is 25 greater than this number?
63
81 43 [OP_SUB] 25 [OP_ADD]
var_a = 81 var_b = 43 var_c = var_a - var_b var_d = 25 var_e = var_c + var_d print(int(var_e))
Comparison
Assuming that the distance between the school and the park is 396 meters (m) and the distance between the school and the pharmacy is 0.389 kilometers (km), find the one closer to the school between the park and the pharmacy.
pharmacy
[OP_LIST_SOL] park pharmacy [OP_LIST_EOL] [OP_LIST_SOL] 396 0.389 1000 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'park' var_b = 'pharmacy' 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 = 396 var_d = 0.389 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-1] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Geometry
Find the area of a square whose diagonal is 12 centimeters (cm).
72
12 2 [OP_POW] 2 [OP_DIV]
var_a = 12 var_b = 2 var_c = var_a ** var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Correspondence
If the reciprocal of -0.4 is A and the reciprocal of +5/2 is B, find the reciprocal of 3/A + 2/B.
0.26
1 3 1 -0.4 [OP_DIV] [OP_DIV] 2 1 5/2 [OP_DIV] [OP_DIV] [OP_ADD] [OP_DIV]
var_a = 1 var_b = 3 var_c = 1 var_d = -0.4 var_e = var_c / var_d var_f = var_b / var_e var_g = 2 var_h = 1 var_i = 2.5 var_j = var_h / var_i var_k = var_g / var_j var_l = var_f + var_k var_m = var_a / var_l print('{:.2f}'.format(round(var_m+1e-10,2)))
Comparison
Jungsoo put 28 marbles equally divided into 4 bags, and Hyeonju put 18 marbles equally divided into 3 bags. Who has fewer marbles in one bag, Jungsoo or Hyeonju?
Hyeonju
[OP_LIST_SOL] Jungsoo Hyeonju [OP_LIST_EOL] [OP_LIST_SOL] 28 4 [OP_DIV] 18 3 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jungsoo' var_b = 'Hyeonju' 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 = 28 var_d = 4 var_e = var_c / var_d var_f = 18 var_g = 3 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-1] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Comparison
There are a total of three numbers: 0.8, 1/2, and 0.5. What is the sum of all numbers less than 2?
1.8
[OP_LIST_SOL] 0.8 1/2 0.5 [OP_LIST_EOL] 2 [OP_LIST_LESS] [OP_LIST_SUM]
var_a = 0.8 var_b = 0.5 var_c = 0.5 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 2 list_b = [] for i in list_a: if i < var_d: list_b.append(i) list_b = [float(i) for i in list_b] var_e = sum(list_b) print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
Minyoung has 9 candies and Taehyung has 3. How many candies must Minyoung give to Taehyung so that Minyoung and Taehyung have the same number of candies?
3
9 3 [OP_SUB] 2 [OP_DIV]
var_a = 9 var_b = 3 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Geometry
If the volume of 4 squares with side length 3 is equal to the volume of a circle, find the length of the radius of the circle. (Note that the pi is calculated as 3.1)
3.41
4 3 2 [OP_POW] [OP_MUL] 3.1 [OP_DIV] 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 = 3.1 var_g = var_e / var_f var_h = 0.5 var_i = var_g ** var_h print('{:.2f}'.format(round(var_i+1e-10,2)))
Geometry
I'm trying to make a square as small as possible by arranging rectangular tiles that are 12 centimeters (cm) wide and 15 centimeters (cm) tall without any overlap. How many tiles will you need in total?
20
12 15 [OP_LCM] 2 [OP_POW] 12 15 [OP_MUL] [OP_DIV]
var_a = 12 var_b = 15 var_c = var_b * var_a / math.gcd(int(var_b), int(var_a)) var_d = 2 var_e = var_c ** var_d var_f = 12 var_g = 15 var_h = var_f * var_g var_i = var_e / var_h print(int(var_i))
Arithmetic calculation
How many numbers are there greater than 40 and less than 80 are multiples of 8?
4
40 1 [OP_ADD] 80 1 [OP_SUB] 1 [OP_LIST_ARANGE] 8 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 40 var_b = 1 var_c = var_a + var_b var_d = 80 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 = 8 list_b = [] var_h = int(var_h) for i in list_a: i = int(i) if i % var_h == 0: list_b.append(i) var_i = len(list_b) print(int(var_i))
Correspondence
I have a single digit A. If division 9A5÷5<197, count all possible numbers that can be A.
8
9A5÷5<197 A [OP_DIGIT_UNK_SOLVER] [OP_LIST_LEN]
var_a = '9A5÷5<197' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = [] candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k].append(int(c[i])) list_a = list(set(ans_dict[var_b])) var_c = len(list_a) print(int(var_c))
Arithmetic calculation
There are 8 students in Minsu's class, and Jinho's class has one more student than Minsu's class. From 3.944 meters (m) of ribbon, 29.05 centimeters (cm) were divided to each student in Minsu's class. After that, if you cut and distribute the remaining ribbons equally to Jinho's classmates, find how many centimeters (cm) of ribbons Jinho received.
18
3.944 100 [OP_MUL] 29.05 8 [OP_MUL] [OP_SUB] 8 1 [OP_ADD] [OP_DIV]
var_a = 3.944 var_b = 100 var_c = var_a * var_b var_d = 29.05 var_e = 8 var_f = var_d * var_e var_g = var_c - var_f var_h = 8 var_i = 1 var_j = var_h + var_i var_k = var_g / var_j print(int(eval('{:.2f}'.format(round(var_k+1e-10,2)))))
Comparison
At school, you took exams in the order of Korean, Social, Mathematics, English, and Science. What subject did you take the test for the third time?
Mathematics
[OP_LIST_SOL] Korean Social Mathematics English Science [OP_LIST_EOL] 3 [OP_LIST_GET]
var_a = 'Korean' var_b = 'Social' var_c = 'Mathematics' var_d = 'English' var_e = 'Science' list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 3 var_g = list_a[var_f-1] print(var_g)
Arithmetic calculation
Moving a decimal point to the right by one place makes a some number to become 2.7 larger than it originally was. Find the original decimal number.
0.3
2.7 10 1 [OP_SUB] [OP_DIV]
var_a = 2.7 var_b = 10 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
The teacher gave candy to Yoongi, Jimin, and Taehyung. If Yoongi got more candies than Taehyung and Taehyung got more candies than Jimin, who got the fewest candies?
Jimin
[OP_LIST_SOL] Yoongi Jimin Taehyung [OP_LIST_EOL] [OP_LIST_SOL] Yoongi Taehyung > Taehyung Jimin > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET]
var_a = 'Yoongi' var_b = 'Jimin' var_c = 'Taehyung' 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 = 'Yoongi' var_e = 'Taehyung' var_f = '>' var_g = 'Taehyung' var_h = 'Jimin' 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)
Correspondence
What number must be in B to make 1A+4B3=469?
5
1A+4B3=469 B [OP_DIGIT_UNK_SOLVER]
var_a = '1A+4B3=469' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Arithmetic calculation
An elementary school has 1256 students. Of these, the difference between the number of students who like math and those who like other subjects is 408. How many students like math? (However, students who like math are fewer than 500.)
424
1256 408 [OP_SUB] 2 [OP_DIV]
var_a = 1256 var_b = 408 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Comparison
You want to choose a figure with a longer perimeter. Given a square whose side is 3 centimeters (cm) and an equilateral-triangle whose side is 5 centimeters (cm), which shape has a longer perimeter?
equilateral-triangle
[OP_LIST_SOL] square equilateral-triangle [OP_LIST_EOL] [OP_LIST_SOL] 3 4 [OP_MUL] 5 3 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'square' var_b = 'equilateral-triangle' 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 var_d = 4 var_e = var_c * var_d var_f = 5 var_g = 3 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)
Geometry
If the sum of all the edges of a polyhedron made of 6 equal-sized squares is 144 centimeters (cm), what is the length of one side of the square in centimeters (cm)?
12
144 12 [OP_DIV]
var_a = 144 var_b = 12 var_c = var_a / var_b print(int(var_c))
Arithmetic calculation
Yuna gave 12 marbles to her younger brother and got 5 marbles to her sister. After that, Yuna gave half of the marbles to Namjoon and received 3 from Yoongi, so the number of marbles She currently have is 17. How many marbles did Yuna have in the first place?
35
17 3 [OP_SUB] 2 [OP_MUL] 5 [OP_SUB] 12 [OP_ADD]
var_a = 17 var_b = 3 var_c = var_a - var_b var_d = 2 var_e = var_c * var_d var_f = 5 var_g = var_e - var_f var_h = 12 var_i = var_g + var_h print(int(var_i))
Comparison
Yuri ate 6 plates of tteokbokki at the restaurant, and Jisoo ate 8 plates. Taehyung ate more than Yuri and less than Jisoo. How many plates of tteokbokki did Taehyung eat?
7
6 8 [OP_ADD] 2 [OP_FDIV]
var_a = 6 var_b = 8 var_c = var_a + var_b var_d = 2 var_e = var_c // var_d print(int(var_e))
Arithmetic calculation
Hyunwoo's family uses 215 liters (L) of water a day. If they adjust the water pressure valve weakly, they can save as much as 0.32 times the usual amount. How many liters (L) of water can Hyunwoo's family save in a day when the water pressure valve is adjusted weakly?
68.8
215 0.32 [OP_MUL]
var_a = 215 var_b = 0.32 var_c = var_a * var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
If you pack 6 or 9 candies, you will have nothing left, and if you pack 7 candies, you will have 1 candy left. If the number of candies is a natural number between 11 and 100, how many candies are there?
36
10 100 1 [OP_LIST_ARANGE] 6 9 [OP_LCM] 0 [OP_LIST_DIVIDE_AND_REMAIN] 7 1 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_GET]
var_a = 10 var_b = 100 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 6 var_e = 9 var_f = var_e * var_d / math.gcd(int(var_e), int(var_d)) var_g = 0 list_b = [] var_f = int(var_f) var_g = int(var_g) if var_g < 0: var_g = var_g + var_f for i in list_a: i = int(i) if i%var_f == var_g: list_b.append(i) var_h = 7 var_i = 1 list_c = [] var_h = int(var_h) var_i = int(var_i) if var_i < 0: var_i = var_i + var_h for i in list_b: i = int(i) if i%var_h == var_i: list_c.append(i) var_j = 1 var_k = list_c[var_j-1] print(int(var_k))
Geometry
You drew diagonals from one vertex of an octagon. Find the number of triangles formed in this case.
6
8 3 [OP_SUB] 1 [OP_ADD]
var_a = 8 var_b = 3 var_c = var_a - var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
How many natural numbers from 1 to 1000 have 3 in the tens place?
100
1 1000 1 [OP_LIST_ARANGE] 10 3 [OP_LIST_SEARCH_FIXED_DIGIT] [OP_LIST_LEN]
var_a = 1 var_b = 1000 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 10 var_e = 3 list_b = [] var_d = int(var_d) var_e = int(var_e) for i in list_a: i = int(i) if (i//var_d)%10 == var_e: list_b.append(i) var_f = len(list_b) print(int(var_f))
Comparison
There are two numbers. When you add 30 to the smaller numbers and multiply it by 4, you get the larger number. If the difference between these two numbers is 480, what is the larger number?
600
480 30 4 [OP_MUL] [OP_SUB] 4 1 [OP_SUB] [OP_DIV] 30 [OP_ADD] 4 [OP_MUL]
var_a = 480 var_b = 30 var_c = 4 var_d = var_b * var_c var_e = var_a - var_d var_f = 4 var_g = 1 var_h = var_f - var_g var_i = var_e / var_h var_j = 30 var_k = var_i + var_j var_l = 4 var_m = var_k * var_l print(int(var_m))
Correspondence
When 632-5AB=41, what number should be in B?
1
632-5AB=41 B [OP_DIGIT_UNK_SOLVER]
var_a = '632-5AB=41' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Geometry
If four points B, C, D, and E of the five points A, B, C, D, and E are on a straight line, how many straight lines can be formed by connecting these two points?
5
4 1 [OP_ADD]
var_a = 4 var_b = 1 var_c = var_a + var_b print(int(var_c))
Possibility
You want to create a five-digit number using the numbers 7, 2, 3, 4, and 9. How many five-digit numbers can you make? The same number can appear multiple times.
3125
[OP_LIST_SOL] 7 2 3 4 9 [OP_LIST_EOL] 5 [OP_LIST_GET_PRODUCT] [OP_LIST_LEN]
var_a = 7 var_b = 2 var_c = 3 var_d = 4 var_e = 9 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 5 list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = len(list_b) print(int(var_g))
Possibility
How many three-digit integers can be made by drawing 3 cards from 1 through 4?
24
4 3 [OP_PERM]
var_a = 4 var_b = 3 var_c = 1 var_a = int(var_a) var_b = int(var_b) for i, elem in enumerate(range(var_b)): var_c = var_c * (var_a-i) print(int(var_c))
Correspondence
You want to multiply 20 by some number. But you mistakenly divided a number by 10, and the result was 5. What is the correct calculation result?
40
20 10 5 [OP_DIV] [OP_MUL]
var_a = 20 var_b = 10 var_c = 5 var_d = var_b / var_c var_e = var_a * var_d print(int(var_e))
Geometry
Find how many centimeters (cm) per side of a rhombus is 60 centimeters (cm) when the lengths of the four sides are added.
15
60 4 [OP_DIV]
var_a = 60 var_b = 4 var_c = var_a / var_b print(int(var_c))
Possibility
You want to create a three-digit number by picking three of 1, 0, 7, 4, and 5 and using them only once. Find the difference between the second largest number and the third smallest number that can be made.
644
[OP_LIST_SOL] 1 0 7 4 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 2 [OP_LIST_MAX] 3 [OP_LIST_MIN] [OP_SUB] [OP_ABS]
var_a = 1 var_b = 0 var_c = 7 var_d = 4 var_e = 5 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 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 = 2 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = 3 list_d=list_b.copy() list_d.sort() var_j = list_d[var_i-1] var_k = var_h - var_j var_l = abs(var_k) print(int(var_l))
Geometry
The sum of the lengths of the sides of a rectangle with sides of 8 centimeters (cm) and 10 centimeters (cm) and a square is equal. How many centimeters (cm) is the length of one side of the square?
9
8 10 [OP_ADD] 2 [OP_MUL] 4 [OP_DIV]
var_a = 8 var_b = 10 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))
Comparison
There is a box full of sand weighing 1 kilogram (kg) 780 grams (g) and a barrel weighing 2 kilograms (kg) 250 grams (g). If the box weighs 250 grams (g) and the barrel weighs 460 grams (g), which contains more sand, the box or the barrel?
barrel
[OP_LIST_SOL] box barrel [OP_LIST_EOL] [OP_LIST_SOL] 1 1000 [OP_MUL] 780 [OP_ADD] 250 [OP_SUB] 2 1000 [OP_MUL] 250 [OP_ADD] 460 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'box' var_b = 'barrel' 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 var_d = 1000 var_e = var_c * var_d var_f = 780 var_g = var_e + var_f var_h = 250 var_i = var_g - var_h var_j = 2 var_k = 1000 var_l = var_j * var_k var_m = 250 var_n = var_l + var_m var_o = 460 var_p = var_n - var_o list_b= [] if "/" in str(var_p): var_p = eval(str(var_p)) list_b.append(var_p) if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) list_b.reverse() var_q = 1 list_c=list_b.copy() list_c.sort() var_r = list_c[-var_q] var_s = list_b.index(var_r)+1 var_t = list_a[var_s-1] print(var_t)
Arithmetic calculation
You are trying to make a team of 6 people to play the game. How many teams can you make if there are 72 students in all?
12
72 6 [OP_FDIV]
var_a = 72 var_b = 6 var_c = var_a // var_b print(int(var_c))
Correspondence
The number that is 204 less than C is A, and A is 520. Calculate B when adding 179 to B equals C.
545
520 204 [OP_ADD] 179 [OP_SUB]
var_a = 520 var_b = 204 var_c = var_a + var_b var_d = 179 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
The second-year students participated in the running competition, which is five times the number of students who participated in the running competition among the first-year students participated in the running competition. If eight of the first graders participated in the race, how many first and second graders participated in the race?
48
8 8 5 [OP_MUL] [OP_ADD]
var_a = 8 var_b = 8 var_c = 5 var_d = var_b * var_c var_e = var_a + var_d print(int(var_e))
Correspondence
The quotient of a number subtracted by 8 and then subtracted by 12 and then divided by 5 equals 7. Find the number.
55
5 7 [OP_MUL] 12 [OP_ADD] 8 [OP_ADD]
var_a = 5 var_b = 7 var_c = var_a * var_b var_d = 12 var_e = var_c + var_d var_f = 8 var_g = var_e + var_f print(int(var_g))
Arithmetic calculation
To go to school, Woojun walked 1/5 of the total distance and took the subway for the remaining distance. How many times is the total distance taken by subway?
0.8
1 1/5 [OP_SUB]
var_a = 1 var_b = 0.2 var_c = var_a - var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Possibility
There are four types of animals in the fence: chicken, duck, rabbit, and dog. Find a way to get 15 animals out of the fence.
816
4 1 [OP_SUB] 15 [OP_ADD] 15 [OP_COMB]
var_a = 4 var_b = 1 var_c = var_a - var_b var_d = 15 var_e = var_c + var_d var_f = 15 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) for i, elem in enumerate(range(var_f)): var_g = var_g / (i+1) print(int(var_g))
Comparison
Which number is the smallest among 5, 8, 3, 2, and 6?
2
[OP_LIST_SOL] 5 8 3 2 6 [OP_LIST_EOL] 1 [OP_LIST_MIN]
var_a = 5 var_b = 8 var_c = 3 var_d = 2 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 = 1 list_b=list_a.copy() list_b.sort() var_g = list_b[var_f-1] print(int(var_g))
Arithmetic calculation
There are 19 boxes of apples, each containing 46 pieces, and several boxes of tangerines, each containing 170 pieces. If there are 1894 apples and tangerines, how many boxes of tangerines are there?
6
1894 46 19 [OP_MUL] [OP_SUB] 170 [OP_FDIV]
var_a = 1894 var_b = 46 var_c = 19 var_d = var_b * var_c var_e = var_a - var_d var_f = 170 var_g = var_e // var_f print(int(var_g))
Comparison
What is the sum of the numbers greater than or equal to 1.1 in 1.4, 9/10, 1.2, 0.5, and 13/10?
3.9
[OP_LIST_SOL] 1.4 9/10 1.2 0.5 13/10 [OP_LIST_EOL] 1.1 [OP_LIST_MORE_EQUAL] [OP_LIST_SUM]
var_a = 1.4 var_b = 0.9 var_c = 1.2 var_d = 0.5 var_e = 1.3 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 1.1 list_b = [] for i in list_a: if i >= var_f: list_b.append(i) list_b = [float(i) for i in list_b] var_g = sum(list_b) print('{:.2f}'.format(round(var_g+1e-10,2)))
Correspondence
A number subtract by 7 is a multiple of 9, and the quotient of a number divided by 9 is 25. Find the value of a number multiplied by 9.
2088
25 9 [OP_MUL] 7 [OP_ADD] 9 [OP_MUL]
var_a = 25 var_b = 9 var_c = var_a * var_b var_d = 7 var_e = var_c + var_d var_f = 9 var_g = var_e * var_f print(int(var_g))
Comparison
Nana and Gaeun are playing a game of tossing paper airplanes far. Nana flew the paper airplane 1.618 meters (m), and Gaeun flew the paper airplane 162.3 centimeters (cm). Find out who flew the paper plane farther.
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)
Comparison
Jungkook collected the number 6 multiplied by 3, Yoongi collected 4, and Yuna collected 5. Who got the smallest number?
Yoongi
[OP_LIST_SOL] Jungkook Yoongi Yuna [OP_LIST_EOL] [OP_LIST_SOL] 6 3 [OP_MUL] 4 5 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jungkook' var_b = 'Yoongi' var_c = 'Yuna' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 6 var_e = 3 var_f = var_d * var_e var_g = 4 var_h = 5 list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[var_i-1] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Correspondence
Today, I poured 7/3 liter (L) of water from Suho's beaker into Seohyun's beaker. If the water in Suho's beaker is 3/2 liter (L) more than the water in Seohyun's beaker, how many more water was in Suho's beaker than in Seohyun's beaker originally in liters (L)?
6.17
3/2 7/3 [OP_ADD] 7/3 [OP_ADD]
var_a = 1.5 var_b = 2.3333333333333335 var_c = var_a + var_b var_d = 2.3333333333333335 var_e = var_c + var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
In the multiplication of two-digit numbers, 2432 was calculated because I had mistaken the number 2 in the tens place of the number being multiplied for 6. If the correctly calculated value is 912, write the smaller of the two two-digit numbers.
24
[OP_LIST_SOL] 2432 912 [OP_SUB] 40 [OP_DIV] 912 2432 912 [OP_SUB] 40 [OP_DIV] [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MIN]
var_a = 2432 var_b = 912 var_c = var_a - var_b var_d = 40 var_e = var_c / var_d var_f = 912 var_g = 2432 var_h = 912 var_i = var_g - var_h var_j = 40 var_k = var_i / var_j var_l = var_f / var_k list_a= [] if "/" in str(var_l): var_l = eval(str(var_l)) list_a.append(var_l) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) list_a.reverse() var_m = 1 list_b=list_a.copy() list_b.sort() var_n = list_b[var_m-1] print(int(var_n))
Correspondence
Seungho gave 273 of his marbles to Hyukjin. At this time, if Seungho has 477 more marbles than Hyukjin, find out how many more marbles he had before giving them.
1023
477 273 [OP_ADD] 273 [OP_ADD]
var_a = 477 var_b = 273 var_c = var_a + var_b var_d = 273 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
When four 250 centimeters (cm) long tapes were attached together, the total length was 925 centimeters (cm). How many centimeters (cm) is the length of one overlapping segment, assuming that each overlapping segment is the same length?
25
250 4 [OP_MUL] 925 [OP_SUB] 4 1 [OP_SUB] [OP_DIV]
var_a = 250 var_b = 4 var_c = var_a * var_b var_d = 925 var_e = var_c - var_d var_f = 4 var_g = 1 var_h = var_f - var_g var_i = var_e / var_h print(int(var_i))
Geometry
There is a square with sides of 11 centimeters (cm) and a square with sides of 5 centimeters (cm). What is the sum of the areas of the two squares in square centimeters (cm2)?
146
11 2 [OP_POW] 5 2 [OP_POW] [OP_ADD]
var_a = 11 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))
Correspondence
The four-digit number 18A4 is less than 1853. A is in the tens place and can contain any digit from 0 to 9. How many digits can go in A?
5
18A4 [OP_GEN_POSSIBLE_LIST] 1853 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = '18A4' 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 = 1853 list_b = [] for i in list_a: if i < var_b: list_b.append(i) var_c = len(list_b) print(int(var_c))
Correspondence
A7B+23=695. How much is B?
2
A7B+23=695 B [OP_DIGIT_UNK_SOLVER]
var_a = 'A7B+23=695' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Arithmetic calculation
Minseok and Jaeyoon ate 3 apples each, so there are 2 apples left. How many apples were there initially?
8
2 3 2 [OP_MUL] [OP_ADD]
var_a = 2 var_b = 3 var_c = 2 var_d = var_b * var_c var_e = var_a + var_d print(int(var_e))
Arithmetic calculation
There are 20 books (a) and books (b) in total, and there are four more books (a) than books (b). How many books (a) are there?
12
20 4 [OP_ADD] 2 [OP_FDIV]
var_a = 20 var_b = 4 var_c = var_a + var_b var_d = 2 var_e = var_c // var_d print(int(var_e))
Possibility
What is the third largest three-digit number with a tens digit of 2 formed by using 2, 0, 3, and 8 once?
328
[OP_LIST_SOL] 2 0 3 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 10 2 [OP_LIST_SEARCH_FIXED_DIGIT] 3 [OP_LIST_MAX]
var_a = 2 var_b = 0 var_c = 3 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 = 10 var_g = 2 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] print(int(var_i))
Correspondence
61 is the result of accidentally adding 26 to a number, to which 62 should have been added. How much do you get if calculated correctly?
97
61 26 [OP_SUB] 62 [OP_ADD]
var_a = 61 var_b = 26 var_c = var_a - var_b var_d = 62 var_e = var_c + var_d print(int(var_e))
Possibility
The number of the room where the treasure is hidden is four digits, each digit does not overlap, and is the second largest number which can be made of 2, 3, 7, and 9. What is the number of the room where the treasure is hidden?
9723
[OP_LIST_SOL] 2 3 7 9 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 2 [OP_LIST_MAX]
var_a = 2 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 = 4 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 2 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] print(int(var_g))
Arithmetic calculation
If the hundreds digit of a three-digit natural number is 5, the tens digit is 1, and the units digit is 3, what is this number?
513
[OP_LIST_SOL] 5 1 3 [OP_LIST_EOL] [OP_LIST2NUM]
var_a = 5 var_b = 1 var_c = 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="" for i in list_a: i = str(i) var_d = var_d + i print(int(var_d))
Correspondence
Subtracting 46 from a number gives 15. What is the number obtained when 29 is subtracted from a number?
32
15 46 [OP_ADD] 29 [OP_SUB]
var_a = 15 var_b = 46 var_c = var_a + var_b var_d = 29 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
Namjoon has 17 marbles. Yoongi has 11 fewer marbles than Namjoon's marbles times 5, and Hoseok has 8 more marbles than 2 times Yoongi's. How many marbles do Namjoon, Yoongi, and Hoseok have?
247
17 17 5 [OP_MUL] 11 [OP_SUB] [OP_ADD] 17 5 [OP_MUL] 11 [OP_SUB] 2 [OP_MUL] 8 [OP_ADD] [OP_ADD]
var_a = 17 var_b = 17 var_c = 5 var_d = var_b * var_c var_e = 11 var_f = var_d - var_e var_g = var_a + var_f var_h = 17 var_i = 5 var_j = var_h * var_i var_k = 11 var_l = var_j - var_k var_m = 2 var_n = var_l * var_m var_o = 8 var_p = var_n + var_o var_q = var_g + var_p print(int(var_q))
Arithmetic calculation
You are going to make a fence by connecting 3 wooden planks that are 217 centimeters (cm) long. If the length of the overlapping part of the wooden planks is the same, and the length of the fence made is 627 centimeters (cm), find how many centimeters (cm) is the length of one overlapping part of the planks.
12
217 3 [OP_MUL] 627 [OP_SUB] 3 1 [OP_SUB] [OP_DIV]
var_a = 217 var_b = 3 var_c = var_a * var_b var_d = 627 var_e = var_c - var_d var_f = 3 var_g = 1 var_h = var_f - var_g var_i = var_e / var_h print(int(var_i))
Geometry
If the length of one side of the parallelogram is 3.8 meters (m) and the distance between this side and the opposite side is 6.36 meters (m), what is the area of the parallelogram?
24.17
3.8 6.36 [OP_MUL]
var_a = 3.8 var_b = 6.36 var_c = var_a * var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
If A is the number less than -3 by -5, and B is the number greater than +2 by -2, find the value of A+B.
2
-3 -5 [OP_SUB] 2 -2 [OP_ADD] [OP_ADD]
var_a = -3 var_b = -5 var_c = var_a - var_b var_d = 2 var_e = -2 var_f = var_d + var_e var_g = var_c + var_f print(int(var_g))