def solution(l, t):
    start = 0
    end = 0
    s = l[0]
    while True:
        if s < t:
            end += 1
            if end >= len(l):
                return [-1, -1]
            s += l[end]
        elif s > t:
            s -= l[start]
            start += 1
            if start >= len(l):
                return [-1, -1]
        elif s == t:
            return [start, end]
