Sherlocks bet to Moriarty

Problem Name:
Sherlocks bet to Moriarty
Site:CodeForces
Links:
Tags:
Problem setters: