#include using namespace std; template inline void read(T &x){ x=0; int f=1; char ch=getchar(); while(!isdigit(ch)){ if(ch=='-') f=-1; ch=getchar(); } while(isdigit(ch)) x=(x<<3)+(x<<1)+(ch^48),ch=getchar(); x*=f; return ; } template inline void write(T x){ if(x<0) putchar('-'),x=-x; if(x>9) write(x/10); putchar(x%10+'0'); return ; } typedef long long ll; ll n,k,O; ll work(ll x){ if(x