Recover an RBS

Problem Name:
Recover an RBS
Site:CodeForces
Links:
Tags:
Problem setters: