Four To The Floor

Four To The Floor


In 2011, Ajax Systems was just an ambitious idea. Today, our security systems are being sold in 90 countries and protect more than 350 thousand people. Over the past 3 years, the company has become 30 times larger and has already sold more than two million devices. Each of them is designed, manufactured and tested in Kiev.

Ajax, as a system, is not just a set of sensors, but also beautiful and user-friendly applications that help users configure the system and manage their security. We are looking for a Python Developer to join the team that is currently working on Ajax PRO Desktop. Out tech stack consists of: Python 3, pyside2, QML, asyncio. Want to know more?

Why don't we talk about the PIR sensors (passive infrared sensors) systems?
Let's talk about them and then solve a thematic mission.

If there's a need for motion detection, we have various options at our disposal, all based on the general principle of tracking environmental change. Narrowing the concept of "motion detection" down to the concept of "human detection", it becomes obvious that one of the most convenient way to detect a human presence (entrance) is to keep tracking constantly a certain distinctive environmental characteristic that is attributable for a human as well as for any other possible object. And this kind of a characteristic really exists. Everything in the world emits thermal radiation . The radiation density depends on the temperature of the object and its surface area. And here I must add that infrared light is nothing but thermal radiation. Although this radiation is not visible to the human eye, it is quite intense. You can feel it if place your palm near (not onto!) a hot object, a cup of coffee for example.


Knowing mentioned above, it's quite easy to realize how PIR sensor systems operate, right? Imagine a locked room and a sensor "looking" down from the ceiling (or look at the schema below). Remember that everything emits thermal radiation, so our sensor will register a conventionally constant level of the background thermal emission, so called thermal imprint. In order a PIR sensor system won't be triggered by a pet, the maintainers of such a system increase its sensitivity threshold. That threshold isn't that high though, especially taking into account the human body that emits ~1kW of thermal radiation. So when a man enters a sensor's field of view, the sensor detects significantly increased level of thermal radiation and triggers either a security system which notifies the owner or a lighting system which turns on the lights.

PIR sensor

And now, finally, the mission's objective. Given a room's size and a list of PIR sensors mounted on the room's ceiling and looking down on the floor, your task is to determine whether the floor area is completely into the sensors coverage area (return True) or not (return False). The bottom left corner of the rectangle matches the origin point O , the top right corner is defined by W and H . Each sensor is defined by its mounting point (coordinates x i and y i ) and its range ( R i ).

Input: Two arguments:

  • the first is a list containing a room's top right corner coordinates,all are integers [W, H]
  • the second is a list containing sensors info, all are integers [[x i , y i , R i ], [x i+1 , y i+1 , R i+1 ], ....., [x n , y n , R n ]]

Output: True or False.


is_covered([200, 150], [[100, 75, 130]]) == True                                   #example #1
is_covered([200, 150], [[50, 75, 100], [150, 75, 100]]) == True                    #example #2
is_covered([200, 150], [[50, 75, 100], [150, 25, 50], [150, 125, 50]]) == False    #example #3

PIR sensor

All given values are integers.

  • if (int - 10e-6 < f < int + 10e-6) then (f == int)
  • H ∈ (0; 1000]
  • W ∈ [H; 4*H]
  • x i ∈ [0; W]
  • y i ∈ [0; H]
  • R i ∈ (0; 1600]
  • n ∈ [1; 10]

Invalid hot key. Each hot key should be unique and valid
Hot keys:
CheckiO Extensions

CheckiO Extensions allow you to use local files to solve missions. More info in a blog post.

In order to install CheckiO client you'll need installed Python (version at least 3.8)

Install CheckiO Client first:

pip3 install checkio_client

Configure your tool

checkio --domain=py config --key=

Sync solutions into your local folder

checkio sync

(in beta testing) Launch local server so your browser can use it and sync solution between local file end extension on the fly. (doesn't work for safari)

checkio serv -d

Alternatevly, you can install Chrome extension or FF addon

checkio install-plugin
checkio install-plugin --ff
checkio install-plugin --chromium

Read more here about other functionality that the checkio client provides. Feel free to submit an issue in case of any difficulties.

Pair Programming (Beta-version)

Welcome to Pair Programming! Engage in real-time collaboration on coding projects by starting a session and sharing the provided unique URL with friends or colleagues. This feature is perfect for joint project development, debugging, or learning new skills together. Simply click 'Start Session' to begin your collaborative coding journey!

Waiting for Pair Programming to start...

You are trying to join a pair programming session that has not started yet.

Please wait for the session creator to join.

Waiting for Pair Programming to reconnect...

It looks like the creator of the pair programming session closed the editor window.

It might happen accidentally, so that you can wait for reconnection.

<< <
> >>
exec show

Whats Next?

Free accounts will see Best CheckiO solutions with some delay.
Best Solutions will be opened in a moment
Become Awesome and Don't wait
The next stage is ""
Will be activated in
View More Solutions Random Review Solutions Go to the next mission