Hi!

# Hints

**A**: Let *Cost*(*k*) the answer if we compress the image with *k*, find *min* *Cost*(*k*).

**B**: Solve the problem without first query.

**C**: Let the frequencies of the characters be *a*_{1}, *a*_{2}, ..., *a*_{k}. Alice loses if and only if is odd and *n* is even.

**D**: Consider adding an extra seat, and the plane is now circular.

**E**: Let *dp*_{i, j} be the longest path given that we've included segment *i*, *j* in our solution, and we are only considering points to the right of ray *i*, *j* (so *dp*_{i, j} and *dp*_{j, i} may be different).

**F**: We want to compute *dp*_{i, j}: expected value given we have seen *i* red balls and *j* black balls.

# Solutions

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

**P.S.** Please notify me if there are any problems.