Edward Cake Problem-Combinatorial Geometry

This is a classic situation where we have to find the maximum number of  straight cuts possible on a cake which is termed as combinatorial geometry.

def max_pieces(n):
  MOD=1000000007
return(N*(N+1)//2+1)%MOD
N=int(input())
print(max_pieces(N))

OUTPUT:

print(max_pieces(7))

29

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top