Shards of the Past

Problem Name:
Shards of the Past
Site:CodeForces
Links:
Tags:
Problem setters: