<doocs>2090.K Radius Subarray Averages_1.py
def getAverages( nums: List[int], k: int) -> List[int]:
    n = len(nums)
    presum = [0] * (n + 1)
    for i in range(n):
        presum[i + 1] = presum[i] + nums[i]
    return [
        -1
        if i - k < 0 or i + k >= n
        else (presum[i + k + 1] - presum[i - k]) // (k * 2 + 1)
        for i in range(n)
    ]
def sample_funcname ( var_0 : List [ int ] , var_3 : int ) -> List [ int ] :
    var_5 = len ( var_0 )
    var_8 = [ 0 ] * ( var_5 + 1 )
    for var_10 in range ( var_5 ) :
        var_8 [ var_10 + 1 ] = var_8 [ var_10 ] + var_0 [ var_10 ]
    return [ - 1 if var_10 - var_3 < 0 or var_10 + var_3 >= var_5 else ( var_8 [ var_10 + var_3 + 1 ] - var_8 [ var_10 - var_3 ] ) // ( var_3 * 2 + 1 ) for var_10 in range ( var_5 ) ]
