Pair Sum
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Time Limit: 1.0 s
Memory Limit: 256.0 MB
Description
You are given a positive integer N. You need to find out all possible pair \((i , j)\) such that,
\(0 < i < j < N\) and \(i + j = N.\)
Input
First Line T, the number of test case.
In each test case, a positive integer N.
\(1 <= T <= 10^5\)
\(1 < = N <= 10^9\)
Output
In each test case, Print the total number of pair.
Sample
Input | Output |
---|---|
|
|
First test case: N = 3,
only pair (i,j) = (1,2) = 1 + 2 = 3, satisfy the condition. So answer is 1.
Second test case : N = 5,
all possible pair (1,4) , (2,3). So answer is 2.
Bangladesh 2.0
- Status
- Done
- Rule
- ACM/ICPC
- Problem
- 8
- Start at
- 2024-08-16 15:30
- End at
- 2024-08-16 17:45
- Duration
- 2.2 hour(s)
- Host
- Partic.
- 133