Python SortedList and Deque
\nimport collections\nimport math\nimport statistics\nfrom typing import Deque\n\nimport sortedcontainers\n\n\nclass MKAverage:\n    def __init__(self, m: int, 
```\nimport collections\nimport math\nimport statistics\nfrom typing import Deque\n\nimport sortedcontainers\n\n\nclass MKAverage:\n    def __init__(self, m: int, k: int):\n        self.m: int = m\n        self.k: int = k\n        self.sl = sortedcontainers.SortedList()\n        self.dq: Deque[int] = collections.deque()\n\n    def addElement(self, num: int) -> None:\n        self.sl.add(num)\n        self.dq.append(num)\n        if len(self.dq) > self.m:\n            item: int = self.dq.popleft()\n            self.sl.remove(item)\n\n    def calculateMKAverage(self) -> int:\n        if len(self.dq) < self.m:\n            return -1\n        mean = statistics.mean(self.sl[self.k:-self.k])\n        return math.floor(mean)\n```
['Queue', 'Python3']