INTERESTING PROBLEM

why the answer to the problem
https://codeforces.com/contest/1243/problem/C

is the gcd of all divisors of n ?? soemone plz
give an explanantion