Main.cc: In function ‘int main()’: Main.cc:13:36: error: no matching function for call to ‘__gcd(long long int&, int&)’ long long d=n/__gcd(n,i); ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:1232:5: note: candidate: template _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement) __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n) ^~~~~ /usr/include/c++/7/bits/stl_algo.h:1232:5: note: template argument deduction/substitution failed: Main.cc:13:36: note: deduced conflicting types for parameter ‘_EuclideanRingElement’ (‘long long int’ and ‘int’) long long d=n/__gcd(n,i); ^