class Solution {
public:
    #define SCD static_cast<double>
    vector<int> v;
    void Insert(int num)
    {
        v.push_back(num);
    }

    double GetMedian()
    { 
        sort(v.begin(), v.end());
        int sz = v.size();
        if (sz % 2 == 1) {
            return SCD(v[sz / 2]);
        }
        else {
            return SCD(v[sz / 2] + v[(sz - 1) / 2]) / 2;
        }
    }

};