Saleh127

UVA 11417.cpp

Jun 5th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define Faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. #define pi acos(-1)
  7. int main()
  8. {
  9. Faster
  10. ll a,c,d,e,f,i,j,k,l;
  11.  
  12. while(cin>>a && a)
  13. {
  14. c=0;
  15. for(i=1; i<a; i++)
  16. {
  17. for(j=i+1; j<=a; j++)
  18. {
  19. c+=__gcd(i,j);
  20. }
  21. }
  22. cout<<c<<endl;
  23. }
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment