For this Question: Given an integer N, find the closest prime number to N. If there are multiple print the smaller one.The input contains a single integer N.

Constraints:
1 <= N <= 1000000000Print the closest prime to N.Sample Input 1
12

Sample Output 1
11

Explanation: Closest prime to 12 is 11 and 13 smaller of which is 11.

Sample Input 2
17

Sample Output 2
17

Explanation: Closest prime to 17 is 17., I have written this Solution Code: #pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountll
#define m_p make_pair
#define infi 1e18+1
#define eps 0.000000000001
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
string char_to_str(char c){string tem(1,c);return tem;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<class T>//usage rand<long long>()
T rand() {
    return uniform_int_distribution<T>()(rng);
}
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template<class T>
using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();
 
//////////////
auto clk=clock();
#define all(x) x.begin(),x.end()
#define S second
#define F first
#define sz(x) ((long long)x.size())
#define int long long  
#define f80 __float128
#define pii pair<int,int>
/////////////

bool isPrime(int n){
	if(n<=1)
		return false;
	for(int i=2;i*i<=n;++i)
		if(n%i==0)
			return false;
	return true;
}

signed main()
{
	fastio;
	#ifdef ANIKET_GOYAL
		freopen("inputf.in","r",stdin);
		freopen("outputf.in","w",stdout);
	#endif
	int n;
	cin>>n;
	if(n==1)
		cout<<"2";
	else{
		int v1=n,v2=n;
		while(isPrime(v1)==false)
			--v1;
		while(isPrime(v2)==false)
			++v2;
		if(v2-n==n-v1)
			cout<<v1;
		else{
			if(v2-n<n-v1)
				cout<<v2;
			else
				cout<<v1;
		}
	}
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?