Buggy python submission (verdict: Time Limit Exceeded):
def kitaichi(x):
    return x * (x+1) / (2 * x)

def main():
    n, k = map(int, input().split())
    inlis = tuple(map(int, input().split()))

    tmp = 0
    for i in range(n - k + 1):
        if tmp < sum(inlis[i:i+k]):
            tmp = sum(inlis[i:i+k])
            tmplis = inlis[i:i+k]
    ans = sum(map(kitaichi, tmplis))
    print(ans)



    
if __name__ == "__main__":
    main()


Fixed submission:
def kitaichi(x):
    return x * (x+1) / (2 * x)

def main():
    n, k = map(int, input().split())
    inlis = tuple(map(int, input().split()))
    kitalis = list(map(kitaichi, inlis))
    kitadic = {}
    kitadic[0] = kitalis[0] 
    for i in range(1, n):
        kitadic[i] = kitadic[i-1] + kitalis[i]
       
    tmp = 0
    if n == k:
        print(kitadic[n-1])
    else:
        for i in range(n - k):
            atai = kitadic[i+k] - kitadic[i]
            if tmp < atai:
                tmp = atai
        print(tmp)
        exit()



    
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def kitaichi(x):
    return x * (x+1) / (2 * x)

def main():
    n, k = map(int, input().split())
    inlis = list(map(int, input().split()))

    tmp = 0
    for i in range(len(inlis)-k+1):
        if tmp < sum(inlis[i:i+k]):
            tmp = sum(inlis[i:i+k])
            tmplis = inlis[i:i+k]
    ans = sum(map(kitaichi, tmplis))
    print(ans)



    
if __name__ == "__main__":
    main()


Fixed submission:
def kitaichi(x):
    return x * (x+1) / (2 * x)

def main():
    n, k = map(int, input().split())
    inlis = tuple(map(int, input().split()))
    kitalis = list(map(kitaichi, inlis))
    kitadic = {}
    kitadic[0] = kitalis[0] 
    for i in range(1, n):
        kitadic[i] = kitadic[i-1] + kitalis[i]
       
    tmp = 0
    if n == k:
        print(kitadic[n-1])
    else:
        for i in range(n - k):
            atai = kitadic[i+k] - kitadic[i]
            if tmp < atai:
                tmp = atai
        print(tmp)
        exit()



    
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def kitaichi(x):
    return x * (x+1) / (2 * x)

def main():
    n, k = map(int, input().split())
    inlis = list(map(int, input().split()))
    kitalis = list(map(kitaichi, inlis))
    #print(kitalis)
    ans = 0
    for i in range(len(kitalis)-k+1):
        if ans < sum(kitalis[i:i+k]):
            ans = sum(kitalis[i:i+k])
            #print(kitalis[i:i+k])
    print(ans)



    
if __name__ == "__main__":
    main()


Fixed submission:
def kitaichi(x):
    return x * (x+1) / (2 * x)

def main():
    n, k = map(int, input().split())
    inlis = tuple(map(int, input().split()))
    kitalis = list(map(kitaichi, inlis))
    kitadic = {}
    kitadic[0] = kitalis[0] 
    for i in range(1, n):
        kitadic[i] = kitadic[i-1] + kitalis[i]
       
    tmp = 0
    if n == k:
        print(kitadic[n-1])
    else:
        for i in range(n - k):
            atai = kitadic[i+k] - kitadic[i]
            if tmp < atai:
                tmp = atai
        print(tmp)
        exit()



    
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def kitaichi(x):
    return x * (x+1) / (2 * x)

def main():
    n, k = map(int, input().split())
    inlis = list(map(int, input().split()))
    kitalis = list(map(kitaichi, inlis))
    ans = 0
    for i in range(len(kitalis)-k+1):
        if ans < sum(kitalis[i:i+k]):
            ans = sum(kitalis[i:i+k])
            
    print(ans)



    
if __name__ == "__main__":
    main()


Fixed submission:
def kitaichi(x):
    return x * (x+1) / (2 * x)

def main():
    n, k = map(int, input().split())
    inlis = tuple(map(int, input().split()))
    kitalis = list(map(kitaichi, inlis))
    kitadic = {}
    kitadic[0] = kitalis[0] 
    for i in range(1, n):
        kitadic[i] = kitadic[i-1] + kitalis[i]
       
    tmp = 0
    if n == k:
        print(kitadic[n-1])
    else:
        for i in range(n - k):
            atai = kitadic[i+k] - kitadic[i]
            if tmp < atai:
                tmp = atai
        print(tmp)
        exit()



    
if __name__ == "__main__":
    main()