Problem: Check if a king can move a valid move or not when N nights are there in a modified chessboard
Given an infinite chessboard with the same rules as that of chess. Also given are N knights coordinates on the infinite chessboard(-10^9 <= x, y <= 10^9) and the king's coordinate, the task is to check if the King is checkmate or not.

Sample Input: a[] = { {1, 0}, {0, 2}, {2, 5}, {4, 4}, {5, 0}, {6, 2} } king -> {3, 2}
Sample Output: Yes
The king cannot make any move as it has been check mate.

Solution (cpp):
// C++ program for checking if a king
// can move a valid move or not when
// N nights are there in a modified chessboard
#include <bits/stdc++.h>
using namespace std;
bool checkCheckMate(pair<int, int> a[], int n, int kx, int ky)
{

    // Pair of hash to mark the coordinates
    map<pair<int, int>, int> mpp;

    // iterate for Given N knights
    for (int i = 0; i < n; i++) {
        int x = a[i].first;
        int y = a[i].second;

        // mark all the "L" shaped coordinates
        // that can be reached by a Knight

        // initial position
        mpp[{ x, y }] = 1;

        // 1-st move
        mpp[{ x - 2, y + 1 }] = 1;

        // 2-nd move
        mpp[{ x - 2, y - 1 }] = 1;

        // 3-rd move
        mpp[{ x + 1, y + 2 }] = 1;

        // 4-th move
        mpp[{ x + 1, y - 2 }] = 1;

        // 5-th move
        mpp[{ x - 1, y + 2 }] = 1;

        // 6-th move
        mpp[{ x + 2, y + 1 }] = 1;

        // 7-th move
        mpp[{ x + 2, y - 1 }] = 1;

        // 8-th move
        mpp[{ x - 1, y - 2 }] = 1;
    }

    // iterate for all possible 8 coordinates
    for (int i = -1; i < 2; i++) {
        for (int j = -1; j < 2; j++) {
            int nx = kx + i;
            int ny = ky + j;
            if (i != 0 && j != 0) {

                // check a move can be made or not
                if (!mpp[{ nx, ny }]) {
                    return true;
                }
            }
        }
    }

    // any moves
    return false;
}

// Driver Code
int main()
{
    pair<int, int> a[] = { { 1, 0 }, { 0, 2 }, { 2, 5 }, 
                           { 4, 4 }, { 5, 0 }, { 6, 2 }};

    int n = sizeof(a) / sizeof(a[0]);

    int x = 3, y = 2;
    if (checkCheckMate(a, n, x, y))
        cout << "Not Checkmate!";
    else
        cout << "Yes its checkmate!";

    return 0;
}