It’s been sixteen years since the last nuclear attack against the Russian Empire, and the area that once was part of a huge megapolis now resembles something closer to a scene out of a horror flick, and not the grandiose city with millions of inhabitants it once was. However, even in times like these, the city is not completely abandoned. Inhabited by some desperate survivors – shady characters, thieves, stalkers, assassins, and dangerous gangs. They are all concerned with one thing – survival at any cost, when even meagre resources have to be fought for.
It’s been a while since you became part of the gang calling themselves the Red Dawn. You try to not commit heinous crimes and this has helped your leaders to stay in dialogue with the local Imperial Guard, who come to descum the area from time to time. The Imperial Guards visit strictly every second Thursday. It’s Wednesday now and with just 24 hours remaining before their next visit you are pressured for time to gather resources to appease the squad and stay alive at least another 2 weeks. The target of your run is a half-ruined building, once headquarters of a large corporation.
It didn’t take you long to find the entrance and start scouring for something to salvage. All of a sudden, your flashlight catches something resembling a dusted up safe, but its too early to cheer. Unlike the destruction all around, the safe itself is in perfect condition, TNT and picks would prove useless here, we’ll have to resort to a more technologically advanced stratagem.
At the very centre of the door there is a disk with barely noticeable numbers engraved on it. Most of the numbers were already indiscernible, but they likely ranged from 0 to 99 sequenced clockwise around the edge of the disk.
While you were scratching your noggin over the safe-door, one of your teammates pulled out from the dusty rubble something that looked like a console with 2 buttons labeled “left” and “right” and some archaic ports for connecting to it. The next 15 minutes you spent trying to fix the only remaining and more or less functioning cable that you could find and connecting the console to the safe. By pressing “right” the disk rotates R amount clockwise, by pressing “left” the disk rotates L amount anticlockwise. Each move is followed by a click and takes 1 second to complete. Initially these sorts of locks have to be set to 0. The lock opens when the dial hits K – the safe key.
Before you start unlocking, you need to ask yourself this: can it be stated with certainty that 1 minute is enough to guarantee an opened lock whatever the value of K, given that R=23 and L=16?
While your team is deciding this you have the opportunity to work out a program which calculates the minimum required time to open the safe with the given R and L values. K may be specified or left undefined. Perhaps this will help you get to the contents of the safe faster and make it back to your base in time for Imperial Guards.
The Lord of the Wastelands and keeper of the holy guzzolene, the one and only Immortan Joe has bestowed upon you a mission – to deliver the next shipment of guzzolene, to a quicksilver refinery in exchange for some ammunition, weapons and cheeseburgers. You are to be escorted by Joe’s trusted gang of halflife warriors. They wish to organize their own teams for escorting the precious fuel. It was decided that in order for a halflife warrior to sign up for a team, he must have at least one friend in that team. Therefore, we assume that if the first member of a team knows the second one, then conversely, the second fellow knows the first. Each team is assigned to a separate assault truck, hence, for economic reasons we have to keep the number of teams to a minimum.
The only thing left to do is load up the trucks and write up a list of troops for each of vehicle. Design a program that would help us solve the latter.
The first row contains 2 numbers: N — represents the number of halflife warriors, M — is for the number of rows representing the relationship between the warriors 0≤N, M≤1000. The following M-rows contain pairs of natural numbers 1≤a, b≤N, representing that warrior ‘a’ is friends with warrior ‘b’.
Input dataThe first row is T – representing the number of assault trucks. The following rows are a breakdown of each truck: [number of passengers]; dogtag numbers listed in their ascending order. Start a new row for each truck required. Each halflife warrior must be assigned to one and only one assault truck. If several correct answers are possible give either one.
The inhabitants of planet Plook in the Kin-dza-dza constellation fall into two categories: the Chatlan and Patzac. The local Patzac population have a secret greeting called “Coo”, which only a true Patzac can pass. This greeting between two Patzacs looks something like this:
Mr.A thinks of a natural number x – the variable, not larger than N-1 and communicates the value of F(x) to Mr.B, Mr.B in turn answers with a number F(x+1);
Mr.B thinks of a natural number y – the variable, not larger than N-1 and communicates the value of F(y) to Mr.A, Mr.A in turn answers with a number F(y+1).
The value of F is equal to the remainder of dividing the variable cubed by N. Prove that you are a true Patzac and find x and y, given that one of the greetings had the following number sequence emerge: 5713, 5783, 7821 and 7870. The value of N has been chosen so that the value of the variable is defined specifically by the function F.
In the not-so-distant future a society depending only on fuel economics have fallen victim to a total collapse of the civil code. The civilization came to an end. People have stopped valuing heroes. The only people making up the society now are psychopaths, road patrols and ordinary civilians. Mad Max’s mad brother Max is an officer of the main patrol unit. Following a loss of his entire family and all his friends during the apocalypse, he vowed to protect civilians and save as many lives as possible.
On one of his patrol shifts he encounters 5 people: 2 psychopaths, 2 civilians and 1 patrol officer. He knows that psychos always lie, and that officers and civilians do not have it in them to tell a fib. The 2 psychos know who they are. The officer is likely to tell between a psycho and a civilian. Civilians know only about themselves and trust nobody. Mad Max’s mad brother Max listens to all testimonies in turn:
A: I know who B is.
B: I know who the officer is.
C: I know who B is.
D: I know who E is.
Help Max identify who is who.
The north of the capital city Fosantier has long been the zone of alienation and a gulag for criminals and Ruthpangas – week, feeble semi-intelligent bipods who have regressed into the endless labyrinth of the sewers and in the damp and romantic darkness have managed to mutate into having a somewhat advantageous trait. Their bodies excrete an oily slime which helps them to slick through tight spaces, time and time again saving them during the regular clean-up operations that the authorities initiate in the district. Although, this gang of bobble-head freaks reaps the benefits of this slime, for regular humans contact with this toxic secretion means a hell of a trip. A mind-altering, time-dilating, narcotic experience that is rather a psychotic challenge than an after-work chill-out with friends. A person exposed to this chemical experiences light nausea for the first hour, their perception of reality skews only slightly, biological clocks align with the real time. However, exactly one hour later, the effect takes on unfathomable heights – the mind burns through the fabric of reality like a hot coal placed on a thin sheet of plastic and falls down a bottomless pit, where up is down, black is white, minutes last hours and hours pass like minutes. Luckily, precisely an hour later the person comes to, and their senses normalize to light dizziness, and so it goes alternating for a full 24 hours, resulting in the victim going completely and irreversibly insane or worse…On one of the recent clean-ups a rookie unit – pte. Fourleaf – got into a chasing frenzy with a Ruthpanga. As Fourleaf came scraping his way through cracks and jams after the Ruthpanga, he inevitably came into contact with some of his slime. Instantly he started feeling sick, he checked his watch and panicked – here he was lost in a dark labyrinth at midnight, his prey Ruthanga was long out of sight, and he was about to experience a hallucinogen similar to an LSD overdose. Sure enough, an hour later, his consciousness sizzles through the ground he was sitting on and he began his descent into oblivion. Fearing the unknown, Fourleaf was rummaging through what was left of his cognition to figure out a way to beat this. His best idea was first to gain control of his biological clocks. To do this he was convinced he had to cut into his wrists with a knife every moment when his perception of time matched the actual time. Crazy began to set in, but we want to help the guy out. Given that for Fourleaf, time runs regularly one hour and the next hour the minutes slow down to hours and the hours speed up to minutes, help Fourleaf figure out the schedule for the next 24 hours of moments when he has to score his wrists (ignoring the first hour, of course, since this brilliant idea came afterwards).
Some of our troops have been bitten by zombies on the last supplies run. At the moment they are all in quarantine. The process of radiotherapy is due to begin this evening, once all the troops segregated into their own cells. The procedure room has an X-ray lamp which is initially switched to off. The troops are taken from their cells to the procedure room in turns one at a time. After the procedure, the troop leaving the room may leave the X-ray lamp switched either on or off.
If at any moment either of the troops says that all of the infected units have undergone the therapy, and turns out to be correct, then the therapy shall be deemed successful and all troops will be released. If on the other hand he turns out to be wrong, then part of the soldiers will die. Do not worry of anyone of them being left out, if all troops keep their mouths shut long enough, then all of them will visit the procedure room, and no visit is final.
Come up with a strategy for them to agree on now, while together in quarantine, to ensure health and life for all soldiers.