category
stringclasses 5
values | question
stringlengths 20
555
| answer
stringlengths 1
20
| solution_abst
stringlengths 1
287
| solution_code
stringlengths 27
5.97k
|
---|---|---|---|---|
Correspondence | Changhyun tries to increase the length of the 48 centimeters (cm) long fishing rod by 1.33 times because it is too short. What is the length of the extended fishing rod? | 63.84 | 48 1.33 [OP_MUL] | var_a = 48
var_b = 1.33
var_c = var_a * var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Correspondence | A number divided by 23 minus 67 and multiplied by 2 is 102. Find the number. | 2714 | 102 2 [OP_DIV] 67 [OP_ADD] 23 [OP_MUL] | var_a = 102
var_b = 2
var_c = var_a / var_b
var_d = 67
var_e = var_c + var_d
var_f = 23
var_g = var_e * var_f
print(int(var_g)) |
Geometry | How many vertices are there in the pyramid, excluding those at the base? | 1 | 1 | var_a = 1
print(int(var_a)) |
Possibility | Find the number of three-digit natural numbers that can be formed using all 3, 6, and 0. | 4 | [OP_LIST_SOL] 3 6 0 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN] | var_a = 3
var_b = 6
var_c = 0
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 | Yuna is the 4th tallest in the class, and Yujeong is the next tallest after Yuna. How tall is Yujung? | 5 | 4 1 [OP_ADD] | var_a = 4
var_b = 1
var_c = var_a + var_b
print(int(var_c)) |
Geometry | Find the number of diagonals in an octagon minus the number of diagonals in a heptagon. | 6 | 8 8 3 [OP_SUB] [OP_MUL] 2 [OP_DIV] 7 7 3 [OP_SUB] [OP_MUL] 2 [OP_DIV] [OP_SUB] | var_a = 8
var_b = 8
var_c = 3
var_d = var_b - var_c
var_e = var_a * var_d
var_f = 2
var_g = var_e / var_f
var_h = 7
var_i = 7
var_j = 3
var_k = var_i - var_j
var_l = var_h * var_k
var_m = 2
var_n = var_l / var_m
var_o = var_g - var_n
print(int(var_o)) |
Comparison | Kiyoung's classroom has the same number of desks in each row. Kiyoung's seat is 2nd from the back, 4th from the front, and 3rd from the left. Karam is right next to Kiyoung and 2nd from the right. How many desks are there in Kiyoung's classroom? | 25 | 2 4 [OP_ADD] 1 [OP_SUB] 3 2 [OP_ADD] [OP_MUL] | var_a = 2
var_b = 4
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 3
var_g = 2
var_h = var_f + var_g
var_i = var_e * var_h
print(int(var_i)) |
Possibility | If the difference between two of the four digit numbers that can be made by using 0, 3, 4, and 8 once is the greatest, what is the difference? | 5382 | [OP_LIST_SOL] 0 3 4 8 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] | var_a = 0
var_b = 3
var_c = 4
var_d = 8
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_e))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_f = 1
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
var_h = 1
list_d=list_b.copy()
list_d.sort()
var_i = list_d[var_h-1]
var_j = var_g - var_i
print(int(var_j)) |
Correspondence | 5A8-21B=364. How much is A? | 7 | 5A8-21B=364 A [OP_DIGIT_UNK_SOLVER] | var_a = '5A8-21B=364'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Correspondence | I put 25 apples each in boxes, but there are 24 left. If the number of apples is greater than 300, find the minimum number of apples. | 324 | 300 24 [OP_ADD] | var_a = 300
var_b = 24
var_c = var_a + var_b
print(int(var_c)) |
Correspondence | A particular number should have been multiplied by 40, but when I accidentally subtracted 21 from that number, the result was 52. Find the correct calculation result. | 2920 | 52 21 [OP_ADD] 40 [OP_MUL] | var_a = 52
var_b = 21
var_c = var_a + var_b
var_d = 40
var_e = var_c * var_d
print(int(var_e)) |
Arithmetic calculation | What is the value if you jump 4 times reducing 10 each jump from 320? | 280 | 320 10 4 [OP_MUL] [OP_SUB] | var_a = 320
var_b = 10
var_c = 4
var_d = var_b * var_c
var_e = var_a - var_d
print(int(var_e)) |
Arithmetic calculation | There are five numbers 10, 11, 12, 13, and 14. What is the sum of the second largest number and the smallest number? | 23 | [OP_LIST_SOL] 10 11 12 13 14 [OP_LIST_EOL] 2 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD] | var_a = 10
var_b = 11
var_c = 12
var_d = 13
var_e = 14
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 2
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(int(var_j)) |
Arithmetic calculation | What is the smallest three-digit number divisible by the four numbers 6, 5, 8, and 9? | 360 | 100 999 1 [OP_LIST_ARANGE] 6 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 8 [OP_LIST_DIVISIBLE] 9 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN] | var_a = 100
var_b = 999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 6
list_b = []
var_d = int(var_d)
for i in list_a:
i = int(i)
if i % var_d == 0:
list_b.append(i)
var_e = 5
list_c = []
var_e = int(var_e)
for i in list_b:
i = int(i)
if i % var_e == 0:
list_c.append(i)
var_f = 8
list_d = []
var_f = int(var_f)
for i in list_c:
i = int(i)
if i % var_f == 0:
list_d.append(i)
var_g = 9
list_e = []
var_g = int(var_g)
for i in list_d:
i = int(i)
if i % var_g == 0:
list_e.append(i)
var_h = 1
list_f=list_e.copy()
list_f.sort()
var_i = list_f[var_h-1]
print(int(var_i)) |
Arithmetic calculation | There are 7 pieces of paper and 15 straws. How many more straws are there than paper? | 8 | 15 7 [OP_SUB] | var_a = 15
var_b = 7
var_c = var_a - var_b
print(int(var_c)) |
Correspondence | Subtracting 50 from a certain number and dividing it by 4, multiplying by 3 plus 28 equals 73. Find the certain number. | 110 | 73 28 [OP_SUB] 3 [OP_DIV] 4 [OP_MUL] 50 [OP_ADD] | var_a = 73
var_b = 28
var_c = var_a - var_b
var_d = 3
var_e = var_c / var_d
var_f = 4
var_g = var_e * var_f
var_h = 50
var_i = var_g + var_h
print(int(var_i)) |
Arithmetic calculation | When only even numbers are selected among all natural numbers, find the sum up to the 123rd in descending order. | 15252 | 2 2 123 1 [OP_SUB] 2 [OP_MUL] [OP_ADD] 2 [OP_LIST_ARANGE] [OP_LIST_SUM] | var_a = 2
var_b = 2
var_c = 123
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e * var_f
var_h = var_b + var_g
var_i = 2
list_a = [i for i in range(var_a, var_h + 1, var_i)]
list_a = [float(i) for i in list_a]
var_j = sum(list_a)
print(int(var_j)) |
Arithmetic calculation | Lettuce, which was sold at a store for 2,500 won per kilogram (kg), is being sold at a discount of 0.3 of the initial price. Find how much money you need to buy 1.8 kilograms (kg) of lettuce at a discounted price. | 3150 | 2500 1 0.3 [OP_SUB] [OP_MUL] 1.8 [OP_MUL] | var_a = 2500
var_b = 1
var_c = 0.3
var_d = var_b - var_c
var_e = var_a * var_d
var_f = 1.8
var_g = var_e * var_f
print(int(var_g)) |
Possibility | What is the smallest number that can be formed by using all odd numbers less than 10 once? | 13579 | 0 10 [OP_LIST_ODD] [OP_LIST_LEN] [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] | var_a = 0
var_b = 10
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)
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 = 1
list_c=list_b.copy()
list_c.sort()
var_e = list_c[var_d-1]
print(int(var_e)) |
Arithmetic calculation | How many cars are left in the parking lot after 8 out of 24 cars went out and another 6 went out? | 10 | 24 8 [OP_SUB] 6 [OP_SUB] | var_a = 24
var_b = 8
var_c = var_a - var_b
var_d = 6
var_e = var_c - var_d
print(int(var_e)) |
Geometry | If you put 3 cubes with each side 8cm long in a row, you will get 1 cuboid. What is the surface area of the cuboid you created, in square centimeters (cm2)? | 896 | 8 8 [OP_MUL] 6 3 [OP_MUL] 4 [OP_SUB] [OP_MUL] | var_a = 8
var_b = 8
var_c = var_a * var_b
var_d = 6
var_e = 3
var_f = var_d * var_e
var_g = 4
var_h = var_f - var_g
var_i = var_c * var_h
print(int(var_i)) |
Geometry | If the lengths of the two diagonals of a rhombus with an area of 3 square centimeters (cm2) are each multiplied by 5, how many square centimeters (cm2) will be the area? | 75 | 3 5 5 [OP_MUL] [OP_MUL] | var_a = 3
var_b = 5
var_c = 5
var_d = var_b * var_c
var_e = var_a * var_d
print(int(var_e)) |
Comparison | Customers stand in line at the restaurant. If 11 people are standing behind the person in line at the front, how many customers are in line? | 12 | 11 1 [OP_ADD] | var_a = 11
var_b = 1
var_c = var_a + var_b
print(int(var_c)) |
Arithmetic calculation | If the sum of three consecutive even numbers is 1194, what is the smallest even number? | 396 | 1194 0 3 1 [OP_SUB] 2 [OP_MUL] 2 [OP_LIST_ARANGE] [OP_LIST_SUM] [OP_SUB] 3 [OP_DIV] | var_a = 1194
var_b = 0
var_c = 3
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e * var_f
var_h = 2
list_a = [i for i in range(var_b, var_g + 1, var_h)]
list_a = [float(i) for i in list_a]
var_i = sum(list_a)
var_j = var_a - var_i
var_k = 3
var_l = var_j / var_k
print(int(var_l)) |
Arithmetic calculation | I went up the stairs at 2 kilometers per hour (km), but when I came down, I walked 2 kilometers (km) further at 3 kilometers per hour (km), and it took 4 hours. What is the distance of coming down the stairs? | 6 | 2 4 [OP_MUL] 2 [OP_ADD] 3 2 [OP_ADD] [OP_DIV] 3 [OP_MUL] | var_a = 2
var_b = 4
var_c = var_a * var_b
var_d = 2
var_e = var_c + var_d
var_f = 3
var_g = 2
var_h = var_f + var_g
var_i = var_e / var_h
var_j = 3
var_k = var_i * var_j
print(int(var_k)) |
Possibility | What is the smallest number with the units digit of 5 using 3 of 4, 6, 5, and 0? | 405 | [OP_LIST_SOL] 4 6 5 0 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 5 [OP_LIST_SEARCH_FIXED_DIGIT] 1 [OP_LIST_MIN] | var_a = 4
var_b = 6
var_c = 5
var_d = 0
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_e))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_f = 1
var_g = 5
list_c = []
var_f = int(var_f)
var_g = int(var_g)
for i in list_b:
i = int(i)
if (i//var_f)%10 == var_g:
list_c.append(i)
var_h = 1
list_d=list_c.copy()
list_d.sort()
var_i = list_d[var_h-1]
print(int(var_i)) |
Geometry | You lined up Jaewoong's classmates in a square. When 10 students are lined up horizontally and vertically, how many students are inside the circumference? | 64 | 10 2 [OP_SUB] 2 [OP_POW] | var_a = 10
var_b = 2
var_c = var_a - var_b
var_d = 2
var_e = var_c ** var_d
print(int(var_e)) |
Correspondence | To make a particular number equal to 102, it should be divided by 23, subtracted from 67, and multiplied by 2. Find the particular number. | 2714 | 102 2 [OP_DIV] 67 [OP_ADD] 23 [OP_MUL] | var_a = 102
var_b = 2
var_c = var_a / var_b
var_d = 67
var_e = var_c + var_d
var_f = 23
var_g = var_e * var_f
print(int(var_g)) |
Comparison | Jungkook ate 3 out of 6 apples. If Yoongi has 4 apples and Yuna has 5 apples, who has the most apples? | Yuna | [OP_LIST_SOL] Jungkook Yoongi Yuna [OP_LIST_EOL] [OP_LIST_SOL] 6 3 [OP_SUB] 4 5 [OP_LIST_EOL] 1 [OP_LIST_MAX] [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]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l) |
Arithmetic calculation | Students are standing in 8 rows of 4 each. Find the number of students standing at the perimeter. | 20 | 4 8 [OP_ADD] 2 [OP_MUL] 4 [OP_SUB] | var_a = 4
var_b = 8
var_c = var_a + var_b
var_d = 2
var_e = var_c * var_d
var_f = 4
var_g = var_e - var_f
print(int(var_g)) |
Arithmetic calculation | After the same number of boys and girls had left, there were 30 students left in the auditorium. How many girls left the auditorium when there were initially 24 boys and 14 girls in the auditorium? | 4 | 24 14 [OP_ADD] 30 [OP_SUB] 2 [OP_DIV] | var_a = 24
var_b = 14
var_c = var_a + var_b
var_d = 30
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
print(int(var_g)) |
Comparison | Jimin and Yoojeong each have a strap. If Jimin has a 59 centimeters (cm) strap and Yoojeong has a 53 centimeters (cm) strap, who has the shorter strap? | Yoojeong | [OP_LIST_SOL] Jimin Yoojeong [OP_LIST_EOL] [OP_LIST_SOL] 59 53 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Jimin'
var_b = 'Yoojeong'
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 = 59
var_d = 53
list_b= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[var_e-1]
var_g = list_b.index(var_f)+1
var_h = list_a[var_g-1]
print(var_h) |
Comparison | Which figure has a longer perimeter, a square with a side length of 3 centimeters (cm) or an equilateral-triangle with a side length of 5 centimeters (cm)? | equilateral-triangle | [OP_LIST_SOL] square equilateral-triangle [OP_LIST_EOL] [OP_LIST_SOL] 3 4 [OP_MUL] 5 3 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'square'
var_b = 'equilateral-triangle'
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 = 4
var_e = var_c * var_d
var_f = 5
var_g = 3
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) |
Comparison | You want to load three cargoes, A, B, and C, into the compartment. Cargo C is smaller than Cargo A, and Cargo A is smaller than Cargo B. If you want to load the biggest cargo first, which cargo should be loaded first? | B | [OP_LIST_SOL] A B C [OP_LIST_EOL] [OP_LIST_SOL] A B < C A < [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 = 'A'
var_e = 'B'
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 = 1
var_k = list_c[var_j-1]
print(var_k) |
Correspondence | Taehyung wants to divide a number by 6. But when he accidentally multiplied it by 5, the result was 30. Find the correctly calculated value. | 1 | 30 5 [OP_DIV] 6 [OP_DIV] | var_a = 30
var_b = 5
var_c = var_a / var_b
var_d = 6
var_e = var_c / var_d
print(int(var_e)) |
Arithmetic calculation | Eunji is 7 years old this year. Yuna is 5 years older than Eunji. What is the sum of Eunji and Yuna's ages this year? | 19 | 7 7 5 [OP_ADD] [OP_ADD] | var_a = 7
var_b = 7
var_c = 5
var_d = var_b + var_c
var_e = var_a + var_d
print(int(var_e)) |
Comparison | Yewon and Dongju had a fast reading competition. If it took Yewon 16.23 seconds and Dongju 16.19 seconds to read the given sentence, who read faster? | Dongju | [OP_LIST_SOL] Yewon Dongju [OP_LIST_EOL] [OP_LIST_SOL] 100 16.23 [OP_DIV] 100 16.19 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Yewon'
var_b = 'Dongju'
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 = 100
var_d = 16.23
var_e = var_c / var_d
var_f = 100
var_g = 16.19
var_h = var_f / var_g
list_b= []
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[-var_i]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l) |
Correspondence | We have an expression of 6AB-41=591. Find the number that must go into A. | 3 | 6AB-41=591 A [OP_DIGIT_UNK_SOLVER] | var_a = '6AB-41=591'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Correspondence | When you multiply the number by 7 by mistake, which should be divided by 5, you got 5 and 4/9. Write down the result of the correct calculation indicating two decimal places. | 7.62 | 5 4/9 [OP_ADD] 7 [OP_MUL] 5 [OP_DIV] | var_a = 5
var_b = 0.4444444444444444
var_c = var_a + var_b
var_d = 7
var_e = var_c * var_d
var_f = 5
var_g = var_e / var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Geometry | If the area of a trapezoid with a base of 23 centimeters (cm) and a height of 12 centimeters (cm) is 222 square cm (cm2), what is the length of the upper side? | 14 | 222 2 [OP_MUL] 12 [OP_DIV] 23 [OP_SUB] | var_a = 222
var_b = 2
var_c = var_a * var_b
var_d = 12
var_e = var_c / var_d
var_f = 23
var_g = var_e - var_f
print(int(var_g)) |
Geometry | There are 144 pencils. How many dozen pencils are there if one dozen is 12? | 12 | 144 12 [OP_DIV] | var_a = 144
var_b = 12
var_c = var_a / var_b
print(int(var_c)) |
Correspondence | When you divide 23 by 13, the quotient is A and the remainder is 10. What is A in this case? | 1 | 23 10 [OP_SUB] 13 [OP_DIV] | var_a = 23
var_b = 10
var_c = var_a - var_b
var_d = 13
var_e = var_c / var_d
print(int(var_e)) |
Geometry | A cube has one edge 8 centimeters (cm) long. Find the surface area of this cube. | 384 | 8 2 [OP_POW] 6 [OP_MUL] | var_a = 8
var_b = 2
var_c = var_a ** var_b
var_d = 6
var_e = var_c * var_d
print(int(var_e)) |
Geometry | Some parks are square with sides measuring 11 meters (m), and others are square with sides measuring 5 meters (m). Find the sum of the areas of the two parks. | 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 | You are trying to attach every square tile to a wall measuring 24 meters (m) wide and 18 meters (m) long. If you use a minimum number of tiles, find how many meters (m) each side of the tile is. | 6 | 24 18 [OP_GCD] | var_a = 24
var_b = 18
var_c = math.gcd(int(var_b), int(var_a))
print(int(var_c)) |
Comparison | Mom, Dad and Grandpa bought clothes at the department store. Dad bought more clothes than Mom, and Grandpa bought more clothes than Dad. In what place did grandpa rank for buying the least amount of clothes? | 3 | [OP_LIST_SOL] Mom Dad Grandpa [OP_LIST_EOL] Grandpa [OP_LIST_INDEX] | var_a = 'Mom'
var_b = 'Dad'
var_c = 'Grandpa'
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 = 'Grandpa'
var_e = list_a.index(var_d)+1
print(int(var_e)) |
Geometry | The area of the rectangular flower garden is 48.6 square meters (m2). When the length of this flower garden was measured, it was 5.4 meters (m). Find the width of the flower garden in meters (m). | 9 | 48.6 5.4 [OP_DIV] | var_a = 48.6
var_b = 5.4
var_c = var_a / var_b
print(int(var_c)) |
Comparison | Mihye trained for 1 hour and 5/12 hours, and Seongjae trained for 1 hour and 3/12 hours. Who has been training the longest? | Mihye | [OP_LIST_SOL] Mihye Seongjae [OP_LIST_EOL] [OP_LIST_SOL] 1 5 12 [OP_DIV] [OP_ADD] 1 3 12 [OP_DIV] [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Mihye'
var_b = 'Seongjae'
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
var_d = 5
var_e = 12
var_f = var_d / var_e
var_g = var_c + var_f
var_h = 1
var_i = 3
var_j = 12
var_k = var_i / var_j
var_l = var_h + var_k
list_b= []
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
list_b.reverse()
var_m = 1
list_c=list_b.copy()
list_c.sort()
var_n = list_c[-var_m]
var_o = list_b.index(var_n)+1
var_p = list_a[var_o-1]
print(var_p) |
Correspondence | Mingi gave 15 cherry tomatoes each to 20 classmates. If the remaining number of cherry tomatoes is 6, how many cherry tomatoes did Mingi have at first? | 306 | 15 20 [OP_MUL] 6 [OP_ADD] | var_a = 15
var_b = 20
var_c = var_a * var_b
var_d = 6
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | There are three numbers 10, 11, and 12. What is the quotient of the second largest number divided by the second smallest number? | 1 | [OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 2 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_FDIV] | 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 = 2
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(int(var_h)) |
Arithmetic calculation | I turned on the tap so that 21 liters (L) came out in 6 minutes to fill the bathtub. When I filled the water without blocking the water drain in the bathtub, it took 22 minutes and 30 seconds to fill it up. If 0.3 liters (L) of water escaped from the bathtub per 1 minute, find how many liters (L) the bathtub can contain. | 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)) |
Geometry | When boxes are lined up to make square shape, there are 6 left. So, I tried to increase the width and height by one row each, but I was short of 11 boxes. If these boxes are laid out in rows of 7, how many boxes are in row 1? | 10 | 6 11 [OP_ADD] 1 [OP_SUB] 2 [OP_DIV] 2 [OP_POW] 6 [OP_ADD] 7 [OP_DIV] | var_a = 6
var_b = 11
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
var_h = 2
var_i = var_g ** var_h
var_j = 6
var_k = var_i + var_j
var_l = 7
var_m = var_k / var_l
print(int(var_m)) |
Arithmetic calculation | Male lions in the zoo weigh 145/4 kilograms (kg), and male lions are said to weigh 47/10 kilograms (kg) more than female lions. How many kilograms (kg) does the female lion weigh? | 31.55 | 145/4 47/10 [OP_SUB] | var_a = 36.25
var_b = 4.7
var_c = var_a - var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Correspondence | Yoongi had to subtract 57 from a certain two-digit number. Yoongi mistook 9 as a 6 in the units digit of a two-digit number. When Yoongi's result is 39, find a two-digit number. | 99 | 39 57 [OP_ADD] 6 9 [OP_SUB] [OP_SUB] | var_a = 39
var_b = 57
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 | 35 students are standing in a line. 27 students are standing in front of Minyoung. How many students are standing behind Minyoung? | 7 | 35 27 [OP_SUB] 1 [OP_SUB] | var_a = 35
var_b = 27
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e)) |
Possibility | You would like to purchase 2 kinds of fruits. If the fruits sold in the fruit store are apples, peaches, pears, melons, and strawberries, how many possible ways are there? | 10 | [OP_LIST_SOL] apples peaches pears melons strawberries [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_COMB] | var_a = 'apples'
var_b = 'peaches'
var_c = 'pears'
var_d = 'melons'
var_e = 'strawberries'
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = len(list_a)
var_g = 2
var_h = 1
var_f = int(var_f)
var_g = int(var_g)
for i, elem in enumerate(range(var_g)):
var_h = var_h * (var_f-i)
for i, elem in enumerate(range(var_g)):
var_h = var_h / (i+1)
print(int(var_h)) |
Geometry | There is a rhombus with two diagonals measuring 6 centimeters (cm) and 4 centimeters (cm). Find the area in square centimeters (cm2) of a rhombus whose diagonals are 3 times longer than this rhombus. | 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)) |
Possibility | Find the largest four-digit number that can be made by using the number cards 5, 1, 6, 2, and 4 once. | 6542 | [OP_LIST_SOL] 5 1 6 2 4 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] | var_a = 5
var_b = 1
var_c = 6
var_d = 2
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 = 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 = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
print(int(var_h)) |
Comparison | There are 4 high schools. The average student number of these schools is 2300. The average number of students in High School 1 and 2 is 3000, the average number of students for High School 2 and 3 is 2100, and the average number of students for High schools 3 and 4 is 2750. And High School 2 has 800 fewer students than High School 1. How many students are there in all four high schools? | 3900 | 2750 2 [OP_MUL] 2100 2 [OP_MUL] 3000 2 [OP_MUL] 800 [OP_SUB] 2 [OP_DIV] [OP_SUB] [OP_SUB] | var_a = 2750
var_b = 2
var_c = var_a * var_b
var_d = 2100
var_e = 2
var_f = var_d * var_e
var_g = 3000
var_h = 2
var_i = var_g * var_h
var_j = 800
var_k = var_i - var_j
var_l = 2
var_m = var_k / var_l
var_n = var_f - var_m
var_o = var_c - var_n
print(int(var_o)) |
Geometry | Several students lined up completely in a square shape, but there were six students left. So, the students tried to increase the width and height by one row each, but they were short of 11 students. If you arrange these students in rows of 7, how many will stand in row 1? | 10 | 6 11 [OP_ADD] 1 [OP_SUB] 2 [OP_DIV] 2 [OP_POW] 6 [OP_ADD] 7 [OP_DIV] | var_a = 6
var_b = 11
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
var_h = 2
var_i = var_g ** var_h
var_j = 6
var_k = var_i + var_j
var_l = 7
var_m = var_k / var_l
print(int(var_m)) |
Correspondence | Jinyoung is harvesting apples in the orchard. He harvested 419 new apples, and then threw away 263 rotten apples among the apples he already had. If the current number of apples is 725, how many apples did he have before harvesting? | 569 | 725 263 [OP_ADD] 419 [OP_SUB] | var_a = 725
var_b = 263
var_c = var_a + var_b
var_d = 419
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | Eun-soo picked up 2 kilograms (kg) and 600 grams (g) of chestnuts in the mountain, and Min-gi picked up 3700 grams (g). How many grams (g) do the chestnuts that Eunsu and Mingi picked in total weigh? | 6300 | 2 1000 [OP_MUL] 600 [OP_ADD] 3700 [OP_ADD] | var_a = 2
var_b = 1000
var_c = var_a * var_b
var_d = 600
var_e = var_c + var_d
var_f = 3700
var_g = var_e + var_f
print(int(var_g)) |
Arithmetic calculation | Four people are sitting at a round table. If you want to shake hands once with people who are not sitting next to each other, find how many times you shake hands. | 2 | 4 4 3 [OP_SUB] [OP_MUL] 2 [OP_DIV] | var_a = 4
var_b = 4
var_c = 3
var_d = var_b - var_c
var_e = var_a * var_d
var_f = 2
var_g = var_e / var_f
print(int(var_g)) |
Possibility | When you select three of the four numbers 1, 2, 3, and 4, allowing duplicates, and arrange them in a row to form a three-digit natural number, which number is the largest that is divisible by both 2 and 3? | 444 | [OP_LIST_SOL] 1 2 3 4 [OP_LIST_EOL] 3 [OP_LIST_GET_PRODUCT] 2 [OP_LIST_DIVISIBLE] 3 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX] | 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 = 2
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 = 3
list_d = []
var_g = int(var_g)
for i in list_c:
i = int(i)
if i % var_g == 0:
list_d.append(i)
var_h = 1
list_e=list_d.copy()
list_e.sort()
var_i = list_e[-var_h]
print(int(var_i)) |
Geometry | Find the volume difference between a bowl measuring 16 centimeters (cm) wide, 14 centimeters (cm) long, and 9 centimeters (cm) high, and a bowl measuring 16 centimeters (cm) wide, 14 centimeters (cm) long, and 4 centimeters (cm) high. | 1120 | 16 14 [OP_MUL] 9 4 [OP_SUB] [OP_MUL] | var_a = 16
var_b = 14
var_c = var_a * var_b
var_d = 9
var_e = 4
var_f = var_d - var_e
var_g = var_c * var_f
print(int(var_g)) |
Correspondence | There are different numbers A, B, C, and D. 2×B+B=12, C-B=5, D+C=12, A-D=5. Find A. | 8 | 12 2×B+B=12 B [OP_NUM_UNK_SOLVER] 5 [OP_ADD] [OP_SUB] 5 [OP_ADD] | var_a = 12
var_b = '2×B+B=12'
var_c = 'B'
ans_dict = dict()
var_b = var_b.replace('×','*')
var_b = var_b.replace('x','*')
var_b = var_b.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_b):
if v in variable_candi:
ans_dict[v] = 0
candidate_num = [i for i in range(51)]
candi = list(itertools.product(candidate_num, repeat=len(ans_dict)))
for c in candi:
temp = var_b
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
if term_list[i] == '':
new_eq += str(term_list[i])+op_list[i]
else:
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
if '=' in new_eq and '>' not in new_eq and '<' not in new_eq:
new_eq=new_eq.replace('==','=')
new_eq=new_eq.replace('>','')
new_eq=new_eq.replace('<','')
new_eq=new_eq.split('=')
for i in range(len(new_eq)-1):
eval_result = math.isclose(eval(new_eq[i]), eval(new_eq[i+1]))
if not eval_result:
break
else:
eval_result = eval(new_eq)
except:
eval_result = False
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_d = ans_dict[var_c]
var_e = 5
var_f = var_d + var_e
var_g = var_a - var_f
var_h = 5
var_i = var_g + var_h
print(int(var_i)) |
Comparison | Two different natural numbers, A and 24, are either factors or multiples of each other. Find the third number from the left when the two-digit numbers corresponding to A are organized in ascending order. | 48 | 24 [OP_LIST_GET_DIVISOR] 24 99 24 [OP_LIST_ARANGE] [OP_SET_UNION] 10 [OP_LIST_MORE_EQUAL] 3 [OP_LIST_MIN] | var_a = 24
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 = 24
var_c = 99
var_d = 24
list_b = [i for i in range(var_b, var_c + 1, var_d)]
list_c = list(set(list_a) | set(list_b))
var_e = 10
list_d = []
for i in list_c:
if i >= var_e:
list_d.append(i)
var_f = 3
list_e=list_d.copy()
list_e.sort()
var_g = list_e[var_f-1]
print(int(var_g)) |
Arithmetic calculation | I paid 1,000 won and bought several pencils for 210 won and a glue for 270 won. How many pencils did you buy in total when you received 100 won in change? | 3 | 1000 100 [OP_SUB] 270 1 [OP_MUL] [OP_SUB] 210 [OP_DIV] | var_a = 1000
var_b = 100
var_c = var_a - var_b
var_d = 270
var_e = 1
var_f = var_d * var_e
var_g = var_c - var_f
var_h = 210
var_i = var_g / var_h
print(int(var_i)) |
Possibility | You want to create a three-digit number by picking three of 1, 0, 5, 8, and 6 and using them only once. Find the sum of the third largest and second smallest possible numbers. | 966 | [OP_LIST_SOL] 1 0 5 8 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 3 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_ADD] | 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 = 3
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = 2
list_d=list_b.copy()
list_d.sort()
var_j = list_d[var_i-1]
var_k = var_h + var_j
print(int(var_k)) |
Geometry | Blue paint was applied to all sides of a cuboid measuring 4 centimeters (cm) long, 3 centimeters (cm) wide, and 3 centimeters (cm) high. Then, this cuboid was divided into 36 cubes with each edge of 1 centimeter (cm) long. How many cube pieces have 2 colored faces? | 16 | 4 2 [OP_SUB] 3 2 [OP_SUB] [OP_ADD] 3 2 [OP_SUB] [OP_ADD] 4 [OP_MUL] | var_a = 4
var_b = 2
var_c = var_a - var_b
var_d = 3
var_e = 2
var_f = var_d - var_e
var_g = var_c + var_f
var_h = 3
var_i = 2
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)) |
Possibility | There are 4 500 won coins, 2 100 won coins, and 5 10 won coins in Cheolsu's wallet. Find how much total amounts of money he can pay. (However, the case where the payment amount is 0 won is excluded.) | 89 | 4 1 [OP_ADD] 2 1 [OP_ADD] [OP_MUL] 5 1 [OP_ADD] [OP_MUL] 1 [OP_SUB] | var_a = 4
var_b = 1
var_c = var_a + var_b
var_d = 2
var_e = 1
var_f = var_d + var_e
var_g = var_c * var_f
var_h = 5
var_i = 1
var_j = var_h + var_i
var_k = var_g * var_j
var_l = 1
var_m = var_k - var_l
print(int(var_m)) |
Arithmetic calculation | Hoseok jumped the rope during this weekday. If he jumped 88 times, 75 times, 62 times, 91 times, and 80 times from Monday to Friday, find how many times he did more comparing the days he jumped the most and the least. | 29 | [OP_LIST_SOL] 88 75 62 91 80 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] | var_a = 88
var_b = 75
var_c = 62
var_d = 91
var_e = 80
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(int(var_j)) |
Arithmetic calculation | What is the smallest five-digit number divisible by 3 and 4? | 10008 | 10000 99999 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 4 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN] | var_a = 10000
var_b = 99999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 3
list_b = []
var_d = int(var_d)
for i in list_a:
i = int(i)
if i % var_d == 0:
list_b.append(i)
var_e = 4
list_c = []
var_e = int(var_e)
for i in list_b:
i = int(i)
if i % var_e == 0:
list_c.append(i)
var_f = 1
list_d=list_c.copy()
list_d.sort()
var_g = list_d[var_f-1]
print(int(var_g)) |
Geometry | You have two identical rectangular cookies. If you put these two cookies together horizontally, the total circumference will be 70 centimeters (cm) and the height will be 15 centimeters (cm). Find the area of one cookie. | 150 | 70 2 [OP_DIV] 15 [OP_SUB] 15 [OP_MUL] 2 [OP_DIV] | var_a = 70
var_b = 2
var_c = var_a / var_b
var_d = 15
var_e = var_c - var_d
var_f = 15
var_g = var_e * var_f
var_h = 2
var_i = var_g / var_h
print(int(var_i)) |
Correspondence | The weight of 12 apples is 5400 grams (g) heavier than the weight of 8 pears. One apple weighs 530 grams (g). Find how many grams (g) a pear weigh. | 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)) |
Correspondence | Beomhyeon's family ate 10 more than 1/4 of the total eggs yesterday, 5 less than 3/5 of the remaining eggs for lunch today, and 12 of the remaining eggs were rotten and so discarded. When there are 13 eggs left, find the number of eggs that Beomhyeon's family had first. | 80 | 13 12 [OP_ADD] 5 [OP_SUB] 1 3/5 [OP_SUB] [OP_DIV] 10 [OP_ADD] 1 1/4 [OP_SUB] [OP_DIV] | var_a = 13
var_b = 12
var_c = var_a + var_b
var_d = 5
var_e = var_c - var_d
var_f = 1
var_g = 0.6
var_h = var_f - var_g
var_i = var_e / var_h
var_j = 10
var_k = var_i + var_j
var_l = 1
var_m = 0.25
var_n = var_l - var_m
var_o = var_k / var_n
print(int(var_o)) |
Comparison | Nine students are standing in a line to get on the bus. How many students are standing between the student standing third from the front and the student standing second from the back? | 4 | 9 3 [OP_SUB] 2 [OP_SUB] | var_a = 9
var_b = 3
var_c = var_a - var_b
var_d = 2
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | The sum of 5 consecutive natural numbers is 100. Write the smallest of these 5 numbers. | 18 | 100 5 [OP_DIV] 5 2 [OP_FDIV] [OP_SUB] | var_a = 100
var_b = 5
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)) |
Correspondence | Moving a decimal point two places to the left makes it 1.485 less than the original decimal. Find the original decimal number including the decimal point. | 1.5 | 1.485 0.99 [OP_DIV] | var_a = 1.485
var_b = 0.99
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Arithmetic calculation | In Yoongi's class, there are 18 students who raise flower (a), 24 students who raise flower (b), and 7 students who raise both flower (a) and flower (b). If there is no student who does not raise any of flower (a) or flower (b), how many students are in Yoongi's class? | 35 | 18 24 [OP_ADD] 7 [OP_SUB] | var_a = 18
var_b = 24
var_c = var_a + var_b
var_d = 7
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | I folded the string in half twice. If the length of the string was 12 meters (m) at first, how many meters (m) is it now? | 3 | 12 2 [OP_DIV] 2 [OP_DIV] | var_a = 12
var_b = 2
var_c = var_a / var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e)) |
Arithmetic calculation | Yoongi had 28 flowers. Among them, 7 were given to Eunji and 9 were given to Yuna. How many flowers are left for Yoongi? | 12 | 28 7 [OP_SUB] 9 [OP_SUB] | var_a = 28
var_b = 7
var_c = var_a - var_b
var_d = 9
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | Minsu runs 120 meters (m). Minsu says that he runs 4 meters (m) per second. If Minsu is 20 meters (m) away from the finish line, find how many seconds have elapsed since he ran. | 25 | 120 20 [OP_SUB] 4 [OP_DIV] | var_a = 120
var_b = 20
var_c = var_a - var_b
var_d = 4
var_e = var_c / var_d
print(int(var_e)) |
Comparison | There are 6 numbers 1, 4, 25, 16, 22, and 14. What is the 2nd largest number? | 22 | [OP_LIST_SOL] 1 4 25 16 22 14 [OP_LIST_EOL] 2 [OP_LIST_MAX] | 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]
print(int(var_h)) |
Arithmetic calculation | Find the average of odd one-digit numbers. | 5 | 1 9 [OP_LIST_ODD] [OP_LIST_MEAN] | 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)
list_a = [float(i) for i in list_a]
var_c = sum(list_a)/len(list_a)
print(int(var_c)) |
Possibility | You want to make a four-digit number using the number cards 1, 2, and 3. Assuming you can use the same number card multiple times, find the sum of all the numbers that are made. | 179982 | [OP_LIST_SOL] 1 2 3 [OP_LIST_EOL] 4 [OP_LIST_GET_PRODUCT] [OP_LIST_SUM] | var_a = 1
var_b = 2
var_c = 3
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
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=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_b = [float(i) for i in list_b]
var_e = sum(list_b)
print(int(var_e)) |
Comparison | Youngbin and Sujeong had a race to pick up coins faster. If it took Yeongbin 16.23 seconds and Sujeong 16.19 seconds to pick up all the coins, who wins? | Sujeong | [OP_LIST_SOL] Youngbin Sujeong [OP_LIST_EOL] [OP_LIST_SOL] 16.23 16.19 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Youngbin'
var_b = 'Sujeong'
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 = 16.23
var_d = 16.19
list_b= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[var_e-1]
var_g = list_b.index(var_f)+1
var_h = list_a[var_g-1]
print(var_h) |
Arithmetic calculation | Jungkook and Seokjin each had 12 pencils. After using a few of them, Jungkook gave 4 of the remaining pencils to Seokjin, and the number of pencils they both had became 7 each. How many pencils did Seokjin use? | 9 | 12 7 [OP_SUB] 4 [OP_ADD] | var_a = 12
var_b = 7
var_c = var_a - var_b
var_d = 4
var_e = var_c + var_d
print(int(var_e)) |
Comparison | Yerim drank 0.65 kg (kg) of milk, and Chanwoo drank 0.645 kg (kg) of milk. Who drank more milk? | Yerim | [OP_LIST_SOL] Yerim Chanwoo [OP_LIST_EOL] [OP_LIST_SOL] 0.65 0.645 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Yerim'
var_b = 'Chanwoo'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 0.65
var_d = 0.645
list_b= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = list_b.index(var_f)+1
var_h = list_a[var_g-1]
print(var_h) |
Arithmetic calculation | There are 75, 91, 83, and 72. What is the sum of the largest number and the second smallest number? | 166 | [OP_LIST_SOL] 75 91 83 72 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_ADD] | var_a = 75
var_b = 91
var_c = 83
var_d = 72
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-1]
var_i = var_f + var_h
print(int(var_i)) |
Correspondence | I should have subtracted a number from 713, but instead mistakenly added 713 and got 928 as a result. Find out how much it is if you had calculated it correctly. | 498 | 713 928 713 [OP_SUB] [OP_SUB] | var_a = 713
var_b = 928
var_c = 713
var_d = var_b - var_c
var_e = var_a - var_d
print(int(var_e)) |
Arithmetic calculation | Consider there are four numbers of 10, 11, 12, and 13. What is the answer for the largest number minus the second largest number? | 1 | [OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MAX] [OP_SUB] | 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(int(var_i)) |
Arithmetic calculation | The fish shop sold 3/5 of the fish caught at dawn in the morning. In the afternoon, all 180 fish, including the fish left from the morning and the newly caught fish, were sold. If the number of fish sold in the morning is not different from the number of fish sold in the afternoon, how many fish were caught at dawn? | 300 | 180 3/5 [OP_DIV] | var_a = 180
var_b = 0.6
var_c = var_a / var_b
print(int(var_c)) |
Correspondence | There are 52 tropical fish and koi in the tank. If there are 37 koi, how many tropical fish are there? | 15 | 52 37 [OP_SUB] | var_a = 52
var_b = 37
var_c = var_a - var_b
print(int(var_c)) |
Arithmetic calculation | There are 58 slices of bread. The slices of bread are 18 more than bottles of milk and 27 less than cookies. How many slices of bread, bottles of milk, and cookies are there in total? | 183 | 58 58 18 [OP_SUB] [OP_ADD] 58 27 [OP_ADD] [OP_ADD] | var_a = 58
var_b = 58
var_c = 18
var_d = var_b - var_c
var_e = var_a + var_d
var_f = 58
var_g = 27
var_h = var_f + var_g
var_i = var_e + var_h
print(int(var_i)) |
Geometry | There is a rectangular farm that is three times as wide as it is length. If the length of this farm is 0.6 km (km), how many square kilometers (km2) is the farm? | 1.08 | 0.6 3 [OP_MUL] 0.6 [OP_MUL] | var_a = 0.6
var_b = 3
var_c = var_a * var_b
var_d = 0.6
var_e = var_c * var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Geometry | The square is divided into 2 rectangles of equal size. If the sum of the lengths of the four sides of the divided rectangle is 42 centimeters (cm), how many centimeters (cm) is the side of the first square? | 14 | 42 2 [OP_DIV] 2 1 [OP_ADD] [OP_DIV] 2 [OP_MUL] | var_a = 42
var_b = 2
var_c = var_a / var_b
var_d = 2
var_e = 1
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 | Equation of two-digt numbers 4A+B3=68 is said to hold. At this time, what number can go into A? | 5 | 4A+B3=68 A [OP_DIGIT_UNK_SOLVER] | var_a = '4A+B3=68'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Arithmetic calculation | Some flight requires more than 15 people to depart. If there are 9 people currently on the plane, find how many more people need to board before departure. | 7 | 15 1 [OP_ADD] 9 [OP_SUB] | var_a = 15
var_b = 1
var_c = var_a + var_b
var_d = 9
var_e = var_c - var_d
print(int(var_e)) |
Geometry | (A) and (B) are both rectangular parallelepiped-shaped tanks. (A) is 4 centimeters (cm) long, 3 centimeters (cm) wide, and 5 centimeters (cm) high, and (B) is 4 centimeters (cm) long, 2 centimeters (cm) wide, and 8 centimeters (cm) high. When the height of the water in (B) was measured as 1.5 centimeters (cm), and all of this water was transferred to (a) the barrel, how high would the water in (A) be in centimeters (cm)? | 1 | 4 2 [OP_MUL] 1.5 [OP_MUL] 4 3 [OP_MUL] [OP_DIV] | var_a = 4
var_b = 2
var_c = var_a * var_b
var_d = 1.5
var_e = var_c * var_d
var_f = 4
var_g = 3
var_h = var_f * var_g
var_i = var_e / var_h
print(int(var_i)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.