For this Question: You are given Q queries. Each query consists of a single number N. You can perform any one of the  2 operations in a single move:
1: If we take 2 integers a and b where, N=a*b, (a and b are not equal to 1), then we can change N=max(a,b)
2: Decrease the value of N by 1 .
For each query determine the minimum number of moves required to reduce the value of N to 0.The first line contains the integer Q. 
The next Q lines each contain an integer, N.
1 <= Q <= 1000
1 <= N <= 1000000Output Q lines. Each line containing the minimum number of moves required to reduce the value of N  to 0.Sample Input
2
3
4
Sample Output
3
3
Explanation
For test case 1, We only have one option that gives the minimum number of moves. 
Follow  3-> 2 -> 1 ->0 . Hence, 3 moves.
For the case 2, we can either go 4 -> 3 -> 2 -> 1 -> 0 or  4-> 2 -> 1 ->0 . The 2nd option is more optimal. Hence, 3 moves., I have written this Solution Code: #include "bits/stdc++.h"
using namespace std;
 
#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif

const int N = 1e6 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

vector<int> v[N];
int dp[N];

void solve(){
	for(int i = 1; i < N; i++)
		dp[i] = inf;
	dp[1] = 1;
 	for(int i = 2; i < N; i++){
 		dp[i] = min(dp[i], 1 + dp[i-1]);
		for(int j = 1; j <= i && j*i < N; j++)
			dp[i*j] = min(dp[i*j], 1 + dp[i]);
	}	
	int q;	cin >> q;
	while(q--){
		int n;	cin >> n;
		cout << dp[n] << endl;
	}
}

void testcases(){
	int tt = 1; 
	//cin >> tt;
	while(tt--){
		solve();
	}
}

signed main() {
	IOS;
		clock_t start = clock();
	
	testcases();

	cerr << (double)(clock() - start)*1000/CLOCKS_PER_SEC << " ms" << endl;
	return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?