Counting Is Not Fun (Hard Version)

Problem Name:
Counting Is Not Fun (Hard Version)
Site:CodeForces
Links:
Tags: