id
stringlengths
11
14
content
stringlengths
424
1.17M
apps_data_3600
Basin City is known for her incredibly high crime rates. The police see no option but to tighten security. They want to install traffic drones at different intersections to observe who’s running on a red light. If a car runs a red light, the drone will chase and stop the car to give the driver an appropriate ticket. Th...
apps_data_3601
Misha needs to send packages to his friend Nadia. Both of them often travel across Russia, which is very large. So they decide to hire a messenger. Since the cost of the messenger service depends on the time it takes to deliver the package, they need your help to optimize a little bit. Assume Misha and Nadia move on a...
apps_data_3602
Consider a square grid with lamps in fixed locations. Each lamp can either illuminate its row or its column, but not both. The illumination of each lamp extends over a limited distance. Any square in the grid should only be illuminated by at most one lamp in its row and by at most one lamp in its column (one of each i...
apps_data_3603
It is time again for the annual International Convention for Phonetic Communication. Because there are attendees from all over the world, and they do not all speak the same languages, the organizers have hired translators to help out. To thank the translators at the end of the conference for their hard work, the organ...
apps_data_3604
A wireless sensor network consists of autonomous sensors scattered in an environment where they monitor conditions such as temperature, sound, and pressure. Samantha is a researcher working on the Amazon Carbon-dioxide Measurement (ACM) project. In this project, a wireless sensor network in the Amazon rainforest gath...
apps_data_3605
Andy is going holiday shopping and needs to buy several Christmas trees. At the store, there is a row of Christmas trees of various heights. Andy is only allowed to buy trees that are next to each other, i.e. trees that are contiguous within the row. He also wants to make sure that the shortest tree he buys and the tal...
apps_data_3606
Luka parked his truck near the lake. The lake is inhabited by the frog Barica, who jumps acrossplants floating on the lake’s surface. Knowing a fair number of folk tales, Luka knows that if he kisses Barica, she will turn into a beautiful princess. However, he needs to catch her first! Assuming an aerial view, the posi...
apps_data_3607
The BASIC computer programming language has been popular for many years, and there have been dozens of ‘dialects’ of the language. It’s considered a high-level language and is typically interpreted (rather than compiled). For this problem, write an interpreter for a restricted dialect of BASIC. Here is a description of...
apps_data_3608
From a pile of suggested tasks, authors of COCI must choose ones that will appear in the next round. Difficulty of a task is described with an integer in range $1$ to $N$. For some tasks, however, it is not easy to exactly determine their difficulty. The COCI authors decided that these tasks can be considered as havin...
apps_data_3609
Once, two trees forgot their place and started to grow into each other. One of the trees grew from the left, and the other from the right. On $n$ points, they collided. Numbering the points $1, 2, \dots , n$ from left to right, the left tree ended up connecting all of them in a single subtree rooted in node $1$, such ...
apps_data_3610
A friend of yours works at an undisclosed company in the music streaming industry, and needs your help. The company has offices in Stockholm and London, and collaboration between the two offices is extensive. The situation is that each of the many but small projects are handled by a two-person team with a member in eac...
apps_data_3611
Fatima commutes from KTH to home by subway every day. Today Robert decided to surprise Fatima by baking cookies and bringing them to an intermediate station. Fatima does not always take the same route home, because she loves to admire the artwork inside different stations in Stockholm. However, she always optimizes her...
apps_data_3612
One morning last summer, Charlotte was watching the moon and the sun and observed that the moon was full. As she lives along the Atlantic coast she knows that this means a larger variation in the tide compared to first and last quarter. With no rain in the air, it seemed like a perfect week for walks at the beach by th...
apps_data_3613
Every year the three friendly teachers at the kindergarten let their classes’ kids change classes to form three new ones. Some kids, of course, are old enough to leave, but those who stay for another year are rearranged among the three teachers. The teachers even let the kids have their say in the process. As friendsh...
apps_data_3614
A grasshopper is in a flower field. The field contains $N \cdot N$ flowers arranged in $N$ rows and $N$ columns. For each flower in the field, we know how many petals it has. The grasshopper is initially on the flower in row $R$ and column $C$. Its goal is to visit as many flowers as possible while obeying these rules...
apps_data_3615
A cellular provider has installed $n$ towers to support their network. Each tower provides coverage in a $1\text { km}$ radius, and no two towers are closer than $1\text { km}$ to each other. The coverage region of this network is therefore the set of all points that are no more than $1\text { km}$ away from at least o...
apps_data_3616
A test for allergy is conducted over the course of several days, and consists of exposing you to different substances (so called allergens). The goal is to decide exactly which of the allergens you are allergic to. Each allergen has a live duration $D$ measured in whole days, indicating exactly how many days you will s...
apps_data_3617
Note that this is a harder version of the problem pikemaneasy.Programming is an ancient art. Archeologists have made findings which indicate that already in the Middle Ages, infantry were practicing for programming contests while not in battle. Although it is not known how the programming contests were carried out (the...
apps_data_3618
Having passed the Hunter Exam, Gon is now officially a Hunter! Gon is now saying goodbye to his best friend, Killua, as Gon wants to visit his home in ‘While Island’. Gon and Killua plan to use the online chat application, Olaz, to keep in touch. However, they are not confident with Olaz’s security: some imposters may...
apps_data_3619
UpCoder is looking to assign their best employees to a team tasked with designing their new and improved website, and they’re looking to you to help them form the team. There are $n$ potential candidates. The CEO is employee number $0$, and the candidates are all assigned employee numbers ranging from $1$ through $n$. ...
apps_data_3620
You are given a simple graph with $N$ nodes and $M$ edges. The graph has the special property that any connected component of size $s$ contains no more than $s + 2$ edges. You are also given two integers $k$ and $P$. Find the number of $k$-colourings of the graph, modulo $P$. Recall that a simple graph is an undirecte...
apps_data_3621
You found a complete, undirected graph with $n$ nodes, labeled $1$ to $n$. Each edge has a color. For simplicity, each color is identified by a number between $1$ and $300$ inclusive. Interestingly, you noticed that for each and every simple cycle in this graph, there are at least two adjacent edges on this cycle which...
apps_data_3622
You have been hired by Addictive Coin Machines to help design the next hit in their line of eye-catching, coin-guzzling, just-one-more-try Pachinko machines for casinos around the world. Playing a Pachinko machine involves launching balls into a rectangular grid filled with pegs, obstacles, and targets. The ball bounc...
apps_data_3623
Bob’s green thumb has recently gotten him a job as a gardener at a local park. Along with caring for all the plants in the garden, he was also given the responsibility of completely redesigning the park with all new equipment and green spaces. Unfortunately for Bob, he’s not as good at financing as he is at gardening,...
apps_data_3624
The prudent Mr. Day and adventurous Dr. Knight have decided to be backpack buddies and go trekking in the gorgeous Norwegian mountains. Of course they will use the trails marked by the Norwegian Trekking Association (DNT), like any sane trekkers would; such trails all start and end at some cabin where it is possible to...
apps_data_3625
Jack the Lumberjack used to love chopping down trees. Jack is getting older and is becoming tired of this activity he used to love. He thinks of an idea, ‘The Big One’, and fantasizes about going out into the forest one last time to harvest as many trees as possible. Jack calls the forest administrator for his local e...
apps_data_3626
You are given a set of $n$ axis-aligned rectangles in a 2D plane. For this problem, two rectangles are considered to intersect if their boundaries contain any common points (in particular, two nesting rectangles don’t count as intersecting). Determine if some pair of rectangles intersect. In this example, only rectang...
apps_data_3627
Peter is attempting to deep-water solo a rock climbing cliff over the ocean. Deep-water soloing (DWS) is a form of solo rock climbing that relies solely upon the presence of water at the base of the climb to protect against injury from falling. Rock climbing is very exhausting and takes lots of energy. Since Peter is ...
apps_data_3628
Alan works for a company specialising in computer security. He recently came up with what he thinks is a great public key cryptosystem, in which the private key consists of two permutations $\pi $ and $\sigma $ of $\{ 1, \dots , n\} $. The public key $(a_1, \dots , a_ n)$ is then given by $a_ i \equiv \pi _ i + \sigma ...
apps_data_3629
A crazed boar has become lost in the forest! In its madness, it will charge in a random direction at blazing speed, until it has traveled a distance $d$, or until it hits a tree (in which case the boar will become dazed and end its charge), whichever comes first. Given the layout of trees around the boar, what is the p...
apps_data_3630
Žofka invented a new word puzzle. She gives you two strings $s_1$ and $s_2$ of the same length. You need to modify $s_1$ into $s_2$ as quickly as possible. The trick is that you are allowed to modify the strings only using the following types of moves: (1) shift forward where you choose a substring of one of the string...
apps_data_3631
In ancient times, communication was not as swift as it is today. When a kingdom was at war, it could take months to muster all the armed forces. But by using fire-lit beacons at strategic locations, it was still possible to quickly send emergency signals. When the first beacon is lit, all other beacons within sight fr...
apps_data_3632
Consider $n$ initial strings of lower case letters, where no initial string is a prefix of any other initial string. Now, consider choosing $k$ of the strings (no string more than once), and concatenating them together. You can make this many such composite strings:$n \times (n-1) \times (n-2) \times \ldots \times (n-k...
apps_data_3633
The premier of the anticipated action film No Thyme to Fry is right around the corner, and it is time to give early screenings to film critics so that they can review it. A small cinema has been selected to show these early screenings. There are $n$ critics numbered from $1$ to $n$ scheduled to watch the movie early,...
apps_data_3634
In the cold and remote areas of northern Sweden, a young boy named Anton lives. Being born to a family of pistvakts (an occupation that involves drinking moonshine called “bäverhojt”, hunting bears and occasionally handling safety in the mountains), he has been handed the responsibility of mounting temperature sensors ...
apps_data_3635
You are the boss of ACM (Association for the Country of Mububa), an upstanding company with a single goal of world domination. Today, you have conquered the unnamed country of Mububa (how an unnamed country has a name is, of course, outside the scope of this problem). Mububa is known for its great, great, bananas. In ...
apps_data_3636
Alice has an $n\! \times \! m$ grid and a $2\! \times \! 2$ block. She would like to place her block in the grid. She must place it so that the block is axis-aligned and covers exactly $4$ grid cells. Bob wants to prevent Alice from doing that. To do this, he places obstacles in some of the grid cells. After Bob place...
apps_data_3637
Me and my friends are ordering a big pizza to share. As you can imagine this is quite complicated, since everyone has different wishes about what should be on the pizza. For instance Gunnar wants bananas on the pizza, Emma doesn’t want bananas but wants olives, Marc wants there to be tomatoes, and so on. Fortunately, a...
apps_data_3638
Curse your rival! Every year at the annual Rock Paper Scissors tournament, you have made it to the final match. (Your Rock technique is unmatched, and your Paper cuts to the bone! Your Scissors need a little work, though.) But every year, he defeats you, even though his moves appear entirely random! And he claims to th...
apps_data_3639
About to leave the university to go home, you notice dark clouds packed in the distance. Since you’re travelling by bicycle, you’re not looking forward to getting wet in the rain. Maybe if you race home quickly you might avert the rain. But then you’d get wet from sweat… Facing this dilemma, you decide to consider thi...
apps_data_3640
Strings of yarn have been popular in Catland for ages. Which cat has not spent many a lazy afternoon bouncing around a ball of yarn? Lately however, strings of yarn have gotten competition: strings of characters. It turns out that these are almost as much fun as yarn, and generally much safer as well (so far, no cat ha...
apps_data_3641
A group of friends was given a necklace. The necklace is a circular nylon wire with gold beads of various weights glued on. They want to cut the wire into segments so that everybody gets one segment, every person gets the same amount of gold, no bead is cut, and no gold is left over. They wonder whether such a split is...
apps_data_3642
You are given an undirected tree1 with each of its node assigned a magic $X_ i$. The magic of a path2 is defined as the product of the magic of the nodes on that path divided by the number of the nodes on the path. For example, the magic of a path that consists of nodes with magic $3$ and $5$ is $7.5$ ($3\cdot 5 / 2$)....
apps_data_3643
Oh no! As a result of recent elections the “Random Laws” party took control of the government. This is going to have bad consequences for Mr. Bourgeois’ company, which just approved the way new salaries will be calculated. The company has $N$ workers and the salary for worker $i$ is going to be determined as a number d...
apps_data_3644
Amazin’ Inc, an up-and-coming company in e-commerce, has recently optimized its operations to make the most out of its workers. Thanks to state-of-the-art prediction methods, Amazin’ now knows in advance how many workers will be needed each day for the foreseeable future. Using this information they can adjust the size...
apps_data_3645
Alf and Beata were two young adults living together a long, long time ago, before you could spend all your afternoons competing in programming. Their lives were thus much more boring than those of today’s young adults. How could you even survive back then, you might ask yourself. The answer is simple: you write down nu...
apps_data_3646
Yoshi is a frog. He lives in the ZOO under a log which was specially transported there from a distant equatorial rainforest. The log is big and wet and attracts the flies and that is what makes Yoshi satisfied. There is also a line of pebbles which runs through the wetland in front of the log. There are various dark s...
apps_data_3647
You are hired as a level designer for the next Pokémon series, with games called Ice and Fire. For the first of these two games, players have to get through a maze in an icy cave. The cave is represented as a grid, with each square of the grid being either ice, gravel or an obstacle. The player will start at a square,...
apps_data_3648
The mayor of RMRCity wants to create a secure landline telephone network for emergency use in case of serious disasters when the city is cut off from the outside world. Some pairs of buildings in the city can be directly connected with a wire telephone line and the municipality engineers have prepared an estimate of th...
apps_data_3649
Recall that a subsequence of a string is any string obtained by removing some subset of characters from the string, for instance “string”, “sing”, “i” and “sg” are all subsequences of “string”. If the same subsequence can be obtained in exactly $t$ different ways, by removing different subsets of characters, we say tha...
apps_data_3650
Sliding Blocks is an interesting puzzle game which can be played on most mobile devices. In this game, you are given an $N \times M$ board with exactly one cell containing a block; all the other cells are empty. You can add a block to the board by sliding the new block from the edge of the board. The new block slides u...
apps_data_3651
Sector quadrant MAPS-2019 has been the home of the Rebel Alliance ever since the beginning of the space war against the Galactic Empire. Now news has reached the Rebel Council that the Empire is conspiring to attack the Rebel planets in the quadrant. Unfortunately, existing communication technology does not enable a di...
apps_data_3652
Luka is slacking again during chemistry class, while the teacher is explaining Avogadro’s law. Luka first drew a table consisting of $3$ rows and $N$ columns. Then he wrote the numbers $1$ to $N$ into the first row in arbitrary order, each number appearing exactly once. In the other two rows he also wrote integers bet...
apps_data_3653
Tom the Straight Builder has finally finished building his Great Wall. Being a Straight Builder he has of course built a wall with no bends in it at all. And as far as you can see he has built this wall infinitely long and infinitely thin. On one side of the wall Tom’s wife Ellen has decided she wants to make a perfec...
apps_data_3654
The Mischievous Troublemakers’ Association (MTA) has hatched a sinister plot for world domination! All through the night, the Troublemakers work tirelessly, arranging rocks in the shape of hideous, misshapen blobs on the lawns of the unsuspecting residents of Quackville. For the sake of efficiency, the MTA splits up in...
apps_data_3655
Yraglac has just finished building a robot! It’s fancy: two wheels, with an auto-balancing system, several cameras, wireless connectivity, and a sattelite dish. There’s just one little problem… He powered it up, sent it off for a test, and now it’s not responding to any inputs. All he has is a photograph of the floor ...
apps_data_3656
A certain big IT company (which we will not name in order not to get sued) is preparing to launch a new version of its flagship product. Having just been employed as a developer on the project, you have been given a list of open bugs that should be fixed in the new version. Being bugs, you are not exactly certain how...
apps_data_3657
You are competing in a ski slalom, and you need to select the best skis for the race. The format of the race is that there are $N$ pairs of left and right gates, where each right gate is $W$ metres to the right of its corresponding left gate, and you may neither pass to the left of the left gate nor to the right of the...
apps_data_3658
Ewan is a park ranger, and part of his duty is to observe how the ecosystem changes over time. He has just detected that a group of pine trees and aspens have started to share the same space. Before, there was a clear line between the species. This isn’t unusual, but Ewan is a bit curious about how this will evolve in...
apps_data_3659
No wonder the old bookcase caved under the massive piles of books Tom had stacked on it. He had better build a new one, this time large enough to hold all of his books. Tom finds it practical to have the books close at hand when he works at his desk. Therefore, he is imagining a compact solution with the bookcase stand...
apps_data_3660
Filoména wants to write a message on her newly opened sticker store. She wants to write the message using stickers that she sells in the store. Each sticker spells a word and has a price. She has unlimited supply of any type of sticker. The stickers can overlap but the maximum thickness of the message is two stickers, ...
apps_data_3661
“Next to the confrontation between two highly honed batteries of lawyers, jungle warfare is a stately minuet.” ­–Bill Veeck. Frivolous lawsuit or legitimate litigation? That is the question the judge Kattis faces today as she presides over lawsuits between individuals and corporations. There are $R$ individuals and $...
apps_data_3662
“Phew, that was the last one!” exclaimed the garden helper Tim as he threw the last tree plant to the ground. His employer, countess Esmeralda Hunt who owned the estate, has ordered him to arrange an avenue of aspen trees along both sides of the front road leading up to the house. The first trees in the avenue are supp...
apps_data_3663
Bwahahahahaha!!! Your nemesis, the dashingly handsome spy Waco Powers, has at last fallen to your secret volcano base’s deathtraps (or so you assume, being a little too busy to witness it firsthand). At long last, you are all set to Conquer The World! Nothing will stand in your way! Well, nothing except a minor proble...
apps_data_3664
Pacman is cleaning his ice rink! The rink, like everything in PacMan’s universe, wraps! In other words, if you go off the edge of the rectangular rink to the right, you’ll end up in the same row on the left side of the rink. Go off of the left side of the rink, and you’ll end up on the right. Going up off the top of th...
apps_data_3665
Arranging Hat is a cushy job indeed; high impact work, absolute authority, and 364 days of holiday every year. However, the hat has decided that it can do even better—it would like very much to become a tenured professor. Recently the hat has been reading computer science papers in its ample spare time, and of course...
apps_data_3666
The gear ratio designers ate BikeCo need your help! They have designed a new set of gear ratios $n_1/d_1, n_2/d_2, \cdots , n_{12}/d_{12}$ for a bicycle with front and rear derailleurs having two and six sprockets respectively. Your task is to figure out, if possible, the sprocket sizes needed to achieve the required g...
apps_data_3667
Linköping has a quite complex water transport system. Around Linköping there are several wells from which water is drawn. The water is then transported to other locations using pipes. Each pipe is a straight canal from one of the wells to some location in the city. All the pipes are at the same depth under ground. Th...
apps_data_3668
Mia is a newly hired administrative assistant. Though Mia was introduced to everyone in the company on her first day, she is forgetful and struggles to remember people’s names. Being too shy to ask for names again, she discovers a way to recall people’s names during lunchtime without asking. Mia orders lunch for all o...
apps_data_3669
Mirko and his faithful friend Slavko got really bored one day. The result of their boredom is the creation of a new game! In the beginning of the game, they draw $N$ points in a coordinate system. The players take turns and Mirko plays first. He draws a straight line which is parallel to one of the axes of the coordina...
apps_data_3670
Luka started driving international routes with his truck. His biggest problem is the border with Slovenia. The border is a point of entrance into the European Union, so every truck is thoroughly examined. Because of this, Luka always has to wait several hours there. To kill the time, he comes up with various logic and ...
apps_data_3671
In the computer-generated world Matriks, you work as a consultant for some hip IT companies that need unique slides for their cool office spaces. During the past year, you got a number of job offers at different points in time, measured in milliseconds since the start of the year. For each job you could choose to desig...
apps_data_3672
The mythical planet, El-gă-rizm, comprises $m$ islands surrounded by water. There are $n$ different natural resources to be found at various locations on the islands. Interestingly, each of the $n$ natural resources is present on exactly two islands; thus there are $2n$ total occurrences of resources on El-gă-rizm. Bo...
apps_data_3673
Marek loves dancing and he has danced a lot in the last couple of years. He has actually danced so much that he became too good in all of the traditional dances like swing, salsa, ballroom and hip-hop and now all partners he dances with can not keep up with him. Therefore he started to invent his own dances and even tr...
apps_data_3674
Filip came across an interesting math problem: He was supposed to find a five-digit number with the following property. If you cross out its first two digits, then place the digit $8$ after the remaining three digits to form a four-digit number and multiply the resulting four-digit number by $4$, you will get the origi...
apps_data_3675
You are given $n$ strings, each a permutation of the first $k$ upper-case letters of the alphabet. String $s$ is a subsequence of string $t$ if and only if it is possible to delete some (possibly zero) characters from the string $t$ to get the string $s$. Compute the length of the longest common subsequence of all $n...
apps_data_3676
“My mom always said life was like a box of chocolates. You never know what you’re gonna get." Forrest Gump is a young boy who goes to Greenbow County Central School. As a child, he enjoys running, dancing by swinging his hips, and eating chocolates. Most of all, he enjoys spending time with his best friend Jenny. How...
apps_data_3677
A certain political party with $N$ members wants to develop some brand new politics. In order to do so, the party plans to make a committee for new political development. Clearly, the best politics is developed when all committee members disagree with each other, and when the committee is as large as possible. In orde...
apps_data_3678
Chubby Trung and skinny Hanh are best friend. They are smart and lovely kids, and they are both very good at math and programming. One day, chubby Trung set a puzzle to challenge skinny Hanh. Trung gives a list of $n$ distinct points on a Cartesian coordinate plane to Hanh and asks Hanh to draw a single loop connecting...
apps_data_3679
It is Catmas time again, and that means a lot of stress for everyone. In the Kattis family everyone used to buy gifts for everyone else, but this becomes more and more expensive every year, since our family keeps growing. To make things easier, we decided that this year each person will buy just one gift. We will the...
apps_data_3680
Donald is a fence builder. He wants to build a fence that is $N - 1$ meters long. He needs a fence post every meter along the fence, which means he needs $N$ fence posts. Donald has $K$ poles of varying lengths that he wants to use as fence posts. The fence posts must have the same lengths, and be as long as possible. ...
apps_data_3681
A new school year has started. The high school for gifted students of Ho Chi Minh city has $N$ classes numbered from $1$ to $N$. All $N$ classes will go through $M$ studying weeks. The high school has $N$ teachers numbered from $1$ to $N$. At the beginning teacher $i$ is assigned to class $i$. In order to improve the ...
apps_data_3682
While reviewing code recently being checked into the repository, Jim discovered that some employees now and then seemed to copy code right from the Internet into the company code base. This would be a potential disaster as the company then risks getting sued by copyright holders of the original code. The obvious soluti...
apps_data_3683
A group of friends has just played a round of miniature golf. Miniature golf courses consist of a number of holes. Each player takes a turn to play each hole by hitting a ball repeatedly until it drops into the hole. A player’s score on that hole is the number of times they hit the ball. To prevent incompetent players ...
apps_data_3684
You are developing software to stream music to users over the Interwebs. In order to reduce network traffic for your servers, you plan to do this in a peer-to-peer way: a user who has listened to a given song for a while longer than some other user will have parts of the song that the second user needs and can send the...
apps_data_3685
The full-board residents of the famous but misnamed Adephagia School For Boys feel hard done by. Recent savings have seen dinnertime puddings cut back to a single biscuit while the masters finish their meals with fine raspberry jelly every night. Although the choice of custard cream or bourbon is not a bad one, the chi...
apps_data_3686
You are a newly designed and created robot. As a robot, you are excellent at shooting lasers: your lasers always go perfectly straight, go infinitely far, and are infinitely thin. To test you, the scientist who made you set out a number of targets for you to hit with your laser beam. The targets (point-like objects) ar...
apps_data_3687
Although we imagine interplanetary probes to be very sophisticated pieces of technology, their information systems are quite archaic. You might assume that they have a certain amount of contiguous main memory and can store their data wherever is convenient, but unfortunately that is not the case. The probe’s main memor...
apps_data_3688
After attending the ProgNova contest, Peter walks out of the school to enjoy a weekend of shopping in Manhattan! Peter has a shopping list with $m$ different items (numbered $1$ to $m$) he wants to purchase. There are $n$ shopping malls in Manhattan. Each shopping mall sells one of these $m$ items. (All the items Pete...
apps_data_3689
You are given an integer $x$ of $n$ digits $a_1, a_2, \ldots, a_n$, which make up its decimal notation in order from left to right. Also, you are given a positive integer $k < n$. Let's call integer $b_1, b_2, \ldots, b_m$ beautiful if $b_i = b_{i+k}$ for each $i$, such that $1 \leq i \leq m - k$. You need to find t...
apps_data_3690
Have you ever tried to explain to the coordinator, why it is eight hours to the contest and not a single problem has been prepared yet? Misha had. And this time he has a really strong excuse: he faced a space-time paradox! Space and time replaced each other. The entire universe turned into an enormous clock face with ...
apps_data_3691
THE SxPLAY & KIVΛ - 漂流 KIVΛ & Nikki Simmons - Perspectives With a new body, our idol Aroma White (or should we call her Kaori Minamiya?) begins to uncover her lost past through the OS space. The space can be considered a 2D plane, with an infinite number of data nodes, indexed from $0$, with their coordinates defined...
apps_data_3692
Firecrackers scare Nian the monster, but they're wayyyyy too noisy! Maybe fireworks make a nice complement. Little Tommy is watching a firework show. As circular shapes spread across the sky, a splendid view unfolds on the night of Lunar New Year's eve. A wonder strikes Tommy. How many regions are formed by the circl...
apps_data_3693
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect. The interior of the square is considered to be part of the square, i.e. if one square is completely inside another, they intersect. If the ...
apps_data_3694
Tokitsukaze and CSL are playing a little game of stones. In the beginning, there are $n$ piles of stones, the $i$-th pile of which has $a_i$ stones. The two players take turns making moves. Tokitsukaze moves first. On each turn the player chooses a nonempty pile and removes exactly one stone from the pile. A player lo...
apps_data_3695
A new dog show on TV is starting next week. On the show dogs are required to demonstrate bottomless stomach, strategic thinking and self-preservation instinct. You and your dog are invited to compete with other participants and naturally you want to win! On the show a dog needs to eat as many bowls of dog food as poss...
apps_data_3696
Suppose you have two polynomials $A(x) = \sum_{k = 0}^{n} a_{k} x^{k}$ and $B(x) = \sum_{k = 0}^{m} b_{k} x^{k}$. Then polynomial $A(x)$ can be uniquely represented in the following way:$A(x) = B(x) \cdot D(x) + R(x), \operatorname{deg} R(x) < \operatorname{deg} B(x)$ This can be done using long division. Here, $\oper...
apps_data_3697
The elections to Berland parliament are happening today. Voting is in full swing! Totally there are n candidates, they are numbered from 1 to n. Based on election results k (1 ≤ k ≤ n) top candidates will take seats in the parliament. After the end of the voting the number of votes for each candidate is calculated. I...
apps_data_3698
The Travelling Salesman spends a lot of time travelling so he tends to get bored. To pass time, he likes to perform operations on numbers. One such operation is to take a positive integer x and reduce it to the number of bits set to 1 in the binary representation of x. For example for number 13 it's true that 13_10 = 1...
apps_data_3699
It was recycling day in Kekoland. To celebrate it Adil and Bera went to Central Perk where they can take bottles from the ground and put them into a recycling bin. We can think Central Perk as coordinate plane. There are n bottles on the ground, the i-th bottle is located at position (x_{i}, y_{i}). Both Adil and Bera...