**Hello, Codeforces!**

On Sep/12/2021 17:35 (Moscow time) we will host Codeforces Global Round 16.

It is the fourth round of a 2021 series of Codeforces Global Rounds. The rounds are open and rated for everybody.

The prizes for this round:

- 30 best participants get a t-shirt.
- 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive.

The prizes for the 6-round series in 2021:

- In each round top-100 participants get points according to the table.
- The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest.
- The best 20 participants over all series get sweatshirts and place certificates.

Thanks to XTX, which in 2021 supported the global rounds initiative!

The problems were written and prepared by shishin and Artyom123.

We would like to thank these people:

- isaf27, the one who did a lot of things for the round to happen
- Shinchan01, Absyarka, Ziware, ijxjdjd, m371, Kotehok3, 221,physics0523, Igorbunov, kpw29, Kirill22, 1-gon, pashka for testing
- Kirill22 for submitting many different solutions
- 1-gon for being a VIP tester and his hilarious greetings in russian
- kpw29 for spending much time discussing the problems with me
- physics0523 for making researches about the tasks (as he always does)
- MikeMirzayanov for Codeforces and Polygon platforms and for his immeasurable contribution to the development of the community!

You will have **2.5 hours** to solve **8 problems**. As always, we highly recommend reading all problems. Moreover, we really hope you upsolve the problems after the round, there are some interesting things to find out!

One of these problems is interactive, please see the guide of interactive problems if you are not familiar with it.

**Score Distribution:**

**500** — **750** — **1000** — **(750 + 1000)** — **2000** — **2500** — **3000** — **3750**

**Editorial:**

**Winners**

System testing finished, congrats to the winners!