C++ Naïve Solution
\nclass Solution {\npublic:\n    vector<vector<int>> queensAttacktheKing(vector<vector<int>>& queens, vector<int>& king) {\n        \n        vector<vector<int>
```\nclass Solution {\npublic:\n    vector<vector<int>> queensAttacktheKing(vector<vector<int>>& queens, vector<int>& king) {\n        \n        vector<vector<int>> ans;\n        \n        map<pair<int, int>, bool>M;\n        \n        for(auto q:queens)\n            M[{q[0], q[1]}] = true; \n        \n        int kr = king[0], kc = king[1];\n        \n        // top\n        for(int r=kr; r>=0; r--)\n        {\n            if(M.find({r , kc}) != M.end())\n            {\n                ans.push_back({r, kc});\n                break;\n            }\n        }\n        \n        // down\n        for(int r=kr; r<8; r++)\n        {\n            if(M.find({r , kc}) != M.end())\n            {\n                ans.push_back({r, kc});\n                break;\n            }\n        }\n        \n        // left\n        for(int c=kc; c>=0; c--)\n        {\n            if(M.find({kr , c}) != M.end())\n            {\n                ans.push_back({kr, c});\n                break;\n            }\n        }\n        \n        // right\n        for(int c=kc; c<8; c++)\n        {\n            if(M.find({kr , c}) != M.end())\n            {\n                ans.push_back({kr, c});\n                break;\n            }\n        }\n        \n        // top left\n        int c = kc;\n        for(int r=kr; r>=0 and c>=0; r--)\n        {\n            if(M.find({r , c}) != M.end())\n            {\n                ans.push_back({r, c});\n                break;\n            }\n            c--;\n        }\n        \n        // top right\n        for(int r=kr, c = kc; r>=0 and c<8; r--, c++)\n        {\n            if(M.find({r , c}) != M.end())\n            {\n                ans.push_back({r, c});\n                break;\n            }\n        }\n        \n        // bottom left\n        for(int r=kr, c=kc; r<8 and c>=0; r++, c--)\n        {\n            if(M.find({r , c}) != M.end())\n            {\n                ans.push_back({r, c});\n                break;\n            }\n        }\n        \n        // bottom right\n        for(int r=kr, c=kc; r<8 and c<8; r++, c++)\n        {\n            if(M.find({r , c}) != M.end())\n            {\n                ans.push_back({r, c});\n                break;\n            }\n        }\n        \n        return ans;\n    }\n};\n```
['C', 'C++']