UVA Problem 11494 Solution – Queen

Problem Solving, UVa

 

 

#include <bits/stdc++.h>

using namespace std;

int main()

{

    int x1,x2,y1,y2;

    while(cin>>x1>>y1>>x2>>y2)

    {

        if(x1==0 && y1==0 && x2==0 && y2==0)

        break;

        if(x1==x2 and y1==y2) printf("0\n");

        else if( x1==x2 ||y1==y2|| abs(y1-y2)==abs(x1-x2)) printf("1\n");

        else if ( abs(y1-y2)!=abs(x1-x2)) printf("2\n");

    }

    return 0;

}

 

0 Comments

You may find interest following article

Complete Guide: Create Laravel Project in Docker Without Local Dependencies

Create Laravel Project Through Docker — No Need to Install PHP, MySQL, or Apache on Your Local Machine In this tutorial, I’ll show you how to create and run a full Laravel project using Docker containers. That means you won’t have to install PHP, MySQL, or Apache locally on your computer. By the end of this guide, you’ll have a fully functional Laravel development...