Help needed , last test case giving TLE
\nclass MKAverage {\npublic:\n    int m,k;\n    int temp;\n    multiset<int,greater<int>> s;\n    vector<int> v;\n    \n    MKAverage(int m, int k) {\n        t
```\nclass MKAverage {\npublic:\n    int m,k;\n    int temp;\n    multiset<int,greater<int>> s;\n    vector<int> v;\n    \n    MKAverage(int m, int k) {\n        this->m = m;\n        this->k = k;\n        v.clear();\n        temp = 0;\n    }\n    \n    void addElement(int num) {\n        v.push_back(num);\n        if(s.size()<m){\n            s.insert(num);\n        }else{\n            s.erase(s.lower_bound(v[temp]));\n            temp++;\n            s.insert(num);\n        }\n    }\n    \n    int calculateMKAverage() {\n        if(s.size()<m) return -1;\n        vector<int> arr;\n        for(auto it:s){\n            arr.push_back(it);\n        }\n        long long ress=0;\n        long long count = 0;\n        int i=k;\n        for(int j=k;j<arr.size();j++){\n            i++;\n            if(i>k && i<=(m-k)){\n                ress+=arr[j];\n                count++;\n            }\n            if(i>(m-k)) break;\n        }\n        int res = ress/count ;\n        return res;\n    }\n};\n\n/**\n * Your MKAverage object will be instantiated and called as such:\n * MKAverage* obj = new MKAverage(m, k);\n * obj->addElement(num);\n * int param_2 = obj->calculateMKAverage();\n */\n```
[]