How to solve pizza party ?

@meooow can u tell me how you solved the Pizza party question asked in ICO1803

You had to greedily choose to cut the pizzas in the order of most cuts allowed. You can see the editorials for more details.

just now i read it but was unable to understand how the formula was calculated " the maximum number of slices we get is (n*n + n + 2)/2 ".

Pizza cut here can be in any direction, not necessarily passing from center of pizza as in usual pizza cuts, but away from center too.

Imagine a circle. Try drawing N chords in this circle in a way to maximize number of parts of circle. After that, read editorial. Once you do this, You’ll get the idea of the problem.

1 Like

thanks @taran_1407, now i got it :slight_smile: .During the contest i was unable to figure out how its answer is 31 , but now i am comfortable with it :slight_smile:

Even i wasn’t able to figure out during contest :stuck_out_tongue: