Domino (hard version)

Problem Name:
Domino (hard version)
Site:CodeForces
Links:
Tags:
Problem setters: