NOI Contest Archive

Archive / 2020 / June 2020

Special Pairs.

Medium · National Olympiad in Informatics Sri Lanka - June 2020

You are given an array A of N elements. You have to find number of Special Pairs such that i < j (0\(\leq\) i , j \(\leq\)N-1) and A[i] > 2*A[j].

Input Format

Output Format

A single integer denoting the number of Special Pairs.

Constraints

Sample Input 0

5 
1 3 2 3 1

Sample Output 0

2

Sample Input 1

5
2 4 3 5 1

Sample Output 1

3