def maxindex(a):
    n=len(a)
    if(n == 0):
        return None
    else:
        maxi = 0
        for i in range(0,n):
            l = 0
            r = 0
            for j in range(i-1, 0, -1):
                if(a[j] > a[i]):
                    l = j
                    break
            for j in range(i+1, n):
                if(a[j] > a[i]):
                    r = j
                    break
            product = l*r
            print(product)

a=[int(i) for i in input().split()]
maxindex(a)

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: