We were waiting several weeks tp setting this contest and hope the problem was good enough.

I will write the full editorial in the few next days, now some hints and short solutions exist here.

**hint1**

**hint1**

805C - Find Amir / 804A - Find Amir

**hint1**

**hint2**

805D - Minimum number of steps / 804B - Minimum number of steps

**hint1**

**hint2**

**hint3**

**hint4**

805E - Ice cream coloring / 804C - Ice cream coloring

**hint1**

**hint2**

**hint3**

There were some opinion about this sentence of the problem:

`Vertices which have the i-th (1 ≤ i ≤ m) type of ice cream form a connected subgraph.`

A subgraph *S* of a graph *G* is a graph whose set of vertices and set of edges are all subsets of *G*. And according to this definition, the subgraph can also be empty as a subset of vertices and edges.

A graph which is connected in the sense of a topological space, i.e., there is a path from any point to any other point in the graph. A graph that is not connected is said to be disconnected. This definition means that the null graph and singleton graph are considered connected, while empty graphs on 2 ≤ *n* nodes are disconnected.

All of these definitions were from valid articles and it seems more logical. How ever, I should apologize all of the participants because of bad sample tests when some of articles and books didn't accept my opinion.

805F - Expected diameter of a tree / 804D - Expected diameter of a tree

**hint1**

**hint2**

**hint1**