HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Albanian National Olympiads in Informatics > problem:


2013-5. 50543 - Hotel rooms

Guest
• Discussion of problem (1)

Volume problems

• 2012-1. 50544 - Stock market
• 2012-2. 50545 - Diet
• 2012-3. 50721 - Palindrome
• 2012-4. 50680 - Triangle
• 2012-5. 50551 - Camelot
• 2013-1. 50591 - Leap year
• 2013-3. 50570 - Prime numbers in t...
• 2013-4. 50958 - ATM
• 2013-5. 50543 - Hotel rooms
• 2013-6. 50562 - List of students
• 2014-2. 50738 - Median value
• 2015-2. 50489 - Football Championship

Feedback

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

Time limit 4000/7000/7000/7000 ms. Memory limit 65000/65000/65000/65000 Kb.
Olympiad 2013. Prepared by: Evis Hoxha. Difficulty Alpha

Question 5- Hotel rooms


In a vector containing 15 elements of values 1 or 0, is stored the availability of the hotel rooms (0- free, 1- reserved). The rooms numbered from 1-9 are in the side of the sea, while the rooms numbered 10-15 not. In all the cases show the right message.

Input
There will be given 15 numbers with value 1 or 0, that show the availability of the respective room. Then will be given a number N with value 0 or 1, where 1 means that the client wants a room in the side of the sea, and 0 means that he does not want that. At the end will be given a number A (1<=A<=15), which is the number of the room he wants to book.

Output
If the client wants a room in the seaside but choses a room numbered 10-15, (or vice versa) show “Irregular choice”. If the chosen room is reserved, show "Reserved". If the room is free, show Free.


Input I

1 0 1 1 0 0 0 1 0 1 1 0 1 1 0

1 8
Output I

Reserved


Input II

1 0 1 1 0 0 0 1 0 1 1 0 1 1 0

0 2
Output II

Irregular choice


Input III

1 0 1 1 0 0 0 1 0 1 1 0 1 1 0

1 2
Output III

Free


.

www.contester.ru