from sys import stdin scan = lambda : stdin.readline() def gcd(a,b): if b==0: return a return gcd(b,a%b) while True: num = int(scan()) if num ==0: break sum=0 for i in range(1,num): for j in range(i+1,num+1): sum = sum + gcd(i,j) print(sum)
Subscribe to:
Post Comments (Atom)
-
/*** Md. Namzul Hasan Shahjalal University of Science & Technology,Sylhet. hasan08sust@gmail.com ***/ #include<iostream> #i...
-
#include<iostream> #include<cstdio> #include<stack> #include<queue> #include<cstring> using namespace st...
-
Problem Explanation Category: Easy One have to find out maximum number of player which is even. Check the amount of left hand player...
No comments:
Post a Comment