Design a data structure that supports a stream of numbers and, after each new number xt arrives, returns the average of the most recent k values:
MAt=k1∑i=t−k+1txi.
How do you make each update O(1) instead of O(k)?