you give positive integer n Lets build graph vertex 12n way edge vertex u v Let duv short distance u v 0 path Compute sum value duv 1uvnthe gcd great common divisor positive integer maximum positive integer divide integer