SanRubik 0 Newbie Poster

Our hardworking chef is bored of sleeping in his restaurants. He has decided to settle down. The first thing he must do is to find a suitable location to build a palatial home.

Think of the city as a two-dimensional grid. There are N restaurants in the city. Each of the chef's restaurant is a point denoted by (X , Y). A house can be located at a grid point (R, S) if the sum of the distances between this point and each of the restaurants is as small as possible. Find the number of possible house locations in the city to help out chef build a home.

More than one restaurant can be located at the same point.
Houses and restaurants can be located at the same point.
Every house must have integer co-ordinates. In other words, R and S are integers.
The distance between two points (A,B) and (C,D) is |A-C| + |B-D|. Here |X| is the absolute function.
Input

First line in the input contains T, number of test cases.
First line of each test case contains N, number of restaurants.
Each of the next N lines contain two integers X and Y separated by a space.

T <= 100
N <= 10^3
-10^8 <= X <=10^8
-10^8 <= Y <=10^8
Output

The number of possible locations (grid points) where houses can be built.
Example

Input:
3
5
0 0
-1 0

SanRubik 0 Newbie Poster
#include<iostream>
#include<string>
using namespace std; // the namespace for cout<< & such functions
int main()
{
    char strn[80];
    cout<<"Enter the string: ";
    cin.getline(strn,80);
    int len=strlen(strn);

    bool flag=true; // create a Boolean value, "flag" to be used in our loop

    for (int c=0; c!=len/2; c++) // do a loop from 0 to half the length of the string
    {
        if (flag) // if it is a palindrome so far
        {
            if (strn[c]!=strn[len-c-1]) // check the characters match
            {
                flag=false; // if they don't set the indicator to false
            }

        }
        else
        {
            break; // if it is not a palindrome, exit the for loop
        }
    }

// if flag is true cout "Palindrome" otherwise output "Not Palindrome"

    if (flag)
    {
        cout<<"Palindrome";
    }
    else
    {
        cout<<"Not Palindrome";
    }

    cin.get();
    return 0;
}

----------
This should do it.