📜 ⬆️ ⬇️

How many rooms are in the hallway?

You are in a ring corridor consisting of N rooms. Each room has two doors - “forward” and “backward”. Having passed N rooms in any of the directions - you will visit all and return to the original.
In each room there is a light bulb and a switch from this light bulb, i.e. while in the room you can turn on / off the light bulb as you wish. Initially they are turned on randomly.
Beat light bulbs, break switches, draw with chalk on walls, etc. prohibited.
It is required to determine the number N.
UPD: the task is quite simple, in the comments there is already an answer.

')

Source: https://habr.com/ru/post/84058/


All Articles