#include #include #include #include using namespace std; #define rep(i,a,b) for(int i = a; i < (b); ++i) #define sz(x) (int)(x).size() template int sgn(T x) { return (x > 0) - (x < 0); } template struct Point { typedef Point P; T x, y; explicit Point(T x=0, T y=0) : x(x), y(y) {} bool operator<(P p) const { return tie(x,y) < tie(p.x,p.y); } bool operator==(P p) const { return tie(x,y)==tie(p.x,p.y); } P operator+(P p) const { return P(x+p.x, y+p.y); } P operator-(P p) const { return P(x-p.x, y-p.y); } P operator*(T d) const { return P(x*d, y*d); } P operator/(T d) const { return P(x/d, y/d); } T dot(P p) const { return x*p.x + y*p.y; } T cross(P p) const { return x*p.y - y*p.x; } T cross(P a, P b) const { return (a-*this).cross(b-*this); } T dist2() const { return x*x + y*y; } double dist() const { return sqrt((double)dist2()); } // angle to x-axis in interval [-pi, pi] double angle() const { return atan2(y, x); } P unit() const { return *this/dist(); } // makes dist()=1 P perp() const { return P(-y, x); } // rotates +90 degrees P normal() const { return perp().unit(); } // returns point rotated 'a' radians ccw around the origin P rotate(double a) const { return P(x*cos(a)-y*sin(a),x*sin(a)+y*cos(a)); } friend ostream& operator<<(ostream& os, P p) { return os << "(" << p.x << "," << p.y << ")"; } }; typedef Point P; template T polygonArea2(vector>& v) { T a = v.back().cross(v[0]); rep(i,0,sz(v)-1) a += v[i].cross(v[i+1]); return abs(a); } void solve() { int n; int64_t k; cin >> n >> k; vector

v(n); for(auto& p: v) cin >> p.x >> p.y; int64_t maxdist = 0; int adj = 0, nadj = 0; { int j = 1; for(int i = 0; i < n; i++) { if(i == j) j = (j+1)%n; while(true) { int64_t cdist = (v[i] - v[j]).dist2(); if(cdist > maxdist) { maxdist = cdist; adj = 0; nadj = 0; } if(cdist == maxdist) { if((i+1)%n == j || (j+1)%n == i) adj++; else nadj++; } int nj = (j+1)%n; if(nj == i) break; vector

tri(3); tri[0] = v[i]; tri[1] = v[(i+1)%n]; tri[2] = v[j]; auto a1 = polygonArea2(tri); tri[2] = v[nj]; auto a2 = polygonArea2(tri); if(a1 >= a2) break; j = nj; } } } assert(nadj%2 == 0); nadj /= 2; int64_t cand = k / (2 * sqrtl(maxdist)); __int128 k2 = __int128(k) * k; while(__int128(4) * maxdist * cand * cand < k2) cand++; while(cand > 0 && __int128(4) * maxdist * (cand-1) * (cand-1) >= k2) cand--; if(__int128(4) * maxdist * cand * cand == k2 && cand > nadj) cand++; cout << cand << "\n"; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); solve(); }