category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Correspondence
Subtracting this number from 35, and then multiplying it by 2, adding 12, and dividing it by 8 is 9. Find this number.
5
35 9 8 [OP_MUL] 12 [OP_SUB] 2 [OP_DIV] [OP_SUB]
var_a = 35 var_b = 9 var_c = 8 var_d = var_b * var_c var_e = 12 var_f = var_d - var_e var_g = 2 var_h = var_f / var_g var_i = var_a - var_h print(int(var_i))
Comparison
Inhyuk and Kyungsoo have a gift wrapping string. The string that Inhyeok has is 97.5 centimeters (cm), and the string that Kyungsoo has is 3 millimeters (mm) longer than 97 centimeters (cm). Who has a shorter string?
Kyungsoo
[OP_LIST_SOL] Inhyuk Kyungsoo [OP_LIST_EOL] [OP_LIST_SOL] 97.5 97 3 10 [OP_DIV] [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Inhyuk' var_b = 'Kyungsoo' 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 = 97.5 var_d = 97 var_e = 3 var_f = 10 var_g = var_e / var_f var_h = var_d + var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_c): var_c = eval(str(var_c)) list_b.append(var_c) 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)
Geometry
11 students in Hyeonju's class are standing in a hendecagonal shape. If every student exchanges a high-five once, except for the friend standing next to them, how many high-fives will there be?
44
11 11 3 [OP_SUB] [OP_MUL] 2 [OP_DIV]
var_a = 11 var_b = 11 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
Suzy did 247 jump ropes yesterday and 131 more jumps today than yesterday. Find out how many jump ropes Suzy did in two days.
625
247 247 131 [OP_ADD] [OP_ADD]
var_a = 247 var_b = 247 var_c = 131 var_d = var_b + var_c var_e = var_a + var_d print(int(var_e))
Arithmetic calculation
Yoojung had several notebooks. Among them, she gave 5 books to her older sister and gave half of the rest to her younger sister. If there are 4 notebooks left, how many notebooks did Yoojung have at first?
13
4 2 [OP_MUL] 5 [OP_ADD]
var_a = 4 var_b = 2 var_c = var_a * var_b var_d = 5 var_e = var_c + var_d print(int(var_e))
Comparison
When the students are standing in a line, Jimin is behind Seokjin, with 4 in front of Seokjin and 7 behind Jimin. When 3 people are standing between Seokjin and Jimin, how many students are in line?
16
4 7 [OP_ADD] 3 [OP_ADD] 2 [OP_ADD]
var_a = 4 var_b = 7 var_c = var_a + var_b var_d = 3 var_e = var_c + var_d var_f = 2 var_g = var_e + var_f print(int(var_g))
Correspondence
Subtract 2A from the two-digit number A5 to get B7. If A and B are two different numbers, find the value of A+B.
13
A5-2A=B7 A [OP_DIGIT_UNK_SOLVER] A5-2A=B7 B [OP_DIGIT_UNK_SOLVER] [OP_ADD]
var_a = 'A5-2A=B7' 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 = 'A5-2A=B7' 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))
Correspondence
A and B are two-digit numbers. Find A-B when A is 8 less than 23, and B plus 7 is 18.
4
23 8 [OP_SUB] 18 7 [OP_SUB] [OP_SUB]
var_a = 23 var_b = 8 var_c = var_a - var_b var_d = 18 var_e = 7 var_f = var_d - var_e var_g = var_c - var_f print(int(var_g))
Arithmetic calculation
You have 45 (A) animals and 32 (B) animals. (B) animals and (C) animals are 8 fewer than (A) animals. How many (C) animals are there?
5
45 32 [OP_SUB] 8 [OP_SUB]
var_a = 45 var_b = 32 var_c = var_a - var_b var_d = 8 var_e = var_c - var_d print(int(var_e))
Correspondence
14 runners participate in the marathon event. It is said that each player needs 5 bottles of water. If you currently have 68 bottles of water, how many more bottles do you need to avoid running out?
2
14 5 [OP_MUL] 68 [OP_SUB]
var_a = 14 var_b = 5 var_c = var_a * var_b var_d = 68 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
There are three numbers 10, 11, and 12. What is the remainder when divided by the largest number and the next largest number?
1
[OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MAX] [OP_MOD]
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 = 2 list_c=list_a.copy() list_c.sort() var_g = list_c[-var_f] var_h = var_e % var_g print(int(var_h))
Arithmetic calculation
If 1256 students are enrolled in a school, the first graders are 408 fewer than the total of students excluding first year. How many students are in first grade?
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))
Arithmetic calculation
In a two-digit number subtraction, the unit digit of the minuend was originally 3, but it was mistaken for 5. Also, by changing the tens digit and the unit digit of the subtrahend, mistakenly thought that it was 25 and calculated it as 60. Find the result of the correct calculation.
31
60 1 3 5 [OP_SUB] [OP_MUL] [OP_ADD] 52 25 [OP_SUB] [OP_SUB]
var_a = 60 var_b = 1 var_c = 3 var_d = 5 var_e = var_c - var_d var_f = var_b * var_e var_g = var_a + var_f var_h = 52 var_i = 25 var_j = var_h - var_i var_k = var_g - var_j print(int(var_k))
Arithmetic calculation
If you divide the flour into small boxes by 500 grams (g), you have 3 kilograms (kg) left over. Also, 200 grams (g) are left if you divide it into 900 grams (g) each. How many kilograms (kg) is flour in total?
6.5
3 1000 [OP_MUL] 200 [OP_SUB] 900 500 [OP_SUB] [OP_DIV] 500 [OP_MUL] 3 1000 [OP_MUL] [OP_ADD] 1000 [OP_DIV]
var_a = 3 var_b = 1000 var_c = var_a * var_b var_d = 200 var_e = var_c - var_d var_f = 900 var_g = 500 var_h = var_f - var_g var_i = var_e / var_h var_j = 500 var_k = var_i * var_j var_l = 3 var_m = 1000 var_n = var_l * var_m var_o = var_k + var_n var_p = 1000 var_q = var_o / var_p print('{:.2f}'.format(round(var_q+1e-10,2)))
Arithmetic calculation
The average of the five numbers is 8. If you take one of these numbers and change it to 8, the average is 9. What is the original number before the change?
3
8 5 [OP_MUL] 9 5 [OP_MUL] 8 [OP_SUB] [OP_SUB]
var_a = 8 var_b = 5 var_c = var_a * var_b var_d = 9 var_e = 5 var_f = var_d * var_e var_g = 8 var_h = var_f - var_g var_i = var_c - var_h print(int(var_i))
Geometry
There is a colored paper in the shape of a rhombus that fits inside a circle with a radius of 10 centimeters (cm). Find the area of the rhombus drawn by connecting the middles of all four sides of this piece of colored paper.
100
10 10 [OP_MUL]
var_a = 10 var_b = 10 var_c = var_a * var_b print(int(var_c))
Comparison
How many numbers are less than or equal to 1.1 out of five numbers: 1.4, 9/10, 1.2, 0.5, and 13/10?
2
[OP_LIST_SOL] 1.4 9/10 1.2 0.5 13/10 [OP_LIST_EOL] 1.1 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN]
var_a = 1.4 var_b = 0.9 var_c = 1.2 var_d = 0.5 var_e = 1.3 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 1.1 list_b = [] for i in list_a: if i <= var_f: list_b.append(i) var_g = len(list_b) print(int(var_g))
Arithmetic calculation
Item (A)s are divided into 4 boxes with 6 in each box. How many boxes are needed to pack 3 items in a box?
8
6 4 [OP_MUL] 3 [OP_DIV]
var_a = 6 var_b = 4 var_c = var_a * var_b var_d = 3 var_e = var_c / var_d print(int(var_e))
Correspondence
You get the two-digit number A7+3B=73. What is the possible value of A at this time?
3
A7+3B=73 A [OP_DIGIT_UNK_SOLVER]
var_a = 'A7+3B=73' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Correspondence
A is the same as 1 group of 100 and 23 groups of 10. If B is the number that is increased 4 times by 105 from 172, what is the sum of A and B?
922
100 1 [OP_MUL] 10 23 [OP_MUL] [OP_ADD] 172 105 4 [OP_MUL] [OP_ADD] [OP_ADD]
var_a = 100 var_b = 1 var_c = var_a * var_b var_d = 10 var_e = 23 var_f = var_d * var_e var_g = var_c + var_f var_h = 172 var_i = 105 var_j = 4 var_k = var_i * var_j var_l = var_h + var_k var_m = var_g + var_l print(int(var_m))
Geometry
A trapezoid was created by cutting a parallelogram. The upper side of this trapezoid is 15 centimeters (cm) and the lower side is 9 centimeters (cm). If the height of the trapezoid is 12 centimeters (cm), how many centimeters (cm) is the side of a square with the same area as the trapezoid?
12
15 9 [OP_ADD] 12 [OP_MUL] 2 [OP_DIV] 1/2 [OP_POW]
var_a = 15 var_b = 9 var_c = var_a + var_b var_d = 12 var_e = var_c * var_d var_f = 2 var_g = var_e / var_f var_h = 0.5 var_i = var_g ** var_h print(int(var_i))
Possibility
There are 3 red clothes and 7 yellow clothes in the closet. How many clothes can you wear?
10
3 7 [OP_ADD]
var_a = 3 var_b = 7 var_c = var_a + var_b print(int(var_c))
Correspondence
Find the sum of each digit of the quotient of 111111 divided by 3.
20
111111 3 [OP_DIV] [OP_NUM2LIST] [OP_LIST_SUM]
var_a = 111111 var_b = 3 var_c = var_a / var_b list_a = [] var_c = int(var_c) while var_c//10 > 0: list_a.append(var_c%10) var_c = var_c//10 list_a.append(var_c%10) list_a = list_a[::-1] list_a = [float(i) for i in list_a] var_d = sum(list_a) print(int(var_d))
Correspondence
When a teacher gave an equal amount of 8204 candies, with 28 candies per student, to the 2nd graders, and there were no candies left. How many 2nd graders are there?
293
1 28 8204 [OP_DIV] [OP_DIV]
var_a = 1 var_b = 28 var_c = 8204 var_d = var_b / var_c var_e = var_a / var_d print(int(var_e))
Geometry
There is a cuboid-shaped brick that is 20 centimeters (cm) long, 12 meters (m) wide, and 10 centimeters (cm) high. What is the volume of the largest cube-shaped brick that can be made by cutting this brick?
1000
[OP_LIST_SOL] 20 12 10 [OP_LIST_EOL] 1 [OP_LIST_MIN] 1 [OP_LIST_MIN] 3 [OP_POW]
var_a = 20 var_b = 12 var_c = 10 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 = 1 list_c=list_a.copy() list_c.sort() var_g = list_c[var_f-1] var_h = 3 var_i = var_g ** var_h print(int(var_i))
Correspondence
When I mistakenly multiplied a decimal that should be divided by 12, I got 84.6. Find the original decimal.
7.05
84.6 12 [OP_DIV]
var_a = 84.6 var_b = 12 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Geometry
How many faces are there in a regular tetrahedron?
4
4
var_a = 4 print(int(var_a))
Arithmetic calculation
Min-young used 8 tablespoons of salt, 3 tablespoons of pepper and 3 tablespoons of sugar. Yujeong used 7 tablespoons of salt and 2 tablespoons less than sugar. If Yujeong used twice as much spices as Min-young used, how many spoons of pepper did Yujeong use?
4
9 3 [OP_ADD] 5 [OP_ADD] 7 [OP_SUB] 2 [OP_SUB] 2 [OP_FDIV]
var_a = 9 var_b = 3 var_c = var_a + var_b var_d = 5 var_e = var_c + var_d var_f = 7 var_g = var_e - var_f var_h = 2 var_i = var_g - var_h var_j = 2 var_k = var_i // var_j print(int(var_k))
Arithmetic calculation
The sum of 5 consecutive even numbers is 240. Write the smallest of these 5 numbers.
44
240 5 [OP_DIV] 5 2 [OP_FDIV] 2 [OP_MUL] [OP_SUB]
var_a = 240 var_b = 5 var_c = var_a / var_b var_d = 5 var_e = 2 var_f = var_d // var_e var_g = 2 var_h = var_f * var_g var_i = var_c - var_h print(int(var_i))
Comparison
On a ranch there are more pigs than cows and fewer pigs than chickens. What are the most common animals on a ranch?
chickens
[OP_LIST_SOL] cows pigs chickens [OP_LIST_EOL] [OP_LIST_SOL] pigs cows > pigs chickens < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'cows' var_b = 'pigs' var_c = 'chickens' 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 = 'pigs' var_e = 'cows' var_f = '>' var_g = 'pigs' var_h = 'chickens' var_i = '<' list_b= [] if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_j = 1 var_k = list_c[var_j-1] print(var_k)
Geometry
I used several wires to make a cube with a volume of 3375 cubic centimeters (cm3). Find the length of wires used to make it.
180
3375 1/3 [OP_POW] 12 [OP_MUL]
var_a = 3375 var_b = 0.3333333333333333 var_c = var_a ** var_b var_d = 12 var_e = var_c * var_d print(int(eval('{:.2f}'.format(round(var_e+1e-10,2)))))
Arithmetic calculation
I am trying to hang pictures with a width of 30 centimeters (cm) in a row on a bulletin board that is 3 meters (m) and 20 centimeters (cm) wide. How many centimeters (cm) should the distance between the board and the picture and the distance between the pictures be, if all six pictures are hung at the same distance?
20
3 100 [OP_MUL] 20 [OP_ADD] 30 6 [OP_MUL] [OP_SUB] 6 1 [OP_ADD] [OP_DIV]
var_a = 3 var_b = 100 var_c = var_a * var_b var_d = 20 var_e = var_c + var_d var_f = 30 var_g = 6 var_h = var_f * var_g var_i = var_e - var_h var_j = 6 var_k = 1 var_l = var_j + var_k var_m = var_i / var_l print(int(var_m))
Geometry
Find the minimum number of bricks required to make a cube by stacking bricks with a width of 18 centimeters (cm), a depth of 12 centimeters (cm), and a height of 9 cm (cm).
24
18 12 [OP_LCM] 9 [OP_LCM] 18 [OP_DIV] 18 12 [OP_LCM] 9 [OP_LCM] 12 [OP_DIV] 18 12 [OP_LCM] 9 [OP_LCM] 9 [OP_DIV] [OP_MUL] [OP_MUL]
var_a = 18 var_b = 12 var_c = var_b * var_a / math.gcd(int(var_b), int(var_a)) var_d = 9 var_e = var_d * var_c / math.gcd(int(var_d), int(var_c)) var_f = 18 var_g = var_e / var_f var_h = 18 var_i = 12 var_j = var_i * var_h / math.gcd(int(var_i), int(var_h)) var_k = 9 var_l = var_k * var_j / math.gcd(int(var_k), int(var_j)) var_m = 12 var_n = var_l / var_m var_o = 18 var_p = 12 var_q = var_p * var_o / math.gcd(int(var_p), int(var_o)) var_r = 9 var_s = var_r * var_q / math.gcd(int(var_r), int(var_q)) var_t = 9 var_u = var_s / var_t var_v = var_n * var_u var_w = var_g * var_v print(int(var_w))
Comparison
There are 168 pieces of red confetti and 173 pieces of yellow confetti. Which color of confetti do you have more?
yellow
[OP_LIST_SOL] red yellow [OP_LIST_EOL] [OP_LIST_SOL] 168 173 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'red' var_b = 'yellow' 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 = 168 var_d = 173 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)
Correspondence
7/12 of a certain number is 42. What is a value of 4 less than 11/18 of this number?
40
42 1 7/12 [OP_DIV] [OP_MUL] 11/18 [OP_MUL] 4 [OP_SUB]
var_a = 42 var_b = 1 var_c = 0.5833333333333334 var_d = var_b / var_c var_e = var_a * var_d var_f = 0.6111111111111112 var_g = var_e * var_f var_h = 4 var_i = var_g - var_h print(int(var_i))
Geometry
There is a figure with 9 sides with each side length of 2 centimeters (cm). What is the perimeter of this shape in centimeters (cm)?
18
2 9 [OP_MUL]
var_a = 2 var_b = 9 var_c = var_a * var_b print(int(var_c))
Arithmetic calculation
Jimin moved at 60 kilometers (km) per hour for two hours. If the destination is 300 kilometers (km) away, how far does Jimin have to go?
180
300 60 2 [OP_MUL] [OP_SUB]
var_a = 300 var_b = 60 var_c = 2 var_d = var_b * var_c var_e = var_a - var_d print(int(var_e))
Geometry
You have a rectangle with a length of 15 centimeters (cm) and a width of 0.9 of its length. Find the area of this rectangle in square centimeters (cm2).
202.5
15 15 0.9 [OP_MUL] [OP_MUL]
var_a = 15 var_b = 15 var_c = 0.9 var_d = var_b * var_c var_e = var_a * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
Find the smallest five-digit number that is divided into 2, 3, or 5.
10020
10000 10000 10 [OP_MUL] 1 [OP_SUB] 1 [OP_LIST_ARANGE] 2 [OP_LIST_DIVISIBLE] 3 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN]
var_a = 10000 var_b = 10000 var_c = 10 var_d = var_b * var_c var_e = 1 var_f = var_d - var_e var_g = 1 list_a = [i for i in range(var_a, var_f + 1, var_g)] var_h = 2 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 = 3 list_c = [] var_i = int(var_i) for i in list_b: i = int(i) if i % var_i == 0: list_c.append(i) var_j = 5 list_d = [] var_j = int(var_j) for i in list_c: i = int(i) if i % var_j == 0: list_d.append(i) var_k = 1 list_e=list_d.copy() list_e.sort() var_l = list_e[var_k-1] print(int(var_l))
Arithmetic calculation
To make one ribbon, you need 4 meters (m) of string. If Jimin bought 105.8 meters (m) of string, make as many ribbons as possible and find the length of the remaining string.
1.8
105.8 4 [OP_MOD]
var_a = 105.8 var_b = 4 var_c = var_a % var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Geometry
How many centimeters (cm) will be the length of a 49 centimeters (cm) wire if it is divided into 7 equal parts?
7
49 7 [OP_DIV]
var_a = 49 var_b = 7 var_c = var_a / var_b print(int(var_c))
Geometry
There are aliens with cube-shaped heads. The surface area of this alien's head is 150 square centimeters (cm2). Find the volume of the head.
125
150 6 [OP_DIV] 1/2 [OP_POW] 3 [OP_POW]
var_a = 150 var_b = 6 var_c = var_a / var_b var_d = 0.5 var_e = var_c ** var_d var_f = 3 var_g = var_e ** var_f print(int(var_g))
Geometry
A triangle has a total of 3 vertices. If two of these vertices are selected and the segment connected is a triangle with a length of 8 centimeters (cm) and an area of 24 square centimeters (cm2), how many centimeters is the distance between the unselected vertex and the segment formed by the selected vertex.
6
24 2 [OP_MUL] 8 [OP_DIV]
var_a = 24 var_b = 2 var_c = var_a * var_b var_d = 8 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
There are five numbers 10, 11, 12, 13, and 14. What is the sum of the smallest number and the next smallest number?
21
[OP_LIST_SOL] 10 11 12 13 14 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_ADD]
var_a = 10 var_b = 11 var_c = 12 var_d = 13 var_e = 14 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] var_h = 2 list_c=list_a.copy() list_c.sort() var_i = list_c[var_h-1] var_j = var_g + var_i print(int(var_j))
Correspondence
There are different numbers A, B, C, and D. Find the sum of A, B, C, and D in the four-digit addition formula DCBA+ABCD=ABCD0.
18
[OP_LIST_SOL] DCBA+ABCD=ABCD0 A [OP_DIGIT_UNK_SOLVER] DCBA+ABCD=ABCD0 B [OP_DIGIT_UNK_SOLVER] DCBA+ABCD=ABCD0 C [OP_DIGIT_UNK_SOLVER] DCBA+ABCD=ABCD0 D [OP_DIGIT_UNK_SOLVER] [OP_LIST_EOL] [OP_LIST_SUM]
var_a = 'DCBA+ABCD=ABCD0' 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 = 'DCBA+ABCD=ABCD0' 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 = 'DCBA+ABCD=ABCD0' var_h = 'C' ans_dict = dict() var_g = var_g.replace('×','*') var_g = var_g.replace('x','*') var_g = var_g.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_g): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_g 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_g): 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_i = ans_dict[var_h] var_j = 'DCBA+ABCD=ABCD0' var_k = 'D' ans_dict = dict() var_j = var_j.replace('×','*') var_j = var_j.replace('x','*') var_j = var_j.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_j): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_j 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_j): 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_l = ans_dict[var_k] list_a= [] if "/" in str(var_l): var_l = eval(str(var_l)) list_a.append(var_l) if "/" in str(var_i): var_i = eval(str(var_i)) list_a.append(var_i) if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) list_a.reverse() list_a = [float(i) for i in list_a] var_m = sum(list_a) print(int(var_m))
Arithmetic calculation
The sum of three consecutive even numbers is 18 greater than the smallest even number among those three. What is the largest one among the 3 even numbers?
10
18 2 1 [OP_MUL] 2 2 [OP_MUL] [OP_ADD] [OP_SUB] 3 1 [OP_SUB] [OP_DIV] 2 2 [OP_MUL] [OP_ADD]
var_a = 18 var_b = 2 var_c = 1 var_d = var_b * var_c var_e = 2 var_f = 2 var_g = var_e * var_f var_h = var_d + var_g var_i = var_a - var_h var_j = 3 var_k = 1 var_l = var_j - var_k var_m = var_i / var_l var_n = 2 var_o = 2 var_p = var_n * var_o var_q = var_m + var_p print(int(var_q))
Possibility
Using 3 of 4, 5, 8, and 9, what is the second smallest number whose units digit is 5?
495
[OP_LIST_SOL] 4 5 8 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 5 [OP_LIST_SEARCH_FIXED_DIGIT] 2 [OP_LIST_MIN]
var_a = 4 var_b = 5 var_c = 8 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 = 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 = 5 list_c = [] var_f = int(var_f) var_g = int(var_g) for i in list_b: i = int(i) if (i//var_f)%10 == var_g: list_c.append(i) var_h = 2 list_d=list_c.copy() list_d.sort() var_i = list_d[var_h-1] print(int(var_i))
Geometry
If you draw a line bisector of the vertex angle of an isosceles triangle, the length of the each divided base is 4 meters (m). How many meters (m) is the total length of the base?
8
4 2 [OP_MUL]
var_a = 4 var_b = 2 var_c = var_a * var_b print(int(var_c))
Possibility
Write the 5th smallest number among three-digit numbers that can be made by drawing three different numbers from 2, 7, 0, and 9.
290
[OP_LIST_SOL] 2 7 0 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 5 [OP_LIST_MIN]
var_a = 2 var_b = 7 var_c = 0 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 = 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 = 5 list_c=list_b.copy() list_c.sort() var_g = list_c[var_f-1] print(int(var_g))
Correspondence
Yein wrapped three presents with ribbon. She used 1/2 of the total ribbon to wrap the first present, 1/3 of the remaining ribbon to wrap the second present, and 1/2 of the remaining ribbon to wrap the third present, leaving 250 centimeters (cm). How much ribbon did Yein have at first?
1500
250 1 1/2 [OP_SUB] [OP_DIV] 1 1/3 [OP_SUB] [OP_DIV] 1 1/2 [OP_SUB] [OP_DIV]
var_a = 250 var_b = 1 var_c = 0.5 var_d = var_b - var_c var_e = var_a / var_d var_f = 1 var_g = 0.3333333333333333 var_h = var_f - var_g var_i = var_e / var_h var_j = 1 var_k = 0.5 var_l = var_j - var_k var_m = var_i / var_l print(int(eval('{:.2f}'.format(round(var_m+1e-10,2)))))
Arithmetic calculation
You have a stick that is 28 meters (m) long. How many slices can you get if you cut this stick by 1.12 meters (m) each?
25
28 1.12 [OP_DIV] 1 [OP_CEIL]
var_a = 28 var_b = 1.12 var_c = var_a / var_b var_d = 1 var_e=int(((var_c+9*10**(var_d-2))//(10**(var_d-1)))*10**(var_d-1)) print(int(var_e))
Arithmetic calculation
The weight of a full bottle of sesame oil is 3.4 kilograms (kg). If the weight of the bottle after using 1/5 of the sesame oil is 2.98 kilograms (kg), find the weight of the empty bottle in kilograms (kg).
1.3
3.4 3.4 2.98 [OP_SUB] 1/5 [OP_DIV] [OP_SUB]
var_a = 3.4 var_b = 3.4 var_c = 2.98 var_d = var_b - var_c var_e = 0.2 var_f = var_d / var_e var_g = var_a - var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Comparison
The rectangle is 11 centimeters (cm) wide and 8 centimeters (cm) long. The base and the height of a parallelogram are 12 centimeters (cm) and 7 centimeters (cm), respectively. Which shape has the largest area?
rectangle
[OP_LIST_SOL] rectangle parallelogram [OP_LIST_EOL] [OP_LIST_SOL] 11 8 [OP_MUL] 12 7 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'rectangle' var_b = 'parallelogram' 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 = 11 var_d = 8 var_e = var_c * var_d var_f = 12 var_g = 7 var_h = var_f * var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Arithmetic calculation
Among the students in Eunji's class, there are 24 students who can play musical instrument (a), and 8 of them are said to be able to play instrument (b) as well. If not a single student can play both (a) and (b), and 17 students can play instrument (b), how many students are there in Eunji's class?
33
24 17 [OP_ADD] 8 [OP_SUB]
var_a = 24 var_b = 17 var_c = var_a + var_b var_d = 8 var_e = var_c - var_d print(int(var_e))
Possibility
When you remove one of the cards from 7, 6, 2, and 0 and use all remaining cards to make a three-digit number, find the sum of the third largest number and the third smallest number.
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))
Arithmetic calculation
Yoochan walks 0.75 meters (m) in one step. If Yoochan walks straight for 13 minutes at 70 steps per minute, find how many meters (m) the current location of Yoochan is from the first 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)))
Correspondence
There are four numbers A, B, C, and D. Find the value of A+B-C+D in the four-digit subtraction formula A05B-1C04=30D8.
10
A05B-1C04=30D8 A [OP_DIGIT_UNK_SOLVER] A05B-1C04=30D8 B [OP_DIGIT_UNK_SOLVER] [OP_ADD] A05B-1C04=30D8 C [OP_DIGIT_UNK_SOLVER] [OP_SUB] A05B-1C04=30D8 D [OP_DIGIT_UNK_SOLVER] [OP_ADD]
var_a = 'A05B-1C04=30D8' 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 = 'A05B-1C04=30D8' 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 var_h = 'A05B-1C04=30D8' var_i = 'C' ans_dict = dict() var_h = var_h.replace('×','*') var_h = var_h.replace('x','*') var_h = var_h.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_h): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_h 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_h): 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_j = ans_dict[var_i] var_k = var_g - var_j var_l = 'A05B-1C04=30D8' var_m = 'D' ans_dict = dict() var_l = var_l.replace('×','*') var_l = var_l.replace('x','*') var_l = var_l.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_l): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_l 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_l): 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_n = ans_dict[var_m] var_o = var_k + var_n print(int(var_o))
Arithmetic calculation
If you add the allowance of Yul-gi and Ga-yeong have, you get 6,000 won. If you subtract the difference between their allowance from the sum of their allowance, you get 4,800 won. If Yul-gi's allowance is more than Ga-yeong's, find out how much Yul-gi's allowance is.
3600
6000 4800 2 [OP_DIV] [OP_SUB]
var_a = 6000 var_b = 4800 var_c = 2 var_d = var_b / var_c var_e = var_a - var_d print(int(var_e))
Arithmetic calculation
A certain number multiplied by 7 minus 6 minus 12 equals the number multiplied by 4. Find the certain number.
6
12 6 [OP_ADD] 7 4 [OP_SUB] [OP_DIV]
var_a = 12 var_b = 6 var_c = var_a + var_b var_d = 7 var_e = 4 var_f = var_d - var_e var_g = var_c / var_f print(int(var_g))
Arithmetic calculation
Minyoung has 9 dogs, 3 cats, and 5 rabbits, and Yoojeong has 2 more animals than Minyoung. If Yoojeong has 7 dogs and 2 fewer cats than rabbits, how many rabbits does Yoojeong have?
7
9 3 [OP_ADD] 5 [OP_ADD] 2 [OP_ADD] 7 [OP_SUB] 2 [OP_DIV] 1 [OP_ADD]
var_a = 9 var_b = 3 var_c = var_a + var_b var_d = 5 var_e = var_c + var_d var_f = 2 var_g = var_e + var_f var_h = 7 var_i = var_g - var_h var_j = 2 var_k = var_i / var_j var_l = 1 var_m = var_k + var_l print(int(var_m))
Geometry
The rectangular ranch fence has a perimeter of 30 meters (m), and the length of the fence is twice its width. What is the length of the fence in meters (m)?
10
30 2 2 1 [OP_ADD] [OP_MUL] [OP_DIV] 2 [OP_MUL]
var_a = 30 var_b = 2 var_c = 2 var_d = 1 var_e = var_c + var_d var_f = var_b * var_e var_g = var_a / var_f var_h = 2 var_i = var_g * var_h print(int(var_i))
Arithmetic calculation
Find the second largest aliquot of 32.
16
32 [OP_LIST_GET_DIVISOR] 2 [OP_LIST_MAX]
var_a = 32 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 = 2 list_b=list_a.copy() list_b.sort() var_c = list_b[-var_b] print(int(var_c))
Correspondence
There is a four-digit number 571A which is greater than 5716. How many digits can you put in A?
6
571A [OP_GEN_POSSIBLE_LIST] 5716 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = '571A' 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 = 5716 list_b = [] for i in list_a: if i < var_b: list_b.append(i) var_c = len(list_b) print(int(var_c))
Possibility
Round down the largest four-digit number you can make using four cards 7, 9, 3, and 6 only once each to the nearest tenth.
9760
[OP_LIST_SOL] 7 9 3 6 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 2 [OP_FLOOR]
var_a = 7 var_b = 9 var_c = 3 var_d = 6 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 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 = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] var_h = 2 var_i=int((var_g//(10**(var_h-1)))*10**(var_h-1)) print(int(var_i))
Arithmetic calculation
Among the three-digit natural numbers formed by using the three natural numbers 1, 6, and 8, what is the third number when arranged in ascending order?
681
[OP_LIST_SOL] 1 6 8 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 3 [OP_LIST_MAX]
var_a = 1 var_b = 6 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 = len(list_a) 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=list_b.copy() list_c.sort() var_f = list_c[-var_e] print(int(var_f))
Correspondence
After Jungkook walked 3 kilometers (km) and 7 meters (m), he walked a few more meters (m). After a break, he took a walk for 840 meters (m), and it turned out that he walked 6 kilometers (km) and 30 meters (m) in total. How many meters (m) did Jungkook walk before the break?
2183
6 1000 [OP_MUL] 30 [OP_ADD] 840 [OP_SUB] 3 1000 [OP_MUL] 7 [OP_ADD] [OP_SUB]
var_a = 6 var_b = 1000 var_c = var_a * var_b var_d = 30 var_e = var_c + var_d var_f = 840 var_g = var_e - var_f var_h = 3 var_i = 1000 var_j = var_h * var_i var_k = 7 var_l = var_j + var_k var_m = var_g - var_l print(int(var_m))
Arithmetic calculation
What is the sum of all natural numbers greater than 28 and less than or equal to 31?
90
28 1 [OP_ADD] 31 1 [OP_LIST_ARANGE] [OP_LIST_SUM]
var_a = 28 var_b = 1 var_c = var_a + var_b var_d = 31 var_e = 1 list_a = [i for i in range(var_c, var_d + 1, var_e)] list_a = [float(i) for i in list_a] var_f = sum(list_a) print(int(var_f))
Comparison
There are a total of 4 numbers: 0.8, 1/2, 0.5, 1/3. How many of these numbers are less than 3?
4
[OP_LIST_SOL] 0.8 1/2 0.5 1/3 [OP_LIST_EOL] 3 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = 0.8 var_b = 0.5 var_c = 0.5 var_d = 0.3333333333333333 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 list_b = [] for i in list_a: if i < var_e: list_b.append(i) var_f = len(list_b) print(int(var_f))
Geometry
The perimeter of the eastern lake has 96 trees at 10m (m) intervals, and the perimeter of the western lake has 82 trees at 20 m (m) intervals. What is the difference between the circumferences of the two lakes in meters (m)?
680
10 96 [OP_MUL] 20 82 [OP_MUL] [OP_SUB] [OP_ABS]
var_a = 10 var_b = 96 var_c = var_a * var_b var_d = 20 var_e = 82 var_f = var_d * var_e var_g = var_c - var_f var_h = abs(var_g) print(int(var_h))
Arithmetic calculation
When the box containing 10 cups was weighed, it was 3.1 kg (kg). When you removed one cup from this box, its weight changed to 2.81 kilograms (kg). Find the weight of the empty box in kilograms (kg).
0.2
3.1 3.1 2.81 [OP_SUB] 10 [OP_MUL] [OP_SUB]
var_a = 3.1 var_b = 3.1 var_c = 2.81 var_d = var_b - var_c var_e = 10 var_f = var_d * var_e var_g = var_a - var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Arithmetic calculation
What is the sum of the second largest and second smallest odd numbers from 1 to 15?
16
1 15 [OP_LIST_ODD] 2 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_ADD]
var_a = 1 var_b = 15 list_a = [] if var_a%2==0: for i in range(var_a+1, var_b+1, 2): list_a.append(i) else: for i in range(var_a, var_b+1, 2): list_a.append(i) var_c = 2 list_b=list_a.copy() list_b.sort() var_d = list_b[-var_c] var_e = 2 list_c=list_a.copy() list_c.sort() var_f = list_c[var_e-1] var_g = var_d + var_f print(int(var_g))
Correspondence
Ji-woo and Seunghye saw the same number, but Jiwoo shifted the decimal point of the number one space to the right by mistake. If the difference of the number Seunghye saw and the number Jiwoo saw is 37.35, what is the number that Seunghye saw?
4.15
37.35 9 [OP_DIV]
var_a = 37.35 var_b = 9 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Possibility
There are 4 different chairs. When two people want to sit down, in how many ways can they sit?
6
4 2 [OP_COMB]
var_a = 4 var_b = 2 var_c = 1 var_a = int(var_a) var_b = int(var_b) for i, elem in enumerate(range(var_b)): var_c = var_c * (var_a-i) for i, elem in enumerate(range(var_b)): var_c = var_c / (i+1) print(int(var_c))
Geometry
A rectangular room has sides with three different areas of 4 square centimetres (cm2) , 3 square centimetres (cm2) , and 6 square centimetres (cm2) , respectively. How many square tiles measuring 1 square centimetre (cm2) are needed to cover all the walls, floor, and ceiling of this room?
26
4 3 6 [OP_ADD] [OP_ADD] 2 [OP_MUL]
var_a = 4 var_b = 3 var_c = 6 var_d = var_b + var_c var_e = var_a + var_d var_f = 2 var_g = var_e * var_f print(int(var_g))
Correspondence
There are single-digit numbers A and B. If A56B made using these two is divisible by 36, how many numbers are there for A?
3
A56B [OP_GEN_POSSIBLE_LIST] 36 [OP_LIST_DIVISIBLE] A56B A [OP_LIST_FIND_UNK] [OP_LIST_LEN]
var_a = 'A56B' 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 = 36 list_b = [] var_b = int(var_b) for i in list_a: i = int(i) if i % var_b == 0: list_b.append(i) var_c = 'A56B' var_d = 'A' var_c = str(var_c) var_d = str(var_d) unk_idx = var_c.index(var_d) list_c = [] for elem in list_b: elem = str(elem) list_c.append(int(elem[unk_idx])) list_c = list(set(list_c)) var_e = len(list_c) print(int(var_e))
Arithmetic calculation
There are five numbers 10, 11, 12, 13, and 14. What is the remainder of the largest number divided by the next largest number?
1
[OP_LIST_SOL] 10 11 12 13 14 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MAX] [OP_MOD]
var_a = 10 var_b = 11 var_c = 12 var_d = 13 var_e = 14 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] var_h = 2 list_c=list_a.copy() list_c.sort() var_i = list_c[-var_h] var_j = var_g % var_i print(int(var_j))
Geometry
A cuboid has a volume of 28 cubic centimeters (cm3) and a height of 4 centimeters (cm). What is the area of the base?
7
28 4 [OP_DIV]
var_a = 28 var_b = 4 var_c = var_a / var_b print(int(var_c))
Arithmetic calculation
Minji drank 0.26 liters (L) of water in the morning and 0.37 liters (L) in the afternoon. How many liters (L) of water did Minji drink today?
0.63
0.26 0.37 [OP_ADD]
var_a = 0.26 var_b = 0.37 var_c = var_a + var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
When 14A+2B3=418, what number should go in A?
5
14A+2B3=418 A [OP_DIGIT_UNK_SOLVER]
var_a = '14A+2B3=418' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Correspondence
A number must be divided by 8, but when you accidentally divide it by 7, the quotient is 12 and the remainder is 5. Find what the quotient would be if calculated correctly.
11
12 7 [OP_MUL] 5 [OP_ADD] 8 [OP_FDIV]
var_a = 12 var_b = 7 var_c = var_a * var_b var_d = 5 var_e = var_c + var_d var_f = 8 var_g = var_e // var_f print(int(var_g))
Arithmetic calculation
When 52.5 kg (kg) of sweet potato is divided by 5 kg (kg) per person, find how many grams (g) of sweet potato are left after sharing.
2500
52.5 5 [OP_MOD] 1000 [OP_MUL]
var_a = 52.5 var_b = 5 var_c = var_a % var_b var_d = 1000 var_e = var_c * var_d print(int(var_e))
Comparison
In the line, Seokjin stands 8th from the front and 6th from the back. Find the total number of students standing in the line.
13
8 6 [OP_ADD] 1 [OP_SUB]
var_a = 8 var_b = 6 var_c = var_a + var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Correspondence
When you should multiply a number by 16 and add 8, you mistakenly divide it by 16 and the quotient is divided by 8. Find the correct calculated value.
2056
8 16 [OP_MUL] 16 [OP_MUL] 8 [OP_ADD]
var_a = 8 var_b = 16 var_c = var_a * var_b var_d = 16 var_e = var_c * var_d var_f = 8 var_g = var_e + var_f print(int(var_g))
Geometry
I made a rectangle by arranging 4 Go stones horizontally on each row and 8 vertically on each column. How many Go stones are at the perimeter?
20
4 8 [OP_ADD] 2 [OP_MUL] 4 [OP_SUB]
var_a = 4 var_b = 8 var_c = var_a + var_b var_d = 2 var_e = var_c * var_d var_f = 4 var_g = var_e - var_f print(int(var_g))
Correspondence
I made a mistake and added 7/5 to this particular number, when I had to subtract 7/5 from this number and then multiply it by 5, and it became 81/20. Find the rightly calculated value.
6.25
81/20 7/5 [OP_SUB] 7/5 [OP_SUB] 5 [OP_MUL]
var_a = 4.05 var_b = 1.4 var_c = var_a - var_b var_d = 1.4 var_e = var_c - var_d var_f = 5 var_g = var_e * var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Arithmetic calculation
Find the sum of the largest and smallest three-digit numbers whose hundreds digit is 4 and whose tens digit is 8.
969
[OP_LIST_SOL] 4 8 A [OP_LIST_EOL] [OP_LIST2NUM] [OP_GEN_POSSIBLE_LIST] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD]
var_a = 4 var_b = 8 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 = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] var_g = 1 list_d=list_b.copy() list_d.sort() var_h = list_d[var_g-1] var_i = var_f + var_h print(int(var_i))
Geometry
A rectangular parallelepiped is 9 centimeters (cm) wide and 7 centimeters (cm) long. If the volume is 315 square centimeters (cm2), how many centimeters (cm) is the height of this cuboid?
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))
Possibility
You are trying to find the case of choosing two different fruits. There are fruits including apples, peaches, pears, melons, and tangerines. How many cases are available?
10
[OP_LIST_SOL] apples peaches pears melons tangerines [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_COMB]
var_a = 'apples' var_b = 'peaches' var_c = 'pears' var_d = 'melons' var_e = 'tangerines' 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) for i, elem in enumerate(range(var_g)): var_h = var_h / (i+1) print(int(var_h))
Arithmetic calculation
In a toy factory, machine A makes 288 toys in 12 days, and machine B makes 243 toys in 9 days. Find the difference between the number of toys made per day by the two machines.
3
288 12 [OP_DIV] 243 9 [OP_DIV] [OP_SUB] [OP_ABS]
var_a = 288 var_b = 12 var_c = var_a / var_b var_d = 243 var_e = 9 var_f = var_d / var_e var_g = var_c - var_f var_h = abs(var_g) print(int(var_h))
Arithmetic calculation
A basket full of persimmons of the same size and weight weighed 62 kilograms (kg). After removing half of the persimmons, I weighed them together with the basket and found that they weighed 34 kilograms (kg). What is the weight of the basket without the persimmons?
6
62 62 34 [OP_SUB] 2 [OP_MUL] [OP_SUB]
var_a = 62 var_b = 62 var_c = 34 var_d = var_b - var_c var_e = 2 var_f = var_d * var_e var_g = var_a - var_f print(int(var_g))
Geometry
During the origami class, Donggeon folded the paper in a triangular shape with a base of 3 centimeters (cm) and a height of 2 centimeters (cm), and Jihye folded the paper in a triangular shape with a base of 3 centimeters (cm) and a height of 6.02 centimeters (cm). How many times the area of the triangle folded by Jihye is the area of the triangle folded by Donggeon?
3.01
3 6.02 [OP_MUL] 2 [OP_DIV] 3 2 [OP_MUL] 2 [OP_DIV] [OP_DIV]
var_a = 3 var_b = 6.02 var_c = var_a * var_b var_d = 2 var_e = var_c / var_d var_f = 3 var_g = 2 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)))
Correspondence
8050 multiplied by a number gives 80.5. What number is it?
0.01
80.5 8050 [OP_DIV]
var_a = 80.5 var_b = 8050 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Geometry
There is a rectangular notebook with a width to height ratio of 7:5. If the perimeter of this notebook is 48 centimeters (cm), what is the area in square centimeters (cm2) of this notebook?
140
48 2 [OP_DIV] 7 [OP_MUL] 7 5 [OP_ADD] [OP_DIV] 48 2 [OP_DIV] 5 [OP_MUL] 7 5 [OP_ADD] [OP_DIV] [OP_MUL]
var_a = 48 var_b = 2 var_c = var_a / var_b var_d = 7 var_e = var_c * var_d var_f = 7 var_g = 5 var_h = var_f + var_g var_i = var_e / var_h var_j = 48 var_k = 2 var_l = var_j / var_k var_m = 5 var_n = var_l * var_m var_o = 7 var_p = 5 var_q = var_o + var_p var_r = var_n / var_q var_s = var_i * var_r print(int(var_s))
Arithmetic calculation
There are 240 kilograms (kg) of apples in the market, and there are three times as many pears as apples. How many kilograms (kg) are there in both apples and pears?
960
240 240 3 [OP_MUL] [OP_ADD]
var_a = 240 var_b = 240 var_c = 3 var_d = var_b * var_c var_e = var_a + var_d print(int(var_e))
Correspondence
When 10-A=6, find the number that must be in A.
4
10-A=6 A [OP_DIGIT_UNK_SOLVER]
var_a = '10-A=6' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Correspondence
What number divided by 10 gives 12?
120
12 10 [OP_MUL]
var_a = 12 var_b = 10 var_c = var_a * var_b print(int(var_c))
Correspondence
There are different numbers A, B, C and D. In the case of A+C=15, A-B=1, C+C=A and B-D=2, get D.
7
C+C+C=15 C [OP_NUM_UNK_SOLVER] 2 [OP_MUL] 1 [OP_SUB] 2 [OP_SUB]
var_a = 'C+C+C=15' var_b = 'C' 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] = 0 candidate_num = [i for i in range(51)] candi = list(itertools.product(candidate_num, repeat=len(ans_dict))) for c in candi: temp = var_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] = int(c[i]) var_c = ans_dict[var_b] var_d = 2 var_e = var_c * var_d var_f = 1 var_g = var_e - var_f var_h = 2 var_i = var_g - var_h print(int(var_i))
Geometry
There is a flower garden in the shape of a circle. Assume the pi as 3 and the radius of the flower garden is 0.6 meters (m), how many square meters (m2) is the area of the flower garden?
1.08
3 0.6 2 [OP_POW] [OP_MUL]
var_a = 3 var_b = 0.6 var_c = 2 var_d = var_b ** var_c var_e = var_a * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
Machine A alone takes 10 hours to complete the job, and machine B takes 15 hours to complete the job alone. How many hours would it take for A and B to do this at the same time?
6
1 1 10 [OP_DIV] 1 15 [OP_DIV] [OP_ADD] [OP_DIV]
var_a = 1 var_b = 1 var_c = 10 var_d = var_b / var_c var_e = 1 var_f = 15 var_g = var_e / var_f var_h = var_d + var_g var_i = var_a / var_h print(int(eval('{:.2f}'.format(round(var_i+1e-10,2)))))
Arithmetic calculation
There are three numbers 10, 11 and 12. What is the sum of the largest number and the next largest number?
23
[OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MAX] [OP_ADD]
var_a = 10 var_b = 11 var_c = 12 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 1 list_b=list_a.copy() list_b.sort() var_e = list_b[-var_d] var_f = 2 list_c=list_a.copy() list_c.sort() var_g = list_c[-var_f] var_h = var_e + var_g print(int(var_h))