Odd Pairs solution codechef-

Odd Pairs solution codechef

Solution – CLICK HERE

Given an integer N, determine the number of pairs (A, B) such that:

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

Odd Pairs solution codechef

  • 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.

Odd Pairs solution codechef

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

Odd Pairs solution codechef

Input

Output

5
1
2
3
100
199
0
2
4
5000
19800

Odd Pairs solution codechef

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 are: (1, 2), (2, 1), (2, 3), and (3, 2).

Solution – CLICK HERE

Leave a Comment