We are going to paint a sign but we can only afford stencils for $$$k$$$ letters. Update the text of the sign to use only $$$k$$$ unique letters without changing the lengths of any of the words, so that we can subtly fix the sign later.

Illustration of Sample Input 1. You can do this!
Output a phrase using at most $$$k$$$ distinct letters, substituting as few from the original text as possible. If there are multiple possible answers, output any.
2 3good luck
lool lull
3 1this is hard
ssss ss ssss
1 6impossible
imbossibee
Charlie the CNC miller is a cad with a capital 'C'. He is going to clone a valuable statue of a famous voxel-based video game character, and you are going to help him.
The voxel shape is defined by three photos Charlie took, which have been traced into the form of simple, axis-aligned (but potentially concave) polygons representing front ($$$xy$$$), side ($$$zy$$$), and top ($$$xz$$$) views of the statue respectively.
The meaning of "axis-aligned" here is that every edge of every polygon is parallel with one of the $$$X$$$/$$$Y$$$/$$$Z$$$ axes.
Any 3-dimensional point not contained by all three polygon projections will be blasted out of existence leaving only the true form, which may consist of multiple pieces or no pieces at all.

Illustration of a complex statue.
Calculate the volume of the final statue.
The input consists of three lines of input, each giving one view as a two-dimensional, axis-aligned polygon in anti-clockwise order, with integer coordinates measured in centimetres.
It is guaranteed that for all adjacent vertices $$$a$$$ and $$$b$$$, $$$u_{ia} = u_{ib}$$$ or $$$v_{ia} = v_{ib}$$$. No three consecutive vertices are collinear.
Output the integer total volume of the resulting shape(s) in cubic centimetres.
4 0 0 10 0 10 10 0 104 5 7 15 7 15 15 5 154 11 6 11 12 6 12 6 6
72
The 5 Latin letters a-e have each been assigned a distinct digit between 0-9. Given an expression involving the sum of two numbers written as X+Y=Z (each number having the same number of digits, at most $$$1000$$$, including any leading zeroes), written using letter substitutions, print plausible values for the assignments of all $$$5$$$ letters in order from a-e as a string of $$$5$$$ characters.
For instance, given ab+ac=ca, you may choose to output 18364. Or, given aaa+bbb=eee, you may output 45789.
If no assignment is possible, output impossible.
Otherwise, output any string of $$$5$$$ distinct digits which gives plausible values for the letters $$$a$$$, $$$b$$$, $$$c$$$, $$$d$$$, and $$$e$$$ respectively.
ab+ac=ca
18305
aaaa+bbbb=eeee
34567
bba+bbc=bab
10987
Mickey has been enjoying sailing on the local lake, but now it's the end of the day and it's time to go back to dock to return the rental boat on time.
Find the shortest path from its current location to the one remaining egress point over water, staying within or passing along the coastline of the lake.
The lake is represented as a simple, potentially concave, polygon having vertices at integer coordinates, and with no $$$3$$$ consecutive vertices being collinear.
A triangulation of the lake into $$$(n-2)$$$ pieces is also provided.

Illustration of Sample Input 1.
The given triangles correspond to the polygon, thus cover the lake without any self-overlaps, holes, or other hazards.
Output the shortest distance from point $$$a$$$ to point $$$b$$$ without exiting the lake.
The output must be accurate to an absolute or relative error of $$$10^{-6}$$$.
8 3 70 010 010 22 22 410 410 60 61 2 31 3 41 4 84 5 85 7 85 6 7
18.246211251
14 1 9-3 -1-1 -1-1 -31 -31 -13 -13 11 11 35 35 5-1 5-1 1-3 11 2 146 8 133 4 59 12 138 9 136 13 142 5 145 6 1410 11 122 3 59 10 126 7 8
5.6568542495
Jeanne and her son Semi-Demi-John are engaged in the elderberry-wine making business.
The recipe requires, aside from a closely-guarded secret quantity of the letter $$$r$$$, strict proportions of $$$12$$$ parts fresh elderberries, $$$12$$$ parts brewing sugar, and $$$40$$$ parts water. As long as one or more ingredients are lacking, the team will place an order for as much extra as needed to make up the weight, and start again.
For instance:
| Phase | Eb (kg) | Su (kg) | $$$H_{2}O$$$ (kg) |
| Initial Stock | 18 | 9 | 100 |
| First Brewing Run | -9 | -9 | -30 |
| Remaining Stock (Stuck) | 9 | 0 | 70 |
| Sugar Order | 0 | +9 | 0 |
| Stock After First Order | 9 | 9 | 70 |
| Second Brewing Run | -9 | -9 | -30 |
| Remaining Stock (Stuck) | 0 | 0 | 40 |
| Berry + Sugar Order | +12 | +12 | 0 |
| Stock After Second Order | 12 | 12 | 40 |
| Final Brewing Run | -12 | -12 | -40 |
The input consists of one line containing three floating-point numbers $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \le a, b, c \le 10^{16}$$$): the number of kilograms of elderberries, sugar, and water respectively.
Output three floating-point numbers $$$a'$$$ $$$b'$$$ $$$c'$$$ giving the cumulative total quantities of elderberries, sugar, and water that will be ordered respectively.
The output must be accurate to an absolute or relative error of $$$10^{-6}$$$.
18 9 100
12 21 0
1.5 17 5
15.5 0 51.666667
3 4 7000000000000000
2099999999999997 2099999999999996 0
Your colleague Cynthia likes writing asides in messages (but then again, don't we all (and there's nothing strictly wrong with that anyway)). As some people find the text hard to read this way, we are going to try to extract some parts of the sentences out into equally-sized footnotes instead of brackets.
For example, this(complicated(nested(passage))) could become:
Given one such message, an unbroken string of up to $$$10^6$$$ characters (letters and brackets, without any spaces), isolate exactly two-thirds of the Latin letters into footnotes, each footnote containing exactly the same number of Latin letters.
It is guaranteed that the brackets in $$$s$$$ are properly matched and that the content of a pair of brackets is always non-empty.
Output three lines in the form shown above, using exactly two footnotes in square brackets to indicate where passages were relocated. If there is no way of doing this, output impossible instead.
Your answer will be tested by substituting the footnotes back (inside brackets) and comparing character-by-character with the original text.
(a(b(c(d(e(f(g(h(i)))))))))
(a(b(c[1]))) [1] d(e(f[2])) [2] g(h(i))
a(b)(b)(b)((cc))
impossible
a((b)(b))(b)((cc))
a[1](b)[2] [1] (b)(b) [2] (cc)
A piece of cheese with polygonal cross-sectional area is rolling along a flat surface as part of a major sporting event.
The piece of cheese rotates clockwise continuously, pivoting around the vertex with lowest $$$y$$$-coordinate and, in case of a tie, greatest x-coordinate.

Illustration of Sample Input 1.
The finish line is $$$m$$$ metres from the origin point and must be crossed at ground level, meaning that one of the vertices on the ground is strictly past the line.
How many revolutions does the piece of cheese make in order for at least one part touching the ground to be strictly past the line?
No three adjacent vertices on the shape are collinear and at least one vertex has $$$y = 0$$$. The cheese has not yet crossed the line.
Output the number of full $$$360$$$-degree rotations performed by the piece of cheese until it strictly crosses the line on the ground, rounded up to an integer.
4 100 03 01 10 3
1
4 10051 053 251 449 2
5
You are practicing a sequence of hops on a rather boring hopscotch track consisting of several consecutive cells in a straight line, spaced 1m apart.
You have a planned route of cell names to visit. The total hopping distance depends on how you assign these names to the physical positions ($$$1$$$ to $$$k$$$).
For example, to complete the route A, B, A, C with the layout [A, B, C, D, E], the hops take $$$1 + 1 + 2 = 4$$$ metres total.

Illustration of Sample Input 1.
Given your sequence of hops, determine how to arrange the names across the cells (left to right) to minimize the total hopping distance.
It is guaranteed that no more than $$$k$$$ distinct cell names are given.
Output $$$k$$$ strings of up to $$$10$$$ lower-case letters each: the names you want to assign to each cell from left to right. If there are multiple potential solutions, you may output any.
In case fewer than $$$k$$$ names are given in the input, feel free to invent more to fill the space.
5 4hop skip hop jump
anything jump hop skip something
9 16a b c a b c a x y z x y z e f g
g f e z y x a c b
Given an integer $$$n \gt 1$$$, and the equation: $$$$$$ \frac{1}{n}=\frac{1}{a}+ \frac{1}{b}$$$$$$ Find two distinct positive integers $$$a,b$$$ which both satisfy the above equation, and have a minimal sum $$$a+b$$$.
Output the best choices for $$$a$$$ and $$$b$$$ in ascending order.
4
6 12
107
108 11556
999999
1998000 2002000
1000000
1800000 2250000
Swimming for exercise involves assigning swimmers to lanes suited to their fitness level.
We know the velocity of each swimmer in metres per hour. The swimmers start in any order but inevitably they will eventually become stuck behind the slowest swimmer in the lane and start matching their pace.

Illustration of Sample Input 3.
If we can assign swimmers to $$$l$$$ lanes, how can we ensure that the average speed of all of the swimmers in the pool (measured in metres per hour) is as high as possible? Output this average speed and an assignment of swimmers to lanes.
Output the maximum achievable average speed (mean metres per hour) on one line, followed by a possible assignment of swimmers to lanes to achieve this on the next line. The $$$i$$$th integer on this line is the lane number for the $$$i$$$th swimmer, $$$1 \le a \le l$$$.
The output must be accurate to an absolute or relative error of $$$10^{-6}$$$.
3 2100 200 50
100 1 2 1
4 211 22 34 47
22.5 1 1 2 2
10 334 123 127 161 168 30 44 150 183 193
110.3 1 2 2 3 3 1 1 2 3 3
An image set to be painted onto a tartan canvas consists of $$$n$$$ rows of $$$m$$$ pixels with each colour represented as a lowercase letter of the alphabet.
You are going to paint the image using long brush strokes that cover either a whole row of $$$m$$$ pixels, or a whole column of $$$n$$$ pixels. Each brush stroke overwrites any pixels that were previously there. You must cover the whole canvas with brush strokes.
Is it possible to do so? If so, output a sequence of instructions of the form x=[1-m] [a-z] or y=[1-n] [a-z]. If there are multiple sequences, output any of the shortest possible lists of instructions.

Illustration of Sample Input 2.
On the first line, output the minimum number of instructions needed. If no sequence of instructions covers the canvas, output impossible and exit.
On each of the next lines, output one instruction to follow in order. For example, "x=5 z", and "y=100 b" are both valid instructions.
4 6aaaabaaaaabaaaaabaaaaaba
5 y=1 a y=2 a y=3 a y=4 a x=5 b
4 4laaqdaaqlaaqbbbq
6 x=1 l y=2 d x=2 a x=3 a y=4 b x=4 q
Lawn stripes are drawn using a roller to flatten grass blades in a particular direction and impart a sheen that, at a distance, is distinguishable from blades flattened in another direction. This is typically for aesthetic appeal.
We are going to draw lawn stripes in our square garden using a roller in any of the $$$4$$$ cardinal directions. The roller must stay on the lawn throughout. The final direction of a piece of lawn is determined by the last time the roller ran over it, including starting from or finishing there.

Illustration of Sample Input 1.
Given a description of the lawn and the starting point of the roller, determine how to draw the pattern.
If it is not possible to draw the pattern, output impossible. Otherwise, demonstrate a solution in under $$$10n^2$$$ moves by outputting the number of moves to use on one line, followed by the moves on the remaining lines.
Each move consists of a distance in metres $$$d$$$ and a direction from (l|r|u|d). A roller following the instructions must roll over every square metre without leaving the lawn.
41 4rrrdllllrrruulll
8 3 l 3 r 3 d 3 l 1 u 3 r 1 u 3 l
21 1rdul
impossible
We have a number of processor slots in a row. The processors are each dedicated to a single task that they can complete before going into a busy-looping mode while they wait for the next instruction.
A processor can run at 100% speed if it has enough cooling, and that requires there be no adjacent processor. If a processor has 1 adjacent processor, it only runs at 60% of maximum speed. If it has 2 adjacent processors it can only run at 30% of maximum speed.

Illustration of Sample Input 2.
We know how many seconds each task will take running on a processor at full speed, starting from $$$t=0$$$, and need to allocate tasks to processors to ensure the last task finishes as soon as possible.
Output the minimum time by which all of the tasks can be finished.
The output must be accurate to an absolute or relative error of $$$10^{-6}$$$.
4 51 1000 1 1
1000
7 105 2 3 5 4 6 7
8.33333333