category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Possibility
Suppose you make a three-digit natural number by selecting three of the four numbers 1, 2, 3, and 4 and arranging them in a row. How many numbers are divisible by 3?
22
[OP_LIST_SOL] 1 2 3 4 [OP_LIST_EOL] 3 [OP_LIST_GET_PRODUCT] 3 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 1 var_b = 2 var_c = 3 var_d = 4 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.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 = 3 list_c = [] var_f = int(var_f) for i in list_b: i = int(i) if i % var_f == 0: list_c.append(i) var_g = len(list_c) print(int(var_g))
Geometry
Cheolsu's nine classmates are standing in a nonagonal shape facing each other. If every student plays rock-paper-scissors once with everyone except for the person next to him/her, how many times do all students play rock-paper-scissors?
27
9 9 3 [OP_SUB] [OP_MUL] 2 [OP_DIV]
var_a = 9 var_b = 9 var_c = 3 var_d = var_b - var_c var_e = var_a * var_d var_f = 2 var_g = var_e / var_f print(int(var_g))
Arithmetic calculation
I would like to exchange 170,000 won for a trip to China. One Chinese yuan equals 161.5 won in Korean won. If you want to exchange 1000 yuan and 10 yuan bills, and you change as many 1000 yuan bills as possible, find how many bills will be converted into 10 yuan bills.
5
17 10000 [OP_MUL] 161.5 1000 [OP_MUL] [OP_MOD] 161.5 10 [OP_MUL] [OP_FDIV]
var_a = 17 var_b = 10000 var_c = var_a * var_b var_d = 161.5 var_e = 1000 var_f = var_d * var_e var_g = var_c % var_f var_h = 161.5 var_i = 10 var_j = var_h * var_i var_k = var_g // var_j print(int(var_k))
Correspondence
Ji-hoon made a mistake while calculating and subtracted 7 from a number instead of multiplying by 7, and it became 0.45. Find out the answer Jihoon was originally looking for.
52.15
0.45 7 [OP_ADD] 7 [OP_MUL]
var_a = 0.45 var_b = 7 var_c = var_a + var_b var_d = 7 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Comparison
Jaeho and Kyunghwan took a walk for the same amount of time. Jaeho walked a distance of 1/100 of 10.2 kilometers (km), and Kyunghwan walked a distance of 100 meters (m). Who walked more distances, Jaeho or Kyunghwan?
Jaeho
[OP_LIST_SOL] Jaeho Kyunghwan [OP_LIST_EOL] [OP_LIST_SOL] 10.2 1000 [OP_MUL] 1/100 [OP_MUL] 100 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jaeho' var_b = 'Kyunghwan' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 10.2 var_d = 1000 var_e = var_c * var_d var_f = 0.01 var_g = var_e * var_f var_h = 100 list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Geometry
There is a prism with a sum of the number of vertices, faces, and corners is 50. How many edges of the pyramid have the same base shape as the prism?
16
50 2 [OP_SUB] 2 3 [OP_ADD] 1 [OP_ADD] [OP_DIV] 2 [OP_MUL]
var_a = 50 var_b = 2 var_c = var_a - var_b var_d = 2 var_e = 3 var_f = var_d + var_e var_g = 1 var_h = var_f + var_g var_i = var_c / var_h var_j = 2 var_k = var_i * var_j print(int(var_k))
Possibility
There are 9 number cards with the numbers 1 through 9 written on them. In how many ways can you draw 3 cards so that the sum is 17?
42
1 9 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] 17 [OP_LIST_FIND_NUM]
var_a = 1 var_b = 9 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] list_c=[] for i in list_b: var_e = 0 i = int(i) while i//10 > 0: var_e = var_e + i%10 i = i//10 var_e = var_e + i%10 list_c.append(var_e) var_f = 17 var_g = 0 var_f = int(var_f) for i in list_c: i = int(i) if i == var_f: var_g = var_g + 1 print(int(var_g))
Arithmetic calculation
Find the certain number if the certain number multiplied by 7 minus 6 equals the certain number multiplied by 4 plus 12.
6
12 6 [OP_ADD] 7 4 [OP_SUB] [OP_DIV]
var_a = 12 var_b = 6 var_c = var_a + var_b var_d = 7 var_e = 4 var_f = var_d - var_e var_g = var_c / var_f print(int(var_g))
Arithmetic calculation
3 puppies and 7 chicks are playing in the yard of Junho's house. Find how many legs the puppies and chicks have together.
26
3 4 [OP_MUL] 7 2 [OP_MUL] [OP_ADD]
var_a = 3 var_b = 4 var_c = var_a * var_b var_d = 7 var_e = 2 var_f = var_d * var_e var_g = var_c + var_f print(int(var_g))
Possibility
When displaying 2 tangerines and 3 oranges in a line, find the number of cases where the tangerines must be placed next to each other.
48
1 3 [OP_ADD] 1 3 [OP_ADD] [OP_PERM] 2 2 [OP_PERM] [OP_MUL]
var_a = 1 var_b = 3 var_c = var_a + var_b var_d = 1 var_e = 3 var_f = var_d + var_e var_g = 1 var_c = int(var_c) var_f = int(var_f) for i, elem in enumerate(range(var_f)): var_g = var_g * (var_c-i) var_h = 2 var_i = 2 var_j = 1 var_h = int(var_h) var_i = int(var_i) for i, elem in enumerate(range(var_i)): var_j = var_j * (var_h-i) var_k = var_g * var_j print(int(var_k))
Arithmetic calculation
Find the largest number divided by the next largest number among 4 numbers: 10, 11, 12, and 13.
1.08
[OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MAX] [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] var_g = 2 list_c=list_a.copy() list_c.sort() var_h = list_c[-var_g] var_i = var_f / var_h print('{:.2f}'.format(round(var_i+1e-10,2)))
Arithmetic calculation
128 coins are scattered on the floor. If there are 12 more coins that are heads than coins that are tails, how many coins are heads?
70
128 12 [OP_SUB] 2 [OP_DIV] 12 [OP_ADD]
var_a = 128 var_b = 12 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d var_f = 12 var_g = var_e + var_f print(int(var_g))
Arithmetic calculation
Roses were planted in one-third of the 2.4 square meters (m2) flower bed, and tulips were planted in the remaining one-quarter. Find the area of the area where the tulips are planted.
0.4
2.4 1 1/3 [OP_SUB] [OP_MUL] 1/4 [OP_MUL]
var_a = 2.4 var_b = 1 var_c = 0.3333333333333333 var_d = var_b - var_c var_e = var_a * var_d var_f = 0.25 var_g = var_e * var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Possibility
You want to create a three-digit number using 5, 9, and 2 once. When the difference between the two numbers made is the largest, find the difference.
693
[OP_LIST_SOL] 5 9 2 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] [OP_ABS]
var_a = 5 var_b = 9 var_c = 2 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 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 = 1 list_d=list_b.copy() list_d.sort() var_h = list_d[var_g-1] var_i = var_f - var_h var_j = abs(var_i) print(int(var_j))
Geometry
The red confetti has a square shape with a side length of 11 centimeters (cm), and the blue confetti has a square shape with a side length of 5 centimeters (cm). What is the sum of the areas of the two pieces of colored paper in square centimeters (cm2)?
146
11 2 [OP_POW] 5 2 [OP_POW] [OP_ADD]
var_a = 11 var_b = 2 var_c = var_a ** var_b var_d = 5 var_e = 2 var_f = var_d ** var_e var_g = var_c + var_f print(int(var_g))
Arithmetic calculation
It is said that the balloon 3 meters (m) underground reached the ground in 4 seconds after it went into the air. Assuming that the balloon pops when it travels 0.09 kilometers (km) above the ground, how many seconds after it rises into the sky will it burst, if the balloon moves at the same speed?
124
0.09 1000 [OP_MUL] 3 [OP_ADD] 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 = 3 var_g = var_e / var_f var_h = 4 var_i = var_g * var_h print(int(var_i))
Arithmetic calculation
Three more boys and 10 girls entered the class, and now the total number of girls became 22. If there were 5 more boys than girls initially, how many boys are still in the classroom?
20
22 10 [OP_SUB] 5 [OP_ADD] 3 [OP_ADD]
var_a = 22 var_b = 10 var_c = var_a - var_b var_d = 5 var_e = var_c + var_d var_f = 3 var_g = var_e + var_f print(int(var_g))
Arithmetic calculation
3rd grade students from Min's school split into 18 15-seater buses to go on a field trip. If 3 seats are empty in each bus, how many 3rd grade students are there at Min's school?
216
15 3 [OP_SUB] 18 [OP_MUL]
var_a = 15 var_b = 3 var_c = var_a - var_b var_d = 18 var_e = var_c * var_d print(int(var_e))
Correspondence
How many times does the figure '9' appear in odd numbers from 1 to 100?
15
1 100 [OP_LIST_ODD] [OP_LIST2NUM] [OP_NUM2LIST] 9 [OP_LIST_FIND_NUM]
var_a = 1 var_b = 100 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="" for i in list_a: i = str(i) var_c = var_c + i list_b = [] var_c = int(var_c) while var_c//10 > 0: list_b.append(var_c%10) var_c = var_c//10 list_b.append(var_c%10) list_b = list_b[::-1] var_d = 9 var_e = 0 var_d = int(var_d) for i in list_b: i = int(i) if i == var_d: var_e = var_e + 1 print(int(var_e))
Possibility
If there are 6 students A, B, C, D, E, and F, find the number of ways to select 2 representatives and 1 secretary.
60
[OP_LIST_SOL] A B C D E F [OP_LIST_EOL] [OP_LIST_LEN] 2 1 [OP_ADD] [OP_PERM] 2 2 [OP_PERM] [OP_DIV]
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 = len(list_a) var_h = 2 var_i = 1 var_j = var_h + var_i var_k = 1 var_g = int(var_g) var_j = int(var_j) for i, elem in enumerate(range(var_j)): var_k = var_k * (var_g-i) var_l = 2 var_m = 2 var_n = 1 var_l = int(var_l) var_m = int(var_m) for i, elem in enumerate(range(var_m)): var_n = var_n * (var_l-i) var_o = var_k / var_n print(int(var_o))
Arithmetic calculation
If you add up Yoongi and Hoseok's ages this year, it is 16. Hoseok is 2 years younger than Yoongi. How old is Yoongi this year?
9
16 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 print(int(var_g))
Correspondence
The four-digit number 4A8B is a multiple of 93. Find the value of A+B at this time.
6
4A8B [OP_GEN_POSSIBLE_LIST] 93 [OP_LIST_DIVISIBLE] 4A8B A [OP_LIST_FIND_UNK] 4A8B B [OP_LIST_FIND_UNK] [OP_ADD]
var_a = '4A8B' 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 = 93 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 = '4A8B' var_d = 'A' var_c = str(var_c) var_d = str(var_d) unk_idx = var_c.index(var_d) var_e = 0 for elem in list_b: elem = str(elem) var_e = int(elem[unk_idx]) var_f = '4A8B' var_g = 'B' var_f = str(var_f) var_g = str(var_g) unk_idx = var_f.index(var_g) var_h = 0 for elem in list_b: elem = str(elem) var_h = int(elem[unk_idx]) var_i = var_e + var_h print(int(var_i))
Correspondence
When you add 2 to a number and then subtract 3, you get 7. Find out this number
8
7 3 [OP_ADD] 2 [OP_SUB]
var_a = 7 var_b = 3 var_c = var_a + var_b var_d = 2 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
When traveling for 2 hours and 36 minutes at a speed of 80 kilometers (km) per hour using a car that uses 0.08 liters (L) of gasoline to travel 1 kilometer (km), how many liters (L) of gasoline are used?
16.64
0.08 80 2 36 60 [OP_DIV] [OP_ADD] [OP_MUL] [OP_MUL]
var_a = 0.08 var_b = 80 var_c = 2 var_d = 36 var_e = 60 var_f = var_d / var_e var_g = var_c + var_f var_h = var_b * var_g var_i = var_a * var_h print('{:.2f}'.format(round(var_i+1e-10,2)))
Arithmetic calculation
In Jungkook's class, there are 9 students who wear glasses and 16 students who do not wear glasses. How many students are there?
25
16 9 [OP_ADD]
var_a = 16 var_b = 9 var_c = var_a + var_b print(int(var_c))
Geometry
Find the total volume if you stack 7 rows, 5 columns, and 3 layers of Legos, each measuring 1 centimeter (cm) in length, width, and height.
105
1 7 [OP_MUL] 1 5 [OP_MUL] [OP_MUL] 1 3 [OP_MUL] [OP_MUL]
var_a = 1 var_b = 7 var_c = var_a * var_b var_d = 1 var_e = 5 var_f = var_d * var_e var_g = var_c * var_f var_h = 1 var_i = 3 var_j = var_h * var_i var_k = var_g * var_j print(int(var_k))
Possibility
Find the number of natural numbers that can be made by drawing three of the number cards 0, 1, 2, 4, and 9.
48
[OP_LIST_SOL] 0 1 2 4 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 2 var_d = 4 var_e = 9 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 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 = len(list_b) print(int(var_g))
Correspondence
There is a four-digit number that has A in the tens place. If the thousands, hundreds, and ones place of this four-digit number are 1, 8, and 4, and it is less than 1853, how many digits can be written in A in 18A4?
5
18A4 [OP_GEN_POSSIBLE_LIST] 1853 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = '18A4' ans_dict = dict() var_a = str(var_a) list_a = [] variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 0 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) if len(var_a) == len(str(int(temp))): new_elem = int(temp) list_a.append(new_elem) var_b = 1853 list_b = [] for i in list_a: if i < var_b: list_b.append(i) var_c = len(list_b) print(int(var_c))
Correspondence
Subtracting 2.95 twice from a number gives 9.28. Find this number.
15.18
9.28 2.95 [OP_ADD] 2.95 [OP_ADD]
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)))
Geometry
The area of the base triangle of a triangular prism with a volume of 576 cubic centimeters (cm3) is 3 square centimeters (cm2). How many centimeters (cm) is half of the height of this triangular prisim?
96
576 3 [OP_DIV] 2 [OP_DIV]
var_a = 576 var_b = 3 var_c = var_a / var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Possibility
When 2 coins and 1 dice are tossed at the same time, in how many ways can both coins come up equal and the dice roll is a multiple of 3?
4
2 1 6 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] [OP_MUL]
var_a = 2 var_b = 1 var_c = 6 var_d = 1 list_a = [i for i in range(var_b, var_c + 1, var_d)] var_e = 3 list_b = [] var_e = int(var_e) for i in list_a: i = int(i) if i % var_e == 0: list_b.append(i) var_f = len(list_b) var_g = var_a * var_f print(int(var_g))
Arithmetic calculation
Min-young and Hoseok each had 1.5 million won of money. If Minyoung earns 320,000 won more and Hoseok earns 490,000 won more, how much more money does Hoseok have than Minyoung?
170000
150 49 [OP_ADD] 150 32 [OP_ADD] [OP_SUB] 10000 [OP_MUL]
var_a = 150 var_b = 49 var_c = var_a + var_b var_d = 150 var_e = 32 var_f = var_d + var_e var_g = var_c - var_f var_h = 10000 var_i = var_g * var_h print(int(var_i))
Arithmetic calculation
The amount of water that Seokgi's family drinks during the day are 3 liters (L) and 200 milliliters (㎖). If out of this, the amount of water Seokgi and his father drink per day is 1 liter (L) and 100 milliliters (㎖) and every member drinks the same amount of water daily, how many liters (L) of water do the other members except Seokgi and his father drink for 2 weeks?
29.4
3 200 1000 [OP_DIV] [OP_ADD] 1 100 1000 [OP_DIV] [OP_ADD] [OP_SUB] 2 7 [OP_MUL] [OP_MUL]
var_a = 3 var_b = 200 var_c = 1000 var_d = var_b / var_c var_e = var_a + var_d var_f = 1 var_g = 100 var_h = 1000 var_i = var_g / var_h var_j = var_f + var_i var_k = var_e - var_j var_l = 2 var_m = 7 var_n = var_l * var_m var_o = var_k * var_n print('{:.2f}'.format(round(var_o+1e-10,2)))
Comparison
Double B plus 4 is C, and the quotient of A divided by 3 is B. When A is 8 multiplied by 9 minus 3. Find the sum of the largest number and the smallest number.
92
[OP_LIST_SOL] 8 9 [OP_MUL] 3 [OP_SUB] 8 9 [OP_MUL] 3 [OP_SUB] 3 [OP_DIV] 8 9 [OP_MUL] 3 [OP_SUB] 3 [OP_DIV] 2 [OP_MUL] 4 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] 3 [OP_LIST_MAX] [OP_ADD]
var_a = 8 var_b = 9 var_c = var_a * var_b var_d = 3 var_e = var_c - var_d var_f = 8 var_g = 9 var_h = var_f * var_g var_i = 3 var_j = var_h - var_i var_k = 3 var_l = var_j / var_k var_m = 8 var_n = 9 var_o = var_m * var_n var_p = 3 var_q = var_o - var_p var_r = 3 var_s = var_q / var_r var_t = 2 var_u = var_s * var_t var_v = 4 var_w = var_u + var_v list_a= [] if "/" in str(var_w): var_w = eval(str(var_w)) list_a.append(var_w) if "/" in str(var_l): var_l = eval(str(var_l)) list_a.append(var_l) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) list_a.reverse() var_x = 1 list_b=list_a.copy() list_b.sort() var_y = list_b[-var_x] var_z = 3 list_c=list_a.copy() list_c.sort() var_A = list_c[-var_z] var_B = var_y + var_A print(int(var_B))
Comparison
A giraffe is 2.3 meters (m) tall, a baby is 9/10 meters (m) tall, a gorilla is 1.8 meters (m) tall, and a dinosaur is 2.5 meters (m) tall. What is the second tallest creature?
giraffe
[OP_LIST_SOL] giraffe baby gorilla dinosaur [OP_LIST_EOL] [OP_LIST_SOL] 2.3 9/10 1.8 2.5 [OP_LIST_EOL] 2 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'giraffe' var_b = 'baby' var_c = 'gorilla' var_d = 'dinosaur' 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.3 var_f = 0.9 var_g = 1.8 var_h = 2.5 list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 2 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Comparison
Buses run at 92 kilometers (km) per hour, and taxis run at 1500 meters (m) per minute. Which of the buses or taxis is faster?
buses
[OP_LIST_SOL] buses taxis [OP_LIST_EOL] [OP_LIST_SOL] 92 1500 1000 [OP_DIV] 60 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'buses' var_b = 'taxis' 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 = 92 var_d = 1500 var_e = 1000 var_f = var_d / var_e var_g = 60 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_c): var_c = eval(str(var_c)) list_b.append(var_c) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Correspondence
I mistakenly subtracted a certain number that should have been added to 5.46, and the result was 3.97. Find the result of the correct calculation.
6.95
5.46 5.46 3.97 [OP_SUB] [OP_ADD]
var_a = 5.46 var_b = 5.46 var_c = 3.97 var_d = var_b - var_c var_e = var_a + var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
When the division was calculated by changing the tens and units digits of the divisor, the quotient and remainder were 25 each. When the divisor is 65, find the sum of the correctly calculated quotient and remainder.
81
56 25 [OP_MUL] 25 [OP_ADD] 65 [OP_FDIV] 56 25 [OP_MUL] 25 [OP_ADD] 65 [OP_MOD] [OP_ADD]
var_a = 56 var_b = 25 var_c = var_a * var_b var_d = 25 var_e = var_c + var_d var_f = 65 var_g = var_e // var_f var_h = 56 var_i = 25 var_j = var_h * var_i var_k = 25 var_l = var_j + var_k var_m = 65 var_n = var_l % var_m var_o = var_g + var_n print(int(var_o))
Possibility
When you want to take a picture of 2 dogs and 3 cats standing in one line, find the number of cases where the dogs should be placed next to each other.
48
1 3 [OP_ADD] 1 3 [OP_ADD] [OP_PERM] 2 2 [OP_PERM] [OP_MUL]
var_a = 1 var_b = 3 var_c = var_a + var_b var_d = 1 var_e = 3 var_f = var_d + var_e var_g = 1 var_c = int(var_c) var_f = int(var_f) for i, elem in enumerate(range(var_f)): var_g = var_g * (var_c-i) var_h = 2 var_i = 2 var_j = 1 var_h = int(var_h) var_i = int(var_i) for i, elem in enumerate(range(var_i)): var_j = var_j * (var_h-i) var_k = var_g * var_j print(int(var_k))
Correspondence
When the six-digit number A4461B is divisible by 72, find A+B.
12
A4461B [OP_GEN_POSSIBLE_LIST] 72 [OP_LIST_DIVISIBLE] A4461B A [OP_LIST_FIND_UNK] A4461B B [OP_LIST_FIND_UNK] [OP_ADD]
var_a = 'A4461B' 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 = 72 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 = 'A4461B' var_d = 'A' var_c = str(var_c) var_d = str(var_d) unk_idx = var_c.index(var_d) var_e = 0 for elem in list_b: elem = str(elem) var_e = int(elem[unk_idx]) var_f = 'A4461B' var_g = 'B' var_f = str(var_f) var_g = str(var_g) unk_idx = var_f.index(var_g) var_h = 0 for elem in list_b: elem = str(elem) var_h = int(elem[unk_idx]) var_i = var_e + var_h print(int(var_i))
Arithmetic calculation
You want to cut 360 meters (m) of wire into 3.6 meters (m) long pieces. In how many pieces can you cut the wire?
100
360 3.6 [OP_DIV]
var_a = 360 var_b = 3.6 var_c = var_a / var_b print(int(var_c))
Arithmetic calculation
1260 people visited the park last Sunday. Of those, 7/18 were men, and 6/11 of the women were students. Find how many female students visited the park.
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)))))
Arithmetic calculation
Eunji has 44 ping pong balls. If she gives 4 ping pong balls to her friends each, how many friends will get the ping pong balls?
11
44 4 [OP_DIV]
var_a = 44 var_b = 4 var_c = var_a / var_b print(int(var_c))
Geometry
How many vertices are there in a tetrahedron?
4
3 1 [OP_ADD]
var_a = 3 var_b = 1 var_c = var_a + var_b print(int(var_c))
Geometry
There is a rectangle with a width three times its height. If the length of this rectangle is 0.06 meters (m), how many square meters (m2) is its area?
0.01
0.06 3 [OP_MUL] 0.06 [OP_MUL]
var_a = 0.06 var_b = 3 var_c = var_a * var_b var_d = 0.06 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
There are 12 more volleyballs and 23 fewer basketballs than soccer balls. If there are 68 soccer balls, how many soccer balls, volleyballs, and basketballs are there?
193
68 12 [OP_ADD] 68 23 [OP_SUB] [OP_ADD] 68 [OP_ADD]
var_a = 68 var_b = 12 var_c = var_a + var_b var_d = 68 var_e = 23 var_f = var_d - var_e var_g = var_c + var_f var_h = 68 var_i = var_g + var_h print(int(var_i))
Correspondence
You need to multiply a certain number by 6, but you mistakenly multiplied it by 9, and I got 153. Find the result of the correct calculation.
102
153 9 [OP_DIV] 6 [OP_MUL]
var_a = 153 var_b = 9 var_c = var_a / var_b var_d = 6 var_e = var_c * var_d print(int(var_e))
Comparison
Jinho gave 3 of the 9 pencils he had to his younger brother, and Youngsu gave 7 of the 14 pencils he had to his friend. Who has more pencils between Jinho and Youngsu?
Youngsu
[OP_LIST_SOL] Jinho Youngsu [OP_LIST_EOL] [OP_LIST_SOL] 9 3 [OP_SUB] 14 7 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jinho' var_b = 'Youngsu' 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 = 9 var_d = 3 var_e = var_c - var_d var_f = 14 var_g = 7 var_h = var_f - var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Possibility
Among 2, 4, 6, 8, and 9, you want to create a two-digit number by drawing two cards and using them only once. Find the sum of the largest and smallest two-digit numbers that can be made.
122
[OP_LIST_SOL] 2 4 6 8 9 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD]
var_a = 2 var_b = 4 var_c = 6 var_d = 8 var_e = 9 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = 1 list_d=list_b.copy() list_d.sort() var_j = list_d[var_i-1] var_k = var_h + var_j print(int(var_k))
Possibility
You want to pick two fruits out of an apple, a peach and a pear and place them in different fruit baskets. What are the number of cases?
6
[OP_LIST_SOL] apple peach pear [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_PERM]
var_a = 'apple' var_b = 'peach' var_c = 'pear' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = len(list_a) var_e = 2 var_f = 1 var_d = int(var_d) var_e = int(var_e) for i, elem in enumerate(range(var_e)): var_f = var_f * (var_d-i) print(int(var_f))
Geometry
A cube-shaped fishbowl with an edge length of 20 centimeters (cm) was filled with water up to 15 centimeters (cm) high. Here, a cube-shaped piece of iron whose edge is 10 centimeters (cm) long was placed to be completely submerged in the water. Find how many centimeters (cm) the water level in this fish tank has risen, including the decimal point.
2.5
10 10 [OP_MUL] 10 [OP_MUL] 20 20 [OP_MUL] [OP_DIV]
var_a = 10 var_b = 10 var_c = var_a * var_b var_d = 10 var_e = var_c * var_d var_f = 20 var_g = 20 var_h = var_f * var_g var_i = var_e / var_h print('{:.2f}'.format(round(var_i+1e-10,2)))
Arithmetic calculation
You are going to make chocolate necklaces for 134 kindergarteners at Seonhee's Kindergarten this year. If you need 7 chocolates for each chocolate necklace, how many bags of 28 chocolates should you buy at least?
34
134 7 [OP_MUL] 28 [OP_DIV] 1 [OP_CEIL]
var_a = 134 var_b = 7 var_c = var_a * var_b var_d = 28 var_e = var_c / var_d var_f = 1 var_g=int(((var_e+9*10**(var_f-2))//(10**(var_f-1)))*10**(var_f-1)) print(int(var_g))
Arithmetic calculation
If the rabbits are color coded, 12 are white and 9 are black. If 8 rabbits are female, how many male rabbits are there?
13
12 9 [OP_ADD] 8 [OP_SUB]
var_a = 12 var_b = 9 var_c = var_a + var_b var_d = 8 var_e = var_c - var_d print(int(var_e))
Possibility
There are 5 students in Yoongi's class, and they are trying to select a class president. At this time, how many cases can Yoongi vote for the 3 class president candidates?
243
3 5 [OP_POW]
var_a = 3 var_b = 5 var_c = var_a ** var_b print(int(var_c))
Arithmetic calculation
If the sum of three consecutive natural numbers is 30, find the middle number among the three natural numbers.
10
30 0 3 1 [OP_SUB] 1 [OP_LIST_ARANGE] [OP_LIST_SUM] [OP_SUB] 3 [OP_DIV] 3 2 [OP_FDIV] [OP_ADD]
var_a = 30 var_b = 0 var_c = 3 var_d = 1 var_e = var_c - var_d var_f = 1 list_a = [i for i in range(var_b, var_e + 1, var_f)] list_a = [float(i) for i in list_a] var_g = sum(list_a) var_h = var_a - var_g var_i = 3 var_j = var_h / var_i var_k = 3 var_l = 2 var_m = var_k // var_l var_n = var_j + var_m print(int(var_n))
Geometry
Find the area of a flower field in the shape of a circle with a radius of 0.6 meters (m) when the pi is 3.
1.08
3 0.6 2 [OP_POW] [OP_MUL]
var_a = 3 var_b = 0.6 var_c = 2 var_d = var_b ** var_c var_e = var_a * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Geometry
There is a rectangular parallelepiped with three distinct edges whose length is 4 centimeters (cm), 6 centimeters (cm), and 15 centimeters (cm) each. Find what is the volume of this rectangular parallelepiped.
360
15 6 [OP_MUL] 4 [OP_MUL]
var_a = 15 var_b = 6 var_c = var_a * var_b var_d = 4 var_e = var_c * var_d print(int(var_e))
Correspondence
If you add 82, add 90, add 88, add 84 to a number and divide it by 5, the quotient is 88. Find the number.
96
88 5 [OP_MUL] 82 [OP_SUB] 90 [OP_SUB] 88 [OP_SUB] 84 [OP_SUB]
var_a = 88 var_b = 5 var_c = var_a * var_b var_d = 82 var_e = var_c - var_d var_f = 90 var_g = var_e - var_f var_h = 88 var_i = var_g - var_h var_j = 84 var_k = var_i - var_j print(int(var_k))
Arithmetic calculation
There are five numbers: 10, 11, 12, 13, and 14. What is the remainder if the largest number is divided by the second largest number?
1
[OP_LIST_SOL] 10 11 12 13 14 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MAX] [OP_MOD]
var_a = 10 var_b = 11 var_c = 12 var_d = 13 var_e = 14 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 1 list_b=list_a.copy() list_b.sort() var_g = list_b[-var_f] var_h = 2 list_c=list_a.copy() list_c.sort() var_i = list_c[-var_h] var_j = var_g % var_i print(int(var_j))
Arithmetic calculation
There are 288 red marbles in 12 bags, and 243 blue marbles in 9 bags. Find the difference between the number of marbles in one bag of red and blue marbles.
3
288 12 [OP_DIV] 243 9 [OP_DIV] [OP_SUB] [OP_ABS]
var_a = 288 var_b = 12 var_c = var_a / var_b var_d = 243 var_e = 9 var_f = var_d / var_e var_g = var_c - var_f var_h = abs(var_g) print(int(var_h))
Comparison
There are three numbers 0.8, 1/2, and 0.9. What is the largest number that is less than 2?
0.9
[OP_LIST_SOL] 0.8 1/2 0.9 [OP_LIST_EOL] 2 [OP_LIST_LESS] 1 [OP_LIST_MAX]
var_a = 0.8 var_b = 0.5 var_c = 0.9 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 2 list_b = [] for i in list_a: if i < var_d: list_b.append(i) var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] print('{:.2f}'.format(round(var_f+1e-10,2)))
Arithmetic calculation
If you fold and unfold the paper once making them overlap, you get 2 squares, and if you fold and unfold it twice, you get 4 squares, and if you fold and unfold it 3 times, you get 8 squares. How many squares will there be on the paper if you fold and unfold it 8 times in the same way?
256
2 8 [OP_POW]
var_a = 2 var_b = 8 var_c = var_a ** var_b print(int(var_c))
Geometry
There is a square with the sum of the lengths of its four sides measuring 52 centimeters (cm). Find the area of this square.
169
52 4 [OP_DIV] 2 [OP_POW]
var_a = 52 var_b = 4 var_c = var_a / var_b var_d = 2 var_e = var_c ** var_d print(int(var_e))
Arithmetic calculation
A person consumes 0.08 milliliters (ml) of water per 1 kilometer (km). Find the amount of water consumed in milliliters (㎖) when traveling for 2 hours and 36 minutes at the speed of moving 80 kilometers (㎞) in 1 hour.
16.64
0.08 80 2 36 60 [OP_DIV] [OP_ADD] [OP_MUL] [OP_MUL]
var_a = 0.08 var_b = 80 var_c = 2 var_d = 36 var_e = 60 var_f = var_d / var_e var_g = var_c + var_f var_h = var_b * var_g var_i = var_a * var_h print('{:.2f}'.format(round(var_i+1e-10,2)))
Arithmetic calculation
Given that there are 18 apples and the sum of apples and persimmons are 33. Find the number of persimmons.
15
33 18 [OP_SUB]
var_a = 33 var_b = 18 var_c = var_a - var_b print(int(var_c))
Correspondence
Yoongi wants to add two-digit to three-digit numbers. Yoongi confused the 9 in the ones place of a two-digit number with 6, and switched the digits in the hundreds and ones place of a three-digit number and saw it as 253. If the sum obtained by Yoongi is 299, find the two-digit number.
49
299 253 [OP_SUB] 6 9 [OP_SUB] [OP_SUB]
var_a = 299 var_b = 253 var_c = var_a - var_b var_d = 6 var_e = 9 var_f = var_d - var_e var_g = var_c - var_f print(int(var_g))
Comparison
There are numbers 0.8, 1/2, 0.9, and 1/3. Find the sum of all numbers greater than 0.3.
2.53
[OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 0.3 [OP_LIST_MORE] [OP_LIST_SUM]
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) list_b = [float(i) for i in list_b] var_f = sum(list_b) print('{:.2f}'.format(round(var_f+1e-10,2)))
Correspondence
When 5A8-B14=364 is valid, find B.
2
5A8-B14=364 B [OP_DIGIT_UNK_SOLVER]
var_a = '5A8-B14=364' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Possibility
If you buy only 2 fruits out of Apples, Peaches, Pears, and Melons, how many combinations are possible?
6
[OP_LIST_SOL] Apple Peach Pear Melon [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_COMB]
var_a = 'Apple' var_b = 'Peach' var_c = 'Pear' var_d = 'Melon' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = len(list_a) var_f = 2 var_g = 1 var_e = int(var_e) var_f = int(var_f) for i, elem in enumerate(range(var_f)): var_g = var_g * (var_e-i) for i, elem in enumerate(range(var_f)): var_g = var_g / (i+1) print(int(var_g))
Geometry
There is a square-shaped park. It is said that the perimeter of a park is the largest multiple of 4 and is less than 35. If Seong-hoon tries to walk 35 kilometers (km) around the perimeter of the park, how many more kilometers (km) must he walk after one lap?
3
35 4 [OP_MOD]
var_a = 35 var_b = 4 var_c = var_a % var_b print(int(var_c))
Possibility
You are making new numbers using all 3, 9, and 8. What is the number of cases in which the number you made is more than or equal to 850 and less than or equal to 920?
1
[OP_LIST_SOL] 3 9 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 850 [OP_LIST_MORE] 920 [OP_LIST_LESS] [OP_LIST_LEN]
var_a = 3 var_b = 9 var_c = 8 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = 850 list_c = [] for i in list_b: if i > var_e: list_c.append(i) var_f = 920 list_d = [] for i in list_c: if i < var_f: list_d.append(i) var_g = len(list_d) print(int(var_g))
Geometry
If the volume of the cube is 729 cubic centimeters (cm3), how many centimeters (cm) is the length of one side of the cube?
9
729 1/3 [OP_POW]
var_a = 729 var_b = 0.3333333333333333 var_c = var_a ** var_b print(int(eval('{:.2f}'.format(round(var_c+1e-10,2)))))
Geometry
There is a tetragon having all four sides the same length. If the lengths of the two diagonals of this figure are 9 centimeters (cm) and 14 centimeters (cm), what is the area?
63
9 14 [OP_MUL] 2 [OP_DIV]
var_a = 9 var_b = 14 var_c = var_a * var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Correspondence
Divide 49 erasers and 66 pencils equally to the students in the class, leaving 4 erasers and 6 pencils. Find how many students are in the class.
15
49 4 [OP_SUB] 66 6 [OP_SUB] [OP_GCD]
var_a = 49 var_b = 4 var_c = var_a - var_b var_d = 66 var_e = 6 var_f = var_d - var_e var_g = math.gcd(int(var_f), int(var_c)) print(int(var_g))
Comparison
Jungkook collected 6 divided by 3 apples, Yoongi collected 4 apples, and Yuna collected 5 apples. Who has the fewest apples?
Jungkook
[OP_LIST_SOL] Jungkook Yoongi Yuna [OP_LIST_EOL] [OP_LIST_SOL] 6 3 [OP_FDIV] 4 5 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jungkook' var_b = 'Yoongi' var_c = 'Yuna' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 6 var_e = 3 var_f = var_d // var_e var_g = 4 var_h = 5 list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[var_i-1] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Arithmetic calculation
How many two-digit numbers meet the condition where the sum of the numbers in the ones and in the tens is greater than or equal to 8?
62
10 99 1 [OP_LIST_ARANGE] [OP_LIST_NUM2SUM] 8 [OP_LIST_MORE_EQUAL] [OP_LIST_LEN]
var_a = 10 var_b = 99 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] list_b=[] for i in list_a: var_d = 0 i = int(i) while i//10 > 0: var_d = var_d + i%10 i = i//10 var_d = var_d + i%10 list_b.append(var_d) var_e = 8 list_c = [] for i in list_b: if i >= var_e: list_c.append(i) var_f = len(list_c) print(int(var_f))
Correspondence
When 6A5+B03=748, find A.
4
6A5+B03=748 A [OP_DIGIT_UNK_SOLVER]
var_a = '6A5+B03=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
There are boxes A, B, and C with balls in them. Box A has fewer balls than Box B, and Box C has more balls than Box A. If Box C contains more balls than Box B, which box has the most balls?
C
[OP_LIST_SOL] A B C [OP_LIST_EOL] [OP_LIST_SOL] C A > A B < C B > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'A' var_b = 'B' var_c = 'C' 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 = 'C' var_e = 'A' var_f = '>' var_g = 'A' var_h = 'B' var_i = '<' var_j = 'C' var_k = 'B' var_l = '>' list_b= [] 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) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_m = 1 var_n = list_c[var_m-1] print(var_n)
Geometry
I drew the largest rhombus in a circle with a radius of 10 centimeters (cm), and then drew a smaller rhombus by connecting the middle of all four sides of the rhombus. What is the area of the small rhombus in square centimeters (cm2)?
100
10 2 [OP_MUL] 2 [OP_POW] 2 [OP_DIV] 2 [OP_DIV]
var_a = 10 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))
Possibility
I'm trying to draw 2 fruits out of apples, peaches, and pears and line them up. How many possible cases are there?
6
[OP_LIST_SOL] apples peaches pears [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_PERM]
var_a = 'apples' var_b = 'peaches' var_c = 'pears' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = len(list_a) var_e = 2 var_f = 1 var_d = int(var_d) var_e = int(var_e) for i, elem in enumerate(range(var_e)): var_f = var_f * (var_d-i) print(int(var_f))
Geometry
Find the area in square centimeters (cm2) of a rhombus where the length of one diagonal is three times 6 centimeters (cm), and the length of the other diagonal is three times 4 centimeters (cm).
108
6 3 [OP_MUL] 4 3 [OP_MUL] [OP_MUL] 2 [OP_DIV]
var_a = 6 var_b = 3 var_c = var_a * var_b var_d = 4 var_e = 3 var_f = var_d * var_e var_g = var_c * var_f var_h = 2 var_i = var_g / var_h print(int(var_i))
Correspondence
Jiho used 13/5 pieces of rubber clay to make a model. After making another identical piece, the remaining rubber clay was 9/7. Find the amount of rubber clay Jiho had at the beginning.
6.49
9/7 13/5 [OP_ADD] 13/5 [OP_ADD]
var_a = 1.2857142857142858 var_b = 2.6 var_c = var_a + var_b var_d = 2.6 var_e = var_c + var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Possibility
Find the number of three-digit numbers where each digit is even.
100
0 9 [OP_LIST_EVEN] 3 [OP_LIST_GET_PRODUCT] [OP_LIST_LEN]
var_a = 0 var_b = 9 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 = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=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))
Arithmetic calculation
You decided to put 235 candies in a box of 10 and sell them for 3,000 won. What is the maximum amount of money you can make selling boxed candy?
69000
235 10 [OP_FDIV] 3000 [OP_MUL]
var_a = 235 var_b = 10 var_c = var_a // var_b var_d = 3000 var_e = var_c * var_d print(int(var_e))
Arithmetic calculation
A turtle moves 15 meters (m) in 3 minutes at a constant speed. How many minutes does it take for a tortoise to travel 140 meters (m)?
28
140 15 3 [OP_DIV] [OP_DIV]
var_a = 140 var_b = 15 var_c = 3 var_d = var_b / var_c var_e = var_a / var_d print(int(var_e))
Geometry
Jaeho has a field in the shape of a rectangle. One side of this field is 5.9 meters (m) long and the other side is 3 meters (m) long. Find the area of this field.
17.7
5.9 3 [OP_MUL]
var_a = 5.9 var_b = 3 var_c = var_a * var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Comparison
Namjoon was the second to arrive at school, and Jimin arrived just before Namjoon. In what place did Jimin enter school?
1
2 1 [OP_SUB]
var_a = 2 var_b = 1 var_c = var_a - var_b print(int(var_c))
Comparison
There are vineyards in the village (a), (b) and (c). If village (c) harvested fewer bunches of grapes than village (a), and village (b) harvested more bunches of grapes than village (a), find which village harvested the fewest bunches of grapes.
(c)
[OP_LIST_SOL] (a) (b) (c) [OP_LIST_EOL] [OP_LIST_SOL] (b) (a) > (c) (a) < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET]
var_a = '(a)' var_b = '(b)' var_c = '(c)' 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 = '(b)' var_e = '(a)' var_f = '>' var_g = '(c)' var_h = '(a)' var_i = '<' list_b= [] if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_j = len(list_c) var_k = list_c[var_j-1] print(var_k)
Arithmetic calculation
The barrel has contained 4 fish (a) and 3 fish (b). I bought some more fish today and put them in the barrel, so there are 10 fish in total. How many more fish did I put in today?
3
10 4 3 [OP_ADD] [OP_SUB]
var_a = 10 var_b = 4 var_c = 3 var_d = var_b + var_c var_e = var_a - var_d print(int(var_e))
Comparison
How many numbers greater than 256 have 5 in the tens digit and 2 in the hundreds digit?
3
[OP_LIST_SOL] 2 5 A [OP_LIST_EOL] [OP_LIST2NUM] [OP_GEN_POSSIBLE_LIST] 256 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 2 var_b = 5 var_c = 'A' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d="" for i in list_a: i = str(i) var_d = var_d + i ans_dict = dict() var_d = str(var_d) list_b = [] variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_d): if v in variable_candi: ans_dict[v] = 0 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_d for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) if len(var_d) == len(str(int(temp))): new_elem = int(temp) list_b.append(new_elem) var_e = 256 list_c = [] for i in list_b: if i > var_e: list_c.append(i) var_f = len(list_c) print(int(var_f))
Geometry
A square has two pairs of parallel sides. If the height of this square is 8 centimeters (cm) and the area is 78.88 square cm (cm2), what is the length?
9.86
78.88 8 [OP_DIV]
var_a = 78.88 var_b = 8 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
When Jiyoung opened the fairy tale book, the sum of the pages on the two pages she opened was 217. What is the product of the number of pages unfolded?
11772
217 2 [OP_FDIV] 217 2 [OP_FDIV] 1 [OP_ADD] [OP_MUL]
var_a = 217 var_b = 2 var_c = var_a // var_b var_d = 217 var_e = 2 var_f = var_d // var_e var_g = 1 var_h = var_f + var_g var_i = var_c * var_h print(int(var_i))
Geometry
The area of a trapezoid is 96.9 square centimeters (cm2). If the lower side is 3.6 centimeters (cm) shorter than the upper side and the height is 5.2 centimeters (cm), how many centimeters (cm) is the lower side?
16.85
96.98 2 [OP_MUL] 5.2 [OP_DIV] 3.6 [OP_SUB] 2 [OP_DIV]
var_a = 96.98 var_b = 2 var_c = var_a * var_b var_d = 5.2 var_e = var_c / var_d var_f = 3.6 var_g = var_e - var_f var_h = 2 var_i = var_g / var_h print('{:.2f}'.format(round(var_i+1e-10,2)))
Arithmetic calculation
Find how many single digits are in all from 2 to 100.
8
2 100 1 [OP_LIST_ARANGE] 9 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN]
var_a = 2 var_b = 100 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 9 list_b = [] for i in list_a: if i <= var_d: list_b.append(i) var_e = len(list_b) print(int(var_e))
Possibility
We are going to divide 54 apples equally into every plate. How many different ways can you portion it out on a plate? (However, not all 54 apples are placed on one plate.)
7
54 [OP_LIST_GET_DIVISOR] [OP_LIST_SOL] 54 [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN]
var_a = 54 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 = 54 list_b= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_b.append(var_b) list_b.reverse() list_c = list(set(list_a) - set(list_b)) var_c = len(list_c) print(int(var_c))
Geometry
You are going to make as many small square pieces as possible by cutting out a large rectangular piece of paper measuring 262 centimeters (cm) long and 185 centimeters (cm) wide. Find how many square pieces of paper you can make.
140
262 18 [OP_FDIV] 185 18 [OP_FDIV] [OP_MUL]
var_a = 262 var_b = 18 var_c = var_a // var_b var_d = 185 var_e = 18 var_f = var_d // var_e var_g = var_c * var_f print(int(var_g))
Correspondence
If 2A3+36=269, what number should go in A?
3
2A3+36=269 A [OP_DIGIT_UNK_SOLVER]
var_a = '2A3+36=269' 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
Taehyung and Namjoon bought 10 pieces of colored paper each and used several of them. When Taehyung gave 3 of the remaining pieces of colored paper to Namjoon, the number of pieces of colored paper they both had ended up to 6. How many pieces of colored paper did Namjoon use?
7
10 6 3 [OP_SUB] [OP_SUB]
var_a = 10 var_b = 6 var_c = 3 var_d = var_b - var_c var_e = var_a - var_d print(int(var_e))
Correspondence
Twelve candies that cost 530 won each, cost 5,400 won more than 8 chocolates. How much is one chocolate?
120
530 12 [OP_MUL] 5400 [OP_SUB] 8 [OP_DIV]
var_a = 530 var_b = 12 var_c = var_a * var_b var_d = 5400 var_e = var_c - var_d var_f = 8 var_g = var_e / var_f print(int(var_g))
Possibility
You are about to make two-digit numbers by using two of the four cards 3, 5, 6, and 7. Find the average of the multiples of 7 you can make.
51.33
[OP_LIST_SOL] 3 5 6 7 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 7 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MEAN]
var_a = 3 var_b = 5 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 = 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 = 7 list_c = [] var_f = int(var_f) for i in list_b: i = int(i) if i % var_f == 0: list_c.append(i) var_g = 1 list_c = [float(i) for i in list_c] var_h = sum(list_c)/len(list_c) print('{:.2f}'.format(round(var_h+1e-10,2)))