#include using namespace std; typedef long long ll; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b>N>>H; vector AA={6,28,496,8128},BB={3,7,31,127}; for(ll q=0;q<4;q++){ if(AA[q]!=N) continue; ll A=AA[q],B=BB[q]; bool fl=false; if(H%B==0){ H=N/H; fl=true; } ll W=N/H; vector> ans; for(ll x=W;x(W,x)); } } vector S; for(ll x=1;x