apaz/codeforces-genesys huggingface dataset:
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 512.0 MB

# Problem
Pak Chanek is given an array $$$a$$$ of $$$n$$$ integers. For each $$$i$$$ ($$$1 \leq i \leq n$$$), Pak Chanek will write the one-element set $$$\{a_i\}$$$ on a whiteboard.

After that, in one operation, Pak Chanek may do the following:

1. Choose two different sets $$$S$$$ and $$$T$$$ on the whiteboard such that $$$S \cap T = \varnothing$$$ ($$$S$$$ and $$$T$$$ do not have any common elements).
2. Erase $$$S$$$ and $$$T$$$ from the whiteboard and write $$$S \cup T$$$ (the union of $$$S$$$ and $$$T$$$) onto the whiteboard.

After performing zero or more operations, Pak Chanek will construct a multiset $$$M$$$ containing the sizes of all sets written on the whiteboard. In other words, each element in $$$M$$$ corresponds to the size of a set after the operations.

How many distinct$$$^\dagger$$$ multisets $$$M$$$ can be created by this process? Since the answer may be large, output it modulo $$$998\,244\,353$$$.

$$$^\dagger$$$ Multisets $$$B$$$ and $$$C$$$ are different if and only if there exists a value $$$k$$$ such that the number of elements with value $$$k$$$ in $$$B$$$ is different than the number of elements with value $$$k$$$ in $$$C$$$.

## Input Format
The first line contains a single integer $$$n$$$ ($$$1 \le n \le 2000$$$).

The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \leq a_i \leq n$$$).

## Output Format
Output the number of distinct multisets $$$M$$$ modulo $$$998\,244\,353$$$.

## Examples
```input
6
1 1 2 1 4 3
```
```output
7
```
-----
```input
7
3 5 4 3 7 4 5
```
```output
11
```

## Note
In the first example, the possible multisets $$$M$$$ are $$$\{1,1,1,1,1,1\}$$$, $$$\{1,1,1,1,2\}$$$, $$$\{1,1,1,3\}$$$, $$$\{1,1,2,2\}$$$, $$$\{1,1,4\}$$$, $$$\{1,2,3\}$$$, and $$$\{2,2,2\}$$$.

As an example, let's consider a possible sequence of operations.

1. In the beginning, the sets are $$$\{1\}$$$, $$$\{1\}$$$, $$$\{2\}$$$, $$$\{1\}$$$, $$$\{4\}$$$, and $$$\{3\}$$$.
2. Do an operation on sets $$$\{1\}$$$ and $$$\{3\}$$$. Now, the sets are $$$\{1\}$$$, $$$\{1\}$$$, $$$\{2\}$$$, $$$\{4\}$$$, and $$$\{1,3\}$$$.
3. Do an operation on sets $$$\{2\}$$$ and $$$\{4\}$$$. Now, the sets are $$$\{1\}$$$, $$$\{1\}$$$, $$$\{1,3\}$$$, and $$$\{2,4\}$$$.
4. Do an operation on sets $$$\{1,3\}$$$ and $$$\{2,4\}$$$. Now, the sets are $$$\{1\}$$$, $$$\{1\}$$$, and $$$\{1,2,3,4\}$$$.
5. The multiset $$$M$$$ that is constructed is $$$\{1,1,4\}$$$.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 5.0 seconds
Memory limit: 512.0 MB

# Problem
Given a rooted tree, define the value of vertex $$$u$$$ in the tree recursively as the MEX$$$^\dagger$$$ of the values of its children. Note that it is only the children, not all of its descendants. In particular, the value of a leaf is $$$0$$$.

Pak Chanek has a rooted tree that initially only contains a single vertex with index $$$1$$$, which is the root. Pak Chanek is going to do $$$q$$$ queries. In the $$$i$$$-th query, Pak Chanek is given an integer $$$x_i$$$. Pak Chanek needs to add a new vertex with index $$$i+1$$$ as the child of vertex $$$x_i$$$. After adding the new vertex, Pak Chanek needs to recalculate the values of all vertices and report the sum of the values of all vertices in the current tree.

$$$^\dagger$$$ The MEX (minimum excluded) of an array is the smallest non-negative integer that does not belong to the array. For example, the MEX of $$$[0,1,1,2,6,7]$$$ is $$$3$$$ and the MEX of $$$[6,9]$$$ is $$$0$$$.

## Input Format
The first line contains a single integer $$$q$$$ ($$$1 \le q \le 3 \cdot 10^5$$$) — the number of operations.

Each of the next $$$q$$$ lines contains a single integer $$$x_i$$$ ($$$1 \leq x_i \leq i$$$) — the description of the $$$i$$$-th query.

## Output Format
For each query, print a line containing an integer representing the sum of the new values of all vertices in the tree after adding the vertex.

## Examples
```input
7
1
1
3
2
5
2
1
```
```output
1
1
3
2
4
4
7
```
-----
```input
8
1
1
1
1
5
6
7
8
```
```output
1
1
1
1
3
2
4
3
```

## Note
In the first example, the tree after the $$$6$$$-th query will look like this.

- Vertex $$$7$$$ is a leaf, so its value is $$$0$$$.
- Vertex $$$6$$$ is a leaf, so its value is $$$0$$$.
- Vertex $$$5$$$ only has a child with value $$$0$$$, so its value is $$$1$$$.
- Vertex $$$4$$$ is a leaf, so its value is $$$0$$$.
- Vertex $$$3$$$ only has a child with value $$$0$$$, so its value is $$$1$$$.
- Vertex $$$2$$$ has children with values $$$0$$$ and $$$1$$$, so its value is $$$2$$$.
- Vertex $$$1$$$ has children with values $$$1$$$ and $$$2$$$, so its value is $$$0$$$.

The sum of the values of all vertices is $$$0+0+1+0+1+2+0=4$$$.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 1.0 seconds
Memory limit: 256.0 MB

# Problem
You are given an integer $$$n$$$. Find a sequence of $$$n$$$ distinct integers $$$a_1, a_2, \dots, a_n$$$ such that $$$1 \leq a_i \leq 10^9$$$ for all $$$i$$$ and $$$$$$\max(a_1, a_2, \dots, a_n) - \min(a_1, a_2, \dots, a_n)= \sqrt{a_1 + a_2 + \dots + a_n}.$$$$$$

It can be proven that there exists a sequence of distinct integers that satisfies all the conditions above.

## Input Format
The first line of input contains $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases.

The first and only line of each test case contains one integer $$$n$$$ ($$$2 \leq n \leq 3 \cdot 10^5$$$) — the length of the sequence you have to find.

The sum of $$$n$$$ over all test cases does not exceed $$$3 \cdot 10^5$$$.

## Output Format
For each test case, output $$$n$$$ space-separated distinct integers $$$a_1, a_2, \dots, a_n$$$ satisfying the conditions in the statement.

If there are several possible answers, you can output any of them. Please remember that your integers must be distinct!

## Examples
```input
3
2
5
4
```
```output
3 1
20 29 18 26 28
25 21 23 31
```

## Note
In the first test case, the maximum is $$$3$$$, the minimum is $$$1$$$, the sum is $$$4$$$, and $$$3 - 1 = \sqrt{4}$$$.

In the second test case, the maximum is $$$29$$$, the minimum is $$$18$$$, the sum is $$$121$$$, and $$$29-18 = \sqrt{121}$$$.

For each test case, the integers are all distinct.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```python
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 512.0 MB

# Problem
You are given an integer $$$n$$$. You have to calculate the number of binary (consisting of characters 0 and/or 1) strings $$$s$$$ meeting the following constraints.

For every pair of integers $$$(i, j)$$$ such that $$$1 \le i \le j \le n$$$, an integer $$$a_{i,j}$$$ is given. It imposes the following constraint on the string $$$s_i s_{i+1} s_{i+2} \dots s_j$$$:

- if $$$a_{i,j} = 1$$$, all characters in $$$s_i s_{i+1} s_{i+2} \dots s_j$$$ should be the same;
- if $$$a_{i,j} = 2$$$, there should be at least two different characters in $$$s_i s_{i+1} s_{i+2} \dots s_j$$$;
- if $$$a_{i,j} = 0$$$, there are no additional constraints on the string $$$s_i s_{i+1} s_{i+2} \dots s_j$$$.

Count the number of binary strings $$$s$$$ of length $$$n$$$ meeting the aforementioned constraints. Since the answer can be large, print it modulo $$$998244353$$$.

## Input Format
The first line contains one integer $$$n$$$ ($$$2 \le n \le 100$$$).

Then $$$n$$$ lines follow. The $$$i$$$-th of them contains $$$n-i+1$$$ integers $$$a_{i,i}, a_{i,i+1}, a_{i,i+2}, \dots, a_{i,n}$$$ ($$$0 \le a_{i,j} \le 2$$$).

## Output Format
Print one integer — the number of strings meeting the constraints, taken modulo $$$998244353$$$.

## Examples
```input
3
1 0 2
1 0
1
```
```output
6
```
-----
```input
3
1 1 2
1 0
1
```
```output
2
```
-----
```input
3
1 2 1
1 0
1
```
```output
0
```
-----
```input
3
2 0 2
0 1
1
```
```output
0
```

## Note
In the first example, the strings meeting the constraints are 001, 010, 011, 100, 101, 110.

In the second example, the strings meeting the constraints are 001, 110.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```python
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 256.0 MB

# Problem
$$$2^n$$$ teams participate in a playoff tournament. The tournament consists of $$$2^n - 1$$$ games. They are held as follows: in the first phase of the tournament, the teams are split into pairs: team $$$1$$$ plays against team $$$2$$$, team $$$3$$$ plays against team $$$4$$$, and so on (so, $$$2^{n-1}$$$ games are played in that phase). When a team loses a game, it is eliminated, and each game results in elimination of one team (there are no ties). After that, only $$$2^{n-1}$$$ teams remain. If only one team remains, it is declared the champion; otherwise, the second phase begins, where $$$2^{n-2}$$$ games are played: in the first one of them, the winner of the game "$$$1$$$ vs $$$2$$$" plays against the winner of the game "$$$3$$$ vs $$$4$$$", then the winner of the game "$$$5$$$ vs $$$6$$$" plays against the winner of the game "$$$7$$$ vs $$$8$$$", and so on. This process repeats until only one team remains.

The skill level of the $$$i$$$-th team is $$$p_i$$$, where $$$p$$$ is a permutation of integers $$$1$$$, $$$2$$$, ..., $$$2^n$$$ (a permutation is an array where each element from $$$1$$$ to $$$2^n$$$ occurs exactly once).

You are given a string $$$s$$$ which consists of $$$n$$$ characters. These characters denote the results of games in each phase of the tournament as follows:

- if $$$s_i$$$ is equal to 0, then during the $$$i$$$-th phase (the phase with $$$2^{n-i}$$$ games), in each match, the team with the lower skill level wins;
- if $$$s_i$$$ is equal to 1, then during the $$$i$$$-th phase (the phase with $$$2^{n-i}$$$ games), in each match, the team with the higher skill level wins.

Let's say that an integer $$$x$$$ is winning if it is possible to find a permutation $$$p$$$ such that the team with skill $$$x$$$ wins the tournament. Find all winning integers.

## Input Format
The first line contains one integer $$$n$$$ ($$$1 \le n \le 18$$$).

The second line contains the string $$$s$$$ of length $$$n$$$ consisting of the characters 0 and/or 1.

## Output Format
Print all the winning integers $$$x$$$ in ascending order.

## Examples
```input
3
101
```
```output
4 5 6 7
```
-----
```input
1
1
```
```output
2
```
-----
```input
2
01
```
```output
2 3
```

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```python
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 256.0 MB

# Problem
Huh, is that it? Slightly disappointed, you boot up the game and click on the new gamemode. It says "Colored platforms".

There are $$$n$$$ platforms, numbered from $$$1$$$ to $$$n$$$, placed one after another. There are $$$m$$$ colors available in the game, numbered from $$$1$$$ to $$$m$$$. The $$$i$$$-th platform is colored $$$c_i$$$.

You start on the platform $$$1$$$ and want to reach platform $$$n$$$. In one move, you can jump from some platform $$$i$$$ to platforms $$$i + 1$$$ or $$$i + 2$$$.

All platforms are initially deactivated (including platforms $$$1$$$ and $$$n$$$). For each color $$$j$$$, you can pay $$$x_j$$$ coins to activate all platforms of that color.

You want to activate some platforms so that you could start on an activated platform $$$1$$$, jump through some activated platforms and reach an activated platform $$$n$$$.

What's the smallest amount of coins you can spend to achieve that?

## Input Format
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$2 \le n \le 3 \cdot 10^5$$$; $$$1 \le m \le 40$$$) — the number of platforms and the number of colors, respectively.

The second line contains $$$n$$$ integers $$$c_1, c_2, \dots, c_n$$$ ($$$1 \le c_i \le m$$$) — the colors of the platforms.

The third line contains $$$m$$$ integers $$$x_1, x_2, \dots, x_m$$$ ($$$1 \le x_i \le 10^7$$$) — the cost of activating all platforms of each color.

## Output Format
Print the smallest amount of coins you can spend to activate some platforms so that you could start on an activated platform $$$1$$$, jump through some activated platforms and reach an activated platform $$$n$$$.

## Examples
```input
5 3
1 3 2 3 1
1 10 100
```
```output
11
```
-----
```input
5 3
1 3 2 3 1
1 200 20
```
```output
21
```
-----
```input
4 2
2 2 1 1
5 5
```
```output
10
```
-----
```input
10 10
3 8 6 2 10 5 2 3 7 3
9 7 4 2 1 8 2 6 2 2
```
```output
15
```

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 512.0 MB

# Problem
Колонна из $$$n$$$ самокатов едет по узкой односторонней дороге в пункт Б. Самокаты пронумерованы от $$$1$$$ до $$$n$$$. Для каждого самоката $$$i$$$ известно, что текущее расстояние от него до пункта Б равно $$$a_i$$$ метров. При этом $$$a_1 < a_2 < \ldots < a_n$$$, в частности, самокат $$$1$$$ находится ближе всего к пункту Б, а самокат $$$n$$$ — дальше всего.

Самокат с номером $$$i$$$ движется в сторону пункта Б со скоростью $$$i$$$ метров в секунду (то есть чем ближе самокат в колонне к пункту Б, тем медленнее он едет). Так как дорога узкая, самокаты не могут обгонять друг друга. Более того, соседние самокаты в колонне должны соблюдать дистанцию хотя бы в $$$1$$$ метр. Поэтому когда более быстрый самокат догоняет более медленный, более быстрому приходится дальше ехать со скоростью более медленного, причём на расстоянии в $$$1$$$ метр от него.

Определите, на каком расстоянии до пункта Б будет каждый самокат ровно через одну секунду.

## Input Format
В первой строке задано одно целое число $$$n$$$ ($$$1 \le n \le 100$$$) — число самокатов в колонне.

В $$$i$$$-й из следующих $$$n$$$ строк задано одно целое число $$$a_i$$$ ($$$1 \le a_i \le 1000$$$; $$$a_1 < a_2 < \ldots < a_n$$$) — текущее расстояние от самоката $$$i$$$ до пункта Б в метрах.

## Output Format
Выведите $$$n$$$ целых чисел — расстояния от самокатов $$$1, 2, \ldots, n$$$ до пункта Б в метрах через одну секунду.

## Examples
```input
4
20
30
50
100
```
```output
19
28
47
96
```
-----
```input
5
1
2
3
4
5
```
```output
0
1
2
3
4
```
-----
```input
8
5
9
10
15
17
18
19
22
```
```output
4
7
8
11
12
13
14
15
```

## Note
В первом тесте самокаты пока не мешают друг другу ехать, поэтому каждый самокат $$$i$$$ продвигается на $$$i$$$ метров в сторону пункта Б.

Во втором тесте самокаты уже выстроились в колонне на расстоянии $$$1$$$ метр друг от друга и вынуждены ехать со скоростью самого медленного самоката с номером $$$1$$$.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 512.0 MB

# Problem
В этой версии задачи размеры копируемых файлов не превышают $$$1000$$$ байт.

Вы копируете с одного сервера на другой $$$n$$$ файлов размером $$$a_1, a_2, \ldots, a_n$$$ байт. Файлы копируются последовательно в заданном порядке.

При копировании вы видите два прогресс-бара: первый показывает процент скопированных данных в текущем файле, а второй — общий процент скопированных данных по всем $$$n$$$ файлам. Оба процента отображаются округлёнными вниз до целого числа. Значения на прогресс-барах обновляются после копирования каждого байта.

Формально, после копирования байта номер $$$x$$$ из файла номер $$$i$$$ первый прогресс-бар показывает $$$\lfloor \frac{100 \cdot x}{a_i} \rfloor$$$ процентов, а второй — $$$\lfloor \frac{100 \cdot (a_1 + a_2 + \ldots + a_{i - 1} + x)}{a_1 + a_2 + \ldots + a_n} \rfloor$$$ процентов. В самом начале копирования оба прогресс-бара показывают $$$0$$$ процентов.

Найдите все такие целые числа от $$$0$$$ до $$$100$$$ включительно, что существует момент времени, в который оба прогресс-бара одновременно показывают это число. Выведите эти числа в порядке возрастания.

## Input Format
В первой строке задано одно целое число $$$n$$$ ($$$1 \le n \le 100$$$) — число копируемых файлов.

Во второй строке заданы $$$n$$$ целых чисел $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 1000$$$) — размеры файлов в байтах в том порядке, в котором они будут копироваться.

## Output Format
Выведите в возрастающем порядке все числа от $$$0$$$ до $$$100$$$ включительно такие, что существует момент времени, в который на обоих прогресс-барах одновременно показывается это число.

## Examples
```input
1
6
```
```output
0
16
33
50
66
83
100
```
-----
```input
2
100 500
```
```output
0
95
96
97
98
99
100
```
-----
```input
4
1000 2 2 998
```
```output
0
50
99
100
```
-----
```input
6
170 130 400 256 30 100
```
```output
0
17
43
44
84
90
99
100
```

## Note
В первом тесте копируется всего один файл, поэтому оба прогресс-бара всегда показывают одинаковые значения.

Во втором тесте первый прогресс-бар сразу же уйдёт вперёд, потом сбросится в ноль и начнёт догонять второй прогресс-бар заново. В конце копирования прогресс-бары некоторое время будут показывать одно и то же число.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in c++17.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```cpp
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 512.0 MB

# Problem
В этой версии задачи размеры копируемых файлов не превышают $$$10^{10}$$$ байт.

Вы копируете с одного сервера на другой $$$n$$$ файлов размером $$$a_1, a_2, \ldots, a_n$$$ байт. Файлы копируются последовательно в заданном порядке.

При копировании вы видите два прогресс-бара: первый показывает процент скопированных данных в текущем файле, а второй — общий процент скопированных данных по всем $$$n$$$ файлам. Оба процента отображаются округлёнными вниз до целого числа. Значения на прогресс-барах обновляются после копирования каждого байта.

Формально, после копирования байта номер $$$x$$$ из файла номер $$$i$$$ первый прогресс-бар показывает $$$\lfloor \frac{100 \cdot x}{a_i} \rfloor$$$ процентов, а второй — $$$\lfloor \frac{100 \cdot (a_1 + a_2 + \ldots + a_{i - 1} + x)}{a_1 + a_2 + \ldots + a_n} \rfloor$$$ процентов. В самом начале копирования оба прогресс-бара показывают $$$0$$$ процентов.

Найдите все такие целые числа от $$$0$$$ до $$$100$$$ включительно, что существует момент времени, в который оба прогресс-бара одновременно показывают это число. Выведите эти числа в порядке возрастания.

## Input Format
В первой строке задано одно целое число $$$n$$$ ($$$1 \le n \le 100$$$) — число копируемых файлов.

Во второй строке заданы $$$n$$$ целых чисел $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 10^{10}$$$) — размеры файлов в байтах в том порядке, в котором они будут копироваться.

## Output Format
Выведите в возрастающем порядке все числа от $$$0$$$ до $$$100$$$ включительно такие, что существует момент времени, в который на обоих прогресс-барах одновременно показывается это число.

## Examples
```input
1
6
```
```output
0
16
33
50
66
83
100
```
-----
```input
2
100 500
```
```output
0
95
96
97
98
99
100
```
-----
```input
4
10000000000 2 2 9999999998
```
```output
0
50
99
100
```
-----
```input
6
170 130 400 256 30 100
```
```output
0
17
43
44
84
90
99
100
```

## Note
В первом тесте копируется всего один файл, поэтому оба прогресс-бара всегда показывают одинаковые значения.

Во втором тесте первый прогресс-бар сразу же уйдёт вперёд, потом сбросится в ноль и начнёт догонять второй прогресс-бар заново. В конце копирования прогресс-бары некоторое время будут показывать одно и то же число.

Обратите внимание, что третий тест в этой версии задачи отличается от третьего теста в предыдущей версии задачи.

Now solve the problem and return the code.