16 lines
274 B
Python
16 lines
274 B
Python
import io
|
|
import sys
|
|
|
|
sys.stdin = io.StringIO('''5 2 3
|
|
3 1 6 2 5''') # 4
|
|
|
|
n, l, r = map(int, input().split())
|
|
a = list(map(int, input().split()))
|
|
s = 0
|
|
for i in range(n - 1):
|
|
for j in range(i + 1, n):
|
|
if l <= abs(a[i] - a[j]) <= r:
|
|
s += 1
|
|
|
|
print(s)
|