Square-free division (hard version)

Problem Name:
Square-free division (hard version)
Site:CodeForces
Links:
Tags:
Problem setters: