class BIT:

    def __init__(self,n):

        self.size=n

        self.tree=[0]*-~n

    def sum(self,i):

        s=0

        while i:

            s+=self.tree[i]

            i-=i&-i

        return s

    def add(self,i,x):

        while i<=self.size:

            self.tree[i]+=x

            i+=i&-i

n,k,*a=list(map(int,open(0).read().split()))

a=[t-k for t in a]

for i in range(1,n):

    a[i]+=a[i-1]

d={}

for i,v in enumerate(sorted(set(a+[0])),1):

    d[v]=i

for i in range(n):

    a[i]=d[a[i]]

b=BIT(max(a))

b.add(d[0],1)

c=0

for i,p in enumerate(a):

    c+=b.sum(p)

    b.add(p,1)

print(c)
class BIT:

    def __init__(self,n):

        self.size=n

        self.tree=[0]*-~n

    def sum(self,i):

        s=0

        while i:

            s+=self.tree[i]

            i-=i&-i

        return s

    def add(self,i,x):

        while i<=self.size:

            self.tree[i]+=x

            i+=i&-i

n,k,*a=list(map(int,open(0).read().split()))

a=[t-k for t in a]

for i in range(1,n):

    a[i]+=a[i-1]

d={}

for i,v in enumerate(sorted(set(a+[0])),1):

    d[v]=i

for i in range(n):

    a[i]=d[a[i]]

b=BIT(max(a))

b.add(d[0],1)

c=0

for p in a:

    c+=b.sum(p)

    b.add(p,1)

print(c)
class BIT:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * -~n

    def sum(self, i):
        s = 0
        while i:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i


n, k, *a = list(map(int, open(0).read().split()))
a = [t - k for t in a]
for i in range(1, n):
    a[i] += a[i - 1]
d = {}
for i, v in enumerate(sorted(set(a + [0])), 1):
    d[v] = i
for i in range(n):
    a[i] = d[a[i]]
b = BIT(max(a))
b.add(d[0], 1)
c = 0
for i, p in enumerate(a):
    c += b.sum(p)
    b.add(p, 1)
print(c)

class BIT:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * -~n

    def sum(self, i):
        s = 0
        while i:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i


n, k, *a = list(map(int, open(0).read().split()))
a = [t - k for t in a]
for i in range(1, n):
    a[i] += a[i - 1]
d = {}
for i, v in enumerate(sorted(set(a + [0])), 1):
    d[v] = i
for i in range(n):
    a[i] = d[a[i]]
b = BIT(max(a))
b.add(d[0], 1)
c = 0
for p in a:
    c += b.sum(p)
    b.add(p, 1)
print(c)

-for i, p in enumerate(a): +for p in a: