Skip to main content

Accenture

Accenture OA-26 2024

Problem Description

It is Edward's birthday today. His friends have bought him a huge circular cake.
Edward wants to find out the maximum number of pieces he can get by making exactly N straight vertical cuts on the cake.
Your task is to write a function that returns the maximum number of pieces that can be obtained by making N number of cuts.

Input Format:

  • The input consists of a single integer N representing the number of cuts.

Output Format:

Output the maximum number of pieces that can be obtained, modulo 1000000007.

Constraints:

  • 1 ≤ N ≤ 10^9

Example

Sample Input:

3

Sample Output:

6

Explanation:
With 3 cuts, we can divide the cake into 6 pieces