task
stringlengths
0
154k
__index_level_0__
int64
0
39.2k
Ligatures Description: Vivi works as a font designer. She is almost done with her new masterpiece but thinks that something is missing. She has therefore decided to add some ligatures. A ligature occurs when two characters are combined into a single glyph. For example, “ff” often becomes “ff”, and “ae” ...
28,600
Light Bulbs Description: Shortly after founding his lightbulb company in Eindhoven in 1891, Frederik Philips made a great discovery: lightbulbs that light up an infinite ray in the horizontal or vertical direction. With this new discovery, he wants to revolutionize the interior design of modern homes. ...
28,601
Light Switches Description: Ann Britt-Caroline has won the lottery. With her new fortune, she has bought a private jet, some private jet1 and a huge house that consists of $N$ rooms with long corridors to connect them. Each corridor connects two rooms, but does not necessarily follow any specific geome...
28,602
Light Up Description: Light Up is a pencil puzzle. Your job will not be to play Light Up, but simply to judge whether a player’s solution is correct. The game is played on a square grid. Some of the cells are blocked, and some of the blocked cells have a number from $0$ to $4$. The player must place l...
28,603
Lights Description: John has $n$ light bulbs and a switchboard with $n$ switches; each bulb can be either on or off, and pressing the $i$-th switch changes the state of bulb $i$ from on to off, and viceversa. He is using them to play a game he has made up. In each move, John selects a (possibly emp...
28,604
Lights Out Description: Eve is a creature of habit and wants to take a fixed route out of the office each evening. At the same time, the set of lamps to turn off may be different on different days, so she has to plan for all eventualities. In other words, Eve wants a route through the office such that,...
28,605
Lights, Camera, Airplane Description: Porco Rosso is trying to catch the notorious air pirates, and he is trying to direct his underlings by lighting up the runway so they can take off. There are $N$ important locations on the runway, and there are $N-1$ lighted pathways between locations such that the...
28,606
Like No One Ever Was Description: Years have passed since Bash dropped out of university to become a Pokenom trainer. The adventure was full of difficulties and hardship, but Bash overcame all obstacles and became the best Pokenom trainer, like no one ever was! Today Bash is celebrating his $13$th anniver...
28,607
Limbo: Part 1 Description: Dominick Cobb and Arthur are “extractors" who perform corporate espionage. Using experimental military technology that gives them access to shared dream worlds, they infiltrate their targets’ subconscious to extract valuable information. Cobb and his entourage are contacted b...
28,608
Limbo: Part 2 Description: Dominick Cobb and Arthur are “extractors" who perform corporate espionage. Using experimental military technology that gives them access to shared dream worlds, they infiltrate their targets’ subconscious to extract valuable information. Cobb and his entourage are contacted b...
28,609
Limited Correspondence Description: Emil, a Polish mathematician, sent a simple puzzle by post to his British friend, Alan. Alan sent a reply saying he didn’t have an infinite amount of time he could spend on such non-essential things. Emil modified his puzzle (making it a bit more restricted) and sent...
28,610
Limited Library Description: During the summer break, fewer students are dwelling on campus, so this is the perfect time to add new books to the TU Delft library. These new books all have the same width, but they have varying heights. Because all existing bookcases are already full, the management boar...
28,611
Linden Mayor System Description: Aristid is the mayor of a town called Linden. He and the townsfolk love fractals. One day, Aristid decides to genetically alter trees so that they have mathematically pleasing structures. It turns out that the people of Linden will support this idea only if the trees ar...
28,612
Line Ball Description: The Pokemon Center has just come out with a brand new type of Poké Ball. This Poké Ball, called the Line Ball, is more powerful than any other ball created before it. When thrown, the Line Ball travels forward in a line in the direction you are facing, catching all Pokemon it enc...
28,613
Line Segment Distance Description: ## Input The first line of input contains an integer $n$ ($n \leq 10000$) giving the number of test cases. Then follow $n$ lines each containing 8 integers $x_1\ y_1\ x_2\ y_2\ x_3\ y_3\ x_4\ y_4$, indicating a line segment from $(x_1, y_1)$ to $(x_2, y_2)$, ...
28,614
Line Segment Intersection Description: ## Input The first line of input contains an integer $n$ ($n \leq 10000$) giving the number of test cases. Then follow $n$ lines each containing 8 integers $x_1\ y_1\ x_2\ y_2\ x_3\ y_3\ x_4\ y_4$, indicating a line segment from $(x_1, y_1)$ to $(x_2, y_2...
28,615
Line Them Up Description: An eccentric coach asks players on the team to line up alphabetically at the start of practice. The coach does not tell the players whether they need to line up in increasing or decreasing order, so they guess. If they guess wrong, the coach makes them run laps before practice...
28,616
Linear Equation Solver Description: ## Input There are several test cases. Each test case begins with a line containing an integer $n$, where $1 \leq n \leq 100$. Then follow $n$ lines, each containing $n$ floating point numbers. The $j$:th number on the $i$:th row gives the entry $a_{i,j}$ of the ma...
28,617
Linear Recurrences Description: ## Input The first line of input contains an integer $1 \le N \le 40$, the degree of the recurrence. The next line of input contains $N+1$ integers $a_0, a_1, \ldots , a_ N$ indicating that the linear recurrence is $x_{t} = a_0 + \sum _{i=1}^ N a_ i x_{t-i}$. The next line ...
28,618
Lines Of Action Description: Lines Of Action is a two-player game that is played on an $8$-by-$8$ board (e.g. a chess board). The first player is designated the color black, and the second player the color white. Each player has $12$ tokens in his or her respective color. In the initial setup, the blac...
28,619
Lines Per Hour Description: You are the chief judge for the next ICPC regional contest, and you want to make sure that it is theoretically possible for a team to solve all problems in the contest, but only if they are performing at their peak skill. With your insider knowledge, you know that the best t...
28,620
Lines of X Description: Tic-tac-toe is boring. The optimal strategy is simple to work out. But what about a generalization to an $N \times N$ board. That also does not seem interesting, and you probably won’t convince anyone to play with you. So you decide to have your own fun with such grids. Given a...
28,621
Linije Description: 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 parall...
28,622
Lipschitz Constant Description: Today you are doing your calculus homework, and you are tasked with finding a Lipschitz constant for a function f(x), which is defined for $N$ integer numbers $x$ and produces real values. Formally, the Lipschitz constant for a function f is the smallest real number $L$ such...
28,623
Liquid Assets Description: You are but a humble villager with big dreams, and they are finally coming true! You have just been promoted to “general manager” at the best (only) tavern in your town, Creeper County. You have much loyalty to this town - your original spawn point - but it’s not exactly a p...
28,624
Lisa the Ladybug Description: Buttons 0,1,…, 9 are called the numeric buttons, = is the equals button, and the other buttons are the operator buttons. The calculator also has the C key to reset it, but only Calculon is allowed to press it, so we will not consider it in this problem. The result ...
28,625
Lista Description: Mirko received a birthday present from his aunt in the US – a brand-new doubly-linked list (an example of which is shown in the figure below). The list contains $N$ nodes numbered $1$ through $N$. Two types of moves can be done on the list: * Move node $X$ in front of node $Y$. ...
28,626
Listen To Your Boss Description: At work, Atrebla recently became overwhelmed with orders from people all over his company and is trying to reduce his workload. He has realized that a large portion of the orders are from people who don’t have the authority to tell him what to do. By identifying such or...
28,627
Litespace Description: Whitespace is an esoteric programming language (esolang) created in 2003 by Edwin Brady and Chris Morris. Many elements of Whitespace are familiar, including the fact that it is imperative and stack-based, but it has one main distinguishing feature: the only significant character...
28,628
Little Toys Description: The World Finals Contest marshals are continuously walking back and forth across the contest area and it is only a matter of time until one of them trips over a power or network cable, ruining the whole event. To keep them occupied with something less dangerous, the GNYR head j...
28,629
Liðaskipting Description: In recent years contestants have had the option of grouping up into teams to compete in Forritunarkepni Framhaldsskólanna, but as you know teams can contain up to three people. This hasn’t always gone too well since some people end up being left out. The planning committee hav...
28,630
Liðaskipting 2 Description: The competitive programming association of Iceland has been hard at work preparing the contest. Luckily, the association gets plenty of help from Reykjavík University. However, this year there was a bit of a problem. Due to the cyberattack on the university some of the regis...
28,631
Ljutnja Description: Children in a kindergarten have received a large sack containing $M$ candies. It has been decided that the candies are to be distributed among $N$ children. Each child has stated the number of candies that it wants. If a child isn’t given the amount of candy it wants, it will ...
28,632
Lock Blocked Description: You own and manage an office building. One of the tenants, a regional paper supply company, is complaining about the lack of security offered by the CrapTacular$^{\text {TM}}$ doors you installed in the building. A potential attacker could easily pick the locks on these doors ...
28,633
Locked Treasure Description: A group of $n$ ($1 \leq n \leq 30$) bandits hid their stolen treasure in a room. The treasure needs to be locked away until there is a need to retrieve it. Since the bandits do not trust each other, they wanted to ensure that at least $m$ ($1 \leq m \leq n$) of the band...
28,634
Lockout Description: Mario and Luigi are speedrunning Super Mario Odyssey to determine who is the better speedrunner. In Super Mario Odyssey, there is a collection of $N$ worlds, where world $i$ has $a_ i$ coins and takes $t_ i$ seconds to clear. If Mario or Luigi are the first to enter a world, then they ...
28,635
Locust Locus Description: There are two different species of periodical cicadas that only appear from hibernation every $13$ and $17$ years, respectively. Your old grandpa tells you that he saw them simultaneously back in ’92. You start pondering how many years you have to wait until you see them a...
28,636
LogDB Description: A LogDB database is filled with facts. A fact is a name with a body consisting of a parenthesized list of names. This is similar to a function call: ``` fact1(arg1,arg2,arg_3,4,4) thing(p1,arg2,p3) ``` where fact1 is the name of the fact and the list of names in the body are the argume...
28,637
Logic Functions Description: In addition to the normal boolean operators we use (such as or, ||, and, && and negation, !) there are also a number of additional operators that might be of interest. ## Task In this problem, your task is to write C++ functions that implement a few of them. You will give the...
28,638
Logland Description: Two thieves (who strongly “recommended” us not to reveal their names) has broken into the central bank of Logland, where the country’s cash reserve is stored. In Logland, the currency has the $k$ denominations $1, 2, 4, 8, \ldots , 2^{k - 1}$, and the bank currently stores $x_ ...
28,639
Logo Description: Logo is a programming language built around a turtle. Commands in the language cause the turtle to move. The turtle has a pen attached to it. As the turtle moves, it draw lines on the page. The turtle can be programmed to draw interesting pictures. We are interested in making the tur...
28,640
Logo 2 Description: Logo is a programming language built around a turtle. Commands in the language cause the turtle to move. The turtle has a pen attached to it. As the turtle moves, it draw lines on the page. The turtle can be programmed to draw interesting pictures. We are interested in making the t...
28,641
Lone Knight Description: In the game of chess, a knight moves as shown in the picture below; each move is one square horizontally and two squares vertically or two squares horizontally and one square vertically. A rook can move any number of squares horizontally or vertically, but not both in the same ...
28,642
Lone Rook Description: On a chess board of $r$ rows and $c$ columns there is a lone white rook surrounded by a group of opponent’s black knights. Each knight attacks $8$ squares as in a typical chess game, which are shown in the figure – the knight on the red square attacks the $8$ squares with...
28,643
Lonely Strings Description: A binary string has either even parity or odd parity, depending on whether it contains an even or an odd number of $1$’s, respectively. Now suppose a binary string, $S$, has been partitioned into $m \geq 2$ nonempty substrings, $S = S_1 S_2 \ldots S_ m$. The neighbou...
28,644
Long Long Strings Description: * Ins($p$, $c$): Insert the character $c$ at position $p$. * Del($p$): Delete the character at position $p$. Ins($p$, $c$): Insert the character $c$ at position $p$. Del($p$): Delete the character at position $p$. A DNA editing program ...
28,645
Long Swaps Description: You have a string $s$ and you may modify it by making long swaps of its letters. Two letters can be swapped if their positions differ by at least $k$. That is, you may swap the $i$-th letter with the $j$-th letter in $s$ if $|i - j| \geq k$. Is it possible to sort all the le...
28,646
Long Walk Description: To ignore his impending doom, Jimmy-Jimmy likes to imagine going for long walks. Today, he is imagining a walk on a graph $G$. $G$ has $2^ n$ nodes, labelled $0,1,2,\dots ,2^ n-1$. For each $i\in \{ 1,2,\dots ,2^ n-1\} $, $G$ has a bidirectional edge between node $i$ and node...
28,647
Longest Collatz Chain Description: The Collatz conjecture says that if you take a positive integer $n$ and repeat the following procedure you always end up at $1$. If the number is even you divide it by two, and otherwise you multiply by three and add one. Dividing by two or multiplying by three and ad...
28,648
Longest Common Subsequence Description: 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$...
28,649
Longest Common Substring Description: Given a list of strings, what is the longest substring common to all of them? ## Input The first line of input contains an integer $n$ ($1 \le n \le 1\, 000$), which is the number of strings that follow. Each of the next $n$ lines contains a single string $s$ ($...
28,650
Longest Increasing Subsequence Description: We say that an integer sequence is increasing if the numbers in the sequence increase (rather than decrease or stay the same). For example, the following is an increasing sequence of length $7$: A subsequence of a sequence uses some of the same members, in t...
28,651
Longest Life Description: Everyone wants to live as long a life as possible. As time progresses, technology progresses. Various anti-aging pills get introduced to the market at various times which allow a person to age more slowly than normal. In particular, an $x$-$y$ pill, when taken regularly, ages ...
28,652
Longest Prime Sum Description: Given a positive integer $N$, what is the maximum number of terms of a sum consisting only of prime numbers and summing to $N$? ## Input The first line contains an integer $N$ ($2 \le N \le 10^{18}$). ## Output Output a single integer – the maximum number of terms in ...
28,653
Longest Rivers Description: The Chao Phraya River System is the main river system of Thailand. Its six longest rivers listed by decreasing length are: * Tha Chin ($765$ km) * Nan ($740$ km) * Yom ($700$ km) * Ping ($658$ km) * Pa Sak ($513$ km) * Wang ($335$ km) Tha Chin ($765$ k...
28,654
Longest path in a DAG Description: Given a directed acyclic graph, output one of its longest paths. ## Input The first line contains two integers $V$ ($1 \le V \le 100\, 000$), the number of vertices in the graph, and $E$ ($1 \le E \le 200\, 000$), the number of edges. Next, $E$ lines follow ...
28,655
Loo Rolls Description: Nick has a clever way of preventing crises from happening: he uses a backup roll. The backup roll is another roll of length $\ell $ that is hidden somewhere in the bathroom, and when the regular roll runs out even though Nick still needs more paper, he will take that amount f...
28,656
Looping Around Description: 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 a...
28,657
Loopy Cab Drivers Description: You’re a cab driver, and you regularly take passengers downtown to go pick something up from a store. Often they ask you to wait for them, but it can be impossible to find parking. When you can’t find parking, you have to drive around the city, periodically coming back to...
28,658
Loopy Transit Description: Luke likes to ride on public transit in different cities he visits, just for fun. He tries to find unique ways to travel in loops: leaving from one transit station, traveling along the transit connections to at least one other station, and returning to the station where he st...
28,659
Loot Chest Description: Your favorite online game has a prize system. After each match you win, there is a $P\% $ chance you will receive a prize. This value $P$ changes over time: * every time you lose a match, $P$ increases by $\Delta _ L$, * every time you win a match but fail to receive a prize, ...
28,660
Lopsided Lineup Description: Together with your coworker, Sergey, you are organizing the exciting Billiards and Pool Competition for your coworkers in your small company. However, communication has not been great between you two. You are not sure you and Sergey think alike, but as far as you are concer...
28,661
Lorem Ipsum Description: You are an archaeologist exploring the underground crypts of Rome. You have just stumbled into a hidden archive containing copies of a lost manuscript by the Knights Templar. Unfortunately, the copies have crumbled over time and now comprise thousands of small text fragments th...
28,662
Lost In The Woods Description: Your friend has gotten lost in the woods. He has called and asked for you to come get him, but you are very busy and would rather just stay home. You quickly look up a map of the woods. It appears that the woods consist of a small number of clearings, with paths connectin...
28,663
Lost Lineup Description: Jimmy and his friends were all standing in a lineup for ice cream when a huge gust blew them all around. The friends want to keep things fair and make sure everyone gets their ice cream in the order they started with. The friends do not remember the order, but each of them reme...
28,664
Lost Map Description: Trade between these villages is very important, since not every village has access to the same supply of natural resources. Many villages produce the same resource, however, so it is useful for villages to know their relative distance to other villages so that they can choose trad...
28,665
Lost Map Description: An amateur Viking historian needs your help finding the silver left by Egill Skallagrímsson, of Egil’s saga. She has found two old treasure maps that are supposed to lead to it. A treasure map is a list of instructions of the form “direction $k$”, where direction can be “n”, “s”, “e”,...
28,666
Lost in Translation Description: The word is out that you’ve just finished writing a book entitled How to Ensure Victory at a Programming Contest and requests are flying in. Not surprisingly, many of these requests are from foreign countries, and while you are versed in many programming languages, ...
28,667
Lost is Close to Lose Description: Better Documents Inc. is contemplating the next generation of word processors. Now, nearly every word processor includes a Spell Checker. BDI, however, is looking forward to replacing that with a true Typo Checker. We’ve all been caught, after relying on a spell check...
28,668
Love Letter Description: Mio and Sara come from two very different families. In Mio’s family, everyone wears hats shaped like rectangles, while in Sara’s family, everyone wears triangular-shaped hats. This difference in taste has led to feuds that have lasted for generations. Despite this, Mio and Sara...
28,669
Love Polygon Description: As we all know, TV soap operas with many characters can lead to seriously complicated love dramas. In one TV show, there are $N$ characters. Each character loves exactly one character (which could actually be him- or herself). We say that two characters are in a relationsh...
28,670
Low Order Zeros Description: When you compute a large, factorial number, it has a long string of low-order zeros at the end. This makes sense; every time you multiply in something like a $10$ or a $20$, you are sure to pick up another low-order zero. Thus, it’s easy to guess the low-order digit of some...
28,671
Low Power Description: You are building advanced chips for machines. Making the chips is easy, but the power supply turns out to be an issue since the available batteries have varied power outputs. Consider the problem of $n$ machines, each with two chips, where each chip is powered by $k$ batteries. Surp...
28,672
Low Toner Description: You have a printer with a toner cartridge that’s just about empty. When you print a document, some letters may not print very well, and it may be easy to mistake one letter for another. For example, a printed letter that looks as a P may be the result of trying to print an R ...
28,673
Lubbi Lærir Description: Ásdís works in a kindergarten. She is teaching the kids the letters of the alphabet today. She uses the game Lubbi Learns to teach the kids about the letters. The game works in the following manner. First, she shows the kids an object. Then the kids guess the first letter of the ...
28,674
Lucky Draw Description: You and your friends at the Betting against All Probability Club are visiting a casino where the following game is played. Each of the $n$ players starts with $k$ lives and puts in a fixed amount of money. In each round of the game, each player flips a biased coin and loses...
28,675
Lucky Numbers Description: Mr. Lucky has a store that sells numbers. These numbers have an interesting property: each number formed by its first $k$ digits is evenly divisible by $k$, for $k$ from $1$ to $n$, where $n$ is the number of digits in the number. The numbers do not have leading zeroes. ...
28,676
Lucky Shirt Description: In order to keep a fresh supply of clean shirts, you sometimes also do laundry at night, washing all shirts in the laundry basket (including the one you wore that day). This is not according to some neat schedule however; the number of days between your wash cycles is a uniform...
28,677
Luggage Description: Johan has a really boring job at the airport. It is his duty to make sure no bags collide when sliding onto the circular conveyor belt in the luggage pick-up zone. All pieces of luggage are loaded onto a straight conveyer belt which ends above the circular conveyor belt. Johan is t...
28,678
Luhn's Checksum Algorithm Description: In 1954, Hans Peter Luhn, a researcher at IBM, filed a patent describing a simple checksum algorithm for numbers written as strings of base-$10$ digits. If a number is chosen according to Luhn’s technique, the algorithm provides a basic integrity check. This means...
28,679
LumberCraft Description: In a variety of popular strategy games, you must harvest materials in order to build up your forces and eventually defeat your opponents (who are, of course, trying to do the same thing). Let’s play a simplified version of this kind of game. Here, a number of players (A, B, C $...
28,680
Lunchtime Name Recall Description: 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 l...
28,681
Lykilorð Description: In digital systems requiring authentication, it is rather common that a user needs to create their own password to pair with their username. The passwords should not be stored in plaintext, instead they should be processed by a hash function. Simply put, the hash function transfor...
28,682
Lyklagangriti Description: Benni was browsing the web and accidentally got himself a keylogger. Luckily Benni has antivirus software that let him know about it, but the antivirus didn’t remove the virus itself. When Benni writes his passwords to log into various sites he tries to hide it so the keylogg...
28,683
Lægð yfir landinu Description: Oh boy, oh dear. Is there a low pressure system over the country or what? Little Siggi is going mad over the terrible weather that has been ravaging the country as of late. He then learned it was the fault of all these damned low pressure systems, but low pressure system...
28,684
Léttasta verkefnið? Description: Jói is taking part in Forritunarkeppni Framhaldsskólanna for the first time. His team is having quite a lot of trouble solving the problems and thus far hasn’t solved any problem. Now Jói stares at the score table with envied eyes. But then he has an idea. Maybe his team h...
28,685
Línuhlýnun Description: The residents of Lineland recently received the news that a university was going to be built in the country. This is exciting news, especially since linear algebra, linear optimization and linear functional analysis will all be taught among other exciting subjects. The greenhou...
28,686
Lög um lög Description: It occurs frequently in pop music, but also in other music genres, that the popular songs follow the same chord progression. This gives listeners a feeling of familiarity, and therefore increases the chances that they will enjoy the song. However, this can cause issues regarding...
28,687
MC Part Deux Description: The Dean sneaks out one night with a tape measure to survey the last remaining grassy area on campus, where the new building will go. He drives stakes into the ground, then measures the distances between them. Afterwards, he retreats into his office to construct a map from his...
28,688
Macarons Description: Pierre is famous for his macarons. He makes round macarons, stored in square boxes of size $1\times 1$, and oval-shaped macarons, stored in rectangular boxes of size $1\times 2$ (or, rotated, in rectangular boxes of size $2\times 1$). For the purpose of a buffet, Pierre wishes to ...
28,689
Mad Diamond Description: Mars lacks a global magnetic field. Advanced gadgets can detect weak local magnetic fields and serve as compasses for navigation. A compass of this kind depends of movement of a highly magnetized diamond crystal in an intricate maze inside the gadget. The crystal is often call...
28,690
Maddison's Square Garden Description: Maddison and her friends live and work on the perimeter of a unit square with bottom left corner at $(0, 0)$ and top right corner at $(1, 1)$. They’ve decided to build a square community garden centered at $(0.5, 0.5)$, but they can’t decide how big it should be! T...
28,691
Mafija Description: Mafia is a social game played frequently by high school competitors in informatics on summer and winter camps and national competitions, usually very late at night, drinking various fruit sodas. This game is not about winning, it’s about los taking part, like in competitions. To so...
28,692
Mag Description: 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$ ...
28,693
Magic Bean Description: A “Magic Bean” is a combination fidget toy and puzzle, with 30 colored beads moving in three circular tracks. In its solved state, the upper circle contains ten indistinguishable orange beads, the lower left circle contains ten indistinguishable grey beads, and the lower right c...
28,694
Magic Bitstrings Description: A bitstring, whose length is one less than a prime, might be magic. 1001 is one such string. In order to see the magic in the string let us append a non-bit x to it, regard the new thingy as a cyclic string, and make this square matrix of bits each bit 1001 every 2nd bi...
28,695
Magic Checkerboard Description: Consider an $n \times m$ checkerboard. On each cell of the checkerboard, place a positive integer. The values in each column of the checkerboard must be in strictly increasing order from top to bottom, and the values in each row of the checkerboard must be in strictl...
28,696
Magic Cube Description: Imagine you are holding an $n \times n \times n$ cube, which is split up into $n^3$ smaller cubes labeled from 1 to $n^3$. The orientation of the axes is left-to-right for the $x$-axis, back-to-front for the $y$-axis, and bottom-to-top for the $z$-axis. For example, ...
28,697
Magic Sequence Description: One day, Bob discovers a magic sequence $\textbf{S}$ of $\textbf{N}$ integers. The sequence is generated from $3$ positive integers $A$, $B$, and $C$ as follows: * $S[0]$ = $A$ * $S[i]$ = ($S[i - 1]$ * $B$ + $A$) % $C$ $(1 \leq i < N)$ $S[0]$ = ...
28,698
Magic Show Description: Mårten the Magician is currently performing in a magnificent magic competition. The show consists of $N$ rounds. In each round, Mårten uses his magic to perform one of two tricks: either he makes some number $x$ rabbits appear, or he sabotages his opponents’ tricks by making som...
28,699