category
stringclasses 5
values | question
stringlengths 20
555
| answer
stringlengths 1
20
| solution_abst
stringlengths 1
287
| solution_code
stringlengths 27
5.97k
|
---|---|---|---|---|
Comparison | We are comparing the heights of Jungkook, Yoongi, Namjoon, and Yuna. Jungkook is taller than Yoongi, and Namjoon is taller than Jungkook. But if Namjoon is shorter than Yuna, who is the shortest among the four? | Yoongi | [OP_LIST_SOL] Jungkook Yoongi Namjoon Yuna [OP_LIST_EOL] [OP_LIST_SOL] Jungkook Yoongi > Namjoon Jungkook > Namjoon Yuna < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | var_a = 'Jungkook'
var_b = 'Yoongi'
var_c = 'Namjoon'
var_d = 'Yuna'
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 'Jungkook'
var_f = 'Yoongi'
var_g = '>'
var_h = 'Namjoon'
var_i = 'Jungkook'
var_j = '>'
var_k = 'Namjoon'
var_l = 'Yuna'
var_m = '<'
list_b= []
if "/" in str(var_m):
var_m = eval(str(var_m))
list_b.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
if cond_ in ("<", ">", "="):
operand_right = temp_stack.pop()
operand_left = temp_stack.pop()
if cond_ == "=":
cond_ = "=="
conditions.append(f"{operand_left} {cond_} {operand_right}")
else:
if not cond_.isdigit():
cond_ = "{" + cond_ + "}"
temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
item_name_index_dict = dict(zip(items_name_list, perm))
formatted_conditions = \
[condition.format_map(item_name_index_dict) for condition in conditions]
if all(map(eval, formatted_conditions)):
break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_n = len(list_c)
var_o = list_c[var_n-1]
print(var_o) |
Possibility | When there is a basket containing each apple, peach, pear, melon, and strawberry, two fruits are taken out. What is the possible number of cases if those combinations are numbered according to the order it comes out? | 20 | [OP_LIST_SOL] apple peach pear melon strawberry [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_PERM] | var_a = 'apple'
var_b = 'peach'
var_c = 'pear'
var_d = 'melon'
var_e = 'strawberry'
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)
print(int(var_h)) |
Arithmetic calculation | When you make three-digit natural numbers using even numbers less than or equal to 6, what is the smallest number? | 204 | 0 6 [OP_LIST_EVEN] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] | var_a = 0
var_b = 6
list_a = []
if var_a%2!=0:
for i in range(var_a+1, var_b+1, 2):
list_a.append(i)
else:
for i in range(var_a, var_b+1, 2):
list_a.append(i)
var_c = 3
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 | I bought 7 baskets of sweet potatoes with 16 in each basket. Among them, 13 are sprouted and discarded, and the remaining sweet potatoes are divided equally into 8 baskets. How many sweet potatoes can't be put in the basket? | 3 | 16 7 [OP_MUL] 13 [OP_SUB] 8 [OP_MOD] | var_a = 16
var_b = 7
var_c = var_a * var_b
var_d = 13
var_e = var_c - var_d
var_f = 8
var_g = var_e % var_f
print(int(var_g)) |
Arithmetic calculation | The length of the wooden block that Yujeong has is 30 centimeters (cm) shorter than 31 meters (m). Find the length of the wooden block that Yujeong has in meters (m). | 30.7 | 31 30 100 [OP_DIV] [OP_SUB] | var_a = 31
var_b = 30
var_c = 100
var_d = var_b / var_c
var_e = var_a - var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Correspondence | When the equation 4A+B3=68 holds, what number can go in B? | 2 | 4A+B3=68 B [OP_DIGIT_UNK_SOLVER] | var_a = '4A+B3=68'
var_b = 'B'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Arithmetic calculation | When you add 5 consecutive natural numbers, you get 100. Which of these numbers is the smallest? | 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)) |
Possibility | Jungkook's fruit shop sells 4 types of fruit. How many ways can you choose to buy two? | 6 | 4 2 [OP_COMB] | var_a = 4
var_b = 2
var_c = 1
var_a = int(var_a)
var_b = int(var_b)
for i, elem in enumerate(range(var_b)):
var_c = var_c * (var_a-i)
for i, elem in enumerate(range(var_b)):
var_c = var_c / (i+1)
print(int(var_c)) |
Arithmetic calculation | You want to attach 8 posters with 29.05 centimeters (cm) width in a row on a wall with a width of 3.944 meters (m), keeping the distance between the end of the wall and the poster and between the posters constant. Find how many centimeters (cm) should be the distance between them. | 18 | 3.944 100 [OP_MUL] 29.05 8 [OP_MUL] [OP_SUB] 8 1 [OP_ADD] [OP_DIV] | var_a = 3.944
var_b = 100
var_c = var_a * var_b
var_d = 29.05
var_e = 8
var_f = var_d * var_e
var_g = var_c - var_f
var_h = 8
var_i = 1
var_j = var_h + var_i
var_k = var_g / var_j
print(int(eval('{:.2f}'.format(round(var_k+1e-10,2))))) |
Correspondence | Jimin wants to add a certain number to 34. If he accidentally multiplied 5 by a certain number and the result was 60, find the correct result. | 46 | 34 60 5 [OP_DIV] [OP_ADD] | var_a = 34
var_b = 60
var_c = 5
var_d = var_b / var_c
var_e = var_a + var_d
print(int(var_e)) |
Geometry | Given a cube, how many vertices does it have? | 8 | 6 2 [OP_SUB] 2 [OP_MUL] | var_a = 6
var_b = 2
var_c = var_a - var_b
var_d = 2
var_e = var_c * var_d
print(int(var_e)) |
Arithmetic calculation | Jungkook collected 585 (a) items, and the number of (a) items is 249 more than (b) items. What is the sum of the items (a) and (b) that Jungkook has gathered? | 921 | 585 585 249 [OP_SUB] [OP_ADD] | var_a = 585
var_b = 585
var_c = 249
var_d = var_b - var_c
var_e = var_a + var_d
print(int(var_e)) |
Comparison | Heejin has 3 Basketballs, 5 Volleyballs, and 1 Baseball. What ball does Heejin have the most? | Volleyballs | [OP_LIST_SOL] Basketballs Volleyballs Baseball [OP_LIST_EOL] [OP_LIST_SOL] 3 5 1 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Basketballs'
var_b = 'Volleyballs'
var_c = 'Baseball'
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 3
var_e = 5
var_f = 1
list_b= []
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j) |
Geometry | Make a square using all the strings that are 34.8 centimeters (cm). What is the length of one side of the rectangle to make it the largest? | 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))) |
Correspondence | When you mistakenly add 2 to a certain number while you had to subtract 2, the result is 6. What is the value if you calculate correctly? | 2 | 6 2 [OP_SUB] 2 [OP_SUB] | var_a = 6
var_b = 2
var_c = var_a - var_b
var_d = 2
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | Of the 1,260 people who entered the exhibition hall, 7/18 were women. If 6/11 of the men who entered wore glasses, how many men that visited the exhibition hall wore glasses? | 420 | 1260 1 7/18 [OP_SUB] [OP_MUL] 6/11 [OP_MUL] | var_a = 1260
var_b = 1
var_c = 0.3888888888888889
var_d = var_b - var_c
var_e = var_a * var_d
var_f = 0.5454545454545454
var_g = var_e * var_f
print(int(eval('{:.2f}'.format(round(var_g+1e-10,2))))) |
Geometry | Songi has a square-shaped piece of colored paper with a side of 13 centimeters (cm). Find the length of the circumference of this piece of paper. | 52 | 13 4 [OP_MUL] | var_a = 13
var_b = 4
var_c = var_a * var_b
print(int(var_c)) |
Geometry | There is a rectangular window with a length of 47.3 centimeters (cm) and a width of 24 centimeters (cm). What is the area of this window? | 1135.2 | 47.3 24 [OP_MUL] | var_a = 47.3
var_b = 24
var_c = var_a * var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Correspondence | Jeonghoon misread the position of the decimal point in a certain number and moved the decimal point one place to the left of its original position. This resulted in the difference from the original number being 37.35. What is the original number? | 41.5 | 37.35 9 [OP_DIV] 10 [OP_MUL] | var_a = 37.35
var_b = 9
var_c = var_a / var_b
var_d = 10
var_e = var_c * var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Correspondence | When we should multiply a certain number by 16 and add 8, we mistakenly divide it by 16, and the quotient is 8 and the remainder is 4. Find the correct calculated value. | 2120 | 8 16 [OP_MUL] 4 [OP_ADD] 16 [OP_MUL] 8 [OP_ADD] | var_a = 8
var_b = 16
var_c = var_a * var_b
var_d = 4
var_e = var_c + var_d
var_f = 16
var_g = var_e * var_f
var_h = 8
var_i = var_g + var_h
print(int(var_i)) |
Correspondence | Yoongi tries to subtract 7 from an unknown number. But when he accidentally multiplied it by 5, the result was 30. Find the correct result. | -1 | 30 5 [OP_DIV] 7 [OP_SUB] | var_a = 30
var_b = 5
var_c = var_a / var_b
var_d = 7
var_e = var_c - var_d
print(int(var_e)) |
Comparison | At the presentation, students take turns giving presentations. Eunjung will be the 6th speaker from the back, and the seven students in front of Eunjung will make the presentation. How many students are giving presentations? | 13 | 6 7 [OP_ADD] | var_a = 6
var_b = 7
var_c = var_a + var_b
print(int(var_c)) |
Arithmetic calculation | There is a white piece of paper in the shape of a rectangle measuring 32 centimeters (cm) wide and 74 centimeters (cm) long. You are going to cut this paper to make several identical square shapes without any excess. How many of th elargest squares can you make? | 592 | 32 32 74 [OP_GCD] [OP_FDIV] 74 32 74 [OP_GCD] [OP_FDIV] [OP_MUL] | var_a = 32
var_b = 32
var_c = 74
var_d = math.gcd(int(var_c), int(var_b))
var_e = var_a // var_d
var_f = 74
var_g = 32
var_h = 74
var_i = math.gcd(int(var_h), int(var_g))
var_j = var_f // var_i
var_k = var_e * var_j
print(int(var_k)) |
Arithmetic calculation | You bought a total of 8 cookies, 300 won each and 500 won each, and paid 3,000 won. How many cookies did you buy that cost 500 won each? | 3 | 3000 300 8 [OP_MUL] [OP_SUB] 500 300 [OP_SUB] [OP_DIV] | var_a = 3000
var_b = 300
var_c = 8
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 500
var_g = 300
var_h = var_f - var_g
var_i = var_e / var_h
print(int(var_i)) |
Correspondence | 9 is the number you get when you add 12 to this number and divide it by 8. What is 35 minus half this number? | 5 | 35 9 8 [OP_MUL] 12 [OP_SUB] 2 [OP_DIV] [OP_SUB] | var_a = 35
var_b = 9
var_c = 8
var_d = var_b * var_c
var_e = 12
var_f = var_d - var_e
var_g = 2
var_h = var_f / var_g
var_i = var_a - var_h
print(int(var_i)) |
Arithmetic calculation | Hyeongjun has a two-year age gap with his older sister. If the ages of the siblings added together were 26, how old is Hyungjun's older sister? | 14 | 26 2 [OP_SUB] 2 [OP_DIV] 2 [OP_ADD] | var_a = 26
var_b = 2
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
var_f = 2
var_g = var_e + var_f
print(int(var_g)) |
Possibility | Five different drinks are sold in a convenience store. You are going to pick three of them and give one to your friend, one to your younger brother, and one to your older sister. Find the number of cases in this situation. | 60 | 5 3 [OP_PERM] | var_a = 5
var_b = 3
var_c = 1
var_a = int(var_a)
var_b = int(var_b)
for i, elem in enumerate(range(var_b)):
var_c = var_c * (var_a-i)
print(int(var_c)) |
Correspondence | When you multiply a number by 2, subtract it by 37, and then add it by 25 before dividing it by 8 equals 5. What is the number? | 26 | 5 8 [OP_MUL] 25 [OP_SUB] 37 [OP_ADD] 2 [OP_DIV] | var_a = 5
var_b = 8
var_c = var_a * var_b
var_d = 25
var_e = var_c - var_d
var_f = 37
var_g = var_e + var_f
var_h = 2
var_i = var_g / var_h
print(int(var_i)) |
Geometry | How many vertices are there in a regular icosahedron-shaped box? | 12 | 12 | var_a = 12
print(int(var_a)) |
Geometry | How many meters (m) of wire are needed to make a rectangle with 480 centimeters (cm) width and 360 centimeters (cm) length? | 16.8 | 480 100 [OP_DIV] 360 100 [OP_DIV] [OP_ADD] 2 [OP_MUL] 2 [OP_ROUND] | var_a = 480
var_b = 100
var_c = var_a / var_b
var_d = 360
var_e = 100
var_f = var_d / var_e
var_g = var_c + var_f
var_h = 2
var_i = var_g * var_h
var_j = 2
var_k = round(float(var_i)+1e-10, var_j)
print('{:.2f}'.format(round(var_k+1e-10,2))) |
Correspondence | Su-geun went fishing, but the fishing line was too long, so he decided to cut it. Su-geun originally intended to divide the fishing line by 2.5, but accidentally divided it into 2 and 2/5, and it became 15/32 centimeters (cm). Find the length of the fishing line in centimeters (cm) when Su-geun did not make a mistake. | 0.45 | 15/32 2 2/5 [OP_ADD] [OP_MUL] 2.5 [OP_DIV] | var_a = 0.46875
var_b = 2
var_c = 0.4
var_d = var_b + var_c
var_e = var_a * var_d
var_f = 2.5
var_g = var_e / var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Possibility | Find the number of ways in which the sum of two different numbers from 1 to 9 is greater than 10. | 32 | 1 9 1 [OP_LIST_ARANGE] 2 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] 10 [OP_LIST_MORE] [OP_LIST_LEN] | 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 = 2
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 = 10
list_d = []
for i in list_c:
if i > var_f:
list_d.append(i)
var_g = len(list_d)
print(int(var_g)) |
Comparison | Taehyung, Minju, Sangmin, Yoonjung, and Yoojung entered the finish line in this order. Who was the first to enter? | Taehyung | [OP_LIST_SOL] Taehyung Minju Sangmin Yoonjung Yoojung [OP_LIST_EOL] 1 [OP_LIST_GET] | var_a = 'Taehyung'
var_b = 'Minju'
var_c = 'Sangmin'
var_d = 'Yoonjung'
var_e = 'Yoojung'
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
var_g = list_a[var_f-1]
print(var_g) |
Comparison | I made an ade with 3, 2/6 spoons of blueberry syrup, and 21/6 spoons of grapefruit syrup. Find out which syrup is contained more in the ade, the blueberry syrup or the grapefruit syrup? | grapefruit | [OP_LIST_SOL] blueberry grapefruit [OP_LIST_EOL] [OP_LIST_SOL] 3 2 6 [OP_DIV] [OP_ADD] 21 6 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'blueberry'
var_b = 'grapefruit'
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 = 2
var_e = 6
var_f = var_d / var_e
var_g = var_c + var_f
var_h = 21
var_i = 6
var_j = var_h / var_i
list_b= []
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
list_b.reverse()
var_k = 1
list_c=list_b.copy()
list_c.sort()
var_l = list_c[-var_k]
var_m = list_b.index(var_l)+1
var_n = list_a[var_m-1]
print(var_n) |
Arithmetic calculation | Bomi bought candy for 350 won and chocolate for 500 won and paid 1,000 won. How much change should Bomi get? | 150 | 1000 350 [OP_SUB] 500 [OP_SUB] | var_a = 1000
var_b = 350
var_c = var_a - var_b
var_d = 500
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | Hyunjoo has 3/4 meter (m) of red tape, 4/5 meter (m) of blue tape, and 2/3 meter (m) of yellow tape. Find how many meters (m) all the colored tapes Hyeonju has. | 2.22 | 3/4 4/5 [OP_ADD] 2/3 [OP_ADD] | var_a = 0.75
var_b = 0.8
var_c = var_a + var_b
var_d = 0.6666666666666666
var_e = var_c + var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Arithmetic calculation | In a park with a circumference of 1 kilometer (km) and 500 meters (m), trees are to be planted at intervals of 30 meters (m). If the cost of one tree is 5,000 mill, how much does it cost to buy the tree you need? | 250000 | 1 1000 [OP_MUL] 500 [OP_ADD] 30 [OP_DIV] 5000 [OP_MUL] | var_a = 1
var_b = 1000
var_c = var_a * var_b
var_d = 500
var_e = var_c + var_d
var_f = 30
var_g = var_e / var_f
var_h = 5000
var_i = var_g * var_h
print(int(var_i)) |
Comparison | Nine students are standing in a line at the bus stop waiting for the bus. How many students are between the second student from the back and the third student from the front? | 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 | It is said that a 30 centimeters (cm) long candle shrinks by 1 centimeter (cm) per minute, and a 20 centimeters (cm) long candle shrinks by 0.5 centimeters (cm) per minute. Find the length of the candle when both candles become equally long. | 10 | 30 30 20 [OP_SUB] 1 0.5 [OP_SUB] [OP_DIV] [OP_SUB] | var_a = 30
var_b = 30
var_c = 20
var_d = var_b - var_c
var_e = 1
var_f = 0.5
var_g = var_e - var_f
var_h = var_d / var_g
var_i = var_a - var_h
print(int(var_i)) |
Correspondence | Which of 15, 18, 29, and 21 is a multiple of 2 that is less than 20? | 18 | [OP_LIST_SOL] 15 18 29 21 [OP_LIST_EOL] 2 [OP_LIST_DIVISIBLE] 20 [OP_LIST_LESS] 1 [OP_LIST_GET] | var_a = 15
var_b = 18
var_c = 29
var_d = 21
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 = []
var_e = int(var_e)
for i in list_a:
i = int(i)
if i % var_e == 0:
list_b.append(i)
var_f = 20
list_c = []
for i in list_b:
if i < var_f:
list_c.append(i)
var_g = 1
var_h = list_c[var_g-1]
print(int(var_h)) |
Geometry | There is a rectangular parallelepiped with a width of 28 centimeters (cm), a length of 24 centimeters (cm) and a height of 19 centimeters (cm). I made a new cuboid using these several identical cuboids, and each of the width, length, and height was twice the original length. How many times did the volume increase? | 8 | 28 2 [OP_MUL] 24 [OP_MUL] 2 [OP_MUL] 19 [OP_MUL] 2 [OP_MUL] 28 24 [OP_MUL] 19 [OP_MUL] [OP_FDIV] | var_a = 28
var_b = 2
var_c = var_a * var_b
var_d = 24
var_e = var_c * var_d
var_f = 2
var_g = var_e * var_f
var_h = 19
var_i = var_g * var_h
var_j = 2
var_k = var_i * var_j
var_l = 28
var_m = 24
var_n = var_l * var_m
var_o = 19
var_p = var_n * var_o
var_q = var_k // var_p
print(int(var_q)) |
Geometry | I have made a cube with a side of 10 centimeters (cm) by stacking several blocks with a side of 2 centimeters (cm). If I paint all the faces of this cube red, how many blocks have only one coloured face? | 54 | 10 2 [OP_DIV] 2 [OP_SUB] 2 [OP_POW] 6 [OP_MUL] | var_a = 10
var_b = 2
var_c = var_a / var_b
var_d = 2
var_e = var_c - var_d
var_f = 2
var_g = var_e ** var_f
var_h = 6
var_i = var_g * var_h
print(int(var_i)) |
Possibility | How many numbers in a three-digit number add up to 25? | 6 | 100 1000 1 [OP_SUB] 1 [OP_LIST_ARANGE] [OP_LIST_NUM2SUM] 25 [OP_LIST_MORE_EQUAL] 25 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN] | var_a = 100
var_b = 1000
var_c = 1
var_d = var_b - var_c
var_e = 1
list_a = [i for i in range(var_a, var_d + 1, var_e)]
list_b=[]
for i in list_a:
var_f = 0
i = int(i)
while i//10 > 0:
var_f = var_f + i%10
i = i//10
var_f = var_f + i%10
list_b.append(var_f)
var_g = 25
list_c = []
for i in list_b:
if i >= var_g:
list_c.append(i)
var_h = 25
list_d = []
for i in list_c:
if i <= var_h:
list_d.append(i)
var_i = len(list_d)
print(int(var_i)) |
Arithmetic calculation | What is the largest three-digit number divisible by 5, 8, and 2? | 960 | 100 999 1 [OP_LIST_ARANGE] 5 [OP_LIST_DIVISIBLE] 8 [OP_LIST_DIVISIBLE] 2 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX] | var_a = 100
var_b = 999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 5
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 = 8
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 = 2
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 = 1
list_e=list_d.copy()
list_e.sort()
var_h = list_e[-var_g]
print(int(var_h)) |
Possibility | Find the largest two-digit number that can be formed by picking two different numbers from 4, 2, and 1. | 42 | [OP_LIST_SOL] 4 2 1 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] | var_a = 4
var_b = 2
var_c = 1
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 = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
print(int(var_f)) |
Possibility | Yoongi wants to read 3 of the 5 different books. Taking into account the order in which he reads them, how many ways can Yoongi read three books? | 60 | 5 3 [OP_PERM] | var_a = 5
var_b = 3
var_c = 1
var_a = int(var_a)
var_b = int(var_b)
for i, elem in enumerate(range(var_b)):
var_c = var_c * (var_a-i)
print(int(var_c)) |
Correspondence | Jimin gave 2 persimmons to Yuna and 7 apples to Minyoung. How many fruits did Jimin share? | 9 | 2 7 [OP_ADD] | var_a = 2
var_b = 7
var_c = var_a + var_b
print(int(var_c)) |
Correspondence | Seokjin put 2 persimmons in the box. How many fruits are in the box when 7 more apples are added to the box? | 9 | 2 7 [OP_ADD] | var_a = 2
var_b = 7
var_c = var_a + var_b
print(int(var_c)) |
Comparison | With the same number of students standing in each row, Yoongi is at 7 rows from the left, 13 rows from the right, 8 rows from the front, and 14 rows from the back. What is the total number of students? | 399 | 7 13 [OP_ADD] 1 [OP_SUB] 8 14 [OP_ADD] 1 [OP_SUB] [OP_MUL] | var_a = 7
var_b = 13
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 8
var_g = 14
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)) |
Correspondence | 84 is the result of subtracting 27 from a certain number and adding 19 by mistake instead of subtracting 19 and adding 27. What is the certain number if you calculate correctly? | 100 | 84 19 [OP_SUB] 27 [OP_ADD] 19 [OP_SUB] 27 [OP_ADD] | var_a = 84
var_b = 19
var_c = var_a - var_b
var_d = 27
var_e = var_c + var_d
var_f = 19
var_g = var_e - var_f
var_h = 27
var_i = var_g + var_h
print(int(var_i)) |
Correspondence | There are N natural numbers. These natural numbers are consecutive from 1 to N, and the sum of even numbers in these numbers is 90 and the sum of odd numbers in these numbers is 100. What is the value of N? | 19 | 100 90 [OP_SUB] 2 [OP_MUL] 1 [OP_SUB] | var_a = 100
var_b = 90
var_c = var_a - var_b
var_d = 2
var_e = var_c * var_d
var_f = 1
var_g = var_e - var_f
print(int(var_g)) |
Arithmetic calculation | A number is said to be not less than 30 and not more than 50. Find the sum of all the possible values of the number. | 840 | 30 50 1 [OP_LIST_ARANGE] [OP_LIST_SUM] | var_a = 30
var_b = 50
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)) |
Arithmetic calculation | Junhyun took a bus for a distance of 2.6 kilometers (km) and a subway for a distance of 5.98 kilometers (km) to go to the meeting place. How many kilometers (km) did Junhyun take public transportation? | 8.58 | 2.6 5.98 [OP_ADD] | var_a = 2.6
var_b = 5.98
var_c = var_a + var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Comparison | In class presidential elections, the candidate with the highest percentage of votes becomes the class representative. 30 classmates voted, A got 12 votes, B got 3 votes, and C got 15 votes. Who is the winner of this election? | C | [OP_LIST_SOL] A B C [OP_LIST_EOL] [OP_LIST_SOL] 12 3 15 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [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 = 12
var_e = 3
var_f = 15
list_b= []
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j) |
Geometry | Find the number of vertices of a solid figure whose bases are parallel and congruent polygons and whose sides are six rectangles. | 12 | 6 2 [OP_MUL] | var_a = 6
var_b = 2
var_c = var_a * var_b
print(int(var_c)) |
Geometry | You want to find the width and length of a rectangle whose perimeter is 16 centimeters (cm) and its width is 2 centimeters (cm) longer than its length. How long is its width? | 5 | 16 2 [OP_DIV] 2 [OP_SUB] 2 [OP_DIV] 2 [OP_ADD] | var_a = 16
var_b = 2
var_c = var_a / var_b
var_d = 2
var_e = var_c - var_d
var_f = 2
var_g = var_e / var_f
var_h = 2
var_i = var_g + var_h
print(int(var_i)) |
Geometry | Village A is rectangular in shape, measuring 6 kilometers (km) wide and 9 kilometers (km) long, and village B is square, measuring 8 kilometers (km) wide and 8 kilometers (km) long. Find which town has the greater perimeter. | B | [OP_LIST_SOL] A B [OP_LIST_EOL] [OP_LIST_SOL] 6 9 [OP_ADD] 8 8 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'A'
var_b = 'B'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 6
var_d = 9
var_e = var_c + var_d
var_f = 8
var_g = 8
var_h = var_f + var_g
list_b= []
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
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 | You want to divide 12 kilograms (kg) and 400 grams (g) of strawberries into two different baskets. How many kilograms (kg) will the large basket contain if the large basket contains 2 kilograms (kg) 600 grams (g) more than the small basket? | 7.5 | 12 400 1000 [OP_DIV] [OP_ADD] 2 [OP_DIV] 2 600 1000 [OP_DIV] [OP_ADD] 2 [OP_DIV] [OP_ADD] | var_a = 12
var_b = 400
var_c = 1000
var_d = var_b / var_c
var_e = var_a + var_d
var_f = 2
var_g = var_e / var_f
var_h = 2
var_i = 600
var_j = 1000
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('{:.2f}'.format(round(var_o+1e-10,2))) |
Geometry | If you want to make the smallest possible square-shaped piece of paper by attaching rectangular pieces of paper with a width of 20 centimeters (cm) and a length of 8 centimeters (cm) without overlapping, find how many sheets of paper you will need. | 10 | 20 8 [OP_LCM] 2 [OP_POW] 20 8 [OP_MUL] [OP_DIV] | var_a = 20
var_b = 8
var_c = var_b * var_a / math.gcd(int(var_b), int(var_a))
var_d = 2
var_e = var_c ** var_d
var_f = 20
var_g = 8
var_h = var_f * var_g
var_i = var_e / var_h
print(int(var_i)) |
Geometry | You want to make a rectangle that is 63 centimeters (cm) wide by 42 centimeters (cm) tall by joining several squares together without overlapping them. To minimize the number of squares, find how many centimeters (cm) each side of the square must be. | 21 | 63 42 [OP_GCD] | var_a = 63
var_b = 42
var_c = math.gcd(int(var_b), int(var_a))
print(int(var_c)) |
Correspondence | There are two different one digit numbers A and B. Find B from the two-digit addition formula 6A+B2=77. | 1 | 6A+B2=77 B [OP_DIGIT_UNK_SOLVER] | var_a = '6A+B2=77'
var_b = 'B'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Geometry | Find the surface area of a cube whose edges are 11 centimeters (cm) long. | 726 | 11 2 [OP_POW] 6 [OP_MUL] | var_a = 11
var_b = 2
var_c = var_a ** var_b
var_d = 6
var_e = var_c * var_d
print(int(var_e)) |
Geometry | A triangle has vertices of point A, point B, and point C. In this case, the length of side AB is 4.9 centimeters (cm), and the area of this triangle is 9.31 square centimeters (cm2). If a line is drawn perpendicular to side AB from point C and D is the point where it intersects, how many centimeters (cm) is the length of the line segment CD? | 3.8 | 9.31 2 [OP_MUL] 4.9 [OP_DIV] | var_a = 9.31
var_b = 2
var_c = var_a * var_b
var_d = 4.9
var_e = var_c / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Correspondence | When A is divided by B, the quotient is C and the remainder is 2. A, B, and C are natural numbers. If B and C are equal, what is the smallest possible number of A? | 11 | 2 1 [OP_ADD] 2 [OP_POW] 2 [OP_ADD] | var_a = 2
var_b = 1
var_c = var_a + var_b
var_d = 2
var_e = var_c ** var_d
var_f = 2
var_g = var_e + var_f
print(int(var_g)) |
Arithmetic calculation | There are 34 bottles of juice in the market, and there are 3/2 times as many bottles of water as juice plus 3 bottles of water. How many bottles of bottled water and juice are there in total in the market? | 88 | 34 34 3/2 [OP_MUL] 3 [OP_ADD] [OP_ADD] | var_a = 34
var_b = 34
var_c = 1.5
var_d = var_b * var_c
var_e = 3
var_f = var_d + var_e
var_g = var_a + var_f
print(int(var_g)) |
Correspondence | 125 is the result when you accidentally add 65 to a certain number that you should add 95 to . Find the result of the correct calculation. | 155 | 125 65 [OP_SUB] 95 [OP_ADD] | var_a = 125
var_b = 65
var_c = var_a - var_b
var_d = 95
var_e = var_c + var_d
print(int(var_e)) |
Correspondence | Divide a certain number by 1/100 and multiply by 10 to get 2804. Find the number. | 2.8 | 2804 10 [OP_DIV] 1/100 [OP_MUL] | var_a = 2804
var_b = 10
var_c = var_a / var_b
var_d = 0.01
var_e = var_c * var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Correspondence | Rounding down A76 to the nearest hundred gives 700. Find the correct number for A. | 7 | A76 [OP_GEN_POSSIBLE_LIST] 700 [OP_LIST_MORE_EQUAL] 700 100 [OP_ADD] [OP_LIST_LESS] A76 A [OP_LIST_FIND_UNK] | var_a = 'A76'
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 = 700
list_b = []
for i in list_a:
if i >= var_b:
list_b.append(i)
var_c = 700
var_d = 100
var_e = var_c + var_d
list_c = []
for i in list_b:
if i < var_e:
list_c.append(i)
var_f = 'A76'
var_g = 'A'
var_f = str(var_f)
var_g = str(var_g)
unk_idx = var_f.index(var_g)
var_h = 0
for elem in list_c:
elem = str(elem)
var_h = int(elem[unk_idx])
print(int(var_h)) |
Arithmetic calculation | When I went up the mountain at 3 kilometers (km) per hour and came down 2 kilometers (km) longer road at 4 kilometers (km) per hour, the total hour of going up and down took 4 hours. Find the distance for coming down. | 8 | 4 2 4 [OP_DIV] [OP_SUB] 1 3 [OP_DIV] 1 4 [OP_DIV] [OP_ADD] [OP_DIV] 2 [OP_ADD] | var_a = 4
var_b = 2
var_c = 4
var_d = var_b / var_c
var_e = var_a - var_d
var_f = 1
var_g = 3
var_h = var_f / var_g
var_i = 1
var_j = 4
var_k = var_i / var_j
var_l = var_h + var_k
var_m = var_e / var_l
var_n = 2
var_o = var_m + var_n
print(int(var_o)) |
Possibility | There is a hotel where every room has 3-digit numbers. You have hidden a treasure in a room with digits 3, 0, and 6 all in the room number. How many treasures have you hidden? | 4 | [OP_LIST_SOL] 3 0 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN] | var_a = 3
var_b = 0
var_c = 6
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 | You want to multiply a number by 24. When you accidentally added 42, the result was 50. What is the correct value? | 192 | 50 42 [OP_SUB] 24 [OP_MUL] | var_a = 50
var_b = 42
var_c = var_a - var_b
var_d = 24
var_e = var_c * var_d
print(int(var_e)) |
Possibility | Find the number in the tens place of the smallest number that can be made by using all of the given number cards 0, 5, and 8 once. | 0 | [OP_LIST_SOL] 0 5 8 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] 100 [OP_MOD] 10 [OP_FDIV] | var_a = 0
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 = len(list_a)
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[var_e-1]
var_g = 100
var_h = var_f % var_g
var_i = 10
var_j = var_h // var_i
print(int(var_j)) |
Geometry | There is a box in the shape of a cuboid. The sum of all edges is 224 centimeters (cm), and the box's width is 30 centimeters (cm) and its length is 22 centimeters (cm). How many centimeters (cm) is the height of this box? | 4 | 224 4 [OP_DIV] 30 [OP_SUB] 22 [OP_SUB] | var_a = 224
var_b = 4
var_c = var_a / var_b
var_d = 30
var_e = var_c - var_d
var_f = 22
var_g = var_e - var_f
print(int(var_g)) |
Comparison | Three classes A, B, and C took a math test. If class B's average is higher than class A's, and class C's average is higher than class A's, find the class with the lowest average. | A | [OP_LIST_SOL] A B C [OP_LIST_EOL] [OP_LIST_SOL] B A > C A > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | var_a = 'A'
var_b = 'B'
var_c = 'C'
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 'B'
var_e = 'A'
var_f = '>'
var_g = 'C'
var_h = 'A'
var_i = '>'
list_b= []
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
if cond_ in ("<", ">", "="):
operand_right = temp_stack.pop()
operand_left = temp_stack.pop()
if cond_ == "=":
cond_ = "=="
conditions.append(f"{operand_left} {cond_} {operand_right}")
else:
if not cond_.isdigit():
cond_ = "{" + cond_ + "}"
temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
item_name_index_dict = dict(zip(items_name_list, perm))
formatted_conditions = \
[condition.format_map(item_name_index_dict) for condition in conditions]
if all(map(eval, formatted_conditions)):
break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_j = len(list_c)
var_k = list_c[var_j-1]
print(var_k) |
Arithmetic calculation | Minyoung has 24 flowers. The number of flowers that Minyoung has is 4 times the number of flowers that Yoojung has. How many flowers do they have? | 30 | 24 24 4 [OP_DIV] [OP_ADD] | var_a = 24
var_b = 24
var_c = 4
var_d = var_b / var_c
var_e = var_a + var_d
print(int(var_e)) |
Arithmetic calculation | Among the 18 flowers, 5 were given to Min-Young and 6 to Yoo-Jeong. How many flowers are left? | 7 | 18 5 [OP_SUB] 6 [OP_SUB] | var_a = 18
var_b = 5
var_c = var_a - var_b
var_d = 6
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | I picked one from 41, 43, 45, and 47, and I got a value greater than 43 and less than 46. What is this number? | 45 | [OP_LIST_SOL] 41 43 45 47 [OP_LIST_EOL] 43 [OP_LIST_MORE] 46 [OP_LIST_LESS] 1 [OP_LIST_GET] | var_a = 41
var_b = 43
var_c = 45
var_d = 47
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 = 43
list_b = []
for i in list_a:
if i > var_e:
list_b.append(i)
var_f = 46
list_c = []
for i in list_b:
if i < var_f:
list_c.append(i)
var_g = 1
var_h = list_c[var_g-1]
print(int(var_h)) |
Correspondence | Yuna gave 2 apples to Minyoung and 7 persimmons to Yoojung, and the number of fruits left is 0. How many fruits did Yuna have? | 9 | 2 7 [OP_ADD] | var_a = 2
var_b = 7
var_c = var_a + var_b
print(int(var_c)) |
Arithmetic calculation | Sungjun drinks a little milk every day. If he drank 1/3 bottle yesterday and 1/2 bottle today, how many bottles of milk did he drink in two days? | 0.83 | 1/3 1/2 [OP_ADD] | var_a = 0.3333333333333333
var_b = 0.5
var_c = var_a + var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Arithmetic calculation | There is a truck that runs at a constant speed of 2.1 kilometers (km) in 1 minute, and a taxi that runs at 10.5 kilometers (km) in 4 minutes. Find how many times the taxi is faster than the truck. | 1.25 | 10.5 4 [OP_DIV] 2.1 1 [OP_DIV] [OP_DIV] | var_a = 10.5
var_b = 4
var_c = var_a / var_b
var_d = 2.1
var_e = 1
var_f = var_d / var_e
var_g = var_c / var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Correspondence | Divide a number by 9 and subtract 13, then divide by 7 and subtract 8 to get 13. Find the number. | 1440 | 13 8 [OP_ADD] 7 [OP_MUL] 13 [OP_ADD] 9 [OP_MUL] | var_a = 13
var_b = 8
var_c = var_a + var_b
var_d = 7
var_e = var_c * var_d
var_f = 13
var_g = var_e + var_f
var_h = 9
var_i = var_g * var_h
print(int(var_i)) |
Arithmetic calculation | A farm raises 64 rabbits, which are 17 fewer than chickens. How many rabbits and chickens does this farm have? | 111 | 64 17 [OP_SUB] 64 [OP_ADD] | var_a = 64
var_b = 17
var_c = var_a - var_b
var_d = 64
var_e = var_c + var_d
print(int(var_e)) |
Possibility | From the numbers 0, 1, 2, 3, and 4, three different numbers were chosen to make a three-digit number. How many of these numbers are divisible by 2, 3, and 5? | 4 | [OP_LIST_SOL] 0 1 2 3 4 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 2 3 [OP_LCM] 5 [OP_LCM] [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 0
var_b = 1
var_c = 2
var_d = 3
var_e = 4
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_f))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_g = 2
var_h = 3
var_i = var_h * var_g / math.gcd(int(var_h), int(var_g))
var_j = 5
var_k = var_j * var_i / math.gcd(int(var_j), int(var_i))
list_c = []
var_k = int(var_k)
for i in list_b:
i = int(i)
if i % var_k == 0:
list_c.append(i)
var_l = len(list_c)
print(int(var_l)) |
Geometry | There is a park in the shape of a square. If the length of one side of this park is 5 kilometers (km), what is the circumference of this garden in kilometers (km)? | 20 | 5 4 [OP_MUL] | var_a = 5
var_b = 4
var_c = var_a * var_b
print(int(var_c)) |
Correspondence | A and B are single digit numbers. A is 4 greater than 2, and 3 less than B is 1. Find the sum of A and B. | 10 | 2 4 [OP_ADD] 1 3 [OP_ADD] [OP_ADD] | var_a = 2
var_b = 4
var_c = var_a + var_b
var_d = 1
var_e = 3
var_f = var_d + var_e
var_g = var_c + var_f
print(int(var_g)) |
Possibility | Find the number of four-digit integers that can be made by drawing 4 cards out of 5 cards with the numbers 0, 1, 2, 3, and 4 written on them. | 96 | [OP_LIST_SOL] 0 1 2 3 4 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] [OP_LIST_LEN] | var_a = 0
var_b = 1
var_c = 2
var_d = 3
var_e = 4
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_f))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_g = len(list_b)
print(int(var_g)) |
Possibility | You are going to paint the three parts A, B, and C that are continuously attached with five colors: red, orange, blue, yellow, and green. Find the number of cases in which a color can be used only once and adjacent areas are painted with different colors. | 60 | 5 3 [OP_PERM] | var_a = 5
var_b = 3
var_c = 1
var_a = int(var_a)
var_b = int(var_b)
for i, elem in enumerate(range(var_b)):
var_c = var_c * (var_a-i)
print(int(var_c)) |
Geometry | There is a tray in the shape of a rectangle measuring 81/4 centimeters (cm) wide and 148/9 centimeters (cm) long. What is the area of this tray in square centimeters (cm2)? | 333 | 81/4 148/9 [OP_MUL] | var_a = 20.25
var_b = 16.444444444444443
var_c = var_a * var_b
print(int(eval('{:.2f}'.format(round(var_c+1e-10,2))))) |
Geometry | Find the length of one edge of a square made using all 12/25 meters (m) of wire. | 0.12 | 12/25 4 [OP_DIV] | var_a = 0.48
var_b = 4
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Geometry | You have a triangle whose base is 4.9 centimeters (cm). If the area of this triangle is 9.31 square centimeters (cm2), how many centimeters (cm) is its height? | 3.8 | 9.31 2 [OP_MUL] 4.9 [OP_DIV] | var_a = 9.31
var_b = 2
var_c = var_a * var_b
var_d = 4.9
var_e = var_c / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Arithmetic calculation | In a subtraction between two-digit numbers, the number 2 in the tens digit of the minuend is mistaken for 5, and the number 6 in the ones digit is mistaken for 9, and the result is 44. Find the result of the correct calculation. | 11 | 44 10 2 5 [OP_SUB] [OP_MUL] [OP_ADD] 1 6 9 [OP_SUB] [OP_MUL] [OP_ADD] | var_a = 44
var_b = 10
var_c = 2
var_d = 5
var_e = var_c - var_d
var_f = var_b * var_e
var_g = var_a + var_f
var_h = 1
var_i = 6
var_j = 9
var_k = var_i - var_j
var_l = var_h * var_k
var_m = var_g + var_l
print(int(var_m)) |
Geometry | You have a triangle with an area of 9.31 square centimeters (cm2) and a base of 4.9 centimeters (cm). What is the height of this triangle in centimeters (cm)? | 3.8 | 9.31 2 [OP_MUL] 4.9 [OP_DIV] | var_a = 9.31
var_b = 2
var_c = var_a * var_b
var_d = 4.9
var_e = var_c / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Geometry | If a cube has a square with a perimeter of 52 centimeters (cm) as one side, what is the surface area of the figure? | 1014 | 52 4 [OP_DIV] 52 4 [OP_DIV] [OP_MUL] 6 [OP_MUL] | var_a = 52
var_b = 4
var_c = var_a / var_b
var_d = 52
var_e = 4
var_f = var_d / var_e
var_g = var_c * var_f
var_h = 6
var_i = var_g * var_h
print(int(var_i)) |
Correspondence | There are two one-digit number A and B. Find the sum of A and B in 8AA4-BBB=BBBB. | 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)) |
Arithmetic calculation | The average weight of the 20 male students in Eugene's class is 42 kg, and the average weight of the 20 female students is 38 kg. What is the average weight of all the students in Eugene's class in kilograms (kg)? | 40 | 20 42 [OP_MUL] 20 38 [OP_MUL] [OP_ADD] 20 20 [OP_ADD] [OP_DIV] | var_a = 20
var_b = 42
var_c = var_a * var_b
var_d = 20
var_e = 38
var_f = var_d * var_e
var_g = var_c + var_f
var_h = 20
var_i = 20
var_j = var_h + var_i
var_k = var_g / var_j
print(int(var_k)) |
Geometry | All of the square-shaped tiles are lined up to make a larger square. If the number of tiles on the perimeter is 52, find the number of tiles on the outermost of one side. | 14 | 52 4 [OP_SUB] 4 [OP_DIV] 2 [OP_ADD] | var_a = 52
var_b = 4
var_c = var_a - var_b
var_d = 4
var_e = var_c / var_d
var_f = 2
var_g = var_e + var_f
print(int(var_g)) |
Arithmetic calculation | Jimin's family runs an orchard. When picking apples, Jimin picked 7, Grandpa 13, younger brother 8, and younger sister 5. How many more apples did the person who picked the most apples pick than the person who picked the fewest? | 8 | [OP_LIST_SOL] 8 13 7 5 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] | var_a = 8
var_b = 13
var_c = 7
var_d = 5
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 1
list_b=list_a.copy()
list_b.sort()
var_f = list_b[-var_e]
var_g = 1
list_c=list_a.copy()
list_c.sort()
var_h = list_c[var_g-1]
var_i = var_f - var_h
print(int(var_i)) |
Comparison | Find the number of numbers greater than or equal to 0.4 among 0.8, 1/2, and 0.3. | 2 | [OP_LIST_SOL] 0.8 1/2 0.3 [OP_LIST_EOL] 0.4 [OP_LIST_MORE_EQUAL] [OP_LIST_LEN] | var_a = 0.8
var_b = 0.5
var_c = 0.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 = 0.4
list_b = []
for i in list_a:
if i >= var_d:
list_b.append(i)
var_e = len(list_b)
print(int(var_e)) |
Arithmetic calculation | When Hyemi went to the game room, she went at 3 kilometers per hour (km). When she came back from the game room, she went through the mart, so she came at a speed of 4 km per hour on a 2 km (km) longer road. If the total time to go and return took 4 hours, how many kilometers did she walk to the game room? | 6 | 4 2 4 [OP_DIV] [OP_SUB] 1 3 [OP_DIV] 1 4 [OP_DIV] [OP_ADD] [OP_DIV] | var_a = 4
var_b = 2
var_c = 4
var_d = var_b / var_c
var_e = var_a - var_d
var_f = 1
var_g = 3
var_h = var_f / var_g
var_i = 1
var_j = 4
var_k = var_i / var_j
var_l = var_h + var_k
var_m = var_e / var_l
print(int(eval('{:.2f}'.format(round(var_m+1e-10,2))))) |
Comparison | Which number is less than or equal to 0.8, 1/2, 0.3, 1/3 and greater than or equal to 0.4? | 0.5 | [OP_LIST_SOL] 0.8 1/2 0.3 1/3 [OP_LIST_EOL] 0.4 [OP_LIST_MORE_EQUAL] 1 [OP_LIST_MIN] | var_a = 0.8
var_b = 0.5
var_c = 0.3
var_d = 0.3333333333333333
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 0.4
list_b = []
for i in list_a:
if i >= var_e:
list_b.append(i)
var_f = 1
list_c=list_b.copy()
list_c.sort()
var_g = list_c[var_f-1]
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.