include <bt bits/extc++.h>
using namespace std;
define min(a,b) ((a)<(b)?(a):(b))
define max(a,b) ((a)>(b)?(a):(b))
define lli long long int
define ll long long
int main() { lli n,k,c,t.i; cin>>t; while(t--) { cin>>n>>k; c=n; for(i=2; i<=10; i++) { if(n%i==0) { c=i; break; } }
n+=c; cout<<n+(k-1)*2<<"\n";
} return 0; }








I think it has something to do with formatting. Try to submit after making font & color the same for all lines. Or at least replace bits/stdc++.h with bt bits/extc++.h.
The loop for finding the smallest divisor of $$$n$$$ that is larger then 1 should not have an upper-limit of 10. Check the following update.
111745818