#ifndef ONLINE_JUDGE #define _GLIBCXX_DEBUG #endif #include #include using namespace std; using ll=long long; using ld=long double; using st=string; using P=pair; typedef atcoder::modint mint; ll inf=9e18; template auto vec(const ll (&sizes)[s], const T& init = T()){ if constexpr(i < s) return vector(sizes[i], vec(sizes, init)); else return init; } int main(){ ll l=0,r=1000000004,c,n,s; cin>>n>>s; auto v=vec({n},0); for(ll i=0;i>v[i]; } sort(v.rbegin(),v.rend()); while(l+1c) rem-=v[i]+1; else {rem-=n-i;break;} } if(rem>=0) r=c; else l=c; // cout<