HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


SAME OR DIFFERENT

Section problems

• Wonder primes
• Round numbers
• Sum less than N
• Perfect numbers
• Sum of N numbers
• How many digits?
• find the numbers
• Fibonacci Series
• SAME OR DIFFERENT
• Binary to decimal
• Decimal to binary
• How many divisors?
• Find the biggest 2
• Find the biggest 3
• Tower of Happiness
• Going to the Movies
• A to the power of B

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.

Title

Description:

 

Chessboard is the type of board used in the game of chess, and consists of 64 squares (eight rows and eight columns) arranged in two alternating colors (black and white). The columns are labeled by the letters a to h from left to right, and the rows by the number 1 to 8 from down to up.

 

Your task is to determine whether the two coordinates are same color or not.

 

Input:

 

The first line on the input contains a number T(1<T<100). A next each T line contains two coordinates of chessboard.

 

Output:

 

Your output should contain T lines. In each line write “SAME” if the correspondent coordinates are same, otherwise write “DIFFERENT”.

 

Sample input:

 

3

d2 g7

a1 c2

f3 c6

 

 

Sample output:

 

SAME

DIFFERENT

SAME

 

 

Äëÿ îòïðàâêè ðåøåíèé íåîáõîäèìî âûïîëíèòü âõîä.

www.contester.ru