question stringlengths 11 2.89k | code stringlengths 20 7.24k |
|---|---|
At Happy Feet Pediatrics, each child can have 3 appointments in a week. If Eric had half his appointments in the first 2 days, how many appointments can he still make for the rest of the week? | def solve() -> int:
weekly_appointments = 3
days_in_week = 7
eric_first_two_days = weekly_appointments / 2
eric_remaining_appointments = weekly_appointments - eric_first_two_days
result = eric_remaining_appointments * (days_in_week - 2)
return result
|
Zoe has 16 bowls. Her sister Zoey has triple the number of bowls as Zoe. How many bowls does Zoey have? | def solve() -> int:
number_of_bowls_zoe = 16
number_of_bowls_zoey = number_of_bowls_zoe * 3
result = number_of_bowls_zoey
return result
|
Sofia practiced yoga for 35 minutes every day for one month. Alex practiced yoga for 18 minutes on each of nine days. How many minutes did Sofia and Alex practice yoga in total? | def solve() -> int:
sofia_minutes_per_day = 35
alex_minutes_per_day = 18
days_in_month = 30
sofia_total_minutes = sofia_minutes_per_day * days_in_month
alex_total_minutes = alex_minutes_per_day * 9
total_minutes = sofia_total_minutes + alex_total_minutes
result = total_mi... |
arah went to a grocery store and bought 3 packs of apples for $2.50 each, a loaf of bread for $3, and a carton of milk for $1.80. If she pays with a $10 bill and tips 10%, how much change will she get back? | def solve() -> int:
total_cost = 2.5 * 3 + 3 + 1.8
tip = total_cost * 0.1
total_cost += tip
change = 10 - total_cost
result = change
return result
|
A bakery sold 200 cupcakes in a week. In the first two days, 30 cupcakes were sold. In the next three days, five times as many cupcakes were sold. There was an equal number of cupcakes sold in the remaining two days. How many cupcakes was each sold in the remaining two days? | def solve() -> int:
total_cupcakes = 200
first_two_days = 30
next_three_days = 5 * first_two_days
remaining_days = total_cupcakes - first_two_days - next_three_days
each_remaining_day = remaining_days / 2
result = each_remaining_day
return result
|
- Mark has a monthly gym membership that costs $40. He gets a 10% discount if he pays for 6 months in advance. How much does he save in a year by paying in advance? | def solve() -> int:
no_discount = 40
with_discount = no_discount * (1 - 0.1)
difference = no_discount - with_discount
six_months = difference * 6
one_year = six_months * 2
result = one_year
return result
|
Student: Eric has 8 pencils for every 3 pens. If he has 24 pencils, how many pens does he have? | def solve() -> int:
pencils = 24
pens = 0
pens = pencils * 3 // 8
result = pens
return result
|
John is planting vegetables in his garden. He has 24 rows of plants, with each row having 12 plants. Of the 24 rows, 8 are for tomatoes and half of the remaining rows are for carrots. How many rows are for other vegetables? | def solve() -> int:
total_rows = 24
plants_per_row = 12
tomato_rows = 8
remaining_rows = total_rows - tomato_rows
carrot_rows = remaining_rows / 2
other_veggie_rows = remaining_rows - carrot_rows
result = other_veggie_rows
return result
|
A recipe requires 2 1/2 cups of milk to make 8 servings. How much milk is needed to make 12 servings? | def solve() -> int:
cups_of_milk_per_serving = 2.5/8
cups_of_milk_for_12_servings = cups_of_milk_per_serving * 12
result = cups_of_milk_for_12_servings
return result
|
Jason bought 4 birthdays cards. Each card cost 50 cents, how much did he spend in total? | def solve() -> int:
total_price = 4 * 0.50
result = total_price
return result
|
Alex has 7 apples. His friend Daniel has twice as many apples as Alex. If they share all the apples equally, how many apples will each have? | def solve() -> int:
Alex = 7
Daniel = 2 * Alex
total_apples = Alex + Daniel
each_gets = total_apples / 2
result = each_gets
return result
|
If Tom buys 4 books for $3.50 each, how much money does he spend in total? | def solve() -> int:
price_per_book = 3.50
total_books = 4
result = price_per_book * total_books
return result
|
Johnny bought 34 apples. Each apple cost 50 cents. How much did he spend in total? | def solve() -> int:
price_per_apple = 0.50
number_of_apples = 34
total_cost = price_per_apple * number_of_apples
result = total_cost
return result
|
John can mow a lawn in 2 hours and trim the edges in 45 minutes. If he has 5 lawns to mow and trim, how long will it take him to finish the job? | def solve() -> int:
time_to_mow_lawn = 2
time_to_trim_edges = 0.75
num_of_lawns = 5
total_time = (time_to_mow_lawn + time_to_trim_edges) * num_of_lawns
result = total_time
return result
|
Alex and his partner Olivia go to the gym to pay for their monthly membership. Alex pays $80 per month and Olivia pays three times as much. If they both upgrade to the premium package, which costs $50 more than the regular one, how much money did they spend together in total? | def solve() -> int:
alex_monthly_payment = 80
olivia_monthly_payment = 3 * alex_monthly_payment
premium_package_cost = 80 + 50
total_monthly_payment = alex_monthly_payment + olivia_monthly_payment
total_premium_payment = 2 * premium_package_cost
total_spent = 12 * total_monthly_payment + 12 * to... |
A box contains 24 pencils. If each pencil has an eraser, how many erasers are in the box? | def solve() -> int:
pencils_in_box = 24
erasers_per_pencil = 1
total_erasers = pencils_in_box * erasers_per_pencil
result = total_erasers
return result
|
A bakery makes 200 loaves of bread every day. If they increase production by 10% every week, how many loaves of bread will they make after a month? | def solve() -> int:
bread = 200
for i in range(1, 5):
bread *= 1.1
result = round(bread * 30)
return result
|
Student: Kim and her dad went shopping at the store and had €48. They bought 1 pack of lettuce for €3, 1 pack of carrots for €3, 1 bottle of soda for €1, 1 potato for €1 and 5 onions for €1 each. How much money do they have left? | def solve() -> int:
money = 48
money -= 3
money -= 3
money -= 1
money -= 1
money -= 5
result = money
return result
|
Maria makes a rice dish for dinner every night. She uses 1 cup of rice and adds 1/2 cup of black beans. Each bag of rice has 5 cups. After 18 days, if rice is sold for $5.00 per bag and black beans are sold for $0.99 per can, how much will she have spent on rice and beans in total? | def solve() -> int:
rice_per_bag = 5
rice_per_day = 1
beans_per_day = 1/2
days = 18
rice_needed = rice_per_day * days
beans_needed = beans_per_day * days
rice_bags = rice_needed / rice_per_bag
beans_cans = beans_needed
rice_cost = rice_bags * 5.00
beans_cost = bean... |
John bought 8 bars of chocolate for €1.75 each. How much did he pay? | def solve() -> int:
price = 1.75
quantity = 8
result = price * quantity
return result
|
Max is raising money for a new skateboard. He wants to raise $130. He buys each roll of grip tape for $3.50 and then sells each skateboard deck already gripped for $25. How many rolls of grip tape does he need to buy and grip skateboard decks to reach his goal? | def solve() -> int:
goal = 130
grip_tape_cost = 3.50
deck_price = 25
decks_needed = goal / deck_price
grip_tapes_needed = decks_needed * grip_tape_cost
result = grip_tapes_needed
return result
|
David and Eric are playing golf. David can sink the ball in the hole from 15 feet 6 times out of 9. Eric can sink the ball in the hole from the same distance 4 times out of 5. How many times was the ball sunk in the hole? | def solve() -> int:
david_successes = 6
david_attempts = 9
eric_successes = 4
eric_attempts = 5
david_percentage = david_successes / david_attempts
eric_percentage = eric_successes / eric_attempts
total_attempts = david_attempts + eric_attempts
total_successes = david_successes... |
A store is offering a 20% discount on all items. If an item originally costs $50, how much will it cost with the discount? | def solve() -> int:
discounted_price = 50 * 0.8
result = discounted_price
return result
|
- Possible additional questions and programs: Alice wants to save up for a vacation. She has $2,000 in her bank account and earns $15/hour as a cashier. She works 25 hours per week, five weeks per month. She spends $800 on rent, $200 on groceries, and $100 on other expenses every month. The vacation costs $5,000 and sh... | def solve() -> int:
income = 15 * 25 * 5
expenses = 800 + 200 + 100
savings = income - expenses
total_savings = 2000 + savings * 6
money_to_save = 5000 - total_savings
result = money_to_save / 6
return result
|
A machine can pour 12 ounces of juice in 2 seconds. How long will it take to pour 144 ounces of juice? | def solve() -> int:
pour_rate = 6
juice_amount = 144
time_to_pour = juice_amount / pour_rate
result = time_to_pour
return result
|
A 6-foot tall person is standing near a lamppost. If the person's shadow is 8 feet long and the shadow of the lamppost is 12 feet long, what is the height of the lamppost? | def solve() -> int:
person_height = 6
person_shadow = 8
lamppost_shadow = 12
lamppost_height = (person_shadow/lamppost_shadow)*person_height
result = lamppost_height
return result
|
Student: 2. Xavier has 120 apples. He wants to divide the apples equally into 5 baskets, with a remainder of 4 apples. How many apples should be in each of his 5 baskets? | def solve() -> int:
apples = 120
baskets = 5
remainder = 4
apples_per_basket = (apples - remainder) // baskets
result = apples_per_basket
return result
|
A zoo has 50 animals. 30% of the animals are primates. Of the animals that are not primates, one-fourth are reptiles. How many more animals are not primates than reptiles? | def solve() -> int:
animals = 50
primates = animals * 0.3
not_primates = animals - primates
reptiles = not_primates * 0.25
more_not_primates_than_reptiles = not_primates - reptiles
result = more_not_primates_than_reptiles
return result
|
A sum of money triples in 8 years at a certain rate of simple interest. What is the interest rate? | def solve() -> int:
years = 8
interest_rate = 200 / years
result = interest_rate
return result
|
Student: Imani has a box containing 12 different shapes. She takes out 2 circles, 3 triangles and a square. What fraction of the shapes remaining in the box are triangles? | def solve() -> int:
total = 12
circles = 2
triangles = 3
square = 1
remaining = total - circles - triangles - square
fraction = (triangles - 3) / remaining
result = fraction
return result
|
10. Gwen runs 5 km/hour and runs for 1.5 hours every day. If she missed 2 days within a week, how many km did she run that week? | def solve() -> int:
speed = 5
time = 1.5
day1 = time
day2 = time
day3 = time
day4 = 0
day5 = 0
distance = speed * (day1 + day2 + day3 + day4 + day5)
result = distance
return result
|
Student: If 9 books cost $35, how much would 18 books cost? | def solve() -> int:
num_books_1 = 9
cost_1 = 35
num_books_2 = 18
cost_per_book = cost_1 / num_books_1
total_cost_2 = cost_per_book * num_books_2
result = total_cost_2
return result
|
Dave has a jar of marbles with 360 marbles in it. If he took away one third of the marbles, how many marbles did he take away? | def solve() -> int:
n = 360
d = 0
d = 120
result = d
return result
|
Emma wants to save for a trip to Europe. She plans to spend two months' worth of her salary on the trip. She earns $70,000 per year and can save $2000 per month. How many months will it take for her to save enough for the trip? | def solve() -> int:
salary_per_year = 70000
savings_per_month = 2000
total_savings_needed = 2 * salary_per_year / 12
months_needed = total_savings_needed / savings_per_month
result = months_needed
return result
|
If a recipe calls for 2/3 cups of sugar to make 12 cookies, how much sugar will be needed to make 24 cookies? | def solve() -> int:
sugar_per_cookie = 2 / 3
total_sugar = sugar_per_cookie * 24
result = total_sugar
return result
|
A store sells dresses. The original cost of each dress is $50. The store currently has a 20% sale on all dresses, with an additional 10% discount for members. If John is a member, how much will he pay for a dress? | def solve() -> int:
original_price = 50
discount_1 = 0.2
discount_2 = 0.1
sale_price = original_price - (original_price * discount_1)
member_price = sale_price - (sale_price * discount_2)
result = member_price
return result
|
Student: Rebecca has 350 metal pipes which need to be shipped in boxes. Each box can hold 5 pipes and the shipping costs for each box is $2.30. How much will she pay for the shipment? | def solve() -> int:
num_pipes = 350
num_pipes_per_box = 5
shipping_cost_per_box = 2.30
num_boxes = num_pipes // num_pipes_per_box
total_shipping_cost = num_boxes * shipping_cost_per_box
result = total_shipping_cost
return result
|
The non-profit organization, GreenEarth, donates 5% of its annual budget to environmental preservation. If they donate $1,000 to preservation this year, and 15% of their budget on technology upgrades, how much is left in their budget? | def solve() -> int:
donation = 1000
preservation_percentage = 0.05
technology_percentage = 0.15
preservation_amount = donation / preservation_percentage
budget = preservation_amount / (1 - preservation_percentage)
technology_amount = budget * technology_percentage
remaining_budget ... |
There are 5 shirts in a store. Each shirt costs $15. How much does it cost to buy all of the shirts in total? | def solve() -> int:
num_shirts = 5
cost_each = 15
total = num_shirts * cost_each
result = total
return result
|
If lapis lazuli has twice as many precious stones as malachite and turquoise has 4 fewer precious stones than lapis lazuli, how many precious stones do they have together if malachite has 30 precious stones? | def solve() -> int:
number_malachite = 30
number_lapis_lazuli = number_malachite * 2
number_turquoise = number_lapis_lazuli - 4
result = number_malachite + number_lapis_lazuli + number_turquoise
return result
|
A gym has 300 members and 20 new members join every month. How many members will they have after a year? | def solve() -> int:
members = 300
new_members_per_month = 20
months_in_a_year = 12
total_members = members + (new_members_per_month * months_in_a_year)
result = total_members
return result
|
-(Make sure to name the variables and use clear comments with ** # ** in the programs) -Each question+program must be different from the original and use different numbers Possible questions and programs: 60 students are taking a test. 15% of them score more than 90 points. Half of the remaining students score between ... | def solve() -> int:
n = 60
more_than_90 = 0.15 * n
between_80_90 = 0.5 * (n - more_than_90)
less_than_60 = 0.25 * (n - more_than_90 - between_80_90)
result = less_than_60
return result
|
Three friends decided to go to the movies. The cost of the tickets was $12, and they spent $20 on snacks. If they want to split the cost evenly, how much does each person owe? | def solve() -> int:
total_cost = 12 + 20
each_person_owes = total_cost / 3
result = each_person_owes
return result
|
John travelled 450 miles at a speed of 90 miles per hour. Calculate how long it would take him to travel 210 miles at the same speed. | def solve() -> int:
distance = 450
speed = 90
time = distance / speed
new_distance = 210
new_time = new_distance / speed * time
result = new_time
return result
|
If Tom can paint a room in 6 hours and Jane can paint the same room in 8 hours, how long will it take them to paint the room together? | def solve() -> int:
toms_rate = 1/6
janes_rate = 1/8
joint_rate = toms_rate + janes_rate
time = 1/joint_rate
result = time
return result
|
Student: John planted some trees in the garden. In the first 4 days, he planted 50 trees each day. For the next 5 days, his 2 friends helped him plant trees. They planted 30% fewer trees than John. How many total trees were planted? | def solve() -> int:
john_trees = 50 * 4
friend_trees = 0.7 * (50 * 5)
total_trees = john_trees + friend_trees
result = total_trees
return result
|
John has 82 bottles of juice. If each person has 6 bottles, how many people can consume John's juice? | def solve() -> int:
bottles = 82
bottles_per_person = 6
people = bottles / bottles_per_person
result = people
return result
|
A rectangular box measures 4 cm by 6 cm by 8 cm. What is the volume of the box in cubic centimeters? | def solve() -> int:
length = 4
width = 6
height = 8
volume = length * width * height
result = volume
return result
|
Rachel is offering lawn mowing services to neighbors. She charges $30 per hour and can mow up to 3 lawns per hour. If she mows 2 lawns for 2 hours each and another lawn for 1 hour, how much money did she make? | def solve() -> int:
lawns_per_hour = 3
hourly_rate = 30
lawns_mowed_2_hours = 2 * lawns_per_hour
lawns_mowed_1_hour = 1 * lawns_per_hour
total_lawns_mowed = lawns_mowed_2_hours + lawns_mowed_1_hour
total_money_made = total_lawns_mowed * hourly_rate
result = total_money_ma... |
Student: Rita earned $4500 from a freelance project. She decided to allocate this amount as follows: 1/5 for rent, 1/10 for groceries, 1/15 for utilities, 1/9 for entertainment and 1/12 for savings. How much money did she spend on entertainment and savings combined? | def solve() -> int:
rent = 4500 * (1/5)
groceries = 4500 * (1/10)
utilities = 4500 * (1/15)
entertainment = 4500 * (1/9)
savings = 4500 * (1/12)
result = entertainment + savings
return result
|
Peter can cycle twice as fast as Alice. If Peter cycles for 3 hours and covers a total of 120 km, while Alice cycles at the same time for 2 hours, how far does Alice cycle? | def solve() -> int:
peter_speed = 120 / 3
alice_speed = peter_speed / 2
alice_distance = alice_speed * 2
result = alice_distance
return result
|
A box of chocolates costs $5 more than a bouquet of flowers. The bouquet of flowers is 30% more expensive than a $20 card. How much is the box of chocolates? | def solve() -> int:
flowers_price = 20 * (1 + 0.3)
chocolates_price = flowers_price + 5
result = chocolates_price
return result
|
Student: Mary has 15 jars of honey. She wants to divide them into groups of 3. How many groups of 3 will Mary have after division? | def solve() -> int:
jars = 15
group_size = 3
groups = jars // group_size
result = groups
return result
|
A bakery sells 50 loaves of bread each day. If the number of loaves sold increases by 30% every week, how many weeks will it take before the bakery sells over 5,000 loaves of bread in one day? At the pizza place, a large pizza costs $12, garlic bread costs $4, and a soda costs $2.50. If you order a special pizza meal, ... | def solve() -> int:
loaves_per_day = 50
n = 0
total_loaves = 0
while total_loaves <= 5000:
increase = loaves_per_day * 0.3
total_loaves = loaves_per_day + (n * increase)
n += 1
result = n
pizza_cost = 12
garlic_bread_cost = 4
soda_cost = 2... |
A bakery sold 24 donuts in one hour. If the bakery is open for 8 hours, how many donuts did they sell in total? | def solve() -> int:
donuts_per_hour = 24
hours_open = 8
total_donuts = donuts_per_hour * hours_open
result = total_donuts
return result
|
Toby is adding wood chips to his vegetable garden. He needs to cover 12 yards of the garden and a bag of wood chips covers two yards. How many bags does he need to buy? | def solve() -> int:
yards_to_cover = 12
yards_per_bag = 2
num_of_bags = yards_to_cover/yards_per_bag
num_of_bags = int(round(num_of_bags))
result = num_of_bags
return result
|
Student: Jill has 5 yellow pencils, 4 black pencils, and 2 white pencils. What fraction of all her pencils are white? | def solve() -> int:
yellow_pencils = 5
black_pencils = 4
white_pencils = 2
total_pencils = yellow_pencils + black_pencils + white_pencils
white_pencils_fraction = white_pencils / total_pencils
result = white_pencils_fraction
return result
|
A carton of eggs costs $3. The cost of a loaf of bread is 40% of the cost of the eggs and a jar of jam costs 30% of the cost of the bread. A family bought 2 cartons of eggs, 3 loaves of bread, and 2 jars of jam. How much did they spend? | def solve() -> int:
eggs = 3
bread = 0.4 * eggs
jam = 0.3 * bread
total = 2 * eggs + 3 * bread + 2 * jam
result = total
return result
|
Charlie loves playing board games with his friends. He likes playing against his friend Ben, as he has played him 9 times and Ben has only won once. He doesn't like playing against his friend Emma, as he has played against her twice as many times as he has played against Ben, and Emma has won 70% of the games. How many... | def solve() -> int:
ben_wins = 1
ben_played = 9
emma_played = ben_played * 2
emma_wins = emma_played * 0.7
total_wins = ben_wins + emma_wins
charlie_wins = total_wins / 2
result = charlie_wins
return result
|
A car is going to take a road trip at a speed of 40 mph. The first 100 miles need to be driven within 3 hours, and the next 400 miles must be driven within 8 hours. How long did the entire trip take? | def solve() -> int:
speed = 40
distance_1 = 100
distance_2 = 400
time_1 = 3
time_2 = 8
total_time_1 = distance_1 / speed
total_time_2 = distance_2 / speed
result = time_1 + time_2 + total_time_1 + total_time_2
return result
|
A baseball team has won 60% of its games so far this season and has played a total of 75 games. How many games has the team won? | def solve() -> int:
wins = 45
result = wins
return result
|
A company's net profit last year was $250,000. If the company's expenses were $120,000, what was the company's gross revenue? | def solve() -> int:
net_profit = 250000
expenses = 120000
gross_revenue = net_profit + expenses
result = gross_revenue
return result
|
There are 5 rows of chairs in a hall and each row has 20 chairs. If 3 chairs are removed from each row, how many chairs are left in the hall? | def solve() -> int:
total_chairs = 5 * 20
removed_chairs = 5 * 3
left_chairs = total_chairs - removed_chairs
result = left_chairs
return result
|
Student: Kevin wants to make a playlist of his favorite songs. He has a total of 36 songs, but he only wants to include 12 songs in his playlist. He decides to randomly pick one song every day from the remaining songs and add it to his playlist. How many days will it take him to fill his playlist? | def solve() -> int:
total_songs = 36
playlist_size = 12
remaining_songs = total_songs - playlist_size
days = remaining_songs
result = days
return result
|
Andy walks to work each day in 30 minutes. If he has to walk twice as far, how long will it take him? | def solve() -> int:
time_for_one_trip = 30
distance_factor = 2
total_time = time_for_one_trip * distance_factor
result = total_time
return result
|
A store is giving a 20% discount on all items. A shirt originally costs $35. How much will the shirt cost after the discount? | def solve() -> int:
original_price = 35
discount_percent = 0.2
discount_amount = original_price * discount_percent
new_price = original_price - discount_amount
result = new_price
return result
|
-As much as possible, use different units and concepts in each question to avoid repetition. One of the possible answers: -Each table in Kelly's cafe can seat 6 people. She has 12 tables in total. If she needs to reserve 2 tables for a large group, how many people can she accommodate in the remaining tables? | def solve() -> int:
tables = 12
seats = 6
reserved = 2
available = tables - reserved
people = available * seats
result = people
return result
|
Leo is a diver who wants to explore a shipwreck. He knows that the shipwreck is 100 feet below the surface of the water, and that he can dive at a constant rate of 20 feet per minute. He also knows that he has to ascend slowly to avoid decompression sickness, and that he can only ascend at a rate of 10 feet per minute.... | def solve() -> int:
down_time = 100 / 20
up_time = 100 / 10
time = down_time + 15 + up_time
result = time
return result
|
A car traveled 60 miles in 1 hour. If the speed remains the same, how long will it take to travel 180 miles? | def solve() -> int:
distance = 60
time = 1
new_distance = 180
new_time = new_distance / (distance / time)
result = new_time
return result
|
Maya has a current grade of 78 in her English class. What is the average grade she must get in her next two papers in order to attain an 85 average? | def solve() -> int:
current_grade = 78
target_average = 85
grades_needed = (target_average * 3) - (current_grade * 2)
average_needed = grades_needed / 2
result = average_needed
return result
|
A swimming pool has a maximum capacity of 500 people, with children and adults only. If the number of children at the pool is one-third the number of adults, how many children are at the pool? | def solve() -> int:
max_capacity = 500
x = max_capacity / 4
y = x / 3
total_people = x + y
result = y
return result
|
Ella had 24 cookies in a jar. She baked 16 more cookies in October and 12 more cookies in November. She ate 4 cookies a day for 5 days and shared 8 cookies with her friend. How many cookies does Ella have left in the jar? | def solve() -> int:
baked = 16 + 12
jar = 24 + baked
eaten = 4 * 5
shared = 8
result = jar - eaten - shared
return result
|
Amy and her mom Amanda made a fruit salad. They used 8 bananas, 12 apples, and 16 oranges. They paid $0.5 for each banana, $0.8 for each apple, and $1 for each orange. How much did they spend on the fruit salad? | def solve() -> int:
bananas_cost = 8 * 0.5
apples_cost = 12 * 0.8
oranges_cost = 16 * 1
total_cost = bananas_cost + apples_cost + oranges_cost
result = total_cost
return result
|
A group of 80 people are planning a trip. They want to split into groups for activities with an equal number of people in each group. If they can divide into groups of 6, 8 or 10 people, how many people should be in each group to ensure that everyone is in a group without any unlucky stragglers? | def solve() -> int:
people_needed=80
pack1=6
pack2=8
pack3=10
min_pack=people_needed//pack1+1
for i in range(min_pack,1,-1):
for j in range(1,(people_needed//i)+1):
if (pack1*i+pack2*j)<=people_needed:
if (people_needed-(pack1*i+pack2*j))%pack3==0:
... |
Heather and Lina had a total of $500. If Lina had twice as much money as Heather, how much money did Heather have? | def solve() -> int:
total_money = 500
heather_money = 0
while total_money > 0:
lina_money = heather_money * 2
total_money = heather_money + lina_money
heather_money += 1
result = heather_money - 1
return result
|
Kevin sells lemonade for $0.5 per cup. He spends $8 on lemons and sugar and makes 40 cups of lemonade. How much profit does he make? | def solve() -> int:
price = 0.5
cups = 40
cost = 8
revenue = price * cups
profit = revenue - cost
result = profit
return result
|
A restaurant has a total of 60 dishes, but 15 of them were subpar. After removing those, the restaurant sold 20 dishes to customer A, a certain amount of dishes to customer B, and 5 dishes to customer C. How many dishes were sold to customer B? | def solve() -> int:
total_dishes = 60
subpar_dishes = 15
remaining_dishes = total_dishes - subpar_dishes
dishes_sold_to_A = 20
dishes_sold_to_C = 5
dishes_sold_to_B = remaining_dishes - dishes_sold_to_A - dishes_sold_to_C
result = dishes_sold_to_B
return result
|
Olivia wants to make a rectangular garden with an area of 40 square meters. If the length of the garden is 4 meters longer than the width, what are the dimensions of the garden? | def solve() -> int:
area = 40
width = ((area*2)/3)**0.5
length = width + 4
result = [width, length]
return result
|
In a class of 30 students, 10 students scored an A (90-100), 15 students scored a B (80-89), and 5 students scored a C (70-79). What percent of the class scored an A? | def solve() -> int:
total_students = 30
num_a_students = 10
percent_a_students = (num_a_students / total_students) * 100
result = percent_a_students
return result
|
Ben has 24 stickers and he wants to share them equally with his three friends. How many stickers will each friend get if Ben keeps 6 stickers for himself? | def solve() -> int:
total = 24
friends = 3
keep = 6
give = total - keep
each = give / friends
result = each
return result
|
A gardener plants 5 rows of carrots, 7 rows of potatoes, and 4 rows of onions. Each row of carrots has 12 plants, each row of potatoes has 15 plants, and each row of onions has 10 plants. Each plant produces a different number of vegetables: 3 carrots, 4 potatoes, or 2 onions. How many vegetables does the gardener harv... | def solve() -> int:
carrot_plants = 5 * 12
potato_plants = 7 * 15
onion_plants = 4 * 10
carrots = carrot_plants * 3
potatoes = potato_plants * 4
onions = onion_plants * 2
result = carrots + potatoes + onions
return result
|
Out of 100 students in a class, 90% of the class has participated in a marathon. How many students have participated in the marathon? | def solve() -> int:
total_num_students = 100
percent_participants = 0.9
num_participants = total_num_students*percent_participants
result = num_participants
return result
|
A coffee shop sold 30 cups of coffee for $3 each and 20 cups of tea for $2.50 each. If their expenses were $60, what was their profit? | def solve() -> int:
cups_of_coffee = 30
price_of_coffee = 3
cups_of_tea = 20
price_of_tea = 2.50
expenses = 60
revenue = cups_of_coffee * price_of_coffee + cups_of_tea * price_of_tea
profit = revenue - expenses
result = profit
return result
|
A carpenter cuts eight wooden planks into equal pieces every hour. He started with five piles of planks, each containing twelve planks. How many pieces of wood did he have after working for four hours? | def solve() -> int:
planks_per_pile = 12
piles = 5
cuts_per_hour = 8
hours = 4
total_planks = planks_per_pile * piles
pieces_per_plank = cuts_per_hour * hours + 1
total_pieces = total_planks * pieces_per_plank
result = total_pieces
return result
|
Rachel had a large jewelry box in her closet. Every day she would add a piece of jewelry to her box. After 3 years, the box was opened and it contained 75 pieces of jewelry. If she added 3 more pieces of jewelry than what she added in the previous year, how many pieces of jewelry did she add in the first year? | def solve() -> int:
years = 3
total_jewelry = 75
x = (total_jewelry - ((years * (years + 1)) / 2)) / years
last_year = x + 3
result = x
return result
|
Kim had 28 cookies. She baked 16 more cookies for a party. She ate 3 cookies, and gave 12 cookies to her friends. Her brother took 8 cookies without asking. How many cookies does Kim have left? | def solve() -> int:
cookies = 28
baked = 16
ate = 3
gave = 12
took = 8
cookies += baked
cookies -= ate
cookies -= gave
cookies -= took
result = cookies
return result
|
Student: A movie theater sells tickets for $12 for adults and $8 for children. If a group of 4 adults and 3 children go to the movies, how much does the group spend in total? | def solve() -> int:
adults = 4
children = 3
adult_ticket_price = 12
child_ticket_price = 8
total_cost = adults * adult_ticket_price + children * child_ticket_price
result = total_cost
return result
|
Possible questions and programs: A school bought 20 boxes of pencils, each containing 50 pencils. The school sold 3/5 of the pencils to the students at a price of $0.1 per pencil. How much profit did the school make from the pencil sale? | def solve() -> int:
cost = 20 * 50 * 0.05
revenue = 20 * 50 * 3/5 * 0.1
profit = revenue - cost
result = 10.0
return result
|
A plane flies from London to Paris, which is 495 miles away. The plane flies at a speed of 165 mph. How long will the flight take? | def solve() -> int:
distance = 495
speed = 165
result = distance / speed
return result
|
A car travels at an average speed of 45 miles per hour. If the total distance traveled is 135 miles, how long did the car take to reach the destination? | def solve() -> int:
speed = 45
distance = 135
time = distance / speed
result = time
return result
|
Maria is making bracelets with beads. She has 4 bags of beads that contain 100 beads each. She uses 15 beads for each bracelet. How many bracelets can she make and how many beads will she have left over? | def solve() -> int:
total_beads = 4 * 100
bracelets = total_beads // 15
beads_left = total_beads % 15
result = (bracelets, beads_left)
return result
|
If a worker is paid $20 per hour, and in a week he worked for 37 hours, how much is his total pay? | def solve() -> int:
pay_per_hour = 20
hours_worked_in_a_week = 37
total_pay = pay_per_hour * hours_worked_in_a_week
result = f'Total pay is ${total_pay}.'
result = total_pay
return result
|
Student: Bill bought a package of 24 erasers that need to be divided into 3 equal lots. How many erasers will he put in each lot? | def solve() -> int:
num_erasers = 24
num_lots = 3
num_erasers_per_lot = num_erasers // num_lots
remainder = num_erasers % num_lots
num_erasers_per_lot_final = num_erasers_per_lot + remainder
result = num_erasers_per_lot_final
return result
|
Jack wants to buy a game that costs $50. He has $10 and plans to save $3 every week. How many weeks does he need to save for the remaining amount? | def solve() -> int:
weeks = 0
saved = 10
remaining = 50 - saved
while remaining > 0:
remaining -= 3
weeks += 1
result = weeks
return result
|
Math Jake sells 24 cupcakes every day for the first 150 days of the year. For the rest of the days of the year, he sells 30 cupcakes every day. How many cupcakes does he sell in total for the year? | def solve() -> int:
cupcakes_per_day_1 = 24
cupcakes_per_day_2 = 30
days_1 = 150
days_2 = 365 - days_1
total_cupcakes = cupcakes_per_day_1 * days_1 + cupcakes_per_day_2 * days_2
result = total_cupcakes
return result
|
Henry has 50 books. He give 10 books to his friend. He wants to divide the rest equally among his 5 siblings. How many books will each sibling get? | def solve() -> int:
total_books = 50
given_books = 10
books_remaining = total_books - given_books
num_siblings = 5
books_each_sibling = books_remaining // num_siblings
result = books_each_sibling
return result
|
Student: A store has a 10% off sale on all items. If a person buys $200 worth of items, what is the total price with the discount? | def solve() -> int:
original_price = 200
discount_percentage = 0.1
discounted_price = original_price * (1 - discount_percentage)
total_price = original_price - discounted_price
result = total_price
return result
|
If the price after a 20% discount is $100, what was the original price? | def solve() -> int:
discount_rate = 20
discounted_price = 100
original_price = discounted_price/(1 - discount_rate/100)
result = original_price
return result
|
Sophia wore her ballet shoes to class. She danced for 1 hour straight in her shoes. Then she danced for 15 minutes less than 1 hour straight in her shoes. Afterward, she danced for five minutes less than 45 minutes straight in her shoes. For how long, in minutes, did Sophia dance in her shoes? | def solve() -> int:
hour = 60
minute = 1
first_dance = hour * minute
second_dance = (hour - 15) * minute
third_dance = (45 - 5) * minute
total_dance = first_dance + second_dance + third_dance
result = total_dance
return result
|
Mr. Miller has 100 cows, 1/5 of which are bulls. How many cows are females? | def solve() -> int:
number_bulls = 100/5
number_cows = 100
result = number_cows - number_bulls
return result
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.