Problem 43108. How many complete pizzas
x is a vector with numbers of pizza slices. A corresponding vector n indicates in how many slices the pizza slices of x were cut. How many complete pizzas do we have?
Example:
x = [1 3 12]; n = [2 6 8];
in the first column we have on slice (x=1) from a pizza cut in half (n=2) -> half a pizza. in the second column we have 3 slices (x=3) from a pizza cut in 6 slices (n=6) -> so half a pizza. in the third column we have 12 slices of a pizzas cut in 8 slices ->1.5 slices.
This combines to 2.5 pizzas, so we have 2 complete pizzas!
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers45
Suggested Problems
-
Flip the main diagonal of a matrix
859 Solvers
-
07 - Common functions and indexing 6
458 Solvers
-
Generate vector according to sign of vector
130 Solvers
-
calculate the tangent of angle in radians
145 Solvers
-
Find the sides of an isosceles triangle when given its area and height from its base to apex
2036 Solvers
More from this Author25
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!