#include #include #include using namespace std; typedef long long int ll; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector p,lp(2e6+1); // lp[i]: iの最小素因数 lp[0]=lp[1]=-1; for(int i=2;i> vec; while(x>1){ if(vec.empty()||vec.back().first!=lp[x]){ vec.push_back({lp[x],1}); } else{ vec.back().second++; } x/=lp[x]; } return vec; }; vector> res; int ans=1e9; for(int i=1;icost){ ans=cost; res.clear(); } if(ans==cost){ res.push_back({i,j}); } } for(auto v:res){ printf("%d %d\n",v.first,v.second); } }