The Lazy Caterer 's Problem | C # program to find the solution to The Lazy Caterer 's Problem ; This function returns the maximum number of pieces that can be made form pancake using n cuts ; Use the formula ; Driver code
using System ; class GFG { static int findPieces ( int n ) { return ( n * ( n + 1 ) ) / 2 + 1 ; } public static void Main ( ) { Console . WriteLine ( findPieces ( 1 ) ) ; Console . WriteLine ( findPieces ( 2 ) ) ; Console . WriteLine ( findPieces ( 3 ) ) ; Console . Write ( findPieces ( 50 ) ) ; } }