category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Possibility
You chose two of the five numbers 0, 1, 2, 3, 4, and 5 to make two-digit numbers. If you can use the same number multiple times, how many numbers can you make in total?
30
[OP_LIST_SOL] 0 1 2 3 4 5 [OP_LIST_EOL] 2 [OP_LIST_GET_PRODUCT] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 2 var_d = 3 var_e = 4 var_f = 5 list_a= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_g = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=var_g)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_h = len(list_b) print(int(var_h))
Arithmetic calculation
From 1 to 100, A is the sum of all even numbers, and B is the sum of all odd numbers. What is the difference of A and B?
50
1 100 [OP_LIST_EVEN] [OP_LIST_SUM] 1 100 [OP_LIST_ODD] [OP_LIST_SUM] [OP_SUB]
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) list_a = [float(i) for i in list_a] var_c = sum(list_a) var_d = 1 var_e = 100 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) list_b = [float(i) for i in list_b] var_f = sum(list_b) var_g = var_c - var_f print(int(var_g))
Geometry
There are 8 rectangular fields with a length of 300 meters (m). If the area of each field is the same and the total area of the fields is 0.6 square kilometers (km2), how many meters (m) is the width of the field?
250
0.6 1000 1000 [OP_MUL] [OP_MUL] 8 [OP_DIV] 300 [OP_DIV]
var_a = 0.6 var_b = 1000 var_c = 1000 var_d = var_b * var_c var_e = var_a * var_d var_f = 8 var_g = var_e / var_f var_h = 300 var_i = var_g / var_h print(int(var_i))
Arithmetic calculation
Seonho has 2,500 won after spending 1/4 of the money in his wallet to buy snacks and 2/3 of the remaining money to buy food. How much money is in his wallet?
10000
2500 1 1/4 [OP_SUB] [OP_DIV] 1 2/3 [OP_SUB] [OP_DIV]
var_a = 2500 var_b = 1 var_c = 0.25 var_d = var_b - var_c var_e = var_a / var_d var_f = 1 var_g = 0.6666666666666666 var_h = var_f - var_g var_i = var_e / var_h print(int(var_i))
Arithmetic calculation
Yoojung folded two fingers, and Yuna folded five. How many fingers do two people fold?
7
2 5 [OP_ADD]
var_a = 2 var_b = 5 var_c = var_a + var_b print(int(var_c))
Arithmetic calculation
Hoseok's average score in Korean and Mathematics is 88 points. If the average score of Korean, Mathematics, and English is 90, what is Hoseok's English score?
94
90 3 [OP_MUL] 88 2 [OP_MUL] [OP_SUB]
var_a = 90 var_b = 3 var_c = var_a * var_b var_d = 88 var_e = 2 var_f = var_d * var_e var_g = var_c - var_f print(int(var_g))
Arithmetic calculation
Three 217 centimeters (cm) long strings are tied together. If the length of the string at the tied part is the same and the length of the tied string is 627 centimeters (cm), find how many centimeters (cm) is the length of one part of the tied part.
12
217 3 [OP_MUL] 627 [OP_SUB] 3 1 [OP_SUB] [OP_DIV]
var_a = 217 var_b = 3 var_c = var_a * var_b var_d = 627 var_e = var_c - var_d var_f = 3 var_g = 1 var_h = var_f - var_g var_i = var_e / var_h print(int(var_i))
Arithmetic calculation
48 objects which weigh a one-metric ton (m/t) have to be moved. How many moves are needed to make if trucks can carry up to 4 metric tons (m/t) at a time and 6 trucks move at once?
2
48 4 6 [OP_MUL] [OP_DIV]
var_a = 48 var_b = 4 var_c = 6 var_d = var_b * var_c var_e = var_a / var_d print(int(var_e))
Correspondence
When you multiply a number by 17, you get 493. Find the number.
29
493 17 [OP_DIV]
var_a = 493 var_b = 17 var_c = var_a / var_b print(int(var_c))
Geometry
The area of a circle is equal to four times the area of the other circle with a radius of 2 cm. Find the size of the radius of the other circle.
4
4 2 2 [OP_POW] [OP_MUL] 1/2 [OP_POW]
var_a = 4 var_b = 2 var_c = 2 var_d = var_b ** var_c var_e = var_a * var_d var_f = 0.5 var_g = var_e ** var_f print(int(var_g))
Possibility
If there are 3 types of pencils, 2 types of erasers, and 5 types of notebooks, find how many ways there are to buy 1 type of pencil, 1 type of eraser, and 1 type of notebook.
30
3 2 [OP_MUL] 5 [OP_MUL]
var_a = 3 var_b = 2 var_c = var_a * var_b var_d = 5 var_e = var_c * var_d print(int(var_e))
Arithmetic calculation
There is a train that runs at 400 meters (m) per minute. How many minutes does it take to completely cross the 1.625 kilometer (km) bridge? The length of the train is 115 meters (m).
4.35
115 1.625 1000 [OP_MUL] [OP_ADD] 400 [OP_DIV]
var_a = 115 var_b = 1.625 var_c = 1000 var_d = var_b * var_c var_e = var_a + var_d var_f = 400 var_g = var_e / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Possibility
If there are 6 citizens A, B, C, D, E, and F, find the number of ways to elect 3 members for the National Assembly.
20
[OP_LIST_SOL] A B C D E F [OP_LIST_EOL] [OP_LIST_LEN] 3 [OP_COMB]
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 = 3 var_i = 1 var_g = int(var_g) var_h = int(var_h) for i, elem in enumerate(range(var_h)): var_i = var_i * (var_g-i) for i, elem in enumerate(range(var_h)): var_i = var_i / (i+1) print(int(var_i))
Possibility
Find the number of natural numbers that can be made by picking four of the number cards 0, 1, 2, 4, and 9.
96
[OP_LIST_SOL] 0 1 2 4 9 [OP_LIST_EOL] 4 [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 = 4 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))
Arithmetic calculation
There are five numbers 10, 11, 12, 13, and 14. What is the remainder when the 3rd smallest number is divided by the 2nd smallest number?
1
[OP_LIST_SOL] 10 11 12 13 14 [OP_LIST_EOL] 3 [OP_LIST_MIN] 2 [OP_LIST_MIN] [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 = 3 list_b=list_a.copy() list_b.sort() var_g = list_b[var_f-1] var_h = 2 list_c=list_a.copy() list_c.sort() var_i = list_c[var_h-1] var_j = var_g % var_i print(int(var_j))
Correspondence
When 132.6 kilograms (kg) of apples harvested from the orchard were divided into equal weights in each truck, each truck loaded 13.26 kilograms (kg). If 6.4 kilograms (kg) of bananas are divided among these trucks, how many kilograms (kg) of bananas will be loaded per truck?
0.64
6.4 132.6 13.26 [OP_DIV] [OP_DIV]
var_a = 6.4 var_b = 132.6 var_c = 13.26 var_d = var_b / var_c var_e = var_a / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
63 is the result of subtracting 29 from a number. Find the value which is 47 less than this number.
45
63 29 [OP_ADD] 47 [OP_SUB]
var_a = 63 var_b = 29 var_c = var_a + var_b var_d = 47 var_e = var_c - var_d print(int(var_e))
Geometry
A rectangle has a sum of four sides equal to 52 centimeters (cm). If the length of one of the sides is 11 centimeters (cm), what is the area?
165
11 52 2 [OP_DIV] 11 [OP_SUB] [OP_MUL]
var_a = 11 var_b = 52 var_c = 2 var_d = var_b / var_c var_e = 11 var_f = var_d - var_e var_g = var_a * var_f print(int(var_g))
Possibility
A set of boxes contains 2 balls. With a set of 3, how many balls are there?
6
2 3 [OP_MUL]
var_a = 2 var_b = 3 var_c = var_a * var_b print(int(var_c))
Correspondence
3/10 of this number minus 8 is 12. Find what 1/5 of this number is.
13.33
12 8 [OP_ADD] 3/10 [OP_DIV] 1/5 [OP_MUL]
var_a = 12 var_b = 8 var_c = var_a + var_b var_d = 0.3 var_e = var_c / var_d var_f = 0.2 var_g = var_e * var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Possibility
What is the sum of the smallest and third smallest numbers that can be formed by moving each digit in 168?
786
168 [OP_NUM2LIST] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] 3 [OP_LIST_MIN] [OP_ADD]
var_a = 168 list_a = [] var_a = int(var_a) while var_a//10 > 0: list_a.append(var_a%10) var_a = var_a//10 list_a.append(var_a%10) list_a = list_a[::-1] var_b = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_b)) 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_c = 1 list_c=list_b.copy() list_c.sort() var_d = list_c[var_c-1] var_e = 3 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))
Comparison
Nine people are standing in a row in order from the short person. Hoseok is standing in second place from the back, and Yuna is standing right behind Hoseok. If you line up again starting with the tall person, which place will Yuna stand from the front?
1
4 3 [OP_SUB]
var_a = 4 var_b = 3 var_c = var_a - var_b print(int(var_c))
Possibility
Find the number of three-digit integers that can be made by drawing 3 cards from 5 cards each containing the numbers 0, 1, 2, 3, 4.
48
[OP_LIST_SOL] 0 1 2 3 4 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 2 var_d = 3 var_e = 4 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
A rice store bought 750 kilograms (kg) of rice. The first week they bought rice, they sold a few kilograms of rice, the next week they sold 3/5 of the remaining rice, and the next week they sold 5/8 of the remaining rice. 75 kg (kg) of rice was left 75 kg (kg) at the end. How many kilograms (kg) of rice did they sell in the first week?
250
750 75 1 5/8 [OP_SUB] [OP_DIV] 1 3/5 [OP_SUB] [OP_DIV] [OP_SUB]
var_a = 750 var_b = 75 var_c = 1 var_d = 0.625 var_e = var_c - var_d var_f = var_b / var_e var_g = 1 var_h = 0.6 var_i = var_g - var_h var_j = var_f / var_i var_k = var_a - var_j print(int(var_k))
Arithmetic calculation
There are 58 roses. The number of tulips is 15 less than the number of roses and the number of lilies is 25 more than the number of roses. What is the total number of roses, tulips, and lilies?
184
58 58 15 [OP_SUB] [OP_ADD] 58 25 [OP_ADD] [OP_ADD]
var_a = 58 var_b = 58 var_c = 15 var_d = var_b - var_c var_e = var_a + var_d var_f = 58 var_g = 25 var_h = var_f + var_g var_i = var_e + var_h print(int(var_i))
Geometry
The height of a rectangular parallelepiped with a volume of 49 square centimeters (cm2) is 7 centimeters (cm). Find the area of the base.
7
49 7 [OP_DIV]
var_a = 49 var_b = 7 var_c = var_a / var_b print(int(var_c))
Comparison
Which one has the greater volume, a card holder in the shape of a cuboid with a base area of 8 square centimeters (cm2) and a height of 3 centimeters (cm), or a dice with a side length of 6 centimeters (cm)?
dice
[OP_LIST_SOL] holder dice [OP_LIST_EOL] [OP_LIST_SOL] 8 3 [OP_MUL] 5 5 [OP_MUL] 5 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'holder' var_b = 'dice' 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 = 8 var_d = 3 var_e = var_c * var_d var_f = 5 var_g = 5 var_h = var_f * var_g var_i = 5 var_j = var_h * var_i list_b= [] if "/" in str(var_j): var_j = eval(str(var_j)) list_b.append(var_j) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_k = 1 list_c=list_b.copy() list_c.sort() var_l = list_c[-var_k] var_m = list_b.index(var_l)+1 var_n = list_a[var_m-1] print(var_n)
Correspondence
Hansol is going to Busan by train. On the way, 263 passengers got off and 419 got on. When he counted the number of passengers arriving at his destination, Busan, there were 725 passengers. How many passengers were on the train at first?
569
725 419 [OP_SUB] 263 [OP_ADD]
var_a = 725 var_b = 419 var_c = var_a - var_b var_d = 263 var_e = var_c + var_d print(int(var_e))
Comparison
Which of the four numbers among 5, 8, 3, 2 is the smallest?
2
[OP_LIST_SOL] 5 8 3 2 [OP_LIST_EOL] 1 [OP_LIST_MIN]
var_a = 5 var_b = 8 var_c = 3 var_d = 2 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 1 list_b=list_a.copy() list_b.sort() var_f = list_b[var_e-1] print(int(var_f))
Possibility
If you make two-digit numbers by picking two out of six number cards 8, 3, 6, 5, 0, 7, the second largest number is A and the third largest number is B. Find (A-B)×6.
6
[OP_LIST_SOL] 8 3 6 5 0 7 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 2 [OP_LIST_MAX] 3 [OP_LIST_MAX] [OP_SUB] 6 [OP_MUL]
var_a = 8 var_b = 3 var_c = 6 var_d = 5 var_e = 0 var_f = 7 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 = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_g)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_h = 2 list_c=list_b.copy() list_c.sort() var_i = list_c[-var_h] var_j = 3 list_d=list_b.copy() list_d.sort() var_k = list_d[-var_j] var_l = var_i - var_k var_m = 6 var_n = var_l * var_m print(int(var_n))
Correspondence
I multiplied a particular number by 25, when I should have divided that particular number by 4. As a result, I got 812. Find the correct calculated value.
8.12
812 25 [OP_DIV] 4 [OP_DIV]
var_a = 812 var_b = 25 var_c = var_a / var_b var_d = 4 var_e = var_c / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
One year before my older brother was 10, my younger brother was 7 years old, and my mother was 32 when my younger brother was 5 years old. Find the sum of the ages of the younger brother and mother when the older brother is 12 years old.
46
12 7 10 1 [OP_SUB] [OP_SUB] [OP_ADD] 12 7 10 [OP_SUB] [OP_ADD] 32 5 [OP_SUB] [OP_ADD] [OP_ADD]
var_a = 12 var_b = 7 var_c = 10 var_d = 1 var_e = var_c - var_d var_f = var_b - var_e var_g = var_a + var_f var_h = 12 var_i = 7 var_j = 10 var_k = var_i - var_j var_l = var_h + var_k var_m = 32 var_n = 5 var_o = var_m - var_n var_p = var_l + var_o var_q = var_g + var_p print(int(var_q))
Possibility
If 6 soccer teams play with each other once, how many matches will take place in total?
15
6 2 [OP_COMB]
var_a = 6 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))
Comparison
The distance from the house to the park is 150 meters (m) more than 3 kilometers (km), and the distance from the house to the bank is 3095 meters (m). Which is farther from home, the park or the bank?
park
[OP_LIST_SOL] park bank [OP_LIST_EOL] [OP_LIST_SOL] 3 1000 [OP_MUL] 150 [OP_ADD] 3096 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'park' var_b = 'bank' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 3 var_d = 1000 var_e = var_c * var_d var_f = 150 var_g = var_e + var_f var_h = 3096 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
5 rows of 8 square-shaped checkerboards that are each 30 centimeters (cm) wide and 30 centimeters (cm) long were attached on the floor. Find the area of the plane on the checkerboard in square centimeters (m2).
3.6
30 100 [OP_DIV] 2 [OP_POW] 8 [OP_MUL] 5 [OP_MUL]
var_a = 30 var_b = 100 var_c = var_a / var_b var_d = 2 var_e = var_c ** var_d var_f = 8 var_g = var_e * var_f var_h = 5 var_i = var_g * var_h print('{:.2f}'.format(round(var_i+1e-10,2)))
Arithmetic calculation
The sum of 3 consecutive odd numbers is 52 greater than the largest odd number of 3 odd numbers. Write down the smallest one of the three odd numbers.
25
52 2 1 [OP_MUL] 2 2 [OP_MUL] [OP_ADD] [OP_ADD] 3 1 [OP_SUB] [OP_DIV] 2 2 [OP_MUL] [OP_SUB]
var_a = 52 var_b = 2 var_c = 1 var_d = var_b * var_c var_e = 2 var_f = 2 var_g = var_e * var_f var_h = var_d + var_g var_i = var_a + var_h var_j = 3 var_k = 1 var_l = var_j - var_k var_m = var_i / var_l var_n = 2 var_o = 2 var_p = var_n * var_o var_q = var_m - var_p print(int(var_q))
Comparison
There are 6 numbers 1, 4, 25, 16, 22, and 14. What is the 2nd smallest number?
4
[OP_LIST_SOL] 1 4 25 16 22 14 [OP_LIST_EOL] 2 [OP_LIST_MIN]
var_a = 1 var_b = 4 var_c = 25 var_d = 16 var_e = 22 var_f = 14 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 = 2 list_b=list_a.copy() list_b.sort() var_h = list_b[var_g-1] print(int(var_h))
Comparison
The distance from the house to the orchard is 396 meters (m) and the distance from the house to the market is 0.389 kilometers (km). Which is closer to the house, the orchard or the market?
mart
[OP_LIST_SOL] orchard mart [OP_LIST_EOL] [OP_LIST_SOL] 396 0.389 1000 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'orchard' var_b = 'mart' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 396 var_d = 0.389 var_e = 1000 var_f = var_d * var_e list_b= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_c): var_c = eval(str(var_c)) list_b.append(var_c) list_b.reverse() var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[var_g-1] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Correspondence
Divide 244.8 by some number to get 51. Find the value multiplied by 15.
72
244.8 51 [OP_DIV] 15 [OP_MUL]
var_a = 244.8 var_b = 51 var_c = var_a / var_b var_d = 15 var_e = var_c * var_d print(int(var_e))
Arithmetic calculation
Each gift box contains 156 candies. How many candies will you need in total if you are going to distribute each gift box to 20 children?
3120
156 20 [OP_MUL]
var_a = 156 var_b = 20 var_c = var_a * var_b print(int(var_c))
Geometry
A trapezoid is a quadrilateral with one pair of opposite sides parallel to each other. A triangle shape was cut out of this trapezoid so that the remaining opposite sides were parallel. If the base of a shape made like this is 9.51 centimeters (cm) and the height is 4.8 centimeters (cm), what is the area?
45.65
9.51 4.8 [OP_MUL]
var_a = 9.51 var_b = 4.8 var_c = var_a * var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
Find the sum of the following six natural numbers. 36, 17, 32, 54, 28, 3.
170
[OP_LIST_SOL] 36 17 32 54 28 3 [OP_LIST_EOL] [OP_LIST_SUM]
var_a = 36 var_b = 17 var_c = 32 var_d = 54 var_e = 28 var_f = 3 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() list_a = [float(i) for i in list_a] var_g = sum(list_a) print(int(var_g))
Arithmetic calculation
To make ribbons in Dayeon's class, 10 students divided the ribbon tapes by 0.84 meters (m). If the ribbon tape had 50 centimeters (cm) left after it was divided, how many meters (m) were it before it was divided?
8.9
0.84 10 [OP_MUL] 50 100 [OP_DIV] [OP_ADD]
var_a = 0.84 var_b = 10 var_c = var_a * var_b var_d = 50 var_e = 100 var_f = var_d / var_e var_g = var_c + var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Arithmetic calculation
There are three numbers 10, 11, and 12. What is the largest number divided by the second smallest number?
1.09
[OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_DIV]
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-1] var_h = var_e / var_g print('{:.2f}'.format(round(var_h+1e-10,2)))
Possibility
Using the number cards 1, 6, and 8 all at least once, find the difference between the largest three-digit number and the third largest three-digit number.
243
[OP_LIST_SOL] 1 6 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 3 [OP_LIST_GET] [OP_SUB] [OP_ABS]
var_a = 1 var_b = 6 var_c = 8 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] var_g = 3 var_h = list_b[var_g-1] var_i = var_f - var_h var_j = abs(var_i) print(int(var_j))
Arithmetic calculation
What is the largest number that is a multiple of 4 and a factor of 108?
108
108 [OP_LIST_GET_DIVISOR] 4 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX]
var_a = 108 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 = 4 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] print(int(var_d))
Geometry
I have decided to mark two lines every 4 meters (m) on a 68 meter (m) line. How many marks are there? (Note that both ends of the string are also marked).
36
68 4 [OP_DIV] 2 [OP_MUL] 2 [OP_ADD]
var_a = 68 var_b = 4 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))
Arithmetic calculation
There are even numbers from 2 to 20. What is the 3rd largest number minus the 4th smallest number?
8
2 20 [OP_LIST_EVEN] 3 [OP_LIST_MAX] 4 [OP_LIST_MIN] [OP_SUB]
var_a = 2 var_b = 20 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=list_a.copy() list_b.sort() var_d = list_b[-var_c] var_e = 4 list_c=list_a.copy() list_c.sort() var_f = list_c[var_e-1] var_g = var_d - var_f print(int(var_g))
Correspondence
The quotient of 59 divided by the natural number A is 6 and the remainder is 5. What is the value of A?
9
59 5 [OP_SUB] 6 [OP_DIV]
var_a = 59 var_b = 5 var_c = var_a - var_b var_d = 6 var_e = var_c / var_d print(int(var_e))
Correspondence
When you divide a certain number by 3, you get a result equal to the number you divided. What number is it?
9
3 3 [OP_MUL]
var_a = 3 var_b = 3 var_c = var_a * var_b print(int(var_c))
Geometry
If the height of a parallelogram with an area of 108 square centimeters is 9 centimeters (cm), what is the length of the base in centimeters (cm)?
12
108 9 [OP_DIV]
var_a = 108 var_b = 9 var_c = var_a / var_b print(int(var_c))
Arithmetic calculation
Watermelons of the same size and weight were filled in a basket, and the basket weighed 63 kilograms (kg). After removing half of the watermelons, the basket weighed 34 kilograms (kg). What was the weight of the watermelons without the basket before they were removed?
58
63 34 [OP_SUB] 2 [OP_MUL]
var_a = 63 var_b = 34 var_c = var_a - var_b var_d = 2 var_e = var_c * var_d print(int(var_e))
Comparison
Jiwoo is 1.32 meters (m) tall and Heejin is 1.3 meters (m) tall. If the class numbers students from the shortest to the tallest, which of Jiwoo's and Heejin's numbers is higher?
Jiwoo
[OP_LIST_SOL] Jiwoo Heejin [OP_LIST_EOL] [OP_LIST_SOL] 1.32 1.3 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jiwoo' var_b = 'Heejin' 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.32 var_d = 1.3 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)
Comparison
When 45 boxes of different sizes are arranged in order from smallest to largest, the red box is 29th from the right. If the boxes are arranged in order of size starting from the largest, how far from the right should the red box be?
17
45 29 [OP_SUB] 1 [OP_ADD]
var_a = 45 var_b = 29 var_c = var_a - var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Geometry
How many diagonals are there in a figure composed of ten angles?
35
10 10 3 [OP_SUB] [OP_MUL] 2 [OP_DIV]
var_a = 10 var_b = 10 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
Yuna's family drank 0.4 of the milk today, and the amount of milk was 0.69 liters (L). Find how many liters (L) of milk were in the beginning.
1.73
0.69 0.4 [OP_DIV]
var_a = 0.69 var_b = 0.4 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
If the sum of two consecutive natural numbers is 39, find the larger of the two natural numbers.
20
39 1 [OP_ADD] 2 [OP_DIV]
var_a = 39 var_b = 1 var_c = var_a + var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
There are 3 tulips and 4 carnations in the flower bed. How many flowers are there in the flower bed in total?
7
3 4 [OP_ADD]
var_a = 3 var_b = 4 var_c = var_a + var_b print(int(var_c))
Correspondence
When a number is divided by 30, it leaves a remainder of 14, when divided by 50, it leaves a remainder of 24, and when divided by 70, it leaves a remainder of 34. Find the smallest number that satisfies this condition.
524
0 9999 1 [OP_LIST_ARANGE] 30 14 [OP_LIST_DIVIDE_AND_REMAIN] 50 24 [OP_LIST_DIVIDE_AND_REMAIN] 70 34 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_MIN]
var_a = 0 var_b = 9999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 30 var_e = 14 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 = 50 var_g = 24 list_c = [] var_f = int(var_f) var_g = int(var_g) if var_g < 0: var_g = var_g + var_f for i in list_b: i = int(i) if i%var_f == var_g: list_c.append(i) var_h = 70 var_i = 34 list_d = [] var_h = int(var_h) var_i = int(var_i) if var_i < 0: var_i = var_i + var_h for i in list_c: i = int(i) if i%var_h == var_i: list_d.append(i) var_j = 1 list_e=list_d.copy() list_e.sort() var_k = list_e[var_j-1] print(int(var_k))
Possibility
Dongbin uses 6, 2, and 5 to make a three-digit number. What is the difference between the largest number and the smallest number Dongbin can make?
396
[OP_LIST_SOL] 6 2 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB]
var_a = 6 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 = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] var_g = 1 list_d=list_b.copy() list_d.sort() var_h = list_d[var_g-1] var_i = var_f - var_h print(int(var_i))
Arithmetic calculation
Jimin got 87 points in Korean and 98 points in math. How many English points should Jimin get in order to get an average point of 95 on the Korean, Math, and English tests?
100
95 3 [OP_MUL] 98 [OP_SUB] 87 [OP_SUB]
var_a = 95 var_b = 3 var_c = var_a * var_b var_d = 98 var_e = var_c - var_d var_f = 87 var_g = var_e - var_f print(int(var_g))
Arithmetic calculation
There were 15 pigeons. After a while, a few more pigeons flew in, bringing the total to 21. How many pigeons flew by?
6
21 15 [OP_SUB]
var_a = 21 var_b = 15 var_c = var_a - var_b print(int(var_c))
Possibility
You are going to create a two-digit number using the numbers 3 and 5 only once. How many two-digit numbers can you make?
2
[OP_LIST_SOL] 3 5 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 3 var_b = 5 list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_c)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_d = len(list_b) print(int(var_d))
Comparison
A rabbit and a tortoise are racing. During the same time, the rabbit ran 1/100 of 10.2 kilometers (km), and the tortoise ran 100 meters (m). Who ran more, the rabbit or the tortoise?
rabbit
[OP_LIST_SOL] rabbit tortoise [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 = 'rabbit' var_b = 'tortoise' 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)
Arithmetic calculation
Find the number of odd numbers from 1 to 9.
5
1 9 [OP_LIST_ODD] [OP_LIST_LEN]
var_a = 1 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 = len(list_a) print(int(var_c))
Possibility
How many ways can you wear 3 different shirts and 4 pants in combination?
12
3 4 [OP_MUL]
var_a = 3 var_b = 4 var_c = var_a * var_b print(int(var_c))
Arithmetic calculation
You surveyed regarding the number of elementary school students in one area of Seoul, and found out that there are 786 students at (A) school, 777 for (B) school, 762 for (C) school, 819 for (D) school, and 493 for (E) school. How many schools have an even number of students?
2
[OP_LIST_SOL] 786 777 762 819 493 [OP_LIST_EOL] 2 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 786 var_b = 777 var_c = 762 var_d = 819 var_e = 493 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 = [] 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))
Arithmetic calculation
Hoseok ate 8 apples, 5 pears, 12 tangerines, 17 lemons, and 10 watermelons. Find the number of lemons eaten minus the number of pears eaten.
12
17 5 [OP_SUB]
var_a = 17 var_b = 5 var_c = var_a - var_b print(int(var_c))
Arithmetic calculation
There are five numbers 10, 11, 12, 13, and 14. What is the largest number divided by the smallest number?
1.4
[OP_LIST_SOL] 10 11 12 13 14 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_DIV]
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 = 1 list_c=list_a.copy() list_c.sort() var_i = list_c[var_h-1] var_j = var_g / var_i print('{:.2f}'.format(round(var_j+1e-10,2)))
Arithmetic calculation
You will need 4 meters (m) of wire to draw one circle. If Taemin's wire is 105.8 meters (m) long, how many circles can he draw?
26
105.8 4 [OP_FDIV]
var_a = 105.8 var_b = 4 var_c = var_a // var_b print(int(var_c))
Correspondence
If A85-2B=364, what number should go in B?
1
A85-2B=364 B [OP_DIGIT_UNK_SOLVER]
var_a = 'A85-2B=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))
Correspondence
You had to multiply 2 by a number but mistakenly multiplied 5 by the number instead to get 40. Find the correctly calculated value.
16
40 5 [OP_DIV] 2 [OP_MUL]
var_a = 40 var_b = 5 var_c = var_a / var_b var_d = 2 var_e = var_c * var_d print(int(var_e))
Geometry
You have a rectangle with a perimeter of 54 centimeters (cm). If the vertical length is 3 centimeters (cm) shorter than the horizontal length, what is the horizontal length?
15
54 2 [OP_DIV] 3 [OP_SUB] 2 [OP_DIV] 3 [OP_ADD]
var_a = 54 var_b = 2 var_c = var_a / var_b var_d = 3 var_e = var_c - var_d var_f = 2 var_g = var_e / var_f var_h = 3 var_i = var_g + var_h print(int(var_i))
Geometry
Given a hexahedron, find the number of its faces.
6
6
var_a = 6 print(int(var_a))
Geometry
Three points are not in a straight line. How many rays are there for these three points?
6
3 2 [OP_PERM]
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) print(int(var_c))
Arithmetic calculation
There is a centipede that travels 5 meters (m) in 3 minutes and an earthworm that travels 5 meters (m) in 2 minutes at a constant speed. If this centipede started 20 meters (m) ahead of the worm in the same direction at the same time, find out what time in minutes the centipede and the worm meet.
24
20 5 2 [OP_DIV] 5 3 [OP_DIV] [OP_SUB] [OP_DIV]
var_a = 20 var_b = 5 var_c = 2 var_d = var_b / var_c var_e = 5 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)))))
Arithmetic calculation
There are 43, 92, 71, and 64. What is the largest number minus the smallest number?
49
[OP_LIST_SOL] 43 92 71 64 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB]
var_a = 43 var_b = 92 var_c = 71 var_d = 64 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 = 1 list_c=list_a.copy() list_c.sort() var_h = list_c[var_g-1] var_i = var_f - var_h print(int(var_i))
Possibility
There are 5 number cards, one each with a number from 1 to 5 written on it. What is the number of all cases that can come out when taking out three of these and calculating the sum of each number?
60
1 5 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] [OP_LIST_LEN]
var_a = 1 var_b = 5 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 = len(list_c) print(int(var_f))
Arithmetic calculation
Divide 13 by A, and you get 4 as the quotient and B as the remainder. Both A, B are natural numbers. Find the smallest possible value of B.
1
1
var_a = 1 print(int(var_a))
Arithmetic calculation
21 liters (L) of ethanol was added to the flask for 6 minutes. The flask took 22 minutes and 30 seconds to be filled, with 0.3 liters (L) of ethanol draining out per minute. Find how many liters (L) the volume of the first flask was.
72
21 6 [OP_DIV] 0.3 [OP_SUB] 22 30 60 [OP_DIV] [OP_ADD] [OP_MUL]
var_a = 21 var_b = 6 var_c = var_a / var_b var_d = 0.3 var_e = var_c - var_d var_f = 22 var_g = 30 var_h = 60 var_i = var_g / var_h var_j = var_f + var_i var_k = var_e * var_j print(int(var_k))
Correspondence
Chowon used 1/5 of the entire tape yesterday while packing the box for two days, and used 3/4 of the remaining tape today. If the length of the remaining tape is 1 meter (m) and 50 centimeters (cm), how long is the length of the tape that Chowon originally had in meters (m)?
7.5
1 50 100 [OP_DIV] [OP_ADD] 1 3/4 [OP_SUB] [OP_DIV] 1 1/5 [OP_SUB] [OP_DIV]
var_a = 1 var_b = 50 var_c = 100 var_d = var_b / var_c var_e = var_a + var_d var_f = 1 var_g = 0.75 var_h = var_f - var_g var_i = var_e / var_h var_j = 1 var_k = 0.2 var_l = var_j - var_k var_m = var_i / var_l print('{:.2f}'.format(round(var_m+1e-10,2)))
Arithmetic calculation
When it comes to mountain climbing, there are two routes. One is a shorter route, and the other one is 2 kilometers (km) longer than the short one. When you went up, you walked at 3 kilometers (km) per hour on a short path, and a long path at 4 kilometers (km) per hour on the way down. If it took 4 hours in total, how many kilometers (km) did you walk?
14
4 2 4 [OP_DIV] [OP_SUB] 1 3 [OP_DIV] 1 4 [OP_DIV] [OP_ADD] [OP_DIV] 2 [OP_MUL] 2 [OP_ADD]
var_a = 4 var_b = 2 var_c = 4 var_d = var_b / var_c var_e = var_a - var_d var_f = 1 var_g = 3 var_h = var_f / var_g var_i = 1 var_j = 4 var_k = var_i / var_j var_l = var_h + var_k var_m = var_e / var_l var_n = 2 var_o = var_m * var_n var_p = 2 var_q = var_o + var_p print(int(eval('{:.2f}'.format(round(var_q+1e-10,2)))))
Arithmetic calculation
Of the 30 students in the class, 4 have math scores of 90, 85, 88, and 80, respectively, and the average math score of the other 26 is 82. What is the average score in math for the whole class? Answer including decimal points.
82.5
26 82 [OP_MUL] 90 [OP_ADD] 85 [OP_ADD] 88 [OP_ADD] 80 [OP_ADD] 30 [OP_DIV]
var_a = 26 var_b = 82 var_c = var_a * var_b var_d = 90 var_e = var_c + var_d var_f = 85 var_g = var_e + var_f var_h = 88 var_i = var_g + var_h var_j = 80 var_k = var_i + var_j var_l = 30 var_m = var_k / var_l print('{:.2f}'.format(round(var_m+1e-10,2)))
Correspondence
Yulgi spent 300 won more than 2/5 of the money he had yesterday, and 200 won less than 1/2 of the rest today. If the remaining money is 800 won, how much money did Yulgi have yesterday?
2500
800 200 [OP_SUB] 1 1/2 [OP_SUB] [OP_DIV] 300 [OP_ADD] 1 2/5 [OP_SUB] [OP_DIV]
var_a = 800 var_b = 200 var_c = var_a - var_b var_d = 1 var_e = 0.5 var_f = var_d - var_e var_g = var_c / var_f var_h = 300 var_i = var_g + var_h var_j = 1 var_k = 0.4 var_l = var_j - var_k var_m = var_i / var_l print(int(var_m))
Possibility
You want to form a three-digit number by picking three out of 1, 0, 5, 8, and 6 and using them only once. Find the difference between the largest number and the fourth smallest number that can be made.
715
[OP_LIST_SOL] 1 0 5 8 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 4 [OP_LIST_MIN] [OP_SUB] [OP_ABS]
var_a = 1 var_b = 0 var_c = 5 var_d = 8 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 = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = 4 list_d=list_b.copy() list_d.sort() var_j = list_d[var_i-1] var_k = var_h - var_j var_l = abs(var_k) print(int(var_l))
Possibility
Using 1, 7, 4, and 3 only once, find the difference between the largest three-digit number whose tens digit is 3 and the third largest three-digit number.
297
[OP_LIST_SOL] 1 7 4 3 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 10 3 [OP_LIST_SEARCH_FIXED_DIGIT] 1 [OP_LIST_MAX] 3 [OP_LIST_MAX] [OP_SUB] [OP_ABS]
var_a = 1 var_b = 7 var_c = 4 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 = 10 var_g = 3 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 = 1 list_d=list_c.copy() list_d.sort() var_i = list_d[-var_h] var_j = 3 list_e=list_c.copy() list_e.sort() var_k = list_e[-var_j] var_l = var_i - var_k var_m = abs(var_l) print(int(var_m))
Arithmetic calculation
Five people are sitting at a round table. If 5 people shake hands with people who are not next to each other, how many handshakes will they make?
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
Minyoung bought 9 apples, 3 pears, and 5 persimmons, and Yoojeong bought 2 more fruits than Minyoung. If Yoojeong bought 7 apples and bought 2 fewer pears than persimmons, how many pears did Yoojeong buy?
7
9 3 [OP_ADD] 5 [OP_ADD] 2 [OP_ADD] 7 [OP_SUB] 2 [OP_DIV] 1 [OP_ADD]
var_a = 9 var_b = 3 var_c = var_a + var_b var_d = 5 var_e = var_c + var_d var_f = 2 var_g = var_e + var_f var_h = 7 var_i = var_g - var_h var_j = 2 var_k = var_i / var_j var_l = 1 var_m = var_k + var_l print(int(var_m))
Geometry
Toss 2 coins high into the sky. How many numbers of cases are there for both coins to land on heads?
1
1
var_a = 1 print(int(var_a))
Geometry
A square is made by arranging 12 marbles of the same size without gaps in both the width and length. How many marbles are placed around the perimeter?
44
12 2 [OP_SUB] 4 [OP_MUL] 4 [OP_ADD]
var_a = 12 var_b = 2 var_c = var_a - var_b var_d = 4 var_e = var_c * var_d var_f = 4 var_g = var_e + var_f print(int(var_g))
Geometry
You have used a piece of wire to make a cube whose side is 10 centimetres (cm) long. If you use the same wire to make a cube that is 8 cm long and 5 cm wide, what is its height in centimetres (cm)?
17
10 12 [OP_MUL] 8 4 [OP_MUL] [OP_SUB] 5 4 [OP_MUL] [OP_SUB] 4 [OP_DIV]
var_a = 10 var_b = 12 var_c = var_a * var_b var_d = 8 var_e = 4 var_f = var_d * var_e var_g = var_c - var_f var_h = 5 var_i = 4 var_j = var_h * var_i var_k = var_g - var_j var_l = 4 var_m = var_k / var_l print(int(var_m))
Comparison
Bank, school, stationery store, convenience store, and park is in the order of distance that is closest. Which building is the second closest?
school
[OP_LIST_SOL] Bank school stationery convenience park [OP_LIST_EOL] 2 [OP_LIST_GET]
var_a = 'Bank' var_b = 'school' var_c = 'stationery' var_d = 'convenience' var_e = 'park' 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 var_g = list_a[var_f-1] print(var_g)
Comparison
The truck is loaded with two boxes, (a) and (b). Box (a) is smaller than box (b). Which of the two boxes is the larger one?
(b)
[OP_LIST_SOL] (a) (b) [OP_LIST_EOL] [OP_LIST_SOL] (a) (b) < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = '(a)' var_b = '(b)' 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 = '(a)' var_d = '(b)' var_e = '<' list_b= [] 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) if "/" in str(var_c): var_c = eval(str(var_c)) list_b.append(var_c) 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_f = 1 var_g = list_c[var_f-1] print(var_g)
Possibility
Sehun wants to make a three-digit number by using the single-digit natural numbers 0, 2, and 9 once each. How many total can he make?
4
[OP_LIST_SOL] 0 2 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 var_b = 2 var_c = 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 = 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))
Geometry
There are regular hexagonal prisms and square pyramids with the same edges. The sum of the lengths of all the edges of the hexagonal prism is 81 centimeters (cm). What is the sum of the lengths of all the edges of the pyramid in centimeters (cm)?
36
81 6 3 [OP_MUL] [OP_DIV] 4 2 [OP_MUL] [OP_MUL]
var_a = 81 var_b = 6 var_c = 3 var_d = var_b * var_c var_e = var_a / var_d var_f = 4 var_g = 2 var_h = var_f * var_g var_i = var_e * var_h print(int(var_i))
Comparison
While Yoongi, Jungkook, and Yuna have following numbers: 4, 6 minus 3, and 5, who has the smallest number?
Jungkook
[OP_LIST_SOL] Yoongi Jungkook Yuna [OP_LIST_EOL] [OP_LIST_SOL] 4 6 3 [OP_SUB] 5 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yoongi' var_b = 'Jungkook' var_c = 'Yuna' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 4 var_e = 6 var_f = 3 var_g = var_e - var_f 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_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-1] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Comparison
There are numbers 0.8, 1/2, 0.9, and 1/3. Find the smallest number that is greater than or equal to 0.6.
0.8
[OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 0.6 [OP_LIST_MORE_EQUAL] 1 [OP_LIST_MIN]
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.6 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)))
Correspondence
What number is A in 56-1A=39?
7
56-1A=39 A [OP_DIGIT_UNK_SOLVER]
var_a = '56-1A=39' 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
There are two buckets of water. The left bucket holds 2800 litres (L) of water and the right bucket holds 1500 L of water. When the water in the left bucket was transferred to the right bucket, the left bucket contained 360 litres (L) more water than the right bucket. Find the number of litres (L) of water transferred to the right bucket.
470
2800 1500 [OP_SUB] 360 [OP_SUB] 2 [OP_DIV]
var_a = 2800 var_b = 1500 var_c = var_a - var_b var_d = 360 var_e = var_c - var_d var_f = 2 var_g = var_e / var_f print(int(var_g))
Correspondence
6A5+B03=748. How much is 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))