You are the proud owner of a newly opened pizzeria, "Pepperoni Paradise", known for its mouth-watering square pizzas loaded with delicious toppings. However, as orders flood in, it's becoming increasingly challenging to keep track of the quantity of pepperonis on each pizza. To streamline your operations, you decide to develop a program that counts the total number of pepperonis on a given pizza.
Each square pizza at Pepperoni Paradise is represented as an $$$N \times N$$$ grid of upper and lower case alphabet characters. Some of these characters are uppercase or lowercase 'P', denoting big and small pepperonis respectively.
Given the character grid representing a pizza, determine the total quantity of pepperonis on the pizza.
The first line contains a single integer $$$N$$$ $$$(1 \leq N \leq 100)$$$, indicating the size of the pizza grid.
The next $$$N$$$ lines contain $$$N$$$ characters each, representing the pizza grid. Each character will be an uppercase or lowercase letter from '$$$A$$$' to '$$$Z$$$', or '$$$a$$$' to '$$$z$$$'.
Output a single integer, representing the total quantity of pepperonis on the pizza.
3SPWXjSSaO
1
4APZaqPbpcCaAXyPZ
4
You are hosting a pizza party and have ordered $$$n\ (1 \leq n \leq 10^5)$$$ pizzas, each with 8 slices. There are $$$m\ (1 \leq m \leq 100)$$$ friends attending your party, and you want to distribute the pizza slices in a fair manner so that everyone receives the same number of slices. However, you do not want people to go home hungry: you want everyone to eat at least $$$k\ (1 \leq k \leq 10)$$$ slices.
Determine if it is possible to distribute the slices such that each friend receives the same number of slices and also does not go home hungry. Return true if this is possible, and false otherwise.
The first line of input will contain a single integer $$$n$$$, the total number of pizzas. The second line of input will contain a single integer $$$m$$$, the total number of attendees at the party. The last line of input will contain a single integer $$$k$$$, the number of slices that you want everyone to eat.
Determine if it is possible to distribute the slices such that each friend receives the same number of slices and also does not go home hungry. Print "TRUE" if it is possible to distribute the slices such that each friend receives the same number of slices and also does not go home hungry. Print "FALSE" otherwise.
143
FALSE
142
TRUE
Math Club and UTPC have decided to host a collab event in which there will be pizza and tacos! Historically the ratio has been 1 pizza = 2 tacos, but due to the excellent budgeting of the Math Club financier they are now equally valued at 1:1.
As a result, people are allowed to take up to 2 items each (with items being either a pizza slice or a taco), and an extra item of their choice if they take exactly 2 sauces. Shelly is in line and has already decided her order: one taco and one slice of pizza. She counts $$$n$$$ people in front of her, and would like to know if the pizza or taco supply will possibly run out before she gets there. Given that there are $$$X$$$ slices of pizza and $$$Y$$$ tacos and $$$Z$$$ sauces, please help Shelly figure out if there is a possibility of running out of either item before her turn.
The first line contains one nonnegative integer $$$n\ (0 \leq n \leq 10^5)$$$, the number of people before Shelly. The second line contains three positive integers $$$X$$$, $$$Y$$$, and $$$Z\ (0 \lt X,Y,Z \leq 10^5)$$$, the number of pizza slices, tacos, and sauces respectively.
Please print "yes" if there is a possibility of running out of pizza or taco and "no" if there is not (no quotes in the actual answer and case insensitive).
2160 70 108
yes
1960 70 108
no
For the first case, if all 21 people choose to order pizza, there will be 18 slices left over. However, if each of the 21 people additionally take 2 sauces (which is possible since there are 108 sauces) and order pizza, there will be 0 slices of pizza left over by the time that Shelly arrives to make her order.
Mr. Reynolds is hosting a pizza party for his algorithms class after the whole class managed to score above 50 percent. There are $$$N$$$ $$$(1 \leq N \leq 10^5)$$$ students in his class, and each of them wants a certain number of slices of pizza. Unfortunately, Mr. Reynolds has a limited budget and has already purchased $$$K$$$ $$$(1 \leq K \leq 10^5)$$$ pizzas, but he has not cut them up into slices yet.
The process of receiving pizza is as follows: the students will line up in a single file line, and each student will demand $$$d_i$$$ slices of pizza ($$$1 \leq i \leq N, 1 \leq d_i \leq 10^6$$$) in that order. Then, if the current pizza has at least $$$d_i$$$ slices of pizza left, Mr. Reynolds will give the student that amount. Otherwise, Mr. Reynolds will eat the remainder of the pizza himself and open up a fresh new pizza for the student.
Mr. Reynolds is clairvoyant and happens to know the values of $$$d_i$$$, and the order in which the students will line up. Please help Mr. Reynolds figure out the minimum number of slices each pizza needs to have so that all children get their desired amount of pizza. Note that all pizzas must have the same number of slices, and it is okay if pizza is left over.
The first line of the input contains two space-separated integers, $$$N$$$ and $$$K$$$.
The second line of the input contains $$$N$$$ space-separated integers, denoting $$$d_i$$$ $$$(1 \leq i \leq N)$$$.
Please output the minimum number of slices each pizza needs to have so that all children get their desired amount of pizza.
5 32 10 3 6 7
12
You are given $$$N\ (1\leq N\leq 10^5)$$$ pizzas. The $$$i$$$-th pizza consists of $$$s_i\ (2\leq s_i\leq 10^3)$$$ slices, each with side strength $$$q_i\ (1\leq q_i\leq 10^3)$$$ and crust strength $$$c_i (1\leq c_i \leq 10^3)$$$. For example, the below pizza consists of $$$4$$$ slices. Let $$$d_i$$$ be the minimum sum of strengths of slices and crusts that can hold the $$$i$$$-th pizza together, meaning that all the vertices in the picture would be in the same connected component as the other vertices, given that you draw crusts and slices to connect them. For example, the below pizza has $$$s_i = 4, q_i=2, c_i=3$$$. If we were to "connect" the crust and the slice edges this way, it is possible to connect all the vertices together with a total cost of $$$10$$$, although getting a lower $$$d_i$$$ may be possible. The center also counts as a vertex.

Being the pizza addict you are, you want to eat each pizza before it becomes soggy, otherwise, you will feel like you wasted $$$v_i\ (1\leq v_i\leq 10^9)$$$ dollars. However, you can only eat one pizza at a time. What is the minimum total possible amount of money you can feel like you wasted, given that you can eat the pizzas in any order? You start at time $$$t=0$$$, and the pizzas expire at deadline $$$d_i$$$, meaning that the $$$i$$$-th pizza cannot be eaten at $$$t\geq d_i$$$.
The first line contains $$$N$$$, the number of pizzas. Then, there will be $$$N$$$ lines that follow. The $$$i$$$-th line will contain 4 integers, $$$s_i, q_i, c_i, v_i$$$.
The minimum possible amount of money that you can feel like you wasted an integer on its own line.
42 1 1 42 2 3 42 3 2 23 2 1 10
0
A customer has come in with an odd request at your pizza shop. They are ordering $$$n$$$ ($$$1 \leq n \leq 1000$$$) pizzas, with each pizza having a unique radius from 1 to $$$n$$$. Additionally, they want you to stack these pizzas on top of each other (like a stack of pancakes) in a very specific way. Given a pair of pizzas $$$a$$$ and $$$b$$$ in the stack, if pizza $$$a$$$ is below pizza $$$b$$$ in the stack and pizza $$$a$$$ has a larger radius than pizza $$$b$$$, we call this a "proper" pair. The customer requests a stack of pizzas with exactly ($$$0\leq k\leq 1000$$$) proper pairs of pizzas, and you want to find out exactly how many different ways you can stack your $$$n$$$ pizzas in order to have exactly $$$k$$$ proper pairs in your stack. Note that this number can be very large, so please mod it by $$$10^9 + 7$$$.
The first and only line of input consists of two integers, $$$n$$$ ($$$1 \leq n \leq 1000$$$) and $$$k$$$ ($$$0\leq k\leq 1000$$$).
Print out the number of ways to create a stack of $$$n$$$ pizzas with exactly $$$k$$$ proper pairs, mod $$$10^9 + 7$$$.
3 0
1
3 1
2
You are making an infinite pepperoni pizza, which fills the entire $$$x$$$-$$$y$$$ coordinate plane. You think it might be too much to eat at once, so you decide to cut the plane in half by cutting along some line. You don't want too many pieces of pepperoni on one side, so you want the line to cut through at least $$$1/8$$$th of the pepperoni slices. You are guaranteed that at least one such line exists. Can you find it? If there are multiple lines, find any.
For this problem, assume that the pepperoni slices have radius 0, i.e. they are single points on the grid.
The first line of the input contains a single integer $$$n$$$ ($$$8 \leq n \leq 10^5$$$) – the number of slices of pepperoni.
The next $$$n$$$ lines contain the coordinates of each slice of pepperoni. The $$$i$$$th line contains two integers $$$x_i, y_i$$$ ($$$1 \leq x_i, y_i \leq 10^6$$$) – the $$$x$$$ and $$$y$$$ coordinates of the $$$i$$$th slice of pepperoni, respectively.
You are guaranteed that each pair of coordinates is distinct, i.e. $$$(x_i, y_i) \neq (x_j, y_j)$$$ if $$$i \neq j$$$. You are also guaranteed there exists a valid solution.
Print three space-separated real numbers $$$A, B, C$$$, which represent the line in standard form $$$Ax + By = C$$$. Please ensure $$$-10^{12} \leq A, B, C \leq 10^{12}$$$.
Let $$$D_i$$$ be $$$Ax_i + By_i$$$. A point is considered "valid" if the absolute or relative error of $$$D_i$$$ from $$$C$$$ is at most $$$10^{-6}$$$, i.e. $$$\frac{|D_i - C|}{\max(1, |C|)} \leq 10^{-6}$$$. Your answer will be considered correct if at least $$$\lfloor n / 8 \rfloor$$$ of the points are valid.
81 12 23 33 29 85 53 84 1
-7.000000000000000 -1.000000000000000 -29.000000000000000
For this sample, any line that goes through a single slice works since we only need $$$\left\lfloor \frac{8}{8} \right\rfloor = 1$$$ slices. For larger $$$n$$$, this is not the case!
You are a time traveler tasked with the duty of introducing pizza to the ancient Greeks. Along your journey, you meet the mathematician Euclid. After studying the pizza you have brought, Euclid gives you a problem. He tells you to envision the pizza as a 2D plane centered at the origin. The toppings are represented as $$$N$$$ points scattered on the plane. Additionally, the "crust" of the pizza is represented by $$$M$$$ points scattered on the plane. He defines "a slice of pizza" as a valid triangle comprised of 2 crust points and the origin. Euclid asks you to count the number of topping points that are enclosed within some valid slice of pizza (including toppings on the boundary).
The first line of input contains 2 space-separated integers $$$N, M\ (0 \leq N \leq 5 \cdot 10^4, 4 \leq M \leq 5 \cdot 10^4) - $$$ the number of topping and crust points, respectively.
Note: It is guaranteed that there is at least 1 crust point in each of the 4 quadrants.
The next $$$N$$$ lines of input contain 2 space-separated integers $$$x, y\ (-10^9 \leq x, y \leq 10^9) - $$$ the $$$x$$$ and $$$y$$$ coordinates of the $$$i^{th}$$$ topping point.
The next $$$M$$$ lines of input contain 2 space-separated integers $$$x, y\ (-10^9 \leq x, y \leq 10^9) - $$$ the $$$x$$$ and $$$y$$$ coordinates of the $$$i^{th}$$$ crust point.
Note: It is guaranteed that no two points, topping or crust, have the same $$$x$$$ or $$$y$$$ values.
Please output 1 integer, the total number of topping points that are enclosed within some slice of pizza.
5 62 2-8 0-3 14 -30 48 -23 3-2 6-1 51 -1-4 -4
3
2 53 -21000000000 10000000000 01 1-2 2-3 -34 -4
0
The first sample case is drawn below (toppings represented by orange points and crusts represented by black points). Two example pizza slices are also drawn. Three out of the five toppings can be enclosed by a slice. Observe that no other topping can be enclosed by a slice.