Language: C++

#include<bits/stdc++.h>
#define ll long long int
#define ull long long int
#define float long double
#define pb push_back
#define mk make_pair
#define mod 1000000007
#define ALL(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define DEBUG(x) cout<<" x is "<<x<<"\n"
using namespace std;

//inline size_t key( int a,int b,int c,int d) {return a*b*c*d-7707;}
//unordered_map<size_t,bool >vismap;


/*int dx[] = {1,-1,0,0} , dy[] = {0,0,1,-1}; */  // 2 Direction
/*int dx[] = {1,0} , dy[] = {0,1};     */  // 4 Direction
/* int dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1}; */ // 8 Direction
/* int dx[] = {1,-1,1,-1,2,2,-2,-2} , dy[] = {2,2,-2,-2,1,-1,1,-1}; */ // Knight Direction
/* int dx[] = {2,-2,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1}; */ // Hexagonal Direction
/*
struct myClass{
 
    int sum;
    int x;
    int y;
 
    bool operator < (myClass t) const{
        return sum<t.sum;
    }
 
};
 */
/*
ll fast_expo(ll a,ll b,ll m){
    if(b==0){
        return 1;
    }
    else{
        ll x=fast_expo(a,b/2,m);
        x*=x;
        x%=m;
        if(b%2==0){
            return x;
        }
        else{
            return (x*a)%m;
        }
    }
}

ll inverse(ll a,ll m){
    return fast_expo(a,m-2,m);
}
*/

/*

void prime_precomputation(vector<ll> &primes,int n){
    vector<int> v(n+10,0);
    v[0]=1;v[1]=1;
    for(int i=2;i*i<=n;i++){
        if(v[i]==0){
            for(int j=2*i;j<=n;j+=i){
                v[j]=1;
            }
        }
    }


}

*/

/*
void FTdfs(int src,vector<vector<int> > &adj, vector<int > & vis,stack<int> &Ftime){
    vis[src]=1;
    for(int i=0;i<adj[src].size();i++){
        int x=adj[src][i];
        if(vis[x]==0){
            FTdfs(x,adj,vis,Ftime);
        }
    }
    Ftime.push(src);
}

void dfs(int src,vector<vector<int> > &adj,vector<int> &vis ,int sc){
    vis[src]=1;
    um[src]=sc;
    scc[sc].pb(src);
    for(int  i=0;i<adj[src].size();i++){
        int x=adj[src][i];
        if(vis[x]==0){
            dfs(x,adj,vis,sc);
        }
    }
}

*/

/*

vector<pair<int,int> > compress(vector<int> &v){
    sort(v.begin(),v.end());
    int n=v.size();
    int cnt=0;
    vector<pair<int,int> > ret;
    for (int i=0;i<n;i++){
        if (i>0&&ar[i]!=ar[i-1]){
            ret.push_back(make_pair(ar[i-1],cnt));
            cnt=0;
        }
        cnt++;
    }
    ret.push_back(make_pair(ar[n-1],cnt));
    return ret;
}






*/

int main(){
    fast
    cout<<fixed;
    cout<<setprecision(10);
    int q;
   // cin>>q;
    q=1;
    while(q--){
     ll n;
      cin>>n;
      cout<<n*2/__gcd(n,2)<<"\n";
        

    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:137:22: error: no matching function for call to '__gcd(long long int&, int)'
  137 |       cout<<n*2/__gcd(n,2)<<"\n";
      |                 ~~~~~^~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   template argument deduction/substitution failed:
a.cc:137:22: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('long long int' and 'int')
  137 |       cout<<n*2/__gcd(n,2)<<"\n";
      |                 ~~~~~^~~~~