"""
Exercise 1: Maximum Average Subarray I (LeetCode 643)

Return the maximum average of any contiguous subarray of length k.
Use a fixed-size sliding window (add the new element, drop the old one).

  find_max_average([1, 12, -5, -6, 50, 3], 4) -> 12.75
"""

def find_max_average(nums, k):
    # TODO
    pass


# --- self-check: do not modify below this line ---
cases = [(([1, 12, -5, -6, 50, 3], 4), 12.75), (([5], 1), 5.0), (([0, 4, 0, 3, 2], 1), 4.0), (([-1, -2, -3], 2), -1.5)]
ok = True
for args, want in cases:
    got = find_max_average(*args)
    print(args, "->", got)
    ok = ok and got is not None and abs(got - want) < 1e-9
print("PASS" if ok else "FAIL")
