Codeforces Round #799 (Div. 4) 1692C. Where's the Bishop? Solution
///La ilaha illellahu muhammadur rasulullah
///******Bismillahir-Rahmanir-Rahim******///
///Abul Hasnat Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
///**********ALLAH IS ALMIGHTY************///
#include <bits/stdc++.h>
using namespace std;
int main()
{
int x,t,i,j,o,e,n,f;
cin>>t;
while(t--)
{
char ch[1000][1000];
for(i=1; i<=8; i++)
{
f=0;
for(j=1; j<=8; j++)
{
cin>>ch[i][j];
}
}
for(i=2; i<=7; i++)
{
f=0;
for(j=2; j<=7; j++)
{
if(ch[i][j]=='#'&&ch[i-1][j-1]=='#'&&ch[i+1][j+1]=='#')
{
if(ch[i+1][j-1]=='#'&&ch[i-1][j+1]=='#')
{
cout<<i<<" "<<j<<endl;
}
}
}
}
}
}
No comments