How to solve pizza party ?

help
ico1803
pizpar

#1

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


#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.


#3

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


#4

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 ".


#5

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:


#6

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