We Are Discuss About CODECHEF SOLUTION
Odd Pairs CodeChef Solution
Odd Pairs CodeChef Solution
Problem
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.
Output Format
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
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 are: (1, 2), (2, 1), (2, 3), and (3, 2).
SOLUTION
Odd Pairs CodeChef Solution
Yhaa You have done it but next? if YOU Want to Get Others Please Visit Here JOIN NOW