Help me in solving MXFACS problem

My issue

k should be smallest number as per the question then how come 2 is not a divisor for 102107304 instead of 3

My code

#include <bits/stdc++.h>
using namespace std;

int main() {
int x;
cin>>x;
while(x--){
    int y;
    cin>>y;
    if(y%2==0) cout<<"2"<<endl;
    else if(y%3==0) cout<<"3"<<endl;
    else if(y%5==0) cout<<"5"<<endl;
    else if(y%7==0) cout<<"7"<<endl;
    else if(y%19==0) cout<<"19"<<endl;
    else cout<<y<<endl;
}
return 0;
}

Learning course: 2000 to 2500 difficulty problems
Problem Link: Maximum Factors Problem Practice Problem in 2000 to 2500 difficulty problems