Run ID:129705

提交时间:2025-09-02 15:52:50

#include <bits/stdc++.h> using namespace std; int dp[100005]; int main() { int n; while(cin>>n){ if(n == 1 ){ cout<<3<<endl; } else{ if (n % 2 == 0){ cout<<n * 2 + 1<<endl; } else{ cout<<n*2<<endl; } } } return 0; } // 1 1 // 2 5 // 3 6 // 4 9 // 5 10