a guest Jan 14th, 2020 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- from itertools import combinations as c; from math import gcd
- 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)+1])(input().split()),2)]))
RAW Paste Data