For this Question: You are given Q queries. Each query consists of a single number N. You can perform any of the 2 operations on N in each move:
1: If we take 2 integers a and b where N = a x b(a≠1, b≠1), then we can change N = max(a, b)
2: Decrease the value of N by 1.
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.

<b>Constraints</b>
1 ≤ Q ≤ 10<sup>3</sup>
1 ≤ N ≤ 10<sup>6</sup>Output 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, 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;

int main() {
    int test;
    cin >> test;
    while (test--) {
        int n;
        cin >> n;
        if (n == 0) {
            cout << 0 << endl;
            continue;
        }
        if (n == 1) {
            cout << 1 << endl;
            continue;
        }
        vector<int> dist(n + 1, 0);
        queue<int> q;
        q.push(n);
        dist[n] = 1;
        while (1) {
            int element = q.front();
            q.pop();
            if (element == 2) {
                cout << dist[2] + 1 << endl;
                break;
            }
            if (dist[element - 1] == 0) {
                dist[element - 1] = dist[element] + 1;
                q.push(element - 1);
            }
            for (int i = 2; i * i <= element; i++) {
                if (element % i == 0) {
                    int maxfrac = element / i;
                    if (dist[maxfrac] == 0) dist[maxfrac] = dist[element] + 1, q.push(maxfrac);
                }
            }
        }
    }
    return 0;
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?