HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Linear Data Structures: Arrays > problem:


50543 - Hotel rooms

Guest
• Discussion of problem (1)

Section problems

• 50344 - Profit or Loss
• 50445 - Cryptography
• 50410 - Zero Padding
• 50380 - Sum of the Numbers in the ...
• 50300 - Matrix
• 50611 - Maximum of the minima
• 50616 - Snake
• 50647 - Spiral
• 50543 - Hotel rooms
• 50271 - Factorial
• 50419 - The longest bitonic sequence
• 50326 - Matrix Operations
• 50329 - Draw Matrix-1
• 50541 - Binary to decimal
• 50592 - Matrix Multiplication
• 50606 - Long product
• 50607 - Long sum

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