HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


SAME OR DIFFERENT

Section problems

• Coins
• Primes
• Providers
• A to the power of B
• A Palace with Many Columns
• X to the power of Y
• A+B
• T-shirts
• SAME OR DIFFERENT
• GCF
• REVERSE ORDER OF WORDS
• Factorial
• Maximum
• Name-Surname
• Decimal to binary
• Heap
• Herons

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