Trailing Loves (or L'oeufs?)

Problem Name:
Trailing Loves (or L'oeufs?)
Site:CodeForces
Links:
Tags:
Problem setters: