#CCBCHBA0000104. Đếm cặp tăng nghiêm (Count Strictly Increasing Pairs)
Đếm cặp tăng nghiêm (Count Strictly Increasing Pairs)
Count Strictly Increasing Pairs
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given a nonnegative integer , count integer pairs satisfying . The answer is zero when is 0 or 1.
Input
One line contains integer .
Output
Print one integer.
Subtasks
-
Subtask 1 (20%): .
-
Subtask 2 (30%): .
-
Subtask 3 (50%): .
Examples
Example 1
Input:
4
Output:
6
Explanation:
There are 4 candidates, so the number of i<j pairs is 4×(4-1)/2 = 6.
Example 2
Input:
0
Output:
0
Explanation:
There are 0 candidates, so the number of i<j pairs is 0×(0-1)/2 = 0.