yl-9/probench huggingface dataset:
# Shohag Loves Mod

## Problem Description

Shohag has an integer $ n $ . Please help him find an increasing integer sequence $ 1 \le a_1 \lt a_2 \lt \ldots \lt a_n \le 100 $ such that $ a_i \bmod i \neq a_j \bmod j $ $ ^{\text{∗}} $ is satisfied over all pairs $ 1 \le i \lt j \le n $ .

It can be shown that such a sequence always exists under the given constraints.

 $ ^{\text{∗}} $ $ a \bmod b $ denotes the remainder of $ a $ after division by $ b $ . For example, $ 7 \bmod 3 = 1, 8 \bmod 4 = 0 $ and $ 69 \bmod 10 = 9 $ .

## Input Format

The first line contains a single integer $ t $ ( $ 1 \le t \le 50 $ ) — the number of test cases.

The first and only line of each test case contains an integer $ n $ ( $ 2 \le n \le 50 $ ).

## Output Format

For each test case, print $ n $ integers — the integer sequence that satisfies the conditions mentioned in the statement. If there are multiple such sequences, output any.

## Sample #1

### Sample Input #1

```
2
3
6
```

### Sample Output #1

```
2 7 8
2 3 32 35 69 95
```

## Hint

In the first test case, the sequence is increasing, values are from $ 1 $ to $ 100 $ and each pair of indices satisfies the condition mentioned in the statement:

- For pair $ (1, 2) $ , $ a_1 \bmod 1 = 2 \bmod 1 = 0 $ , and $ a_2 \bmod 2 = 7 \bmod 2 = 1 $ . So they are different.
- For pair $ (1, 3) $ , $ a_1 \bmod 1 = 2 \bmod 1 = 0 $ , and $ a_3 \bmod 3 = 8 \bmod 3 = 2 $ . So they are different.
- For pair $ (2, 3) $ , $ a_2 \bmod 2 = 7 \bmod 2 = 1 $ , and $ a_3 \bmod 3 = 8 \bmod 3 = 2 $ . So they are different.

Note that you do not necessarily have to print the exact same sequence, you can print any other sequence as long as it satisfies the necessary conditions.

## Limit



Time Limit
1.00s

Memory Limit
250.00MB

Tags: constructive algorithms, number theory
Difficulty: 800
# Fixing the Expression

## Problem Description

An expression is a string consisting of three characters, where the first and the last characters are digits (from $ 0 $ to $ 9 $ ), and the middle character is a comparison symbol (&lt;, = or &gt;).

An expression is true if the comparison symbol matches the digits (for example, if the first digit is strictly less than the last digit, the comparison symbol should be &lt;).

For example, the expressions 1&lt;3, 4&gt;2, 0=0 are true, while 5&gt;5, 7&lt;3 are not.

You are given a string $ s $ , which is an expression. Change as few characters as possible so that $ s $ becomes a true expression. Note that if $ s $ is already true, you should leave it as it is.

## Input Format

The first line contains one integer $ t $ ( $ 1 \le t \le 300 $ ) — the number of test cases.

Each test case consists of one line containing the string $ s $ ( $ |s| = 3 $ , the first and the last characters of $ s $ are digits, the second character is a comparison symbol).

## Output Format

For each test case, print a string consisting of $ 3 $ characters — a true expression which can be obtained by changing as few characters as possible in $ s $ . If there are multiple answers, print any of them.

## Sample #1

### Sample Input #1

```
5
3&lt;7
3&gt;7
8=9
0=0
5&lt;3
```

### Sample Output #1

```
3&lt;7
8&gt;7
8&lt;9
0=0
0&lt;3
```

## Limit



Time Limit
2.00s

Memory Limit
500.00MB

Tags: implementation
Difficulty: 800
# Royal Flush

## Problem Description

Consider the following game. There is a deck, which consists of cards of $ n $ different suits. For each suit, there are $ 13 $ cards in the deck, all with different ranks (the ranks are $ 2 $ , $ 3 $ , $ 4 $ , ..., $ 10 $ , Jack, Queen, King and Ace).

Initially, the deck is shuffled randomly (all $ (13n)! $ possible orders of cards have the same probability). You draw $ 5 $ topmost cards from the deck. Then, every turn of the game, the following events happen, in the given order:

1. if the cards in your hand form a Royal Flush (a $ 10 $ , a Jack, a Queen, a King, and an Ace, all of the same suit), you win, and the game ends;
2. if you haven't won yet, and the deck is empty, you lose, and the game ends;
3. if the game hasn't ended yet, you may choose any cards from your hand (possibly, all of them) and discard them. When a card is discarded, it is removed from the game;
4. finally, you draw cards from the deck, until you have $ 5 $ cards or the deck becomes empty.

Your goal is to find a strategy that allows you to win in the minimum expected number of turns. Note that the turn when the game ends is not counted (for example, if the $ 5 $ cards you draw initially already form a Royal Flush, you win in $ 0 $ turns).

Calculate the minimum possible expected number of turns required to win the game.

## Input Format

The only line contains one integer $ n $ ( $ 1 \le n \le 4 $ ) — the number of suits used in the game.

## Output Format

Print the minimum expected number of turns.

Your answer will be considered correct if its absolute or relative error does not exceed $ 10^{-6} $ . Formally, let your answer be $ a $ , and the jury's answer be $ b $ . Your answer will be accepted if and only if $ \frac{|a - b|}{\max{(1, |b|)}} \le 10^{-6} $ .

## Sample #1

### Sample Input #1

```
1
```

### Sample Output #1

```
3.598290598
```

## Sample #2

### Sample Input #2

```
2
```

### Sample Output #2

```
8.067171309
```

## Limit



Time Limit
3.00s

Memory Limit
500.00MB

Tags: dp, implementation
Difficulty: 2800
# Bridge Renovation

## Problem Description

Recently, Monocarp started working as a director of a park located near his house. The park is quite large, so it even has a small river splitting it into several zones. Several bridges are built across this river. Three of these bridges are especially old and need to be repaired.

All three bridges have the same length but differ in width. Their widths are $ 18 $ , $ 21 $ and $ 25 $ units, respectively.

During the park renovation process, Monocarp has to replace the old planks that served as the surface of the bridges with the new ones.

 ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF2038L/85af0decbad9801e010ac724aebc06474601925e.png)Planks are sold with a standard length of $ 60 $ units. Monocarp already knows that he needs $ n $ planks for each bridge. But since the bridges have different widths, he needs $ n $ planks of length $ 18 $ for the first bridge, $ n $ planks of length $ 21 $ for the second one, and $ n $ planks of length $ 25 $ for the last one.

Workers in charge of renovation have no problem with cutting planks into parts but refuse to join planks, since it creates weak spots and looks ugly.

Monocarp wants to buy as few planks as possible but struggles to calculate the required number of planks. Can you help him?

## Input Format

The first and only line contains a single integer $ n $ ( $ 1 \le n \le 1000 $ ) — the number of planks required for each of the three bridges.

## Output Format

Print a single integer — the minimum number of planks of standard length ( $ 60 $ units) Monocarp needs to cover all three bridges if the planks can be cut into parts.

## Sample #1

### Sample Input #1

```
1
```

### Sample Output #1

```
2
```

## Sample #2

### Sample Input #2

```
3
```

### Sample Output #2

```
4
```

## Sample #3

### Sample Input #3

```
1000
```

### Sample Output #3

```
1167
```

## Hint

In the first example, it is possible to cut one plank of length $ 60 $ into three planks with lengths $ 25 $ , $ 18 $ and $ 17 $ , and cut another plank of length $ 60 $ into two planks with lengths $ 39 $ and $ 21 $ . That way, Monocarp will have all the required planks.

## Limit



Time Limit
2.00s

Memory Limit
500.00MB

Tags: brute force, dp, greedy, math, two pointers
Difficulty: 1400
# Grid Walk

## Problem Description

You have an $ n \times n $ grid and two integers $ a $ and $ b $ . Both the rows and the columns are numbered from $ 1 $ to $ n $ . Let's denote the cell at the intersection of the $ i $ -th row and the $ j $ -th column as $ (i, j) $ .

You are standing in the cell $ (1, 1) $ and want to move into the cell $ (n, n) $ .

Suppose you are in the cell $ (i, j) $ ; in one step, you can move either into the cell $ (i, j + 1) $ or into the cell $ (i + 1, j) $ if the corresponding cells exist.

Let's define the cost of the cell $ (i, j) $ as $ c(i, j) = \gcd(i, a) + \gcd(j, b) $ (here, $ \gcd(x,y) $ denotes the greatest common divisor of $ x $ and $ y $ ). The cost of the route from $ (1, 1) $ to $ (n, n) $ is the sum of costs of the visited cells (including the starting cell and the finishing cell).

 ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF2038K/4ad33fd068826451fb7110dfa133cde2efb273fa.png)Find the route with minimum possible cost and print its cost.

## Input Format

The only line contains three integers $ n $ , $ a $ , and $ b $ ( $ 2 \le n \le 10^6 $ ; $ 1 \le a, b \le 10^6 $ ).

## Output Format

Print one integer — the cost of the cheapest route from $ (1, 1) $ to $ (n, n) $ .

## Sample #1

### Sample Input #1

```
4 2 4
```

### Sample Output #1

```
21
```

## Sample #2

### Sample Input #2

```
10 210 420
```

### Sample Output #2

```
125
```

## Hint

The first example is described in the picture above.

## Limit



Time Limit
2.00s

Memory Limit
500.00MB

Tags: brute force, dp, greedy, math, number theory
Difficulty: 2100
# Waiting for...

## Problem Description

Monocarp is waiting for a bus at the bus stop. Unfortunately, there are many people who want to ride a bus too.

You are given a list of events of two types:

- B $ b_i $ — a bus with $ b_i $ free seats arrives at the stop;
- P $ p_i $ — $ p_i $ people arrive at the stop.

These events are listed in a chronological order.

When a bus arrives, the following happens. All people at the bus stop (except for Monocarp) try to enter the bus. If there are enough free seats for all of them, then they all enter the bus. Otherwise, some people remain at the bus stop (the number of people who enter the bus is equal to the number of free seats).

If there is still at least one free seat after all people (except for Monocarp) enter the bus, then Monocarp can decide to enter this bus as well (but he might choose to wait for another bus). For each bus, you have to determine if it is possible for Monocarp to take that bus.

## Input Format

The first line contains one integer $ n $ $ (1 \le n \le 10^3) $ — the number of events.

Then, $ n $ lines follow. The $ i $ -th of them contains the description of the $ i $ -th event in one of the two following formats:

- B $ b_i $ ( $ 1 \le b_i \le 10^6 $ ) — a bus with $ b_i $ free seats arrives at the stop;
- P $ p_i $ ( $ 1 \le p_i \le 10^6 $ ) — $ p_i $ people arrive at the stop.

Additional constraint on the input: there is at least one event of type B.

## Output Format

For each event of type B, print YES if it is possible for Monocarp to take the corresponding bus, or NO otherwise (case-insensitive).

## Sample #1

### Sample Input #1

```
10
P 2
P 5
B 8
P 14
B 5
B 9
B 3
P 2
B 1
B 2
```

### Sample Output #1

```
YES
NO
NO
YES
NO
YES
```

## Limit



Time Limit
2.00s

Memory Limit
500.00MB

Tags: greedy, implementation
Difficulty: 800
# Polyathlon

## Problem Description

Berland is this year's host country of the International Collegiate Polyathlon Competition! Similar to biathlon being a competition of two sports, polyathlon is a competition of many sports. This year, there are $ m $ sports. Also, there are $ n $ participants in the event. The sports are numbered from $ 1 $ to $ m $ , and the participants are numbered from $ 1 $ to $ n $ .

Some participants are skilled in multiple sports. You are given a binary matrix $ n \times m $ such that the $ j $ -th character of the $ i $ -th row is 1 if the $ i $ -th participant is skilled in the $ j $ -th sport, and 0, otherwise. It's also known that, for each pair of participants, there exists at least one sport such that one of them is skilled in that sport and the other one isn't.

The order of sports in the competition is determined at the opening ceremony. Historically, it's done by the almighty Random Number Generator. A random number $ x $ from $ 1 $ to $ m $ is rolled. The competition then starts with the sport $ x $ , then the sport $ (x \bmod m + 1) $ is played, then the sport $ ((x + 1) \bmod m + 1) $ , and so on.

Each sport is played as follows. If all remaining participants (all participants which are not eliminated yet) are not skilled in that sport, everyone goes through to the next sport. Otherwise, all skilled participants go through to the next sport, and all unskilled participants are eliminated from the competition. Once there is a single participant remaining in the competition, the competition ends, and that participant is declared the winner.

As an organizer of the competition, you are curious of the possible outcomes of the competition beforehand (not that you are going to rig the random roll, how could you possibly think that...). For each sport $ x $ , print the index of the winner if the competition starts with the sport $ x $ .

## Input Format

The first line contains two integers $ n $ and $ m $ ( $ 2 \le n, m \le 10^6 $ ; $ n \le 2^m $ ; $ nm \le 2 \cdot 10^6 $ ) — the number of participants and the number of sports, respectively.

The $ i $ -th of the next $ n $ lines contains a binary string consisting of exactly $ m $ characters 0 or 1 — the skillset of the $ i $ -th participant. If the $ j $ -th character is 1, the $ i $ -th participant is skilled in the $ j $ -th sport. If it's 0, the $ i $ -th participant is not skilled in the $ j $ -th sport.

Additional constraint on the input: for each pair of participants, there exists at least one sport such that one of them is skilled in that sport and the other one isn't. In other words, all $ n $ binary strings are pairwise distinct.

## Output Format

Print $ m $ integers. For each $ x $ from $ 1 $ to $ m $ , print the index of the winner if the competition starts with the sport $ x $ .

## Sample #1

### Sample Input #1

```
3 5
10010
01100
10101
```

### Sample Output #1

```
3 2 3 1 3
```

## Limit



Time Limit
3.00s

Memory Limit
500.00MB

Tags: binary search, data structures, hashing, string suffix structures, strings
Difficulty: 2500
# Galactic Council

## Problem Description

Monocarp plays a computer game. In this game, he maintains a space empire. The empire is governed by $ n $ political parties. Initially, every party has political power equal to $ 0 $ , and there is no ruling party.

During each of the next $ m $ turns, the following happens:

1. initially, Monocarp has to choose which party he supports. He can support any party, except for the ruling party. When Monocarp supports a party, its political power is increased by $ 1 $ . If Monocarp supports the $ i $ -th party during the $ j $ -th turn, his score increases by $ a_{i,j} $ points;
2. then, the elections happen, and the party with the maximum political power is chosen as the ruling party (if there are multiple such parties, the party with the lowest index among them is chosen). The former ruling party is replaced, unless it is chosen again;
3. finally, an event happens. At the end of the $ j $ -th turn, the party $ p_j $ must be the ruling party to prevent a bad outcome of the event, otherwise Monocarp loses the game.

Determine which party Monocarp has to support during each turn so that he doesn't lose the game due to the events, and the score he achieves is the maximum possible. Initially, Monocarp's score is $ 0 $ .

## Input Format

The first line contains two integers $ n $ and $ m $ ( $ 2 \le n, m \le 50 $ ) — the number of political parties and the number of turns, respectively.

The second line contains $ m $ integers $ p_1, p_2, \dots, p_m $ ( $ 1 \le p_j \le n $ ), where $ p_j $ is the index of the party which should be the ruling party at the end of the $ j $ -th turn.

Then $ n $ lines follow. The $ i $ -th of them contains $ m $ integers $ a_{i,1}, a_{i,2}, \dots, a_{i,m} $ ( $ 1 \le a_{i,j} \le 10^5 $ ), where $ a_{i,j} $ is the amount of points Monocarp gets if he supports the $ i $ -th party during the $ j $ -th turn.

## Output Format

If Monocarp loses the game no matter how he acts, print one integer $ -1 $ .

Otherwise, print $ m $ integers $ c_1, c_2, \dots, c_m $ ( $ 1 \le c_j \le n $ ), where $ c_j $ is the index of the party Monocarp should support during the $ j $ -th turn. If there are multiple answers, print any of them.

## Sample #1

### Sample Input #1

```
2 3
2 1 2
1 2 3
4 5 6
```

### Sample Output #1

```
2 1 2
```

## Sample #2

### Sample Input #2

```
3 5
1 1 1 2 1
1 1 1 1 1
10 5 7 8 15
7 10 9 8 15
```

### Sample Output #2

```
1 3 2 2 1
```

## Sample #3

### Sample Input #3

```
3 5
1 1 1 1 1
1 1 1 1 1
10 5 7 8 15
7 10 9 8 15
```

### Sample Output #3

```
-1
```

## Limit



Time Limit
3.00s

Memory Limit
500.00MB

Tags: flows
Difficulty: 3000
# Alternative Platforms

## Problem Description

Suppose you are working in the Ministry of Digital Development of Berland, and your task is to monitor the industry of video blogging.

There are $ n $ bloggers in Berland. Recently, due to the poor state of the main video platform in Berland, two alternative platforms were introduced. That's why bloggers started to reupload their videos to these alternative platforms. You've got the statistics that the $ i $ -th blogger uploaded $ v_i $ videos to the first alternative platform and $ r_i $ videos to the second alternative platform.

You think that a potential user will be upset if even at least one of his favorite bloggers doesn't upload anything. However, if a blogger uploads videos to both platforms, the user will watch that blogger on the platform where more videos are available. So, you've come up with the following function to estimate user experience. Suppose a user watches $ k $ bloggers $ b_1, b_2, \dots, b_k $ ; then, let user experience be $ $$$E(b_1, \dots, b_k) = \max\left(\min_{i=1..k}{v[b_i]}, \min_{i=1..k}{r[b_i]}\right). $ $ </p><p>In order to get some statistics, you want to calculate the value  $ \\mathit{avg}\_k $  that is equal to an average experience among all subsets of bloggers of size  $ k $ . Also, you have to calculate  $ \\mathit{avg}\_k $  for each  $ k $  from  $ 1 $  to  $ n $ .</p><p>Since answers may be too large, print them modulo  $ 998\\,244\\,353$$$.

## Input Format

The first line contains a single integer $ n $ ( $ 1 \le n \le 2 \cdot 10^5 $ ) — the number of bloggers.

The second line contains $ n $ integers $ v_1, v_2, \dots, v_n $ ( $ 0 \le v_i \le 10^6 $ ), where $ v_i $ is the number of videos of the $ i $ -th blogger on the first alternative platform.

The third line contains $ n $ integers $ r_1, r_2, \dots, r_n $ ( $ 0 \le r_i \le 10^6 $ ), where $ r_i $ is the number of videos of the $ i $ -th blogger on the second alternative platform.

## Output Format

Print $ n $ integers $ \mathit{avg}_1, \mathit{avg}_2, \dots, \mathit{avg}_n $ .

It can be proven that $ \mathit{avg}_k $ may be represented as an irreducible fraction $ \dfrac{x}{y} $ where $ y \not\equiv 0 \pmod{998\,244\,353} $ . So, print $ \mathit{avg}_k $ in a form $ x \cdot y^{-1} \bmod 998\,244\,353 $ .

## Sample #1

### Sample Input #1

```
3
2 1 2
1 2 1
```

### Sample Output #1

```
2 332748119 1
```

## Sample #2

### Sample Input #2

```
4
5 5 5 5
0 0 0 0
```

### Sample Output #2

```
5 5 5 5
```

## Sample #3

### Sample Input #3

```
5
1 9 3 7 5
2 4 6 8 5
```

### Sample Output #3

```
6 4 3 199648873 2
```

## Hint

In the first example, $ 332748119 $ is $ \frac{4}{3} $ . In the third example, $ 199648873 $ is $ \frac{12}{5} $ .

## Limit



Time Limit
2.00s

Memory Limit
500.00MB

Tags: combinatorics, data structures, fft, math, sortings
Difficulty: 2500
# Divide OR Conquer

## Problem Description

You are given an array $ [a_1, a_2, \ldots a_n] $ consisting of integers between $ 0 $ and $ 10^9 $ . You have to split this array into several segments (possibly one) in such a way that each element belongs to exactly one segment.

Let the first segment be the array $ [a_{l_1}, a_{l_1 + 1}, \ldots, a_{r_1}] $ , the second segment be $ [a_{l_2}, a_{l_2+ 1}, \ldots, a_{r_2}] $ , ..., the last segment be $ [a_{l_k}, a_{l_k+ 1}, \ldots, a_{r_k}] $ . Since every element should belong to exactly one array, $ l_1 = 1 $ , $ r_k = n $ , and $ r_i + 1 = l_{i+1} $ for each $ i $ from $ 1 $ to $ k-1 $ . The split should meet the following condition: $ f([a_{l_1}, a_{l_1 + 1}, \ldots, a_{r_1}]) \le f([a_{l_2}, a_{l_2+ 1}, \ldots, a_{r_2}]) \le \dots \le f([a_{l_k}, a_{l_k+1}, \ldots, a_{r_k}]) $ , where $ f(a) $ is the bitwise OR of all elements of the array $ a $ .

Calculate the number of ways to split the array, and print it modulo $ 998\,244\,353 $ . Two ways are considered different if the sequences $ [l_1, r_1, l_2, r_2, \ldots, l_k, r_k] $ denoting the splits are different.

## Input Format

The first line contains an integer $ n $ ( $ 1 \le n \le 2 \cdot 10^5 $ ) — the length of the array $ a $ .

The second line contains $ n $ integers $ a_1, a_2, \ldots, a_n $ ( $ 0 \le a_i \le 10 ^9 $ ) — the elements of the given array.

## Output Format

Print one integer — the number of ways to split the array, taken modulo $ 998\,244\,353 $ .

## Sample #1

### Sample Input #1

```
3
1 2 3
```

### Sample Output #1

```
4
```

## Sample #2

### Sample Input #2

```
5
1000 1000 1000 1000 1000
```

### Sample Output #2

```
16
```

## Sample #3

### Sample Input #3

```
3
3 4 6
```

### Sample Output #3

```
3
```

## Hint

In the first two examples, every way to split the array is valid.

In the third example, there are three valid ways to split the array:

- $ k = 3 $ ; $ l_1 = 1, r_1 = 1, l_2 = 2, r_2 = 2, l_3 = 3, r_3 = 3 $ ; the resulting arrays are $ [3] $ , $ [4] $ , $ [6] $ , and $ 3 \le 4 \le 6 $ ;
- $ k = 2 $ ; $ l_1 = 1, r_1 = 1, l_2 = 2, r_2 = 3 $ ; the resulting arrays are $ [3] $ and $ [4, 6] $ , and $ 3 \le 6 $ ;
- $ k = 1 $ ; $ l_1 = 1, r_1 = 3 $ ; there will be only one array: $ [3, 4, 6] $ .

If you split the array into two arrays $ [3, 4] $ and $ [6] $ , the bitwise OR of the first array is $ 7 $ , and the bitwise OR of the second array is $ 6 $ ; $ 7 > 6 $ , so this way to split the array is invalid.

## Limit



Time Limit
3.00s

Memory Limit
500.00MB

Tags: binary search, bitmasks, data structures, dp, implementation
Difficulty: 2400
# DIY

## Problem Description

You are given a list of $ n $ integers $ a_1, a_2, \dots, a_n $ . You need to pick $ 8 $ elements from the list and use them as coordinates of four points. These four points should be corners of a rectangle which has its sides parallel to the coordinate axes. Your task is to pick coordinates in such a way that the resulting rectangle has the maximum possible area. The rectangle can be degenerate, i. e. its area can be $ 0 $ . Each integer can be used as many times as it occurs in the list (or less).

## Input Format

The first line contains one integer $ t $ ( $ 1 \le t \le 25\,000 $ ) — the number of test cases.

The first line of each test case contains one integer $ n $ ( $ 8 \le n \le 2 \cdot 10^5 $ ).

The second line of each test case contains $ n $ integers $ a_1, a_2, \dots, a_n $ ( $ -10^9 \le a_i \le 10^9 $ ).

Additional constraint on the input: the sum of $ n $ over all test cases does not exceed $ 2 \cdot 10^5 $ .

## Output Format

For each test case, print the answer as follows:

- if it is impossible to construct a rectangle which meets the constraints from the statement, print a single line containing the word NO (case-insensitive);
- otherwise, in the first line, print YES (case-insensitive). In the second line, print $ 8 $ integers $ x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 $ — the coordinates of the corners of the rectangle. You can print the corners in any order.

## Sample #1

### Sample Input #1

```
3
16
-5 1 1 2 2 3 3 4 4 5 5 6 6 7 7 10
8
0 0 -1 2 2 1 1 3
8
0 0 0 0 0 5 0 5
```

### Sample Output #1

```
YES
1 2 1 7 6 2 6 7
NO
YES
0 0 0 5 0 0 0 5
```

## Limit



Time Limit
2.00s

Memory Limit
500.00MB

Tags: data structures, geometry, greedy, sortings
Difficulty: 1400