HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Ad-Hoc > problem:


50371 - Modified Karnaugh-Map

Guest
• Review clarifications (1)

Section problems

• 50355 - Bills of City Water Company
• 50454 - What day is it?
• 50350 - Fahrenheit to Celsius
• 50356 - Hours Passed
• 50466 - Drawing Square From Stars
• 50351 - Convert inches to cm
• 50467 - Random Numbers
• 50474 - Sum of Two Primes
• 50371 - Modified Karnaugh-Map
• 50580 - Days passed
• 50591 - Leap year
• 50597 - Drawing Diamonds

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.
By Ardit Meti.

Modified Karnaugh-Map

Your professor wants you to find which value A,B,C or D changes in two different indexes. e.g. if he gives 11 and 10,

  • for 11: A=1; B=0; C=1; D=1;
  • for 10: A=1; B=0: C=1; D=0;
so you should print D.

Question:

  • You are given 2 numbers. You will give the result only if they are in same row or column, you can't pick 0 and 5 for example.
  • Also the numbers must be adjacent or border numbers, for ex. 4 and 6; 0 and 8. You can't have 0 and 12 or 0 and 3.
  • The indexes 0-15 are as shown in figure.

Question: Write a program that gets two numbers which are between 0 and 15. Then, your program finds which letter A,B,C or D is different or changes in those indexes.

Input specification
You will be two different numbers between 0 and 15.

Output specification
Show one letter (capital): which value (0 or 1) is different or changes in those indexes. If any of the two restrictions are violated print "ERROR"

 Sample Input I     Sample Input II   
 0 2
 5 15
 Sample Output I     Sample Output II   
 C

 ERROR


Для отправки решений необходимо выполнить вход.

www.contester.ru