题目描述
Given an integer N, the task is to find the number of ways we can choose 3 numbers from {1, 2, 3, …, N} such that their sum is even.
Note: Answer can be very large, output answer modulo 10^{9}+7
Example 1:
Input: N = 3
Output: 1
Explanation: Select {1, 2, 3}
Example 2:
Input: N = 4
Output: 2
Explanation: Either select {1, 2, 3} or
{1, 3, 4}
Your Task:
You don't need to read input or print anything. Complete the function countWays() which takes N as input parameter and returns the integer value.
Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)
Constraints:
1 ≤ N ≤ 10^{5}
输入格式
见题面
输出格式
见题面
样例输入
N = 3
样例输出
1