HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Linear Data Structures: Arrays > problem:


50543 - Hotel rooms

Guest
• Discussion of problem (1)

Section problems

• 50611 - Maximum of the minima
• 50616 - Snake
• 50647 - Spiral
• 51182 - Count and Sum 2
• 51193 - The max element of k-th co...
• 51194 - The difference between max...
• 51196 - The sum of two arrays
• 51197 - Even and odd Numbers
• 50543 - Hotel rooms
• 50468 - Draw Matrix - 2

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