UVA 10849 - Move the bishop UVA • Sep 1, 2020 Problem PDFSolution:#include #include #include #include #include #include #include #include #include #include #include #include #define ll long long #define sc scanf #define pf printf #define Pi 2*acos(0.0) using namespace std; int main() { int t,no=0; sc("%d",&t); while(t--) { ll m,n; sc("%lld",&m); sc("%lld",&n); while(m--) { ll r1,c1,r2,c2; sc("%lld%lld%lld%lld",&r1,&c1,&r2,&c2); if ( r1<1||r1>n || r2<1||r2>n || c2<1||c2>n || c1<1||c1>n) pf("no move\n"); else if(r1==r2&&c1==c2) pf("0\n"); else if(abs(r1-r2)==abs(c1-c2)) pf("1\n"); else if((r1+r2)%2==(c1+c2)%2) pf("2\n"); else pf("no move\n"); } } return 0; } https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/10849/10849.cpp Tags UVA Competitive Programming Shipu Ahamed Recommended for you UVA UVA 913 - Joana and the Odd Numbers 4 years ago • 1 min read UVA UVA 871 - Counting Cells in a Blob 4 years ago • 3 min read UVA UVA 866 - Intersecting Line Segments 4 years ago • 3 min read