category
stringclasses 5
values | question
stringlengths 20
555
| answer
stringlengths 1
20
| solution_abst
stringlengths 1
287
| solution_code
stringlengths 27
5.97k
|
---|---|---|---|---|
Comparison | The distance from the house to the school is 11/4 kilometers (km), and the distance from the house to the stationery store is 2.89 kilometers (km). Which is farther from home, the school or the stationery store? | stationery | [OP_LIST_SOL] school stationery [OP_LIST_EOL] [OP_LIST_SOL] 11/4 2.89 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'school'
var_b = 'stationery'
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.75
var_d = 2.89
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) |
Correspondence | I am trying to write odd numbers from 1 to 100. How many times should the number 9 be written in all? | 15 | 1 100 [OP_LIST_ODD] [OP_LIST2NUM] [OP_NUM2LIST] 9 [OP_LIST_FIND_NUM] | var_a = 1
var_b = 100
list_a = []
if var_a%2==0:
for i in range(var_a+1, var_b+1, 2):
list_a.append(i)
else:
for i in range(var_a, var_b+1, 2):
list_a.append(i)
var_c=""
for i in list_a:
i = str(i)
var_c = var_c + i
list_b = []
var_c = int(var_c)
while var_c//10 > 0:
list_b.append(var_c%10)
var_c = var_c//10
list_b.append(var_c%10)
list_b = list_b[::-1]
var_d = 9
var_e = 0
var_d = int(var_d)
for i in list_b:
i = int(i)
if i == var_d:
var_e = var_e + 1
print(int(var_e)) |
Arithmetic calculation | What is the sum of the natural numbers from 1 to 5? | 15 | 1 5 1 [OP_LIST_ARANGE] [OP_LIST_SUM] | var_a = 1
var_b = 5
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
list_a = [float(i) for i in list_a]
var_d = sum(list_a)
print(int(var_d)) |
Comparison | The heights of the A and B boxes are 3 centimeters (cm) and 3.5 centimeters (cm), respectively. When Taehyung stacked 16 A boxes and Yoongi stacked 14 B boxes, who stacked them higher? | Yoongi | [OP_LIST_SOL] Taehyung Yoongi [OP_LIST_EOL] [OP_LIST_SOL] 3 16 [OP_MUL] 3.5 14 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Taehyung'
var_b = 'Yoongi'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 3
var_d = 16
var_e = var_c * var_d
var_f = 3.5
var_g = 14
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 | The factory in Busan produced 127,000 kilograms (kg) of products. How many more trucks are needed to transport these products to Seoul by 5000 kilograms (kg) truck than by 8000 kilograms (kg) truck? | 10 | 127000 5000 [OP_DIV] 1 [OP_CEIL] 127000 8000 [OP_DIV] 1 [OP_CEIL] [OP_SUB] | var_a = 127000
var_b = 5000
var_c = var_a / var_b
var_d = 1
var_e=int(((var_c+9*10**(var_d-2))//(10**(var_d-1)))*10**(var_d-1))
var_f = 127000
var_g = 8000
var_h = var_f / var_g
var_i = 1
var_j=int(((var_h+9*10**(var_i-2))//(10**(var_i-1)))*10**(var_i-1))
var_k = var_e - var_j
print(int(var_k)) |
Comparison | You planted sunplant in 2/7 and snapweed in 3/8 of the flower garden. Which flower planted area is larger? | snapweed | [OP_LIST_SOL] sunplant snapweed [OP_LIST_EOL] [OP_LIST_SOL] 2/7 3/8 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'sunplant'
var_b = 'snapweed'
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.2857142857142857
var_d = 0.375
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) |
Possibility | There are 9 number cards with the numbers 1 through 9 written on them. How many ways exist in order to draw 3 cards and make their sum 17? | 42 | 1 9 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] 17 [OP_LIST_FIND_NUM] | var_a = 1
var_b = 9
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
list_c=[]
for i in list_b:
var_e = 0
i = int(i)
while i//10 > 0:
var_e = var_e + i%10
i = i//10
var_e = var_e + i%10
list_c.append(var_e)
var_f = 17
var_g = 0
var_f = int(var_f)
for i in list_c:
i = int(i)
if i == var_f:
var_g = var_g + 1
print(int(var_g)) |
Arithmetic calculation | Eunji's house has 52 ducks and 78 chickens. There are 12 fewer chickens than the number of ducks and rabbits combined. How many rabbits are there in Eunji's house? | 38 | 78 52 [OP_SUB] 12 [OP_ADD] | var_a = 78
var_b = 52
var_c = var_a - var_b
var_d = 12
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | Find the sum of odd numbers from 1 to 200. | 10000 | 1 200 [OP_LIST_ODD] [OP_LIST_SUM] | var_a = 1
var_b = 200
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)
print(int(var_c)) |
Arithmetic calculation | There are three numbers 10, 11, and 12. What is the quotient of the 3rd smallest number divided by the 2nd smallest number? | 1 | [OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 3 [OP_LIST_MIN] 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 = 3
list_b=list_a.copy()
list_b.sort()
var_e = list_b[var_d-1]
var_f = 2
list_c=list_a.copy()
list_c.sort()
var_g = list_c[var_f-1]
var_h = var_e // var_g
print(int(var_h)) |
Comparison | The book Yerim bought was 0.65 kilograms (kg), and the book Chanwoo bought was 0.645 kilograms (kg). Who bought the heavier books? | 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) |
Geometry | You are trying to make a square fence with 5 stakes per side. Find how many stakes you will need. | 16 | 5 4 [OP_MUL] 4 [OP_SUB] | var_a = 5
var_b = 4
var_c = var_a * var_b
var_d = 4
var_e = var_c - var_d
print(int(var_e)) |
Geometry | What is the perimeter in centimeters (cm) of a figure made by enclosing 8 sides that are 12 centimeters (cm) long each? | 96 | 12 8 [OP_MUL] | var_a = 12
var_b = 8
var_c = var_a * var_b
print(int(var_c)) |
Arithmetic calculation | Jinwoo divided the cake into 3 equal pieces and ate one piece. Areum divided a cake of the same size into 12 equal pieces. How many pieces should she eat to eat the same amount as Jinwoo? | 4 | 12 3 [OP_DIV] | var_a = 12
var_b = 3
var_c = var_a / var_b
print(int(var_c)) |
Comparison | What is the smallest number among the three numbers 5, 8, and 4? | 4 | [OP_LIST_SOL] 5 8 4 [OP_LIST_EOL] 1 [OP_LIST_MIN] | var_a = 5
var_b = 8
var_c = 4
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 1
list_b=list_a.copy()
list_b.sort()
var_e = list_b[var_d-1]
print(int(var_e)) |
Arithmetic calculation | The two barrels contain 10 liters (L) and 8 liters (L) of juice, respectively. When 3 liters (L) of the juice contained in 8 liters (L) is poured into a juice container containing 10 liters (L), find the difference in the amount of juice held in the two juice containers. | 8 | 10 3 [OP_ADD] 8 3 [OP_SUB] [OP_SUB] | var_a = 10
var_b = 3
var_c = var_a + var_b
var_d = 8
var_e = 3
var_f = var_d - var_e
var_g = var_c - var_f
print(int(var_g)) |
Comparison | The distance from the house to the library is 2+13/40 kilometers (km), and the distance from the house to the bank is 2.56 kilometers (km). Which is farther, from the house to the library or from the house to the bank? | bank | [OP_LIST_SOL] library bank [OP_LIST_EOL] [OP_LIST_SOL] 2 13 40 [OP_DIV] [OP_ADD] 2.56 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'library'
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 = 2
var_d = 13
var_e = 40
var_f = var_d / var_e
var_g = var_c + var_f
var_h = 2.56
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 | Each bookshelf in the library has 6 slots, and each slot can hold 8 books. Of the 16 bookshelves in the library, there are 5 slots without books, only one slot has 6 books, and all other slots have 8 books. Find how many books there are in the library. | 726 | 16 6 [OP_MUL] 5 [OP_SUB] 1 [OP_SUB] 8 [OP_MUL] 6 [OP_ADD] | var_a = 16
var_b = 6
var_c = var_a * var_b
var_d = 5
var_e = var_c - var_d
var_f = 1
var_g = var_e - var_f
var_h = 8
var_i = var_g * var_h
var_j = 6
var_k = var_i + var_j
print(int(var_k)) |
Possibility | When all 4, 5, and 8 number cards are used once, find the number of three-digit numbers not greater than 550. | 3 | [OP_LIST_SOL] 4 5 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 550 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN] | var_a = 4
var_b = 5
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 = 550
list_c = []
for i in list_b:
if i <= var_e:
list_c.append(i)
var_f = len(list_c)
print(int(var_f)) |
Arithmetic calculation | After eating 15 out of the candies I had, there are 13 left. How many candies were there initially? | 28 | 15 13 [OP_ADD] | var_a = 15
var_b = 13
var_c = var_a + var_b
print(int(var_c)) |
Comparison | Among 0.8, 1/2, 0.9, and 1/3, find the largest number which is less than or equal to 0.7. | 0.5 | [OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 0.7 [OP_LIST_LESS_EQUAL] 1 [OP_LIST_MAX] | 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.7
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]
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Comparison | 20 students stood in a line. Jungkook stood last in line, and Yoongi stood right in front of Jungkook. How many students are standing behind Yoongi? | 18 | 20 1 [OP_SUB] 1 [OP_SUB] | var_a = 20
var_b = 1
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | I should have divided a certain number by 3 and then add 14 to it and then multiply it by 2, but I mistakingly multiplied 3 by that certain number and added 14, and then multiplied it by 2, which resulted in 946. Find the correct calculated value. | 130 | 946 2 [OP_DIV] 14 [OP_SUB] 3 [OP_DIV] 3 [OP_DIV] 14 [OP_ADD] 2 [OP_MUL] | var_a = 946
var_b = 2
var_c = var_a / var_b
var_d = 14
var_e = var_c - var_d
var_f = 3
var_g = var_e / var_f
var_h = 3
var_i = var_g / var_h
var_j = 14
var_k = var_i + var_j
var_l = 2
var_m = var_k * var_l
print(int(var_m)) |
Arithmetic calculation | Bokyung is raising 3 puppies and 7 chicks. What is the total number of legs of Bokyung's animals? | 26 | 3 4 [OP_MUL] 7 2 [OP_MUL] [OP_ADD] | var_a = 3
var_b = 4
var_c = var_a * var_b
var_d = 7
var_e = 2
var_f = var_d * var_e
var_g = var_c + var_f
print(int(var_g)) |
Correspondence | When you mistakenly divide a number by 21, not by 12, it is divisible by 4. Find the value when 4 is added to the correct quotient. | 11 | 4 21 [OP_MUL] 12 [OP_FDIV] 4 [OP_ADD] | var_a = 4
var_b = 21
var_c = var_a * var_b
var_d = 12
var_e = var_c // var_d
var_f = 4
var_g = var_e + var_f
print(int(var_g)) |
Arithmetic calculation | You want to plant trees at intervals of 10 meters (m) on a 100-meter (m) long road. Supposing that trees are planted at the beginning and end of the road as well, how many trees are needed if they are planted on only one side of the road? | 11 | 100 10 [OP_DIV] 1 [OP_ADD] | var_a = 100
var_b = 10
var_c = var_a / var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Comparison | The bike shop has four-wheeled bikes and two-wheeled bikes. The total number of wheels on all bicycles in the shop is 48, and there are 9 four-wheeled bikes. How many two-wheeled bicycles are there? | 6 | 48 4 9 [OP_MUL] [OP_SUB] 2 [OP_DIV] | var_a = 48
var_b = 4
var_c = 9
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 | You want to make a three-digit number as a result of throwing a dice with 0, 1, 2, 3, 4, and 5 written on it three times. How many number of cases to have common multiples of 6 and 9 are there? | 11 | [OP_LIST_SOL] 0 1 2 3 4 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PRODUCT] 6 9 [OP_LCM] [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 0
var_b = 1
var_c = 2
var_d = 3
var_e = 4
var_f = 5
list_a= []
if "/" in str(var_f):
var_f = eval(str(var_f))
list_a.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_g = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.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 = 6
var_i = 9
var_j = var_i * var_h / math.gcd(int(var_i), int(var_h))
list_c = []
var_j = int(var_j)
for i in list_b:
i = int(i)
if i % var_j == 0:
list_c.append(i)
var_k = len(list_c)
print(int(var_k)) |
Arithmetic calculation | There is a train that runs at 95 kilometers (km) per hour and a car that runs at 65 kilometers (km) per hour. If the train and the car travel for 8 hours at a constant speed, by how many kilometers (km) does the train travel more than the car? | 240 | 95 65 [OP_SUB] 8 [OP_MUL] | var_a = 95
var_b = 65
var_c = var_a - var_b
var_d = 8
var_e = var_c * var_d
print(int(var_e)) |
Arithmetic calculation | There are 85 pigs and cows in total. When there are 48 pigs, how many more cows are there than pigs? | 11 | 48 85 48 [OP_SUB] [OP_SUB] | var_a = 48
var_b = 85
var_c = 48
var_d = var_b - var_c
var_e = var_a - var_d
print(int(var_e)) |
Arithmetic calculation | There are 9 girls and 16 boys in Jungkook's class. What is the total number of students in the class? | 25 | 16 9 [OP_ADD] | var_a = 16
var_b = 9
var_c = var_a + var_b
print(int(var_c)) |
Geometry | How many diagonals can be drawn from one vertex of a 12-angle figure? | 9 | 12 3 [OP_SUB] | var_a = 12
var_b = 3
var_c = var_a - var_b
print(int(var_c)) |
Arithmetic calculation | Minyoung's average score for Korean and English is 89 points. If his average score in Korean, Mathematics, and English is 91, what is Minyoung's math score? | 95 | 91 3 [OP_MUL] 89 2 [OP_MUL] [OP_SUB] | var_a = 91
var_b = 3
var_c = var_a * var_b
var_d = 89
var_e = 2
var_f = var_d * var_e
var_g = var_c - var_f
print(int(var_g)) |
Geometry | One side of a cube with a surface area of 54.3 square centimeters (cm2) was painted. Find the area of the painted side. | 9.05 | 54.3 6 [OP_DIV] | var_a = 54.3
var_b = 6
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Arithmetic calculation | Min-Young bought 7 boxes of 12.34 kg (kg) of sugar and wants to share them equally with 3 people. How many kilograms (kg) of sugar can one person get? | 28 | 12.34 7 [OP_MUL] 3 [OP_FDIV] | var_a = 12.34
var_b = 7
var_c = var_a * var_b
var_d = 3
var_e = var_c // var_d
print(int(var_e)) |
Arithmetic calculation | Yuna is 9 years old this year. Her father is 27 years older than Yuna and her grandfather is 23 years older than her father. How old is Yuna's grandfather this year? | 59 | 9 27 [OP_ADD] 23 [OP_ADD] | var_a = 9
var_b = 27
var_c = var_a + var_b
var_d = 23
var_e = var_c + var_d
print(int(var_e)) |
Possibility | There are five types of milk sold at a store: chocolate milk, strawberry milk, banana milk, coffee milk, and white milk. When selecting milk from this store, find the number of ways to select 2 cartons of milk, allowing duplicates. | 15 | [OP_LIST_SOL] chocolate strawberry banana coffee white [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_ADD] 1 [OP_SUB] 2 [OP_COMB] | var_a = 'chocolate'
var_b = 'strawberry'
var_c = 'banana'
var_d = 'coffee'
var_e = 'white'
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 = var_f + var_g
var_i = 1
var_j = var_h - var_i
var_k = 2
var_l = 1
var_j = int(var_j)
var_k = int(var_k)
for i, elem in enumerate(range(var_k)):
var_l = var_l * (var_j-i)
for i, elem in enumerate(range(var_k)):
var_l = var_l / (i+1)
print(int(var_l)) |
Geometry | The radius of the larger circle is 80 centimeters (cm), and the radius of the larger circle is said to be 4 times the radius of the smaller circle. What is the radius of the small circle in centimeters (cm)? | 20 | 80 4 [OP_DIV] | var_a = 80
var_b = 4
var_c = var_a / var_b
print(int(var_c)) |
Geometry | There is a box in the shape of a hexahedron. How many sides does this box have? | 6 | 6 | var_a = 6
print(int(var_a)) |
Arithmetic calculation | What is the total length in centimeters (cm) of 30 straws when each of the straw is 25 centimeters (cm) long, and the overlapped area 6 centimeters (cm) long? | 576 | 25 25 6 [OP_SUB] 30 1 [OP_SUB] [OP_MUL] [OP_ADD] | var_a = 25
var_b = 25
var_c = 6
var_d = var_b - var_c
var_e = 30
var_f = 1
var_g = var_e - var_f
var_h = var_d * var_g
var_i = var_a + var_h
print(int(var_i)) |
Possibility | You are trying to create a signal using the front and back sides of 3 cards. How many signals can you create? | 8 | 2 3 [OP_POW] | var_a = 2
var_b = 3
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 quotient of the smallest number divided by the next smallest number? | 0 | [OP_LIST_SOL] 10 11 12 13 14 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_FDIV] | var_a = 10
var_b = 11
var_c = 12
var_d = 13
var_e = 14
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 1
list_b=list_a.copy()
list_b.sort()
var_g = list_b[var_f-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)) |
Arithmetic calculation | There are 4 consecutive odd numbers whose sum is 112. Which of these numbers is the 2nd smallest? | 27 | 112 4 [OP_DIV] 4 2 [OP_FDIV] 2 [OP_MUL] [OP_SUB] 1 [OP_ADD] 2 [OP_ADD] | var_a = 112
var_b = 4
var_c = var_a / var_b
var_d = 4
var_e = 2
var_f = var_d // var_e
var_g = 2
var_h = var_f * var_g
var_i = var_c - var_h
var_j = 1
var_k = var_i + var_j
var_l = 2
var_m = var_k + var_l
print(int(var_m)) |
Arithmetic calculation | I attached 15 sheets of colored tape, overlapping by 5 centimeters (cm). If the length of one piece of tape is 20 centimeters (cm), how many centimeters (cm) is the total length? | 230 | 20 20 5 [OP_SUB] 15 1 [OP_SUB] [OP_MUL] [OP_ADD] | var_a = 20
var_b = 20
var_c = 5
var_d = var_b - var_c
var_e = 15
var_f = 1
var_g = var_e - var_f
var_h = var_d * var_g
var_i = var_a + var_h
print(int(var_i)) |
Geometry | The perimeter of a square is 34.8 centimeters (cm). Find the length of one side. | 8.7 | 34.8 4 [OP_DIV] | var_a = 34.8
var_b = 4
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Geometry | If 6 diagonals can be drawn from one vertex, find the number of vertices in this polygon. | 9 | 6 3 [OP_ADD] | var_a = 6
var_b = 3
var_c = var_a + var_b
print(int(var_c)) |
Arithmetic calculation | The age difference between Taehyung and his mother is 31 years, and the age difference between Taehyung and his younger brother is 5 years. If Taehyung's younger brother is 7 years old this year, how old is his mother? | 43 | 7 5 [OP_ADD] 31 [OP_ADD] | var_a = 7
var_b = 5
var_c = var_a + var_b
var_d = 31
var_e = var_c + var_d
print(int(var_e)) |
Correspondence | Find the number that has a units digit of 2 and is a two-digit number between 30 and 40. | 32 | 30 40 1 [OP_LIST_ARANGE] 10 2 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_GET] | var_a = 30
var_b = 40
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 10
var_e = 2
list_b = []
var_d = int(var_d)
var_e = int(var_e)
if var_e < 0:
var_e = var_e + var_d
for i in list_a:
i = int(i)
if i%var_d == var_e:
list_b.append(i)
var_f = 1
var_g = list_b[var_f-1]
print(int(var_g)) |
Correspondence | I threw away 16 sets of summer clothes this fall and bought winter clothes that much. If there are 64 more winter clothes than summer clothes in your closet, find the difference between winter clothes and summer clothes in summer. | 32 | 64 16 [OP_SUB] 16 [OP_SUB] | var_a = 64
var_b = 16
var_c = var_a - var_b
var_d = 16
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | A and B are single digit numbers. A375B is a five digit number and is a multiple of 24. What is the number of all numbers that can be A? | 3 | A375B [OP_GEN_POSSIBLE_LIST] 24 [OP_LIST_DIVISIBLE] A375B A [OP_LIST_FIND_UNK] [OP_LIST_LEN] | var_a = 'A375B'
ans_dict = dict()
var_a = str(var_a)
list_a = []
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 0
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
if len(var_a) == len(str(int(temp))):
new_elem = int(temp)
list_a.append(new_elem)
var_b = 24
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 = 'A375B'
var_d = 'A'
var_c = str(var_c)
var_d = str(var_d)
unk_idx = var_c.index(var_d)
list_c = []
for elem in list_b:
elem = str(elem)
list_c.append(int(elem[unk_idx]))
list_c = list(set(list_c))
var_e = len(list_c)
print(int(var_e)) |
Correspondence | When 691-68A=4, what number should go in A? | 7 | 691-68A=4 A [OP_DIGIT_UNK_SOLVER] | var_a = '691-68A=4'
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 | Find the number of natural numbers among 1 to 30 that are not odd. | 15 | 1 30 1 [OP_LIST_ARANGE] 1 30 [OP_LIST_ODD] [OP_SET_DIFFERENCE] [OP_LIST_LEN] | var_a = 1
var_b = 30
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 1
var_e = 30
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_c = list(set(list_a) - set(list_b))
var_f = len(list_c)
print(int(var_f)) |
Correspondence | I want to subtract a number from 20. I mistakenly multiplied 4 by a number, and the result was 52. What is the correct calculation result? | 7 | 20 52 4 [OP_DIV] [OP_SUB] | var_a = 20
var_b = 52
var_c = 4
var_d = var_b / var_c
var_e = var_a - var_d
print(int(var_e)) |
Correspondence | I needed to subtract 46 from a certain number, but I mistakenly subtracted 59, so I got 43. Find the result of the correct calculation. | 56 | 43 59 [OP_ADD] 46 [OP_SUB] | var_a = 43
var_b = 59
var_c = var_a + var_b
var_d = 46
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | There are two strings of unequal length. If the difference in length of the two strings is 48 centimeters (cm) and the sum of the lengths of the two strings is 64 centimeters (cm), how many strings can you make that are the same length as the shorter string by cutting the longer string? | 7 | 64 48 [OP_ADD] 2 [OP_DIV] 64 48 [OP_SUB] 2 [OP_DIV] [OP_FDIV] | var_a = 64
var_b = 48
var_c = var_a + var_b
var_d = 2
var_e = var_c / var_d
var_f = 64
var_g = 48
var_h = var_f - var_g
var_i = 2
var_j = var_h / var_i
var_k = var_e // var_j
print(int(var_k)) |
Correspondence | A certain number multiplied by 5 equals 100. Yoongi divided that certain number by 10 and got an answer. What is his answer? | 2 | 100 5 [OP_DIV] 10 [OP_DIV] | var_a = 100
var_b = 5
var_c = var_a / var_b
var_d = 10
var_e = var_c / var_d
print(int(var_e)) |
Arithmetic calculation | What is the total number of three-digit numbers that are greater than 137 and less than 151? | 13 | 137 1 [OP_ADD] 151 1 [OP_SUB] 1 [OP_LIST_ARANGE] [OP_LIST_LEN] | var_a = 137
var_b = 1
var_c = var_a + var_b
var_d = 151
var_e = 1
var_f = var_d - var_e
var_g = 1
list_a = [i for i in range(var_c, var_f + 1, var_g)]
var_h = len(list_a)
print(int(var_h)) |
Arithmetic calculation | There are three numbers 10, 11 and 12. What is the quotient of the smallest number divided by the second smallest number? | 0 | [OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 1 [OP_LIST_MIN] 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 = 1
list_b=list_a.copy()
list_b.sort()
var_e = list_b[var_d-1]
var_f = 2
list_c=list_a.copy()
list_c.sort()
var_g = list_c[var_f-1]
var_h = var_e // var_g
print(int(var_h)) |
Comparison | The red car traveled 147 kilometers (km) in 1 hour and 45 minutes, and the black car traveled 162 kilometers (km) in 2 hours and 15 minutes. Which car is faster? | red | [OP_LIST_SOL] red black [OP_LIST_EOL] [OP_LIST_SOL] 147 1 60 [OP_MUL] 45 [OP_ADD] [OP_DIV] 162 2 60 [OP_MUL] 15 [OP_ADD] [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'red'
var_b = 'black'
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 = 147
var_d = 1
var_e = 60
var_f = var_d * var_e
var_g = 45
var_h = var_f + var_g
var_i = var_c / var_h
var_j = 162
var_k = 2
var_l = 60
var_m = var_k * var_l
var_n = 15
var_o = var_m + var_n
var_p = var_j / var_o
list_b= []
if "/" in str(var_p):
var_p = eval(str(var_p))
list_b.append(var_p)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
list_b.reverse()
var_q = 1
list_c=list_b.copy()
list_c.sort()
var_r = list_c[-var_q]
var_s = list_b.index(var_r)+1
var_t = list_a[var_s-1]
print(var_t) |
Arithmetic calculation | The natural number 100 is the sum of five consecutive natural numbers. Find the smallest of these five consecutive natural 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)) |
Arithmetic calculation | The village youth association presented 4 boxes of pears, each containing 16 pears, to grandpas and grandmas. How many pears did they present? | 64 | 16 4 [OP_MUL] | var_a = 16
var_b = 4
var_c = var_a * var_b
print(int(var_c)) |
Arithmetic calculation | There were 37 chicks on the farm. If a farmer bought 23 more chicks on day 1 and 12 more chicks on day 2, how many more chicks were on the farm? | 35 | 23 12 [OP_ADD] | var_a = 23
var_b = 12
var_c = var_a + var_b
print(int(var_c)) |
Comparison | There are numbers 0.8, 1/2, 0.9, and 1/3. Find the smallest of these numbers greater than 0.6. | 0.8 | [OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 0.6 [OP_LIST_MORE] 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 | 27A8 plus 3403 is less than 6153. How many digits from 0 to 9 can be A? | 5 | 27A8 [OP_GEN_POSSIBLE_LIST] 6153 3403 [OP_SUB] [OP_LIST_LESS] 27A8 A [OP_LIST_FIND_UNK] [OP_LIST_LEN] | var_a = '27A8'
ans_dict = dict()
var_a = str(var_a)
list_a = []
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 0
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
if len(var_a) == len(str(int(temp))):
new_elem = int(temp)
list_a.append(new_elem)
var_b = 6153
var_c = 3403
var_d = var_b - var_c
list_b = []
for i in list_a:
if i < var_d:
list_b.append(i)
var_e = '27A8'
var_f = 'A'
var_e = str(var_e)
var_f = str(var_f)
unk_idx = var_e.index(var_f)
list_c = []
for elem in list_b:
elem = str(elem)
list_c.append(int(elem[unk_idx]))
list_c = list(set(list_c))
var_g = len(list_c)
print(int(var_g)) |
Arithmetic calculation | Of natural numbers greater than 14 and less than 105, what is the quotient of the largest divided by the smallest? | 7 | 105 14 1 [OP_ADD] [OP_FDIV] | var_a = 105
var_b = 14
var_c = 1
var_d = var_b + var_c
var_e = var_a // var_d
print(int(var_e)) |
Correspondence | For two natural numbers A and B, the quotient and the remainder are 9 and 13 when A is divided by B. What is the remainder when A is divided by 9? | 4 | 13 9 [OP_SUB] | var_a = 13
var_b = 9
var_c = var_a - var_b
print(int(var_c)) |
Arithmetic calculation | Find the largest two-digit number that has a remainder of 2 when divided by 13. | 93 | 10 99 1 [OP_LIST_ARANGE] 13 2 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_MAX] | var_a = 10
var_b = 99
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 13
var_e = 2
list_b = []
var_d = int(var_d)
var_e = int(var_e)
if var_e < 0:
var_e = var_e + var_d
for i in list_a:
i = int(i)
if i%var_d == var_e:
list_b.append(i)
var_f = 1
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
print(int(var_g)) |
Comparison | 20 rabbits are lined up. How many rabbits are there between the 13th and 19th rabbits from the left? | 5 | 19 13 [OP_SUB] 1 [OP_SUB] | var_a = 19
var_b = 13
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e)) |
Possibility | If there are 5 people A, B, C, D, E, find the number of ways to make A, C, and E stand next to each other. | 36 | [OP_LIST_SOL] A B C D E [OP_LIST_EOL] [OP_LIST_SOL] A C [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_LIST_SOL] A C E [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_MUL] | var_a = 'A'
var_b = 'B'
var_c = 'C'
var_d = 'D'
var_e = 'E'
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 = 'A'
var_g = 'C'
list_b= []
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
list_c = list(set(list_a) - set(list_b))
var_h = len(list_c)
var_i = len(list_c)
var_j = 1
var_h = int(var_h)
var_i = int(var_i)
for i, elem in enumerate(range(var_i)):
var_j = var_j * (var_h-i)
var_k = 'A'
var_l = 'C'
var_m = 'E'
list_d= []
if "/" in str(var_m):
var_m = eval(str(var_m))
list_d.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_d.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_d.append(var_k)
list_d.reverse()
var_n = len(list_d)
var_o = len(list_d)
var_p = 1
var_n = int(var_n)
var_o = int(var_o)
for i, elem in enumerate(range(var_o)):
var_p = var_p * (var_n-i)
var_q = var_j * var_p
print(int(var_q)) |
Possibility | The seven digits 0, 1, 2, 3, 4, 5, and 6 are used once to form a seven-digit number. When this number is a multiple of 55, find the second largest number. | 6430215 | [OP_LIST_SOL] 0 1 2 3 4 5 6 [OP_LIST_EOL] 7 [OP_LIST_GET_PERM] 55 [OP_LIST_DIVISIBLE] 2 [OP_LIST_MAX] | var_a = 0
var_b = 1
var_c = 2
var_d = 3
var_e = 4
var_f = 5
var_g = 6
list_a= []
if "/" in str(var_g):
var_g = eval(str(var_g))
list_a.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_a.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_h = 7
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_h))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_i = 55
list_c = []
var_i = int(var_i)
for i in list_b:
i = int(i)
if i % var_i == 0:
list_c.append(i)
var_j = 2
list_d=list_c.copy()
list_d.sort()
var_k = list_d[-var_j]
print(int(var_k)) |
Arithmetic calculation | Find how many common multiples of 12 and 36 are less than or equal to 150. | 4 | 1 150 1 [OP_LIST_ARANGE] 12 36 [OP_LCM] [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 1
var_b = 150
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 12
var_e = 36
var_f = var_e * var_d / math.gcd(int(var_e), int(var_d))
list_b = []
var_f = int(var_f)
for i in list_a:
i = int(i)
if i % var_f == 0:
list_b.append(i)
var_g = len(list_b)
print(int(var_g)) |
Comparison | What is the sum of numbers which are all greater than 0.4 among 0.8, 1/2, 0.9, and 1/3? | 2.2 | [OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 0.4 [OP_LIST_MORE] [OP_LIST_SUM] | var_a = 0.8
var_b = 0.5
var_c = 0.9
var_d = 0.3333333333333333
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 0.4
list_b = []
for i in list_a:
if i > var_e:
list_b.append(i)
list_b = [float(i) for i in list_b]
var_f = sum(list_b)
print('{:.2f}'.format(round(var_f+1e-10,2))) |
Arithmetic calculation | Out of odd numbers up to 10, find the sum of those that are not multiples of 3. | 13 | 1 10 [OP_LIST_ODD] 3 [OP_LIST_DIVISIBLE] [OP_SET_DIFFERENCE] [OP_LIST_SUM] | var_a = 1
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 = 3
list_b = []
var_c = int(var_c)
for i in list_a:
i = int(i)
if i % var_c == 0:
list_b.append(i)
list_c = list(set(list_a) - set(list_b))
list_c = [float(i) for i in list_c]
var_d = sum(list_c)
print(int(var_d)) |
Geometry | There are eight rectangular-shaped playgrounds with the same length of 300 meters (m) and the same area. If the sum of the areas of the playgrounds is 0.6 square kilometers (km2), how many meters (m) are the width of the playground? | 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)) |
Geometry | A 94 centimeters (cm) piece of tape is folded as the middle to be overlapped in order to make a 68 centimeters (cm) piece. Find the length of the overlapping part. | 13 | 94 68 [OP_SUB] 2 [OP_DIV] | var_a = 94
var_b = 68
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e)) |
Arithmetic calculation | Convert 22/8 to a decimal number. | 2.75 | 22 8 [OP_DIV] | var_a = 22
var_b = 8
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Correspondence | Minjeong wants to paint the fence. Originally, he tried to take 4.372 milliliters (ml) from the paint canister, but accidentally took out 43.72 milliliters (ml), leaving 16.398 milliliters (ml) in the paint canister. If it was taken out as original, find how many milliliters (ml) are left in the paint canister. | 55.75 | 16.398 43.72 [OP_ADD] 4.372 [OP_SUB] | var_a = 16.398
var_b = 43.72
var_c = var_a + var_b
var_d = 4.372
var_e = var_c - var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Comparison | Students stand in a line. Taehyung is standing in the front. Eight people are standing behind Namjoon. There are three people standing between Taehyung and Namjoon. How many students are in line? | 13 | 1 3 [OP_ADD] 1 [OP_ADD] 8 [OP_ADD] | var_a = 1
var_b = 3
var_c = var_a + var_b
var_d = 1
var_e = var_c + var_d
var_f = 8
var_g = var_e + var_f
print(int(var_g)) |
Correspondence | A and B are single-digit numbers. Subtracting 2 from A is B, and the number 3 greater than 5 is A. Find A+B. | 14 | 5 3 [OP_ADD] 5 3 [OP_ADD] 2 [OP_SUB] [OP_ADD] | var_a = 5
var_b = 3
var_c = var_a + var_b
var_d = 5
var_e = 3
var_f = var_d + var_e
var_g = 2
var_h = var_f - var_g
var_i = var_c + var_h
print(int(var_i)) |
Arithmetic calculation | When writing the numbers 1 through 125 on the board, how many times is the number 2 used? | 29 | 1 125 1 [OP_LIST_ARANGE] [OP_LIST2NUM] [OP_NUM2LIST] 2 [OP_LIST_FIND_NUM] | var_a = 1
var_b = 125
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d=""
for i in list_a:
i = str(i)
var_d = var_d + i
list_b = []
var_d = int(var_d)
while var_d//10 > 0:
list_b.append(var_d%10)
var_d = var_d//10
list_b.append(var_d%10)
list_b = list_b[::-1]
var_e = 2
var_f = 0
var_e = int(var_e)
for i in list_b:
i = int(i)
if i == var_e:
var_f = var_f + 1
print(int(var_f)) |
Arithmetic calculation | There are four numbers: 10, 11, 12, and 13. What is the product of the second largest number and the smallest number? | 120 | [OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 2 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_MUL] | var_a = 10
var_b = 11
var_c = 12
var_d = 13
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 2
list_b=list_a.copy()
list_b.sort()
var_f = list_b[-var_e]
var_g = 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)) |
Geometry | There are fifteen pieces of square-shaped colored paper with a side length of 25 centimeters (cm) glued together. Given that they were overlapped by 0.5 centimeters (cm) to connect them having a maximum length of one side of the paper, find its length in meters (m). | 3.68 | 25 15 [OP_MUL] 0.5 15 1 [OP_SUB] [OP_MUL] [OP_SUB] 100 [OP_DIV] | var_a = 25
var_b = 15
var_c = var_a * var_b
var_d = 0.5
var_e = 15
var_f = 1
var_g = var_e - var_f
var_h = var_d * var_g
var_i = var_c - var_h
var_j = 100
var_k = var_i / var_j
print('{:.2f}'.format(round(var_k+1e-10,2))) |
Arithmetic calculation | If the elements of set A are 1, 3, and 5, and the elements of set B are 2 and 5, find the number of elements in the intersection of sets A and B. | 1 | [OP_LIST_SOL] 1 3 5 [OP_LIST_EOL] [OP_LIST_SOL] 2 5 [OP_LIST_EOL] [OP_SET_INTERSECT] [OP_LIST_LEN] | var_a = 1
var_b = 3
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 = 2
var_e = 5
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)
list_b.reverse()
list_c = list(set(list_a) & set(list_b))
var_f = len(list_c)
print(int(var_f)) |
Comparison | The conch-shaped bread is 250 grams (g) and I made two boxes with 12 each. The Red-bean bread is 200 grams (g) and is made into three boxes with 16 each. Which bread is in the box that weighs more than other boxes? | Red-bean | [OP_LIST_SOL] Red-bean conch-shaped [OP_LIST_EOL] [OP_LIST_SOL] 200 16 [OP_MUL] 250 12 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Red-bean'
var_b = 'conch-shaped'
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 = 200
var_d = 16
var_e = var_c * var_d
var_f = 250
var_g = 12
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 | Subtracting 27 from a number gives 49. Find a number. | 76 | 49 27 [OP_ADD] | var_a = 49
var_b = 27
var_c = var_a + var_b
print(int(var_c)) |
Arithmetic calculation | Jimin's social studies score is 6 points higher than his science score. The science score is 87. If the average score for science, social studies, and English is 92, what is his English score? | 96 | 92 3 [OP_MUL] 87 87 6 [OP_ADD] [OP_ADD] [OP_SUB] | var_a = 92
var_b = 3
var_c = var_a * var_b
var_d = 87
var_e = 87
var_f = 6
var_g = var_e + var_f
var_h = var_d + var_g
var_i = var_c - var_h
print(int(var_i)) |
Comparison | After Jisoo washed the dishes, she put the plate on the cupboard 2nd from the top, 4th from the bottom, 1st from the left, and 7th from the right. How many slots are there on the cupboard? | 35 | 2 4 [OP_ADD] 1 [OP_SUB] 1 7 [OP_ADD] 1 [OP_SUB] [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 = 1
var_g = 7
var_h = var_f + var_g
var_i = 1
var_j = var_h - var_i
var_k = var_e * var_j
print(int(var_k)) |
Geometry | There is a rectangle that is smaller than a rectangle measuring 108 square centimeters (cm2) with a width ratio of 8:7 and a height ratio of 9:4. What is the area of this rectangle in square centimeters (cm2)? | 42 | 108 8 [OP_DIV] 7 [OP_MUL] 9 [OP_DIV] 4 [OP_MUL] | var_a = 108
var_b = 8
var_c = var_a / var_b
var_d = 7
var_e = var_c * var_d
var_f = 9
var_g = var_e / var_f
var_h = 4
var_i = var_g * var_h
print(int(var_i)) |
Geometry | There is a trapezoid with an area of 222 square centimeters (cm2). If the length of the upper side of this trapezoid is 23 centimeters (cm) and the height is 12 centimeters (cm), how many centimeters (cm) is the length of the base of the trapezoid? | 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)) |
Comparison | Yoongi collected 4, and Jungkook collected 6 minus 3. Whose number is smaller? | Jungkook | [OP_LIST_SOL] Yoongi Jungkook [OP_LIST_EOL] [OP_LIST_SOL] 4 6 3 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Yoongi'
var_b = 'Jungkook'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 4
var_d = 6
var_e = 3
var_f = var_d - var_e
list_b= []
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[var_g-1]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j) |
Arithmetic calculation | Seonho wants to cut 1 large cube of wood into several small cubes of wood. The length of a side of a small block of wood is 1/4 of the length of a side of a block of large wood. Find the number of small wooden blocks that can be made at this time. | 64 | 1 1/4 3 [OP_POW] [OP_DIV] | var_a = 1
var_b = 0.25
var_c = 3
var_d = var_b ** var_c
var_e = var_a / var_d
print(int(var_e)) |
Correspondence | A and B are different numbers. When 8AA4-BBB=BBBB, find the result of A plus B. | 12 | 8AA4-BBB=BBBB A [OP_DIGIT_UNK_SOLVER] 8AA4-BBB=BBBB B [OP_DIGIT_UNK_SOLVER] [OP_ADD] | var_a = '8AA4-BBB=BBBB'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
var_d = '8AA4-BBB=BBBB'
var_e = 'B'
ans_dict = dict()
var_d = var_d.replace('×','*')
var_d = var_d.replace('x','*')
var_d = var_d.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_d):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_d
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_d):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_f = ans_dict[var_e]
var_g = var_c + var_f
print(int(var_g)) |
Geometry | The base of the prism is a regular hexagon, which has the length of one side as 6 centimeters (cm), and the height of the prism is 11 centimeters (cm). Find the sum of the lengths of all the edges of this prism. | 138 | 6 6 [OP_MUL] 2 [OP_MUL] 11 6 [OP_MUL] [OP_ADD] | var_a = 6
var_b = 6
var_c = var_a * var_b
var_d = 2
var_e = var_c * var_d
var_f = 11
var_g = 6
var_h = var_f * var_g
var_i = var_e + var_h
print(int(var_i)) |
Correspondence | Multiplying a number by 13 and subtracting 272 gives you 105. Find the number. | 29 | 105 272 [OP_ADD] 13 [OP_DIV] | var_a = 105
var_b = 272
var_c = var_a + var_b
var_d = 13
var_e = var_c / var_d
print(int(var_e)) |
Geometry | A quadrilateral has two pairs of opposite sides parallel to each other. If the base of this rectangle 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))) |
Possibility | Dohun is about to roll balls with numbers 3, 6, and 9 one by one on top of the mountain. When the results differ depending on the rolling order, how many total results can Dohun see? | 6 | [OP_LIST_SOL] 3 6 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN] | var_a = 3
var_b = 6
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)) |
Correspondence | A and B are single digit numbers. If 7ABABA is divisible by 6, find all possible number of cases that can be 7ABABA. | 15 | 7ABABA [OP_GEN_POSSIBLE_LIST] 6 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = '7ABABA'
ans_dict = dict()
var_a = str(var_a)
list_a = []
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 0
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
if len(var_a) == len(str(int(temp))):
new_elem = int(temp)
list_a.append(new_elem)
var_b = 6
list_b = []
var_b = int(var_b)
for i in list_a:
i = int(i)
if i % var_b == 0:
list_b.append(i)
var_c = len(list_b)
print(int(var_c)) |
Correspondence | We have the expression 5A8-B14=364. Find the number that goes into A. | 7 | 5A8-B14=364 A [OP_DIGIT_UNK_SOLVER] | var_a = '5A8-B14=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 | Find the sum of A and B. 3/7=6/A=B/21 | 23 | 3/7=6/A=B/21 A [OP_NUM_UNK_SOLVER] 3/7=6/A=B/21 B [OP_NUM_UNK_SOLVER] [OP_ADD] | var_a = '3/7=6/A=B/21'
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] = 0
candidate_num = [i for i in range(51)]
candi = list(itertools.product(candidate_num, repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
if term_list[i] == '':
new_eq += str(term_list[i])+op_list[i]
else:
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
if '=' in new_eq and '>' not in new_eq and '<' not in new_eq:
new_eq=new_eq.replace('==','=')
new_eq=new_eq.replace('>','')
new_eq=new_eq.replace('<','')
new_eq=new_eq.split('=')
for i in range(len(new_eq)-1):
eval_result = math.isclose(eval(new_eq[i]), eval(new_eq[i+1]))
if not eval_result:
break
else:
eval_result = eval(new_eq)
except:
eval_result = False
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
var_d = '3/7=6/A=B/21'
var_e = 'B'
ans_dict = dict()
var_d = var_d.replace('×','*')
var_d = var_d.replace('x','*')
var_d = var_d.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_d):
if v in variable_candi:
ans_dict[v] = 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_d
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
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_f = ans_dict[var_e]
var_g = var_c + var_f
print(int(var_g)) |
Arithmetic calculation | There are five numbers 10, 11, 12, 13, and 14. What is the remainder when divided by the smallest number and the second smallest number? | 10 | [OP_LIST_SOL] 10 11 12 13 14 [OP_LIST_EOL] 1 [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 = 1
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)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.