[Solution] Odd Pairs solution codechef

Table of Contents

Odd Pairs solution codechef

Odd Pairs solution codechef – Given an integer N, determine the number of pairs (A, B) such that:

  • 1 \leq A, B \leq N;
  • A + B is odd.

Input Format

  • The first line of input will contain a single integer T, denoting the number of test cases.
  • Each test case consists of a single integer N.

Odd Pairs solution codechef

For each test case, output the number of required pairs.

Constraints

  • 1 \leq T \leq 100
  • 1 \leq N \leq 10^9

Sample 1:

Input

Output

5
1
2
3
100
199
0
2
4
5000
19800

Odd Pairs solution codechef Explanation

Test case 1: There are no pairs satisfying the given conditions.

Test case 2: The pairs satisfying both conditions are: (1, 2) and (2, 1).

Test case 3: The pairs satisfying both conditions

For Solution

“Click Here”

Leave a Comment