Guest User

Untitled

a guest
Jan 14th, 2020
59
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from itertools import combinations as c; from math import gcd
  2. for i in range(int(input())):print(sum([gcd(k,h) for k,h in c((lambda b:[int(j) for j in b][1:int(b[0])+1])(input().split()),2)]))
RAW Paste Data