category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Correspondence
63 is the result of mistakely adding 44 and subtracting 39 when you actually have to add 39 to this certain number and subtract 44. Find the result of the correct calculation.
53
63 44 [OP_SUB] 39 [OP_ADD] 39 [OP_ADD] 44 [OP_SUB]
var_a = 63 var_b = 44 var_c = var_a - var_b var_d = 39 var_e = var_c + var_d var_f = 39 var_g = var_e + var_f var_h = 44 var_i = var_g - var_h print(int(var_i))
Possibility
You want to create a three-digit number by selecting three out of 5, 6, 4, and 7 and using them only once. Find the sum of the digits of the largest possible number.
18
[OP_LIST_SOL] 5 6 4 7 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] [OP_NUM2LIST] [OP_LIST_SUM]
var_a = 5 var_b = 6 var_c = 4 var_d = 7 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] list_d = [] var_g = int(var_g) while var_g//10 > 0: list_d.append(var_g%10) var_g = var_g//10 list_d.append(var_g%10) list_d = list_d[::-1] list_d = [float(i) for i in list_d] var_h = sum(list_d) print(int(var_h))
Comparison
Yoongi has 4, and Jungkook has a number that is the quotient of 6 divided by 3. Who has the bigger number?
Yoongi
[OP_LIST_SOL] Yoongi Jungkook [OP_LIST_EOL] [OP_LIST_SOL] 4 6 3 [OP_FDIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yoongi' var_b = 'Jungkook' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 4 var_d = 6 var_e = 3 var_f = var_d // var_e list_b= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_c): var_c = eval(str(var_c)) list_b.append(var_c) list_b.reverse() var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Arithmetic calculation
If the amount of gasoline in the oil canister is 13 milliliters (ml) lighter than 54 liters (L), what is the amount of gasoline in the oil canister in liters (L)?
53.99
54 13 1000 [OP_DIV] [OP_SUB]
var_a = 54 var_b = 13 var_c = 1000 var_d = var_b / var_c var_e = var_a - var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Possibility
If you can make a number with two decimal digits that is made by using the numbers 3, 8, 2, and 7 once, write the third smallest number.
27.38
[OP_LIST_SOL] 3 8 2 7 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 3 [OP_LIST_MIN] 10 [OP_LIST_POP] [OP_LIST_LEN] 2 [OP_SUB] [OP_POW] [OP_DIV]
var_a = 3 var_b = 8 var_c = 2 var_d = 7 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 = 3 list_c=list_b.copy() list_c.sort() var_g = list_c[var_f-1] var_h = 10 var_i = len(list_a) var_j = 2 var_k = var_i - var_j var_l = var_h ** var_k var_m = var_g / var_l print('{:.2f}'.format(round(var_m+1e-10,2)))
Arithmetic calculation
There are five numbers 10, 11, 12, 13, and 14. What is the quotient 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_FDIV]
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))
Possibility
Find the smallest number that can be made by using all the number cards 0, 2, 4, 6, 8 and 9 only once.
204689
[OP_LIST_SOL] 0 2 4 6 8 9 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 1 [OP_LIST_MIN]
var_a = 0 var_b = 2 var_c = 4 var_d = 6 var_e = 8 var_f = 9 list_a= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_g = len(list_a) list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_g)) 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_h = 1 list_c=list_b.copy() list_c.sort() var_i = list_c[var_h-1] print(int(var_i))
Possibility
How many two-digit numbers are there which are made up of 1 and 4 and, when flipped, become other numbers?
2
[OP_LIST_SOL] 1 4 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 1 var_b = 4 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 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_c)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_d = len(list_b) print(int(var_d))
Comparison
Hoseok had 576 marbles, and Yoongi had 352. If Hoseok gives Yoongi 100 marbles, who has more marbles?
Hoseok
[OP_LIST_SOL] Hoseok Yoongi [OP_LIST_EOL] [OP_LIST_SOL] 576 100 [OP_SUB] 352 100 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Hoseok' var_b = 'Yoongi' 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 = 576 var_d = 100 var_e = var_c - var_d var_f = 352 var_g = 100 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
Miae made a square with a side of 20 centimeters (cm) using wire. Using a wire of the same length as this one, Taehee made a rectangle wide 14 centimeters (cm). How many centimeters (cm) is the length of the rectangle Taehee made?
26
20 4 [OP_MUL] 2 [OP_DIV] 14 [OP_SUB]
var_a = 20 var_b = 4 var_c = var_a * var_b var_d = 2 var_e = var_c / var_d var_f = 14 var_g = var_e - var_f print(int(var_g))
Arithmetic calculation
A barrel contains 12 liters (L) and 400 milliliters (㎖) of petroleum, and B barrel contains 7600 milliliters (㎖) of petroleum. How many liters (L) must be moved from A barrel to B barrel to equalize the amount of petroleum in A barrel and B barrel?
2.4
12 400 1000 [OP_DIV] [OP_ADD] 7600 1000 [OP_DIV] [OP_SUB] 2 [OP_DIV]
var_a = 12 var_b = 400 var_c = 1000 var_d = var_b / var_c var_e = var_a + var_d var_f = 7600 var_g = 1000 var_h = var_f / var_g var_i = var_e - var_h var_j = 2 var_k = var_i / var_j print('{:.2f}'.format(round(var_k+1e-10,2)))
Arithmetic calculation
Taehyung is trying to divide 21/11 liters (L) of water into 7/11 liters (L) per cup, and Hoseok is trying to divide 8/17 liters (L) of water into 2/17 liters (L) per cup. How many cups will Taehyung and Hoseok need in order to divide all the water they each have into the cups?
7
21/11 7/11 [OP_DIV] 1 [OP_CEIL] 8/17 2/17 [OP_DIV] 1 [OP_CEIL] [OP_ADD]
var_a = 1.9090909090909092 var_b = 0.6363636363636364 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)) var_f = 0.47058823529411764 var_g = 0.11764705882352941 var_h = var_f / var_g var_i = 1 var_j=int(((var_h+9*10**(var_i-2))//(10**(var_i-1)))*10**(var_i-1)) var_k = var_e + var_j print(int(var_k))
Arithmetic calculation
There were 3 kilograms (kg) and 300 grams (g) of strawberries. Among them, I gave 1 kilogram (kg) 900 grams (g) to a friend. How many grams (g) of strawberries are left?
1400
3 1000 [OP_MUL] 300 [OP_ADD] 1 1000 [OP_MUL] 900 [OP_ADD] [OP_SUB]
var_a = 3 var_b = 1000 var_c = var_a * var_b var_d = 300 var_e = var_c + var_d var_f = 1 var_g = 1000 var_h = var_f * var_g var_i = 900 var_j = var_h + var_i var_k = var_e - var_j print(int(var_k))
Comparison
The three students, Yoongi, Jungkook and Yuna, have the numbers 7, 6, and 9 respectively. Who has the smallest number?
Jungkook
[OP_LIST_SOL] Yoongi Jungkook Yuna [OP_LIST_EOL] [OP_LIST_SOL] 7 6 9 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yoongi' var_b = 'Jungkook' var_c = 'Yuna' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 7 var_e = 6 var_f = 9 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) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) 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)
Arithmetic calculation
Suppose that street trees are planted on the road that is 2575 meters (m) long at intervals of 25 meters (m). How many street trees will be planted? (However, trees are also planted at the beginning and end of the road.)
104
2575 25 [OP_DIV] 1 [OP_ADD]
var_a = 2575 var_b = 25 var_c = var_a / var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Comparison
Jungkook, who had 6 apples, received 3 more. When Yoongi has 4 apples, who has fewer apples?
Yoongi
[OP_LIST_SOL] Jungkook Yoongi [OP_LIST_EOL] [OP_LIST_SOL] 6 3 [OP_ADD] 4 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jungkook' var_b = 'Yoongi' 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 = 6 var_d = 3 var_e = var_c + var_d var_f = 4 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-1] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Correspondence
When you divide a particular number by 10, you get 6. What number do you get when you subtract 15 from that particular number?
45
6 10 [OP_MUL] 15 [OP_SUB]
var_a = 6 var_b = 10 var_c = var_a * var_b var_d = 15 var_e = var_c - var_d print(int(var_e))
Comparison
Eunbi and Jaeyeon practiced running every day for five days. If Eunbi ran a total of 4.3 kilometers (km) for 5 days and Jaeyeon ran 900 meters (m) every day, find out who would have run more.
Jaeyeon
[OP_LIST_SOL] Eunbi Jaeyeon [OP_LIST_EOL] [OP_LIST_SOL] 4.3 1000 [OP_MUL] 900 5 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Eunbi' var_b = 'Jaeyeon' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 4.3 var_d = 1000 var_e = var_c * var_d var_f = 900 var_g = 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)
Correspondence
6A5+10B=748. What is A?
4
6A5+10B=748 A [OP_DIGIT_UNK_SOLVER]
var_a = '6A5+10B=748' 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))
Comparison
Prize winning numbers are 5 numbers. Their average is 81.6, and the average excluding the hightest number is 6 points smaller than the average excluding the lowest number. When the middle three numbers are 88, 84, and 76, find the highest number.
92
81.6 5 [OP_MUL] 88 84 [OP_ADD] 76 [OP_ADD] [OP_SUB] 6 4 [OP_MUL] [OP_ADD] 2 [OP_DIV]
var_a = 81.6 var_b = 5 var_c = var_a * var_b var_d = 88 var_e = 84 var_f = var_d + var_e var_g = 76 var_h = var_f + var_g var_i = var_c - var_h var_j = 6 var_k = 4 var_l = var_j * var_k var_m = var_i + var_l var_n = 2 var_o = var_m / var_n print(int(var_o))
Correspondence
If the six-digit number 7ABABA is a multiple of 6, find possible numbers that can be made.
15
7ABABA [OP_GEN_POSSIBLE_LIST] 6 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = '7ABABA' 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 = 6 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 = len(list_b) print(int(var_c))
Arithmetic calculation
It takes 4 days to process 240 kilograms (kg) of rice with the (A) machine. How many days does it take to process 1920 killograms (kg) of the same rice with the (A) machine?
32
1920 240 4 [OP_DIV] [OP_FDIV]
var_a = 1920 var_b = 240 var_c = 4 var_d = var_b / var_c var_e = var_a // var_d print(int(var_e))
Arithmetic calculation
Taehyung walks 114 meters (m) in 1 minute, and Minyoung walks 79 meters (m) in 1 minute. If Taehyung and Minyoung walk at the same pace for an hour, how many meters (m) will Taehyung walk more than Minyoung?
2100
114 79 [OP_SUB] 1 [OP_MUL] 60 [OP_MUL]
var_a = 114 var_b = 79 var_c = var_a - var_b var_d = 1 var_e = var_c * var_d var_f = 60 var_g = var_e * var_f print(int(var_g))
Arithmetic calculation
Yoongi's aunt is 38 years old. Yoongi is 23 years younger than his aunt. Hoseok is 4 years younger than Yoongi. What is the sum of Yoongi and Hoseok's ages?
26
38 23 [OP_SUB] 38 23 [OP_SUB] 4 [OP_SUB] [OP_ADD]
var_a = 38 var_b = 23 var_c = var_a - var_b var_d = 38 var_e = 23 var_f = var_d - var_e var_g = 4 var_h = var_f - var_g var_i = var_c + var_h print(int(var_i))
Possibility
I am trying to make a three-digit number by picking three different numbers. Given the numbers 1, 2, 6, 7, and 8, what is the difference between the largest number and the smallest number?
750
[OP_LIST_SOL] 1 2 6 7 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB]
var_a = 1 var_b = 2 var_c = 6 var_d = 7 var_e = 8 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] 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))
Geometry
You have a square with a perimeter of 17.8 centimeters (cm). How many centimeters (cm) is one side of this figure?
4.45
17.8 4 [OP_DIV]
var_a = 17.8 var_b = 4 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Comparison
There are 28 identical vending machines in the aisle. Each vending machine is full and has the same number of drinks, and I chose the drink in the 14th from the bottom, 20th from the top, 3rd from the right, and 2nd from the left, and drank it. Find the sum of the number of total drinks in vending machines in this aisle.
3696
14 20 [OP_ADD] 1 [OP_SUB] 3 2 [OP_ADD] 1 [OP_SUB] [OP_MUL] 28 [OP_MUL]
var_a = 14 var_b = 20 var_c = var_a + var_b var_d = 1 var_e = var_c - var_d var_f = 3 var_g = 2 var_h = var_f + var_g var_i = 1 var_j = var_h - var_i var_k = var_e * var_j var_l = 28 var_m = var_k * var_l print(int(var_m))
Comparison
Jimin, Yoongi, Taehyung, and Namjoon all live in the same apartment building. Taehyung's house is lower than Namjoon's, and Jimin's house is higher than Yoongi's. When Yoongi's is higher than Namjoon's, who lives on the lowest floor?
Taehyung
[OP_LIST_SOL] Jimin Yoongi Taehyung Namjoon [OP_LIST_EOL] [OP_LIST_SOL] Jimin Yoongi > Taehyung Namjoon < Yoongi Namjoon > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET]
var_a = 'Jimin' var_b = 'Yoongi' var_c = 'Taehyung' var_d = 'Namjoon' 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 = 'Jimin' var_f = 'Yoongi' var_g = '>' var_h = 'Taehyung' var_i = 'Namjoon' var_j = '<' var_k = 'Yoongi' var_l = 'Namjoon' 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 = len(list_c) var_o = list_c[var_n-1] print(var_o)
Correspondence
A5-2B=68 is said to be true. At this time, what number can go into A?
9
A5-2B=68 A [OP_DIGIT_UNK_SOLVER]
var_a = 'A5-2B=68' 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))
Arithmetic calculation
A computer requires 30 watts of electricity to run for one second. How many watts of electricity is required to run your computer for 25 seconds?
750
30 25 [OP_MUL]
var_a = 30 var_b = 25 var_c = var_a * var_b print(int(var_c))
Correspondence
Subtracting 477 from a number equals 273. How much is a number plus 273?
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))
Correspondence
The number of pencils is 6 times the number of notebooks. I distributed the notebooks to 6 people, and each person had 9 of them, and there was nothing left. Find the number of pencils.
324
9 6 [OP_MUL] 6 [OP_MUL]
var_a = 9 var_b = 6 var_c = var_a * var_b var_d = 6 var_e = var_c * var_d print(int(var_e))
Geometry
There is an octadecagon-shaped pattern. If you try to draw as many diagonal lines as you can on this pattern, how many can you draw?
135
18 18 3 [OP_SUB] [OP_MUL] 2 [OP_DIV]
var_a = 18 var_b = 18 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))
Possibility
Find the largest four-digit number consisting of 1, 5, 9, and 4.
9541
[OP_LIST_SOL] 1 4 9 5 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX]
var_a = 1 var_b = 4 var_c = 9 var_d = 5 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 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] print(int(var_g))
Correspondence
Seon-mi spends 1/2 of her money at the first store, 1/3 of her remaining money at the second store, and 1/2 of her remaining money at the third store, leaving her with 250 won. Find how much money Seon-mi had 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)))))
Correspondence
Subtracting 10 from AB equals 15. How much is A?
2
15 10 [OP_ADD] 10 [OP_FDIV]
var_a = 15 var_b = 10 var_c = var_a + var_b var_d = 10 var_e = var_c // var_d print(int(var_e))
Comparison
The distance from school to Taehyung's house and Jungkook's house is 106/45 kilometers (km) and 77/30 kilometers (km), respectively. Whose house is closer to the school?
Taehyung
[OP_LIST_SOL] Taehyung Jungkook [OP_LIST_EOL] [OP_LIST_SOL] 106/45 77/30 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Taehyung' var_b = 'Jungkook' 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.3555555555555556 var_d = 2.566666666666667 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-1] var_g = list_b.index(var_f)+1 var_h = list_a[var_g-1] print(var_h)
Arithmetic calculation
A 1000 milliliter (ml) bottle was full of milk, but the bottle cracked and milk leaked at a rate of 5 ml (ml) per minute. After a few minutes, if you look at the milk bottle and there are 300 milliliters (ml) of milk left, find how many minutes have passed.
140
1000 300 [OP_SUB] 5 [OP_DIV]
var_a = 1000 var_b = 300 var_c = var_a - var_b var_d = 5 var_e = var_c / var_d print(int(var_e))
Geometry
If the width and length of a cuboid are 30 centimeters (cm) and 22 centimeters (cm) respectively, and the sum of all edges is 224 centimeters (cm), how many centimeters (cm) is the height of this cuboid?
4
224 4 [OP_DIV] 30 [OP_SUB] 22 [OP_SUB]
var_a = 224 var_b = 4 var_c = var_a / var_b var_d = 30 var_e = var_c - var_d var_f = 22 var_g = var_e - var_f print(int(var_g))
Arithmetic calculation
58 flags were planted at equal intervals on both sides of the 191.8 meters (m) long road. If flags are planted at both the beginning and end of the road, find the distance between the flags in meters (m).
6.85
191.8 58 2 [OP_DIV] 1 [OP_SUB] [OP_DIV]
var_a = 191.8 var_b = 58 var_c = 2 var_d = var_b / var_c var_e = 1 var_f = var_d - var_e var_g = var_a / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Arithmetic calculation
Five roses and two lilies are planted in the vase. How many flowers are there in the vase?
7
5 2 [OP_ADD]
var_a = 5 var_b = 2 var_c = var_a + var_b print(int(var_c))
Geometry
You have a right triangle with three sides, each measuring 10 centimeters (cm), 8 centimeters (cm), and 6 centimeters (cm). What is the length of the radius of the circumscribed circle?
5
10 2 [OP_DIV]
var_a = 10 var_b = 2 var_c = var_a / var_b print(int(var_c))
Comparison
Yuna tries to do more jump rope than Jungkook. Yuna did 26 jump ropes in each of 1st and 2nd try and Jungkook did 81 jump ropes, then how many jump ropes should Yuna do on her 3rd try at least?
30
81 26 26 [OP_ADD] [OP_SUB] 1 [OP_ADD]
var_a = 81 var_b = 26 var_c = 26 var_d = var_b + var_c var_e = var_a - var_d var_f = 1 var_g = var_e + var_f print(int(var_g))
Correspondence
When you multiply 10 by 100 times of a certain number, you get 17 as a result. What is that certain number?
0.02
17 10 [OP_DIV] 100 [OP_DIV]
var_a = 17 var_b = 10 var_c = var_a / var_b var_d = 100 var_e = var_c / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
If AB19 is rounded up to the hundreds place, it gets a value of 7300. What is AB19 when rounded down to the tens place?
7210
AB19 [OP_GEN_POSSIBLE_LIST] 7300 100 [OP_SUB] [OP_LIST_MORE] 7300 [OP_LIST_LESS_EQUAL] AB19 A [OP_LIST_FIND_UNK] 1000 [OP_MUL] AB19 B [OP_LIST_FIND_UNK] 100 [OP_MUL] [OP_ADD] 19 [OP_ADD] 2 [OP_FLOOR]
var_a = 'AB19' 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 = 7300 var_c = 100 var_d = var_b - var_c list_b = [] for i in list_a: if i > var_d: list_b.append(i) var_e = 7300 list_c = [] for i in list_b: if i <= var_e: list_c.append(i) var_f = 'AB19' var_g = 'A' var_f = str(var_f) var_g = str(var_g) unk_idx = var_f.index(var_g) var_h = 0 for elem in list_c: elem = str(elem) var_h = int(elem[unk_idx]) var_i = 1000 var_j = var_h * var_i var_k = 'AB19' var_l = 'B' var_k = str(var_k) var_l = str(var_l) unk_idx = var_k.index(var_l) var_m = 0 for elem in list_c: elem = str(elem) var_m = int(elem[unk_idx]) var_n = 100 var_o = var_m * var_n var_p = var_j + var_o var_q = 19 var_r = var_p + var_q var_s = 2 var_t=int((var_r//(10**(var_s-1)))*10**(var_s-1)) print(int(var_t))
Comparison
The arrived parcel was located at 7th from the left, 13th from the right, 8th from the front, and 14th from the back of the parcel boxes. If the number of parcel boxes in each row is the same, what is the total number of parcel boxes?
399
7 13 [OP_ADD] 1 [OP_SUB] 8 14 [OP_ADD] 1 [OP_SUB] [OP_MUL]
var_a = 7 var_b = 13 var_c = var_a + var_b var_d = 1 var_e = var_c - var_d var_f = 8 var_g = 14 var_h = var_f + var_g var_i = 1 var_j = var_h - var_i var_k = var_e * var_j print(int(var_k))
Possibility
Using 3 of numbers 4, 1, 6, 7, what is the third smallest number with 1 in the tens place?
614
[OP_LIST_SOL] 4 1 6 7 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 10 1 [OP_LIST_SEARCH_FIXED_DIGIT] 3 [OP_LIST_MIN]
var_a = 4 var_b = 1 var_c = 6 var_d = 7 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 = 1 list_c = [] var_f = int(var_f) var_g = int(var_g) for i in list_b: i = int(i) if (i//var_f)%10 == var_g: list_c.append(i) var_h = 3 list_d=list_c.copy() list_d.sort() var_i = list_d[var_h-1] print(int(var_i))
Arithmetic calculation
Ayeon tries to go to a hospital 0.09 kilometers (km) away. If Ayeon takes 4 seconds to go 3 meters (m), how many seconds does it take for her to get to the hospital?
120
0.09 1000 [OP_MUL] 3 [OP_DIV] 4 [OP_MUL]
var_a = 0.09 var_b = 1000 var_c = var_a * var_b var_d = 3 var_e = var_c / var_d var_f = 4 var_g = var_e * var_f print(int(var_g))
Arithmetic calculation
You will need a 1/4 meter (m) block of wood. How many blocks can you make with 3 meters (m) of wood?
12
3 1/4 [OP_DIV]
var_a = 3 var_b = 0.25 var_c = var_a / var_b print(int(var_c))
Comparison
By drawing lots, Jeongyun picked the seat 7th from the left, 13th from the right, 8th from the front, and 14th from the back. If the number of seats in each row is the same, how many seats are there in the classroom?
399
7 13 [OP_ADD] 1 [OP_SUB] 8 14 [OP_ADD] 1 [OP_SUB] [OP_MUL]
var_a = 7 var_b = 13 var_c = var_a + var_b var_d = 1 var_e = var_c - var_d var_f = 8 var_g = 14 var_h = var_f + var_g var_i = 1 var_j = var_h - var_i var_k = var_e * var_j print(int(var_k))
Correspondence
I needed to divide a number by 3 and then subtract 5. However, I mistakenly multiplied this number by 3 and subtracted 5 and got 103 as a result. Find the correct calculated value.
7
103 5 [OP_ADD] 3 [OP_DIV] 3 [OP_DIV] 5 [OP_SUB]
var_a = 103 var_b = 5 var_c = var_a + var_b var_d = 3 var_e = var_c / var_d var_f = 3 var_g = var_e / var_f var_h = 5 var_i = var_g - var_h print(int(var_i))
Correspondence
52 is the result of mistakenly subtracting 48 from a certain number while 48 had to be added. Find the result of the correct calculation.
148
52 48 [OP_ADD] 48 [OP_ADD]
var_a = 52 var_b = 48 var_c = var_a + var_b var_d = 48 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
There are four numbers 10, 11, 12, and 13. What is the difference between the smallest number and the next smallest number?
0.91
[OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_DIV]
var_a = 10 var_b = 11 var_c = 12 var_d = 13 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 1 list_b=list_a.copy() list_b.sort() var_f = list_b[var_e-1] var_g = 2 list_c=list_a.copy() list_c.sort() var_h = list_c[var_g-1] var_i = var_f / var_h print('{:.2f}'.format(round(var_i+1e-10,2)))
Comparison
Jungkook collected 6 times 3 apples, and Yoongi collected 4 apples. Who has fewer apples?
Yoongi
[OP_LIST_SOL] Jungkook Yoongi [OP_LIST_EOL] [OP_LIST_SOL] 6 3 [OP_MUL] 4 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jungkook' var_b = 'Yoongi' 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 = 6 var_d = 3 var_e = var_c * var_d var_f = 4 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-1] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Correspondence
Given 2A32-BBB=1BBB, find B-A when A and B are two different numbers.
3
2A32-BBB=1BBB B [OP_DIGIT_UNK_SOLVER] 2A32-BBB=1BBB A [OP_DIGIT_UNK_SOLVER] [OP_SUB]
var_a = '2A32-BBB=1BBB' 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] var_d = '2A32-BBB=1BBB' var_e = 'A' 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
In the bookstore, all but 4 of the 40 books were sold out. There were 4 customers in total, and they all bought the same number of books. How many books did a customer buy?
9
40 4 [OP_SUB] 4 [OP_DIV]
var_a = 40 var_b = 4 var_c = var_a - var_b var_d = 4 var_e = var_c / var_d print(int(var_e))
Correspondence
There are two different numbers A and B. Find B from the two-digit subtraction equation of 8B-A3=38.
1
8B-A3=38 B [OP_DIGIT_UNK_SOLVER]
var_a = '8B-A3=38' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Comparison
There were 17 fewer children than adults on the train at the first station. At the next station, 57 adults and 18 children got on and 44 got off. If there are 502 people on the train right now, how many adults got on the train at the first station?
244
502 18 57 [OP_ADD] 44 [OP_SUB] [OP_SUB] 17 [OP_ADD] 2 [OP_DIV]
var_a = 502 var_b = 18 var_c = 57 var_d = var_b + var_c var_e = 44 var_f = var_d - var_e var_g = var_a - var_f var_h = 17 var_i = var_g + var_h var_j = 2 var_k = var_i / var_j print(int(var_k))
Arithmetic calculation
There are 44 students in A class. B class has 2 more studemts than A class, and C class has 1 less stuendt than B class. How many students are in C class?
45
44 2 [OP_ADD] 1 [OP_SUB]
var_a = 44 var_b = 2 var_c = var_a + var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Geometry
On a road measuring 6 meters (m) wide and 4 meters (m) long, we are going to attach rectangular bricks 60 centimeters (cm) wide and 20 centimeters (cm) tall without overlapping. How many bricks are needed to fill the road?
200
6 100 [OP_MUL] 4 100 [OP_MUL] [OP_MUL] 60 20 [OP_MUL] [OP_DIV]
var_a = 6 var_b = 100 var_c = var_a * var_b var_d = 4 var_e = 100 var_f = var_d * var_e var_g = var_c * var_f var_h = 60 var_i = 20 var_j = var_h * var_i var_k = var_g / var_j print(int(var_k))
Correspondence
What is B when 1/4×1/8=1/(4×A)=1/B?
32
1/4×1/8=1/(4×A)=1/B B [OP_NUM_UNK_SOLVER]
var_a = '1/4×1/8=1/(4×A)=1/B' 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] = 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] print(int(var_c))
Arithmetic calculation
Minyoung, Yoojung, and Eunji decided to divide marbles they have. Minyoung first brought 27 more marbles than Yoojung brought and if Minyoung gives Eunji 9 marbles, Minyoung and Eunji have 45 marbles each, how many marbles do the three people have in total?
117
45 27 [OP_SUB] 9 [OP_ADD] 27 [OP_ADD] 45 27 [OP_SUB] 9 [OP_ADD] [OP_ADD] 45 9 [OP_SUB] [OP_ADD]
var_a = 45 var_b = 27 var_c = var_a - var_b var_d = 9 var_e = var_c + var_d var_f = 27 var_g = var_e + var_f var_h = 45 var_i = 27 var_j = var_h - var_i var_k = 9 var_l = var_j + var_k var_m = var_g + var_l var_n = 45 var_o = 9 var_p = var_n - var_o var_q = var_m + var_p print(int(var_q))
Correspondence
When you move the decimal point of a prime number two places to the right, it becomes 138.6 more than the original prime number. Find the original prime number.
1.4
138.6 10 2 [OP_POW] 1 [OP_SUB] [OP_DIV]
var_a = 138.6 var_b = 10 var_c = 2 var_d = var_b ** var_c var_e = 1 var_f = var_d - var_e var_g = var_a / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Comparison
15 balls of different weights are placed in a row in order of weight from the lightest. The ball (a) is placed eighth from the front. If you place the balls again, in a row in order of weight from the heaviest, at what position will the ball (A) be placed from the front?
8
15 8 [OP_SUB] 1 [OP_ADD]
var_a = 15 var_b = 8 var_c = var_a - var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Correspondence
27 minus 7 equals the multiplication of one number and 5. What is the product of 7 and the sum of the number and 5?
63
27 7 [OP_SUB] 5 [OP_DIV] 5 [OP_ADD] 7 [OP_MUL]
var_a = 27 var_b = 7 var_c = var_a - var_b var_d = 5 var_e = var_c / var_d var_f = 5 var_g = var_e + var_f var_h = 7 var_i = var_g * var_h print(int(var_i))
Comparison
The weight of one biography is 0.3 kilograms (kg), and the weight of one fairy-tale book is 0.27 kilograms (kg). Which one is heavier, the biography or the fairy tale book?
biography
[OP_LIST_SOL] biography fairy-tale [OP_LIST_EOL] [OP_LIST_SOL] 0.3 0.27 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'biography' var_b = 'fairy-tale' 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 = 0.3 var_d = 0.27 list_b= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_b.append(var_c) list_b.reverse() var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] var_g = list_b.index(var_f)+1 var_h = list_a[var_g-1] print(var_h)
Arithmetic calculation
What is the largest three-digit number divisible by the numbers 6, 5, 8, and 9?
720
100 999 1 [OP_LIST_ARANGE] 6 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 8 [OP_LIST_DIVISIBLE] 9 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX]
var_a = 100 var_b = 999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 6 list_b = [] var_d = int(var_d) for i in list_a: i = int(i) if i % var_d == 0: list_b.append(i) var_e = 5 list_c = [] var_e = int(var_e) for i in list_b: i = int(i) if i % var_e == 0: list_c.append(i) var_f = 8 list_d = [] var_f = int(var_f) for i in list_c: i = int(i) if i % var_f == 0: list_d.append(i) var_g = 9 list_e = [] var_g = int(var_g) for i in list_d: i = int(i) if i % var_g == 0: list_e.append(i) var_h = 1 list_f=list_e.copy() list_f.sort() var_i = list_f[-var_h] print(int(var_i))
Correspondence
It is said that there are 468 more white Go stones than black Go stones. There are 954 white stones. Find the numbers of all Go stones.
1440
954 468 [OP_SUB] 954 [OP_ADD]
var_a = 954 var_b = 468 var_c = var_a - var_b var_d = 954 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
There are four numbers 10, 11, 12, and 13. What is the sum of the second largest number and the second smallest number?
23
[OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 2 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_ADD]
var_a = 10 var_b = 11 var_c = 12 var_d = 13 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 2 list_b=list_a.copy() list_b.sort() var_f = list_b[-var_e] var_g = 2 list_c=list_a.copy() list_c.sort() var_h = list_c[var_g-1] var_i = var_f + var_h print(int(var_i))
Possibility
There are cards each with the numbers 1, 3, 0, and 5 on it. When making a four-digit number using the cards once, what is the 6th largest number?
5013
[OP_LIST_SOL] 1 3 0 5 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 6 [OP_LIST_MAX]
var_a = 1 var_b = 3 var_c = 0 var_d = 5 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 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 = 6 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] print(int(var_g))
Comparison
25 students stand in a line. Thirteen students are standing behind Seokjin. How many students are standing in front of Seokjin?
11
25 13 [OP_SUB] 1 [OP_SUB]
var_a = 25 var_b = 13 var_c = var_a - var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
There are three numbers: 10, 11 and 12. What is the sum of the smallest number and the second smallest number?
21
[OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_ADD]
var_a = 10 var_b = 11 var_c = 12 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 1 list_b=list_a.copy() list_b.sort() var_e = list_b[var_d-1] var_f = 2 list_c=list_a.copy() list_c.sort() var_g = list_c[var_f-1] var_h = var_e + var_g print(int(var_h))
Comparison
Students are sitting on the playground. Yujeong is seated in the 12th row from the left, 11th row from the right, 18th row from the front, and 8th row from the back. How many students are sitting on the playground, assuming the same number of students are in each row?
550
12 11 [OP_ADD] 1 [OP_SUB] 18 8 [OP_ADD] 1 [OP_SUB] [OP_MUL]
var_a = 12 var_b = 11 var_c = var_a + var_b var_d = 1 var_e = var_c - var_d var_f = 18 var_g = 8 var_h = var_f + var_g var_i = 1 var_j = var_h - var_i var_k = var_e * var_j print(int(var_k))
Correspondence
When a number is divided by 9, the quotient is divisible by 25. What do you get when the number is added to 7 and 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))
Arithmetic calculation
Yoojung bought 2 motorcycles and 5 bicycles. How many motorcycles and bicycles did Yoojung buy?
7
2 5 [OP_ADD]
var_a = 2 var_b = 5 var_c = var_a + var_b print(int(var_c))
Arithmetic calculation
It is said that one person needs 155.2 liters (l) of water to live for 53 days, and the amount of water in one bucket is 2 liters (l). If a person lives 17 days, how many buckets of water does a person need?
25
155.2 53 [OP_DIV] 17 [OP_MUL] 2 [OP_DIV] 1 [OP_CEIL]
var_a = 155.2 var_b = 53 var_c = var_a / var_b var_d = 17 var_e = var_c * var_d var_f = 2 var_g = var_e / var_f var_h = 1 var_i=int(((var_g+9*10**(var_h-2))//(10**(var_h-1)))*10**(var_h-1)) print(int(var_i))
Arithmetic calculation
Jungkook has 3 red balls and 2 yellow balls. When Jungkook gives Yoongi 1 red ball, how many yellow balls does Jungkook have?
2
2
var_a = 2 print(int(var_a))
Possibility
Dongwi is going to go to another school to see the festival. If only one school is allowed to go to play, and there are 4 boys' high schools and 3 girls' high schools, find the number of cases in which Dongwi go to play.
7
4 3 [OP_ADD]
var_a = 4 var_b = 3 var_c = var_a + var_b print(int(var_c))
Correspondence
Multiply a number by 5 to get 100. What is the value of the number when divided by 10?
2
100 5 [OP_DIV] 10 [OP_DIV]
var_a = 100 var_b = 5 var_c = var_a / var_b var_d = 10 var_e = var_c / var_d print(int(var_e))
Possibility
Of the two digits that can be created by taking two different numbers out of 1, 0, 5, and 8, what is the largest minus the second largest?
4
[OP_LIST_SOL] 1 0 5 8 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 2 [OP_LIST_MAX] [OP_SUB]
var_a = 1 var_b = 0 var_c = 5 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 = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] var_h = 2 list_d=list_b.copy() list_d.sort() var_i = list_d[-var_h] var_j = var_g - var_i print(int(var_j))
Geometry
A regular hexagon with an area of 21.12 square centimeters (cm2) is divided into 6 equal parts. What is the area of the divided part?
3.52
21.12 6 [OP_DIV]
var_a = 21.12 var_b = 6 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
Namjoon has 3 sets of 7 marbles. He is going to make these marbles into 6 groups of 6 each. How many more marbles does he need?
15
6 6 [OP_MUL] 7 3 [OP_MUL] [OP_SUB]
var_a = 6 var_b = 6 var_c = var_a * var_b var_d = 7 var_e = 3 var_f = var_d * var_e var_g = var_c - var_f print(int(var_g))
Geometry
A figure has a perimeter of 49 centimeters (cm) and a side length of 7 centimeters (cm). How many sides are there in total?
7
49 7 [OP_DIV]
var_a = 49 var_b = 7 var_c = var_a / var_b print(int(var_c))
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
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_ADD] [OP_ADD] [OP_ADD]
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] var_m = var_i + var_l var_n = var_f + var_m var_o = var_c + var_n print(int(var_o))
Arithmetic calculation
I am trying to put 7 posters on a wall that is 20 meters (m) wide. The posters were pasted at equal intervals, starting at 1 meter (m) apart from each end of the wall. Find the space between the posters.
3
20 1 2 [OP_MUL] [OP_SUB] 7 1 [OP_SUB] [OP_DIV]
var_a = 20 var_b = 1 var_c = 2 var_d = var_b * var_c var_e = var_a - var_d var_f = 7 var_g = 1 var_h = var_f - var_g var_i = var_e / var_h print(int(var_i))
Comparison
How many of the following numbers are less than 1? 1/10, 8, 0.9, 7/10, 5.
3
[OP_LIST_SOL] 1/10 8 0.9 7/10 5 [OP_LIST_EOL] 1 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = 0.1 var_b = 8 var_c = 0.9 var_d = 0.7 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 = 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))
Correspondence
A number needs to be divided by 5, but when it was accidentally divided by 8, the quotient was 156 and the remainder 2. Find the value that comes out when the calculation is done correctly.
250
156 8 [OP_MUL] 2 [OP_ADD] 5 [OP_DIV]
var_a = 156 var_b = 8 var_c = var_a * var_b var_d = 2 var_e = var_c + var_d var_f = 5 var_g = var_e / var_f print(int(var_g))
Comparison
At the first stop, there were 17 men fewer than women that took the subway. At the next station, 57 women and 18 men got on and 44 people got off. If there are 502 people on the subway right now, how many men got on the subway at the first stop?
227
502 18 57 [OP_ADD] 44 [OP_SUB] [OP_SUB] 17 [OP_SUB] 2 [OP_DIV]
var_a = 502 var_b = 18 var_c = 57 var_d = var_b + var_c var_e = 44 var_f = var_d - var_e var_g = var_a - var_f var_h = 17 var_i = var_g - var_h var_j = 2 var_k = var_i / var_j print(int(var_k))
Correspondence
I was supposed to divide a certain number by 3 and add 12 to it, but I multiplied this number by 3, subtracted 12 and then divided it by 6 accidentally, getting 60 as a result. How much will I get if I calculate correctly?
53.33
60 6 [OP_MUL] 12 [OP_ADD] 3 [OP_DIV] 3 [OP_DIV] 12 [OP_ADD]
var_a = 60 var_b = 6 var_c = var_a * var_b var_d = 12 var_e = var_c + var_d var_f = 3 var_g = var_e / var_f var_h = 3 var_i = var_g / var_h var_j = 12 var_k = var_i + var_j print('{:.2f}'.format(round(var_k+1e-10,2)))
Possibility
Find the sum of the largest and third largest three-digit numbers with different digits that can be made with the natural numbers 8, 1, and 6.
1542
[OP_LIST_SOL] 8 1 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 3 [OP_LIST_MAX] [OP_ADD]
var_a = 8 var_b = 1 var_c = 6 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] var_g = 3 list_d=list_b.copy() list_d.sort() var_h = list_d[-var_g] var_i = var_f + var_h print(int(var_i))
Correspondence
Each of the two beakers contains a liquid. The sum of the solutions contained in the two beakers is 9.28 milliliters (ml). If one beaker contains 2.95 milliliters (ml), what is the difference in milliliters (ml) between the two beakers?
3.38
9.28 2.95 [OP_SUB] 2.95 [OP_SUB]
var_a = 9.28 var_b = 2.95 var_c = var_a - var_b var_d = 2.95 var_e = var_c - var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Possibility
When 6 people A, B, C, D, E, and F are lined up in a line, find the number of ways in which A, B, and C can be placed next to each other.
144
[OP_LIST_SOL] A B C D E F [OP_LIST_EOL] [OP_LIST_SOL] B C [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_LIST_SOL] A B C [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_MUL]
var_a = 'A' var_b = 'B' var_c = 'C' var_d = 'D' var_e = 'E' var_f = 'F' list_a= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_g = 'B' var_h = 'C' list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) list_b.reverse() list_c = list(set(list_a) - set(list_b)) var_i = len(list_c) var_j = len(list_c) var_k = 1 var_i = int(var_i) var_j = int(var_j) for i, elem in enumerate(range(var_j)): var_k = var_k * (var_i-i) var_l = 'A' var_m = 'B' var_n = 'C' list_d= [] if "/" in str(var_n): var_n = eval(str(var_n)) list_d.append(var_n) if "/" in str(var_m): var_m = eval(str(var_m)) list_d.append(var_m) if "/" in str(var_l): var_l = eval(str(var_l)) list_d.append(var_l) list_d.reverse() var_o = len(list_d) var_p = len(list_d) var_q = 1 var_o = int(var_o) var_p = int(var_p) for i, elem in enumerate(range(var_p)): var_q = var_q * (var_o-i) var_r = var_k * var_q print(int(var_r))
Arithmetic calculation
Among the 45 students, 42 students raised their hands to say they like art, and 40 students raised their hands to say they like science. If all students participated in the survey, how many students raised their hands in both subjects?
37
40 42 [OP_ADD] 45 [OP_SUB]
var_a = 40 var_b = 42 var_c = var_a + var_b var_d = 45 var_e = var_c - var_d print(int(var_e))
Possibility
How many three-digit integers can be created by pressing 3 of the 6 buttons on a calculator with the numbers 0, 1, 2, 3, 4, and 5 on them?
100
[OP_LIST_SOL] 0 1 2 3 4 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 2 var_d = 3 var_e = 4 var_f = 5 list_a= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_g = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_g)) 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_h = len(list_b) print(int(var_h))
Arithmetic calculation
What is the total length in centimeters (cm) of 30 wooden sticks 25 centimeters (cm) long when 6 centimeters (cm) are overlapped?
576
25 25 6 [OP_SUB] 30 1 [OP_SUB] [OP_MUL] [OP_ADD]
var_a = 25 var_b = 25 var_c = 6 var_d = var_b - var_c var_e = 30 var_f = 1 var_g = var_e - var_f var_h = var_d * var_g var_i = var_a + var_h print(int(var_i))
Possibility
Write the largest number that can be made by using all of the figures 0, 8, and 7 once.
870
[OP_LIST_SOL] 0 8 7 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 1 [OP_LIST_MAX]
var_a = 0 var_b = 8 var_c = 7 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 = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] print(int(var_f))
Correspondence
When you multiply a number by 3, you get 33. What number is that?
11
33 3 [OP_DIV]
var_a = 33 var_b = 3 var_c = var_a / var_b print(int(var_c))
Possibility
Find the number of odd numbers in a three-digit number that can be formed by using 5, 6, or 7 only once.
4
[OP_LIST_SOL] 5 6 7 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 2 [OP_LIST_DIVISIBLE] [OP_SET_DIFFERENCE] [OP_LIST_LEN]
var_a = 5 var_b = 6 var_c = 7 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 = 2 list_c = [] var_e = int(var_e) for i in list_b: i = int(i) if i % var_e == 0: list_c.append(i) list_d = list(set(list_b) - set(list_c)) var_f = len(list_d) print(int(var_f))
Correspondence
When you subtract 50 from a number, divide it by 4, multiply it by 3, and add 28, it becomes 73. Find out what number this is.
110
73 28 [OP_SUB] 3 [OP_DIV] 4 [OP_MUL] 50 [OP_ADD]
var_a = 73 var_b = 28 var_c = var_a - var_b var_d = 3 var_e = var_c / var_d var_f = 4 var_g = var_e * var_f var_h = 50 var_i = var_g + var_h print(int(var_i))
Arithmetic calculation
Taehyung's group has five students with a height of 145 centimeters (cm), 139 centimeters (cm), 155 centimeters (cm), 160 centimeters (cm), and 143 centimeters (cm). When one more student joined the group, the average height increased by 1.2 centimeters (cm). Find the height of the new student in centimeters (cm) including the decimal point.
155.6
[OP_LIST_SOL] 145 139 155 160 143 [OP_LIST_EOL] [OP_LIST_MEAN] [OP_LIST_LEN] 1 [OP_ADD] 1.2 [OP_MUL] [OP_ADD]
var_a = 145 var_b = 139 var_c = 155 var_d = 160 var_e = 143 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() list_a = [float(i) for i in list_a] var_f = sum(list_a)/len(list_a) var_g = len(list_a) var_h = 1 var_i = var_g + var_h var_j = 1.2 var_k = var_i * var_j var_l = var_f + var_k print('{:.2f}'.format(round(var_l+1e-10,2)))