Rook, Bishop and King

Problem Name:
Rook, Bishop and King
Site:CodeForces
Links:
Tags:
Problem setters: