luogu#P4755. Beautiful Pair
Beautiful Pair
Problem Description
Xiao D has a sequence . For a pair (), if the product of and is not greater than the maximum value among , then Xiao D considers this pair to be beautiful. Please find the number of beautiful pairs.
Input Format
The first line contains an integer , representing the number of elements.
The second line contains integers , representing the given sequence.
Output Format
Output one integer, the number of beautiful pairs.
4
1 3 9 3
5
5
1 1 2 1 1
14
Hint
[Sample Explanation #1]
The five valid pairs are .
[Sample Explanation #2]
Only the pair is invalid.
[Constraints]
For of the testdata, , and .
Translated by ChatGPT 5