func_code_string: #include <bits/stdc++.h>   using namespace std;   string arr[9];   int moves1[4] = {2, 2, -2, -2}, moves2[4] = {2, -2, 2, -2};   int grid[2][9][9];   bool visited[9][9];   int incrementer;   void canMeet(int row, int col, int nw) {     for (int i = 0; i < 4; ++i) {       if (row + moves1[i] >= 0 && row + moves1[i] < 8 && col + moves2[i] >= 0 &&           col + moves2[i] < 8 && !visited[row + moves1[i]][col + moves2[i]]) {         grid[incrementer][row + moves1[i]][col + moves2[i]] = nw + 1;         visited[row + moves1[i]][col + moves2[i]] = true;         canMeet(row + moves1[i], col + moves2[i], nw + 1);       }     }   }   int main() {     int t;     cin >> t;     while (t--) {       memset(grid, 0, sizeof(grid));       for (int i = 0; i < 8; ++i) {         cin >> arr[i];       }       int x, y, x1, y1;       bool done = false;       for (int i = 0; i < 8; ++i) {         for (int j = 0; j < 8; ++j) {           if (arr[i][j] ==  K  && !done) {             x = i;             y = j;             done = true;           } else if (arr[i][j] ==  K  && done) {             x1 = i;             y1 = j;           }         }       }       incrementer = 1;       memset(visited, false, sizeof(visited));       visited[x][y] = true;       canMeet(x, y, 0);       incrementer = 1;       memset(visited, false, sizeof(visited));       visited[x1][y1] = true;       canMeet(x1, y1, 0);       grid[1][x1][y1] = 2;       grid[0][x][y] = 2;       done = false;       for (int i = 0; i < 8; ++i) {         for (int j = 0; j < 8; ++j) {           if ((arr[i][j] ==  .  || arr[i][j] ==  K ) && grid[0][i][j] != 0 &&               grid[1][i][j] != 0 && grid[0][i][j] % 2 == grid[1][i][j] % 2)             done = true;         }       }       if (done)         cout <<  YES  << endl;       else         cout <<  NO  << endl;     }     return 0;   }   