category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Comparison
There are students standing in a line. Hoseok is at the left side of Yoongi, and five other students are standing between them. Nine people are standing to Hoseok's left, and six people are standing to Yoongi's right. How many students are in the line?
22
1 1 [OP_ADD] 5 [OP_ADD] 9 [OP_ADD] 6 [OP_ADD]
var_a = 1 var_b = 1 var_c = var_a + var_b var_d = 5 var_e = var_c + var_d var_f = 9 var_g = var_e + var_f var_h = 6 var_i = var_g + var_h print(int(var_i))
Correspondence
A and B are numbers from 0 to 9. When the five-digit number A835B is divisible by 12, find the difference between the largest number and the smallest number that can be made from A835B.
69996
A835B [OP_GEN_POSSIBLE_LIST] 12 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB]
var_a = 'A835B' 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 = 12 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 = 1 list_c=list_b.copy() list_c.sort() var_d = list_c[-var_c] var_e = 1 list_d=list_b.copy() list_d.sort() var_f = list_d[var_e-1] var_g = var_d - var_f print(int(var_g))
Arithmetic calculation
Dongmin and Kyuhyung each have some candies. If Dongmin has 5 more candies than Kyuhyung and the sum of their candies is 43, how many candies does Kyuhyung have?
19
43 5 [OP_SUB] 2 [OP_DIV]
var_a = 43 var_b = 5 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Comparison
Jaesuk drank 5 liters (l) of water for two days, and Jaesuk's brother drank 4900 milliliters (ml). Which of the two drank more water in two days?
Jaesuk
[OP_LIST_SOL] Jaesuk brother [OP_LIST_EOL] [OP_LIST_SOL] 5 1000 [OP_MUL] 4900 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jaesuk' var_b = 'brother' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 5 var_d = 1000 var_e = var_c * var_d var_f = 4900 list_b= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Correspondence
What is C when A, B, C, and D are different numbers that correspond to this equation of 4A58+C2D7=7070?
2
4A5B+C2D7=7070 C [OP_DIGIT_UNK_SOLVER]
var_a = '4A5B+C2D7=7070' 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] = 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
Subtract this number from 35, and then multiply it by 2, add 12, divide it by 8, then subtract 4, and you get 5. Find this number.
5
35 5 4 [OP_ADD] 8 [OP_MUL] 12 [OP_SUB] 2 [OP_DIV] [OP_SUB]
var_a = 35 var_b = 5 var_c = 4 var_d = var_b + var_c var_e = 8 var_f = var_d * var_e var_g = 12 var_h = var_f - var_g var_i = 2 var_j = var_h / var_i var_k = var_a - var_j print(int(var_k))
Comparison
What is the smallest number greater than 0.4 among 0.8, 1/2, 0.3, 1/3?
0.5
[OP_LIST_SOL] 0.8 1/2 0.3 1/3 [OP_LIST_EOL] 0.4 [OP_LIST_MORE] 1 [OP_LIST_MIN]
var_a = 0.8 var_b = 0.5 var_c = 0.3 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 = 0.4 list_b = [] for i in list_a: if i > var_e: list_b.append(i) var_f = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[var_f-1] print('{:.2f}'.format(round(var_g+1e-10,2)))
Arithmetic calculation
You are going to divide 16 kilograms (kg) of peanuts equally into 6 bags and share one bag with your friends. How many people can eat if each person eats 4/15 kilograms (kg)?
10
16 6 [OP_DIV] 4/15 [OP_DIV]
var_a = 16 var_b = 6 var_c = var_a / var_b var_d = 0.26666666666666666 var_e = var_c / var_d print(int(var_e))
Correspondence
When a number is divided by 7, the quotient is 12 and the remainder is 5. What is the remainder when this number is divided by 8?
1
12 7 [OP_MUL] 5 [OP_ADD] 8 [OP_MOD]
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))
Geometry
Find the area of a square with side length 3.
9
3 2 [OP_POW]
var_a = 3 var_b = 2 var_c = var_a ** var_b print(int(var_c))
Arithmetic calculation
All 1,260 seats in a concert hall were full. If 7/18 of the audience wore glasses and 6/11 among the audience with no glasses were male, find out the number of male audience members who were not wearing glasses.
420
1260 1 7/18 [OP_SUB] [OP_MUL] 6/11 [OP_MUL]
var_a = 1260 var_b = 1 var_c = 0.3888888888888889 var_d = var_b - var_c var_e = var_a * var_d var_f = 0.5454545454545454 var_g = var_e * var_f print(int(eval('{:.2f}'.format(round(var_g+1e-10,2)))))
Comparison
The shop sells gems A, B, C, and D. A is more expensive than D, B is more expensive than A, and C is the cheapest. What is the most expensive jewel?
B
[OP_LIST_SOL] A B C D [OP_LIST_EOL] [OP_LIST_SOL] A D > B A > C A < C B < C D < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'A' var_b = 'B' var_c = 'C' var_d = 'D' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 'A' var_f = 'D' var_g = '>' var_h = 'B' var_i = 'A' var_j = '>' var_k = 'C' var_l = 'A' var_m = '<' var_n = 'C' var_o = 'B' var_p = '<' var_q = 'C' var_r = 'D' var_s = '<' list_b= [] if "/" in str(var_s): var_s = eval(str(var_s)) list_b.append(var_s) if "/" in str(var_r): var_r = eval(str(var_r)) list_b.append(var_r) if "/" in str(var_q): var_q = eval(str(var_q)) list_b.append(var_q) if "/" in str(var_p): var_p = eval(str(var_p)) list_b.append(var_p) if "/" in str(var_o): var_o = eval(str(var_o)) list_b.append(var_o) if "/" in str(var_n): var_n = eval(str(var_n)) list_b.append(var_n) if "/" in str(var_m): var_m = eval(str(var_m)) list_b.append(var_m) if "/" in str(var_l): var_l = eval(str(var_l)) list_b.append(var_l) if "/" in str(var_k): var_k = eval(str(var_k)) list_b.append(var_k) if "/" in str(var_j): var_j = eval(str(var_j)) list_b.append(var_j) if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) 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_t = 1 var_u = list_c[var_t-1] print(var_u)
Possibility
Find the sum of the third largest number and the third smallest number using all of the given number marbles 7, 6, 8, and 5 once.
14443
[OP_LIST_SOL] 7 6 8 5 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 3 [OP_LIST_MAX] 3 [OP_LIST_MIN] [OP_ADD]
var_a = 7 var_b = 6 var_c = 8 var_d = 5 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = len(list_a) list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 3 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] var_h = 3 list_d=list_b.copy() list_d.sort() var_i = list_d[var_h-1] var_j = var_g + var_i print(int(var_j))
Possibility
Find the sum of the largest two-digit number and the third smallest two-digit number when making a two-digit number by allowing the repetition of the five number cards 1, 3, 5, 8, and 9.
114
[OP_LIST_SOL] 1 3 5 8 9 [OP_LIST_EOL] 2 [OP_LIST_GET_PRODUCT] 1 [OP_LIST_MAX] 3 [OP_LIST_MIN] [OP_ADD]
var_a = 1 var_b = 3 var_c = 5 var_d = 8 var_e = 9 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = 3 list_d=list_b.copy() list_d.sort() var_j = list_d[var_i-1] var_k = var_h + var_j print(int(var_k))
Correspondence
Rounding a number to 2 decimal places gives 1.7. What is the result of subtracting the smallest of these numbers from the largest of these numbers? Please indicate including the decimal point.
0.09
1.74 1.65 [OP_SUB]
var_a = 1.74 var_b = 1.65 var_c = var_a - var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
The length of the tape Jimin used is 26 millimeters (mm) longer than the length of the tape Jungkook used. If Jungkook used 45 centimeters (cm) of tape, how many centimeters (m) did Jimin use?
47.6
45 26 10 [OP_DIV] [OP_ADD]
var_a = 45 var_b = 26 var_c = 10 var_d = var_b / var_c var_e = var_a + var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
If 6 is the result of subtracting 2 from a number, instead of adding 2, write down what the number is.
8
6 2 [OP_ADD]
var_a = 6 var_b = 2 var_c = var_a + var_b print(int(var_c))
Arithmetic calculation
There are three given numbers: 10, 11 and 12. What is the remainder if you divide the largest number by the second 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
180 bottles of milk are divided into 3 cartons, and the bottles of milk in each carton are equally divided into 4 bags. How many bottles of milk are in one bag?
15
180 3 [OP_DIV] 4 [OP_DIV]
var_a = 180 var_b = 3 var_c = var_a / var_b var_d = 4 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
Find the number of even numbers from 1 to 6 and from 11 to 16.
6
1 6 [OP_LIST_EVEN] [OP_LIST_LEN] 11 16 [OP_LIST_EVEN] [OP_LIST_LEN] [OP_ADD]
var_a = 1 var_b = 6 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 = len(list_a) var_d = 11 var_e = 16 list_b = [] if var_d%2!=0: for i in range(var_d+1, var_e+1, 2): list_b.append(i) else: for i in range(var_d, var_e+1, 2): list_b.append(i) var_f = len(list_b) var_g = var_c + var_f print(int(var_g))
Correspondence
13.26 multiplied by some number is 132.6. Find the value of 0.064 multiplied by that number.
0.64
132.6 13.26 [OP_DIV] 0.064 [OP_MUL]
var_a = 132.6 var_b = 13.26 var_c = var_a / var_b var_d = 0.064 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
When 23 is divided by 6, the quotient and remainder are A and B, respectively. Find A at this time.
3
23 6 [OP_FDIV]
var_a = 23 var_b = 6 var_c = var_a // var_b print(int(var_c))
Correspondence
When A is divided by 6, the quotient is 3 and the remainder is 2. A is a natural number. Find A at this time.
20
6 3 [OP_MUL] 2 [OP_ADD]
var_a = 6 var_b = 3 var_c = var_a * var_b var_d = 2 var_e = var_c + var_d print(int(var_e))
Possibility
You are given three numbers 4, 2 and 5. How many three-digit numbers can you make by using the given numbers once each?
6
[OP_LIST_SOL] 4 2 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 4 var_b = 2 var_c = 5 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 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 = len(list_b) print(int(var_e))
Arithmetic calculation
The parking fee for this parking lot is 500 won for 30 minutes, and 200 won is added for every 10 minutes after 30 minutes. If Ha-Young's father parked in this parking lot for 1 hour and 20 minutes, what is the parking fee?
1500
1 60 [OP_MUL] 20 [OP_ADD] 30 [OP_SUB] 10 [OP_FDIV] 200 [OP_MUL] 500 [OP_ADD]
var_a = 1 var_b = 60 var_c = var_a * var_b var_d = 20 var_e = var_c + var_d var_f = 30 var_g = var_e - var_f var_h = 10 var_i = var_g // var_h var_j = 200 var_k = var_i * var_j var_l = 500 var_m = var_k + var_l print(int(var_m))
Possibility
What is the second largest three-digit number where each digit is one of the digits 1, 4, 5, or 9 and the tens digit is 9? However, each number is used only once.
591
[OP_LIST_SOL] 1 4 5 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 10 9 [OP_LIST_SEARCH_FIXED_DIGIT] 2 [OP_LIST_MAX]
var_a = 1 var_b = 4 var_c = 5 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 = 10 var_g = 9 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] print(int(var_i))
Correspondence
When 32+A7B=705, find B.
3
32+A7B=705 B [OP_DIGIT_UNK_SOLVER]
var_a = '32+A7B=705' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Arithmetic calculation
Hyunji gave 7 of the 20 pencils to Hyeonseung and again received 5 from Taewoo. Find how many pencils Hyunji has.
18
20 7 [OP_SUB] 5 [OP_ADD]
var_a = 20 var_b = 7 var_c = var_a - var_b var_d = 5 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
A stick with a total length of 950 centimeters (cm) was divided in two. If the long bar is 150 centimeters (cm) longer than the short bar, how many centimeters (cm) is the short bar?
400
950 150 [OP_SUB] 2 [OP_DIV]
var_a = 950 var_b = 150 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Comparison
There are 50 red balloons and 26 yellow balloons. There are 8 more blue ballons than yellow balloons. Which colored balloon is the most?
red
[OP_LIST_SOL] red yellow blue [OP_LIST_EOL] [OP_LIST_SOL] 50 26 26 8 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'red' var_b = 'yellow' var_c = 'blue' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 50 var_e = 26 var_f = 26 var_g = 8 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) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Geometry
How many diagonals can you draw in a pentagon?
5
5 5 3 [OP_SUB] [OP_MUL] 2 [OP_DIV]
var_a = 5 var_b = 5 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
What is the largest three-digit number divisible by 6?
996
100 999 1 [OP_LIST_ARANGE] 6 [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 = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] print(int(var_f))
Possibility
Find the number of 3-digit integers that can be made by drawing 3 cards from 4 cards each containing the numbers 0, 1, 2, and 3.
18
[OP_LIST_SOL] 0 1 2 3 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 2 var_d = 3 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = len(list_b) print(int(var_f))
Comparison
Nine people are lined up in order from shortest to tallest. Hoseok stands at the very back. If they line up again in order from tallest to shortest, what number will Hoseok be from the front?
1
9 9 [OP_SUB] 1 [OP_ADD]
var_a = 9 var_b = 9 var_c = var_a - var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
After school, Yewon plans to stop by the kindergarten to meet her sister and go home with her. The distance from Yewon's school to the kindergarten is 1 kilometer (km) and 700 meters (m), and the distance from the kindergarten to her house is 900 meters (m). How far is the midpoint of the distance starting from Yewon's school through the kindergarten and to her house, from Yewon's school in meters (m)?
1300
1 1000 [OP_MUL] 700 [OP_ADD] 900 [OP_ADD] 2 [OP_DIV]
var_a = 1 var_b = 1000 var_c = var_a * var_b var_d = 700 var_e = var_c + var_d var_f = 900 var_g = var_e + var_f var_h = 2 var_i = var_g / var_h print(int(var_i))
Comparison
You took Korean, Mathematics, English, Science, and History tests in order. Which of the following subjects was the third test taken?
English
[OP_LIST_SOL] Korean Mathematics English Science History [OP_LIST_EOL] 3 [OP_LIST_GET]
var_a = 'Korean' var_b = 'Mathematics' var_c = 'English' var_d = 'Science' var_e = 'History' list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 3 var_g = list_a[var_f-1] print(var_g)
Geometry
There is a sign in the shape of a square with a side of 90 centimeters (cm). If you decide to hang small light bulbs every 3 centimeters (cm) along the edges of this sign, how many light bulbs will you need in total?
120
90 4 [OP_MUL] 3 [OP_FDIV]
var_a = 90 var_b = 4 var_c = var_a * var_b var_d = 3 var_e = var_c // var_d print(int(var_e))
Possibility
What is the largest minus the smallest seven-digit number that can be formed by using 3, 9, 6, 0, 5, 1, and 7 only once?
8729631
[OP_LIST_SOL] 3 9 6 0 5 1 7 [OP_LIST_EOL] 7 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB]
var_a = 3 var_b = 9 var_c = 6 var_d = 0 var_e = 5 var_f = 1 var_g = 7 list_a= [] if "/" in str(var_g): var_g = eval(str(var_g)) list_a.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_h = 7 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_h)) 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_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = 1 list_d=list_b.copy() list_d.sort() var_l = list_d[var_k-1] var_m = var_j - var_l print(int(var_m))
Correspondence
A, B, C are different numbers from 0 to 9. Find B from the two-digit addition formula AB+CB=CC6.
8
AB+CB=CC6 B [OP_DIGIT_UNK_SOLVER]
var_a = 'AB+CB=CC6' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Geometry
When three points are not on a straight line, find the number of line segments that can be formed from these three points.
3
3 2 [OP_COMB]
var_a = 3 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))
Arithmetic calculation
There are 80 red balls and 40 blue balls. There are 12 fewer red balls than blue and white balls combined. How many white balls are there?
52
80 12 [OP_ADD] 40 [OP_SUB]
var_a = 80 var_b = 12 var_c = var_a + var_b var_d = 40 var_e = var_c - var_d print(int(var_e))
Comparison
Jungkook has 0.8, Yoongi has 1/2, Yoojung has 0.9, Yuna has 1/3 number card. How many people have number cards greater than 0.3?
4
[OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 0.3 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 0.8 var_b = 0.5 var_c = 0.9 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 = 0.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))
Arithmetic calculation
How many four-digit numbers are greater than 3200 and less than 4300?
1099
3200 1 [OP_ADD] 4300 1 [OP_SUB] 1 [OP_LIST_ARANGE] [OP_LIST_LEN]
var_a = 3200 var_b = 1 var_c = var_a + var_b var_d = 4300 var_e = 1 var_f = var_d - var_e var_g = 1 list_a = [i for i in range(var_c, var_f + 1, var_g)] var_h = len(list_a) print(int(var_h))
Geometry
The perimeter of a rectangle is 16 centimeters (cm), and its width is 2 centimeters (cm) longer than its length. What is the length of the width of this rectangle?
5
16 2 [OP_DIV] 2 [OP_SUB] 2 [OP_DIV] 2 [OP_ADD]
var_a = 16 var_b = 2 var_c = var_a / var_b var_d = 2 var_e = var_c - var_d var_f = 2 var_g = var_e / var_f var_h = 2 var_i = var_g + var_h print(int(var_i))
Arithmetic calculation
There are 58 cucumbers in the mart. The numbers of cucumbers are 24 more than carrots and 49 less than tomatoes. The number of radishes equals the number of carrots. How many cucumbers, carrots, tomatoes, and radishes are in the supermarket in total?
233
58 58 24 [OP_SUB] [OP_ADD] 58 49 [OP_ADD] [OP_ADD] 58 24 [OP_SUB] [OP_ADD]
var_a = 58 var_b = 58 var_c = 24 var_d = var_b - var_c var_e = var_a + var_d var_f = 58 var_g = 49 var_h = var_f + var_g var_i = var_e + var_h var_j = 58 var_k = 24 var_l = var_j - var_k var_m = var_i + var_l print(int(var_m))
Correspondence
Insoo had to multiply a certain number by 1.36, but he mistakenly divided it and submitted 0.5 as an answer. If he calculated it correctly, what is the answer?
0.92
0.5 1.36 [OP_MUL] 1.36 [OP_MUL]
var_a = 0.5 var_b = 1.36 var_c = var_a * var_b var_d = 1.36 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
There is a caterpillar that travels 4 meters (m) in 2 minutes and a cicada larva that travels 4 meters (m) in 3 minutes at a constant speed. If this cicada larva, 24 meters (m) ahead of the caterpillar, sets off in the same direction at the same time, find out how many minutes later will the caterpillar and the cicada larva meet.
36
24 4 2 [OP_DIV] 4 3 [OP_DIV] [OP_SUB] [OP_DIV]
var_a = 24 var_b = 4 var_c = 2 var_d = var_b / var_c var_e = 4 var_f = 3 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)))))
Comparison
Multiplying a certain number by 9 and adding 1 is the same as multiplying that number by 10 and subtracting 100. Let the number be A, what is the remainder when A is divided by 7?
3
1 100 [OP_ADD] 10 9 [OP_SUB] [OP_DIV] 7 [OP_MOD]
var_a = 1 var_b = 100 var_c = var_a + var_b var_d = 10 var_e = 9 var_f = var_d - var_e var_g = var_c / var_f var_h = 7 var_i = var_g % var_h print(int(var_i))
Geometry
A large square-shaped piece of paper is made from several small square-shaped pieces of paper. There were 20 small square-shaped pieces of paper left, so I tried to increase each side by 1 row, and 9 small pieces of paper were short. How many small square-shaped pieces of paper are there in total?
216
20 9 [OP_ADD] 1 [OP_SUB] 2 [OP_DIV] 2 [OP_POW] 20 [OP_ADD]
var_a = 20 var_b = 9 var_c = var_a + var_b var_d = 1 var_e = var_c - var_d var_f = 2 var_g = var_e / var_f var_h = 2 var_i = var_g ** var_h var_j = 20 var_k = var_i + var_j print(int(var_k))
Arithmetic calculation
What is the largest five-digit number divisible by both 3 and 4?
99996
10000 99999 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 4 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX]
var_a = 10000 var_b = 99999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 3 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 = 4 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 = 1 list_d=list_c.copy() list_d.sort() var_g = list_d[-var_f] print(int(var_g))
Correspondence
The four-digit number A56B is divisible by 36. How many numbers fit 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 boxes with 20 pairs of shoes in each box. There are 5 times more (B) shoes than (A) shoes and there are 8 boxes of (A) shoes. How many more pairs of (B) shoes do you have than (A) shoes?
640
8 5 [OP_MUL] 8 [OP_SUB] 20 [OP_MUL]
var_a = 8 var_b = 5 var_c = var_a * var_b var_d = 8 var_e = var_c - var_d var_f = 20 var_g = var_e * var_f print(int(var_g))
Geometry
Find the length of the base of a triangle with an area of 36 square centimeters (cm2) and a height of 8 centimeters (cm) .
9
36 2 [OP_MUL] 8 [OP_DIV]
var_a = 36 var_b = 2 var_c = var_a * var_b var_d = 8 var_e = var_c / var_d print(int(var_e))
Possibility
How many natural numbers greater than 200 are formed by using the natural numbers 0, 1, 3, 5, and 6 without overlapping?
36
[OP_LIST_SOL] 0 1 3 5 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 200 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 3 var_d = 5 var_e = 6 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = 200 list_c = [] for i in list_b: if i > var_g: list_c.append(i) var_h = len(list_c) print(int(var_h))
Arithmetic calculation
Given the natural numbers from 12 to 53, find the average of these numbers.
32.5
12 53 1 [OP_LIST_ARANGE] [OP_LIST_MEAN]
var_a = 12 var_b = 53 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] list_a = [float(i) for i in list_a] var_d = sum(list_a)/len(list_a) print('{:.2f}'.format(round(var_d+1e-10,2)))
Comparison
Customers stand in a line at the restaurant. If 8 people are standing in front of the person at the end of the line, how many customers are all in line?
9
8 1 [OP_ADD]
var_a = 8 var_b = 1 var_c = var_a + var_b print(int(var_c))
Arithmetic calculation
What is the sum of all three-digit numbers with 1 in the hundreds place?
14950
[OP_LIST_SOL] 1 A B [OP_LIST_EOL] [OP_LIST2NUM] [OP_GEN_POSSIBLE_LIST] [OP_LIST_SUM]
var_a = 1 var_b = 'A' var_c = 'B' 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) list_b = [float(i) for i in list_b] var_e = sum(list_b) print(int(var_e))
Correspondence
The equation A45+2B3=418 makes sense. What number should go in B?
7
A45+2B3=418 B [OP_DIGIT_UNK_SOLVER]
var_a = 'A45+2B3=418' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Arithmetic calculation
When a certain two-digit number is divided by 13, the remainder is 2. What is the largest possible number that can be the number?
93
10 99 1 [OP_LIST_ARANGE] 13 2 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_MAX]
var_a = 10 var_b = 99 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 13 var_e = 2 list_b = [] var_d = int(var_d) var_e = int(var_e) if var_e < 0: var_e = var_e + var_d for i in list_a: i = int(i) if i%var_d == var_e: list_b.append(i) var_f = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] print(int(var_g))
Correspondence
There is a number that becomes 748 when subtracted 36 and multiplied by 22. What is this number?
70
748 22 [OP_DIV] 36 [OP_ADD]
var_a = 748 var_b = 22 var_c = var_a / var_b var_d = 36 var_e = var_c + var_d print(int(var_e))
Possibility
You want to make a rectangle that is different from each other by attaching all 210 squares that has a side length of 2 centimeters (cm). If the rectangle has the same shape when rotated, it is regarded as the same one. How many ways can you think of?
8
210 [OP_LIST_GET_DIVISOR] [OP_LIST_LEN] 2 [OP_DIV] 1 [OP_CEIL]
var_a = 210 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 = len(list_a) var_c = 2 var_d = var_b / var_c var_e = 1 var_f=int(((var_d+9*10**(var_e-2))//(10**(var_e-1)))*10**(var_e-1)) print(int(var_f))
Comparison
15 students stand in a line. If Namjoon is the 7th person from the left, what about from the right side?
9
15 7 [OP_SUB] 1 [OP_ADD]
var_a = 15 var_b = 7 var_c = var_a - var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Comparison
The three students, Yoongi, Jungkook and Yuna, have the numbers 7, 6, and 9 respectively. Who has the 2nd largest number?
Yoongi
[OP_LIST_SOL] Yoongi Jungkook and Yuna [OP_LIST_EOL] [OP_LIST_SOL] 7 6 9 [OP_LIST_EOL] 2 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yoongi' var_b = 'Jungkook' var_c = 'and' var_d = 'Yuna' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 7 var_f = 6 var_g = 9 list_b= [] if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_h = 2 list_c=list_b.copy() list_c.sort() var_i = list_c[-var_h] var_j = list_b.index(var_i)+1 var_k = list_a[var_j-1] print(var_k)
Possibility
How many three-digit numbers contain all of 4, 2, and 5?
6
[OP_LIST_SOL] 4 2 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 4 var_b = 2 var_c = 5 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 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 = len(list_b) print(int(var_e))
Arithmetic calculation
There are 6000 red and blue marbles together. If you subtract the difference between the red marbles and the blue marbles from the sum of the red marbles and the blue marbles, you get 4800. If there are more blue marbles than red marbles, how many blue marbles are there?
3600
6000 4800 2 [OP_DIV] [OP_SUB]
var_a = 6000 var_b = 4800 var_c = 2 var_d = var_b / var_c var_e = var_a - var_d print(int(var_e))
Correspondence
There are 60 fruits in the fruit basket. There are 32 bananas, 10 apples and 5 pears. If there are bananas, apples, pears, and tangerines in the fruit basket, how many tangerines are there?
13
60 32 [OP_SUB] 10 [OP_SUB] 5 [OP_SUB]
var_a = 60 var_b = 32 var_c = var_a - var_b var_d = 10 var_e = var_c - var_d var_f = 5 var_g = var_e - var_f print(int(var_g))
Correspondence
There are 84.6 grams (g) of ketchup. If you put the same amount of ketchup on 12 hot dogs so that there are no leftovers, find how many grams (g) of ketchup you need to put on each hot dog.
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)))
Arithmetic calculation
On one side of the two-arm scale, there is one weight weighing 0.5 kilograms (kg) and two weights weighing 0.3 kilograms (kg). How many kilograms (kg) must a book weigh in order to make the scale horizontal when this book is placed on the other side?
1.1
0.5 0.3 2 [OP_MUL] [OP_ADD]
var_a = 0.5 var_b = 0.3 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
A dozen means 12. Jungkook initially had 17 pencils, but his mother bought a few more, bringing the total number of pencils to 2 dozen. How many additional pencils did the mother buy?
7
2 12 [OP_MUL] 17 [OP_SUB]
var_a = 2 var_b = 12 var_c = var_a * var_b var_d = 17 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
My mother and father bought me 7 more and 14 more notebooks, respectively. If Jimin had 33 notebooks at first, how many more notebooks does she have than at first?
21
33 7 [OP_ADD] 14 [OP_ADD] 33 [OP_SUB]
var_a = 33 var_b = 7 var_c = var_a + var_b var_d = 14 var_e = var_c + var_d var_f = 33 var_g = var_e - var_f print(int(var_g))
Arithmetic calculation
How many common multiples of 16 and 24 exist between 1 to 200?
4
1 200 1 [OP_LIST_ARANGE] 16 [OP_LIST_DIVISIBLE] 24 [OP_LIST_DIVISIBLE] [OP_SET_INTERSECT] [OP_LIST_LEN]
var_a = 1 var_b = 200 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 16 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 = 24 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
After multiplying a decimal by 10, moving the decimal point three places to the left equals 0.375. Find the original decimal number including the decimal point.
37.5
0.375 10 3 [OP_POW] [OP_MUL] 10 [OP_DIV]
var_a = 0.375 var_b = 10 var_c = 3 var_d = var_b ** var_c var_e = var_a * var_d var_f = 10 var_g = var_e / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Arithmetic calculation
230 students were each given 15 pieces of colored paper. Find the number of pieces of colored paper distributed.
3450
230 15 [OP_MUL]
var_a = 230 var_b = 15 var_c = var_a * var_b print(int(var_c))
Arithmetic calculation
Each box contains 100 marbles. How many marbles are in all 10 boxes?
1000
100 10 [OP_MUL]
var_a = 100 var_b = 10 var_c = var_a * var_b print(int(var_c))
Arithmetic calculation
There is a truck that runs at a constant speed of 2.1 kilometers (km) in 1 minute, and a taxi that runs at a constant speed of 10.5 kilometers (km) in 4 minutes. Find how many times the truck is faster than the taxi.
0.8
2.1 1 [OP_DIV] 10.5 4 [OP_DIV] [OP_DIV]
var_a = 2.1 var_b = 1 var_c = var_a / var_b var_d = 10.5 var_e = 4 var_f = var_d / var_e var_g = var_c / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Correspondence
If a number is multiplied by 6, it is 72. Hoseok wants to add 8 to the number. Write down what Hoseok gets.
20
72 6 [OP_DIV] 8 [OP_ADD]
var_a = 72 var_b = 6 var_c = var_a / var_b var_d = 8 var_e = var_c + var_d print(int(var_e))
Geometry
Nine people stand in a line in order from shortest to tallest. Hoseok is standing 4th from the front. If you line up again in order from the tallest to the shortest, what number will Hoseok stand from the back?
4
4
var_a = 4 print(int(var_a))
Possibility
Round up the smallest 4-digit number to the hundreds place made from using 4 number cards 7, 9, 3, and 6 with overlapping allowed.
3400
[OP_LIST_SOL] 7 9 3 6 [OP_LIST_EOL] 4 [OP_LIST_GET_PRODUCT] 1 [OP_LIST_MIN] 3 [OP_CEIL]
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.product(list_b, repeat=var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[var_f-1] var_h = 3 var_i=int(((var_g+9*10**(var_h-2))//(10**(var_h-1)))*10**(var_h-1)) print(int(var_i))
Geometry
There is a large box in the shape of a cuboid which is 30 centimeters (cm) wide, 20 centimeters (cm) long, and 5 cm (cm) high, and a small cuboid-shaped box 6 centimeters (cm) wide, 4 centimeters (cm) long, and 1 cm (cm) high. Find how many times is the larger box than the smaller box.
125
30 20 [OP_MUL] 5 [OP_MUL] 6 4 [OP_MUL] 1 [OP_MUL] [OP_DIV]
var_a = 30 var_b = 20 var_c = var_a * var_b var_d = 5 var_e = var_c * var_d var_f = 6 var_g = 4 var_h = var_f * var_g var_i = 1 var_j = var_h * var_i var_k = var_e / var_j print(int(var_k))
Comparison
The length of the string that Minju has is 6.704 meters (m) and the length of the string that Daehyun has is 6.74 meters (m). Who has the longer string?
Daehyun
[OP_LIST_SOL] Minju Daehyun [OP_LIST_EOL] [OP_LIST_SOL] 6.704 6.74 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Minju' var_b = 'Daehyun' 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.704 var_d = 6.74 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
It is said that charging 9 mobile phones consumes 19 kWh. How many kWh does it take to charge one mobile phone?
2.11
19 9 [OP_DIV]
var_a = 19 var_b = 9 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
Yuna had 23 candies, but after eating a few, there are 7 left. How many candies did Yuna eat?
16
23 7 [OP_SUB]
var_a = 23 var_b = 7 var_c = var_a - var_b print(int(var_c))
Comparison
The height of 5 of the dwarves next to Snow White is measured. The average was 81.6 centimeters (cm), and the average height without the tallest, Red, was 6 centimeters (cm) lower than the average height without the shortest, Green. If the heights of Blue, Black, and Yellow are 88 centimeters (cm), 84 centimeters (cm), and 76 centimeters (cm), find the height of Green.
68
81.6 5 [OP_MUL] 88 84 [OP_ADD] 76 [OP_ADD] [OP_SUB] 6 4 [OP_MUL] [OP_SUB] 2 [OP_DIV]
var_a = 81.6 var_b = 5 var_c = var_a * var_b var_d = 88 var_e = 84 var_f = var_d + var_e var_g = 76 var_h = var_f + var_g var_i = var_c - var_h var_j = 6 var_k = 4 var_l = var_j * var_k var_m = var_i - var_l var_n = 2 var_o = var_m / var_n print(int(var_o))
Arithmetic calculation
Yoongi bought a 200-page book and read 12 pages each day for two weeks. Find out how many pages Yoongi has not read.
32
200 12 2 [OP_MUL] 7 [OP_MUL] [OP_SUB]
var_a = 200 var_b = 12 var_c = 2 var_d = var_b * var_c var_e = 7 var_f = var_d * var_e var_g = var_a - var_f print(int(var_g))
Correspondence
3 times a number minus 8 minus 2 equals the number. Find the number.
5
2 8 [OP_ADD] 3 1 [OP_SUB] [OP_DIV]
var_a = 2 var_b = 8 var_c = var_a + var_b var_d = 3 var_e = 1 var_f = var_d - var_e var_g = var_c / var_f print(int(var_g))
Comparison
A box of apples weighs 1.3 kilograms (kg), and a box of pears weighs 1100 grams (g). If you have one box of apples and one box of pears, which one is heavier?
apples
[OP_LIST_SOL] apples pears [OP_LIST_EOL] [OP_LIST_SOL] 1.3 1000 [OP_MUL] 1100 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'apples' var_b = 'pears' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 1.3 var_d = 1000 var_e = var_c * var_d var_f = 1100 list_b= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Possibility
You are trying to make a signal by turning three light bulbs on or off. How many signals can you make?
8
2 3 [OP_POW]
var_a = 2 var_b = 3 var_c = var_a ** var_b print(int(var_c))
Correspondence
The difference between the number of red and blue marbles is 12. Also, the total number of marbles is 40 more than the difference between the number of red and blue marbles. What is the product of the number of blue ones times the number of red ones?
640
40 2 [OP_DIV] 12 [OP_ADD] 40 2 [OP_DIV] [OP_MUL]
var_a = 40 var_b = 2 var_c = var_a / var_b var_d = 12 var_e = var_c + var_d var_f = 40 var_g = 2 var_h = var_f / var_g var_i = var_e * var_h print(int(var_i))
Arithmetic calculation
Find the difference between the largest and the 4th largest number of 8, 0, 3, 7, 5, 2, 4.
4
[OP_LIST_SOL] 8 0 3 7 5 2 4 [OP_LIST_EOL] 1 [OP_LIST_MAX] 4 [OP_LIST_MAX] [OP_SUB]
var_a = 8 var_b = 0 var_c = 3 var_d = 7 var_e = 5 var_f = 2 var_g = 4 list_a= [] if "/" in str(var_g): var_g = eval(str(var_g)) list_a.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_h = 1 list_b=list_a.copy() list_b.sort() var_i = list_b[-var_h] var_j = 4 list_c=list_a.copy() list_c.sort() var_k = list_c[-var_j] var_l = var_i - var_k print(int(var_l))
Geometry
rectangle with an area of 59.6 square centimeters (cm2) is divided into 4 equal parts. What is the area of one part?
14.9
59.6 4 [OP_DIV]
var_a = 59.6 var_b = 4 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Geometry
Let the length of the two diagonals of a rhombus be 4 centimeters (cm). Find the area of this rhombus.
8
4 4 [OP_MUL] 2 [OP_DIV]
var_a = 4 var_b = 4 var_c = var_a * var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Comparison
Eight people will share one watermelon. If there are 4 watermelons, how many people can share them?
32
8 4 [OP_MUL]
var_a = 8 var_b = 4 var_c = var_a * var_b print(int(var_c))
Arithmetic calculation
How many numbers not less than 40 and less than 80 are multiples of 8?
5
40 80 1 [OP_SUB] 1 [OP_LIST_ARANGE] 8 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 40 var_b = 80 var_c = 1 var_d = var_b - var_c var_e = 1 list_a = [i for i in range(var_a, var_d + 1, var_e)] var_f = 8 list_b = [] var_f = int(var_f) for i in list_a: i = int(i) if i % var_f == 0: list_b.append(i) var_g = len(list_b) print(int(var_g))
Comparison
The students are lined up in the order of Jungkook, Minyoung, and Taehyung. Who is the third person in line?
Taehyung
[OP_LIST_SOL] Jungkook Minyoung Taehyung [OP_LIST_EOL] 3 [OP_LIST_GET]
var_a = 'Jungkook' var_b = 'Minyoung' var_c = 'Taehyung' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 3 var_e = list_a[var_d-1] print(var_e)
Comparison
Students stand in a line. Nakyung takes the 5th from the front and is the last person. How many students are in line?
6
5 1 [OP_ADD]
var_a = 5 var_b = 1 var_c = var_a + var_b print(int(var_c))
Correspondence
I want to subtract this number from 20. I mistakenly added this number to 40, and the result was 52. What is the result of the correct calculation?
8
20 52 40 [OP_SUB] [OP_SUB]
var_a = 20 var_b = 52 var_c = 40 var_d = var_b - var_c var_e = var_a - var_d print(int(var_e))
Arithmetic calculation
You brought 18 more chickens on the first day and 12 more chickens on the second day to the farm, which originally raised 45 chickens. Find the number of increased chickens since the beginning.
30
18 12 [OP_ADD]
var_a = 18 var_b = 12 var_c = var_a + var_b print(int(var_c))
Geometry
(a), (b), and (c) are all pyramids. If the sum of the vertices of the three pyramids is 40, what is the sum of the edges of the three pyramids?
74
40 3 [OP_SUB] 2 [OP_MUL]
var_a = 40 var_b = 3 var_c = var_a - var_b var_d = 2 var_e = var_c * var_d print(int(var_e))
Arithmetic calculation
Hyeon-joo saves an average of 7,000 won a week. How many weeks will it take for Hyeon-Joo to save 100,000 won?
15
100000 7000 [OP_DIV] 1 [OP_CEIL]
var_a = 100000 var_b = 7000 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))
Possibility
Write the number that can fit in the hundredth place when using the given number cards 7, 5, and 2 once to make a number greater than 520 and less than 710.
5
[OP_LIST_SOL] 7 5 2 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 520 [OP_LIST_MORE] 710 [OP_LIST_LESS] 1 [OP_LIST_GET] [OP_NUM2LIST] 1 [OP_LIST_GET]
var_a = 7 var_b = 5 var_c = 2 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 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 = 520 list_c = [] for i in list_b: if i > var_e: list_c.append(i) var_f = 710 list_d = [] for i in list_c: if i < var_f: list_d.append(i) var_g = 1 var_h = list_d[var_g-1] list_e = [] var_h = int(var_h) while var_h//10 > 0: list_e.append(var_h%10) var_h = var_h//10 list_e.append(var_h%10) list_e = list_e[::-1] var_i = 1 var_j = list_e[var_i-1] print(int(var_j))