Pisoar
We have a new model of a modern urinal equipped with an optical sensor and a "flush" function. We don't have software for it, so we have to write a program that will calculate all the moments when it is time for flushing. The rules are:
· sensors mark that urinal is being used if someone is standing in front of the urinal for K or more consecutive seconds,
· sensors mark that urinal use has completed when nobody is standing in front of the urinal for L consecutive seconds, starting from a point where the sensors marked that the urinal is being used (according to the first rule); in that moment, flushing is activated. Before and after given time interval, we consider that nobody is standing in front of the urinal.
1 1 3
101Output
2
4 3 1000 3
111Output
1003Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.