Java
Consider employees of a factory want to sleep between their job shifts and just to done their job on time
There is a very old clock that ringing sound wake up only one closest to it. also clock just ringing every hour
Therefore, the staff members agreed that:
i.The nearest person wakes up with a ringing tone
ii.when a person wake up and found this time isnt his shift , he should wake up nearest person then he can get up.
We want each The employee will be busy for a certain period of time and then sleep again.