# MOSCOW JUNIOR WORKSHOPS For ICPC - Solution Outlines

Hello,

While we are in talks with the organizers over detailed editorials for the round, I’d like to share the brief setter’s notes we received from them, so that you guys can start upsolving and practicing them :). I tried my best to make the notes reader-friendly as well, and added a couple of alternate explanations/hints etc. Let me know if they can be improved, and dont forget to share your approaches for discussion!!

#1. Pizza Cutting

Ans- The answer is easy to guess if you think in terms of GCD(a2 - a1,a3-a2, ..., an - a1). Alternatively, you can try all angles and rotations and brute force.

Reference Solution : Here

Hint- Binary Search

**Ans-**Binary search on answer. Notice that you can entirely skip groups (of numbers) with the same leading digit and length.

Some more Explanation-

Click to view

Notice that you can find answer for a group easily. Lets say leading digit is K. We will do this step until we get a new number N which has 1 digits less. If our original number was, say P, then we can see that P-x*K=D. Repeat this for all groups.

#3 Antimatching

Hint: 1 Corner case + Trivial observation.

Ans- The answer is either the largest degree (trivial to prove) , or 3 if there is a triangle (corner case).

#4 Inverse LIS:

Ans- Place small numbers after i[k - 1] in decreasing order, then i[1], ..., i[n], then all other positions in decreasing order.

Corner cases- k = 1 and k=2 are special cases.

#5 TREEMEX