Equalizing by Division (hard version)

Problem Name:
Equalizing by Division (hard version)
Site:CodeForces
Links:
Tags:
Problem setters: