QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#803213#9869. Horizon Scanningucup-team159#AC ✓140ms12336kbC++2011.5kb2024-12-07 16:27:202024-12-07 16:27:21

Judging History

你现在查看的是最新测评结果

  • [2024-12-07 16:27:21]
  • 评测
  • 测评结果:AC
  • 用时:140ms
  • 内存:12336kb
  • [2024-12-07 16:27:20]
  • 提交

answer

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rep1(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < (t); ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define em emplace
#define pob pop_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define newline puts("")
#define vc vector
using namespace std;
template<class T> using vv = vc<vc<T>>;
template<class T> using PQ = priority_queue<T,vc<T>,greater<T>>;
using uint = unsigned; using ull = unsigned long long;
using vi = vc<int>; using vvi = vv<int>; using vvvi = vv<vi>;
using ll = long long; using vl = vc<ll>; using vvl = vv<ll>; using vvvl = vv<vl>;
using P = pair<int,int>; using vp = vc<P>; using vvp = vv<P>; using LP = pair<ll,ll>;
int geti(){int x;scanf("%d",&x);return x;}
vi pm(int n, int s=0) { vi a(n); iota(rng(a),s); return a;}
template<class T1,class T2>istream& operator>>(istream&i,pair<T1,T2>&v){return i>>v.fi>>v.se;}
template<class T1,class T2>ostream& operator<<(ostream&o,const pair<T1,T2>&v){return o<<v.fi<<","<<v.se;}
template<class T>istream& operator>>(istream&i,vc<T>&v){rep(j,sz(v))i>>v[j];return i;}
template<class T>string join(const T&v,const string&d=""){stringstream s;rep(i,sz(v))(i?s<<d:s)<<v[i];return s.str();}
template<class T>ostream& operator<<(ostream&o,const vc<T>&v){if(sz(v))o<<join(v," ");return o;}
template<class T>void vin(vc<T>&a){int n;cin>>n;a=vc<T>(n);cin>>a;}
template<class T>void vin(vv<T>&a){int n,m;cin>>n>>m;a=vv<T>(n,vc<T>(m));cin>>a;}
template<class T1,class T2>void operator--(pair<T1,T2>&a,int){a.fi--;a.se--;}
template<class T1,class T2>void operator++(pair<T1,T2>&a,int){a.fi++;a.se++;}
template<class T>void operator--(vc<T>&a,int){for(T&x:a)x--;}
template<class T>void operator++(vc<T>&a,int){for(T&x:a)x++;}
template<class T1,class T2>void operator+=(vc<T1>&a,T2 b){for(T1&x:a)x+=b;}
template<class T1,class T2>void operator-=(vc<T1>&a,T2 b){for(T1&x:a)x-=b;}
template<class T1,class T2>void operator*=(vc<T1>&a,T2 b){for(T1&x:a)x*=b;}
template<class T1,class T2>void operator/=(vc<T1>&a,T2 b){for(T1&x:a)x/=b;}
template<class T>void operator+=(vc<T>&a,const vc<T>&b){a.insert(a.end(),rng(b));}
template<class T1,class T2>pair<T1,T2>operator+(const pair<T1,T2>&a,const pair<T1,T2>&b){return {a.fi+b.fi,a.se+b.se};}
template<class T1,class T2>pair<T1,T2>operator-(const pair<T1,T2>&a,const pair<T1,T2>&b){return {a.fi-b.fi,a.se-b.se};}
template<class T>pair<T,T>operator*(const pair<T,T>&a,T b){return {a.fi*b,a.se*b};}
template<class T1,class T2>bool mins(T1& x,const T2&y){if(y<x){x=y;return true;}else return false;}
template<class T1,class T2>bool maxs(T1& x,const T2&y){if(x<y){x=y;return true;}else return false;}
template<class T>T min(const vc<T>&a){return *min_element(rng(a));}
template<class T>T max(const vc<T>&a){return *max_element(rng(a));}
template<class Tx,class Ty>Tx dup(Tx x, Ty y){return (x+y-1)/y;}
template<class T>ll suma(const vc<T>&a){ll s=0;for(auto&&x:a)s+=x;return s;}
template<class T>ll suma(const vv<T>&a){ll s=0;for(auto&&x:a)s+=suma(x);return s;}
template<class T>void uni(T&a){sort(rng(a));a.erase(unique(rng(a)),a.end());}
template<class T>void prepend(vc<T>&a,const T&x){a.insert(a.begin(),x);}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return;}
#define yes { puts("Yes"); return;}
#define no { puts("No"); return;}
#define rtn(x) { cout<<(x)<<'\n'; return;} // flush!
#define yn {puts("Yes");}else{puts("No");}
using vd = vc<double>;

// geom
const double inf = 1e6;
const double PI = acos(-1.0);
inline double toRad(double deg){ return deg * PI / 180.0;}

struct V {
  double x, y;
  V(double x=0, double y=0):x(x),y(y){}
  V operator+(const V& t) const { return V(x+t.x,y+t.y);}
  V operator-(const V& t) const { return V(x-t.x,y-t.y);}
  V operator*(double t) const { return V(x*t,y*t);}
  V operator/(double t) const { return V(x/t,y/t);}
  V operator*(const V& t) const { return V(x*t.x-y*t.y,x*t.y+y*t.x);}
  V operator/(const V& t) const { return *this*V(t.x,-t.y)/t.norm2();}
  V& operator+=(const V& t) { x += t.x; y += t.y; return *this;}
  V& operator-=(const V& t) { x -= t.x; y -= t.y; return *this;}
  V& operator*=(double t) { x *= t; y *= t; return *this;}
  V& operator/=(double t) { x /= t; y /= t; return *this;}
  V& operator*=(const V& t) { return *this = *this*t;}
  V& operator/=(const V& t) { return *this = *this/t;}
  double dot(const V& t) const { return x*t.x + y*t.y;}
  double cross(const V& t) const { return x*t.y - y*t.x;}
  double norm2() const { return x*x + y*y;}
  double norm() const { return sqrt(x*x + y*y);}
  V rev() const { return V(-x,-y);}
  V normalize() const { return V(x/norm(), y/norm());}
  V rotate90() const { return V(-y,x);}
  V rotate(const V& a, double rad) const {
    return V(a.x + cos(rad)*(x-a.x) - sin(rad)*(y-a.y),
             a.y + sin(rad)*(x-a.x) + cos(rad)*(y-a.y));
  }
  bool operator<(const V& a) const { return abs(x - a.x) > eps ? x < a.x : y < a.y;}
  bool operator==(const V& a) const { return abs(x - a.x) < eps && abs(y - a.y) < eps;}
  // inline int side() const {
  //   if (abs(y) < eps) {
  //     if (abs(x) < eps) return 0;
  //     return x > 0 ? 1 : 3;
  //   }
  //   return y > 0 ? 2 : 4;
  // }
  // bool operator<(const V& a) const {
  //   int s = side(), sa = a.side();
  //   if (s != sa) return s < sa;
  //   return cross(a) > 0;
  // }
};
istream& operator>>(istream&i,V&a){i>>a.x>>a.y;return i;}
ostream& operator<<(ostream&o,const V&a){o<<a.x<<','<<a.y;return o;}

struct Line {
  V s, t;
  Line(V s=V(0,0), V t=V(0,0)):s(s),t(t){}
  V dir() const { return t-s;}
  V normalize() const { return dir().normalize();}
  double norm() const { return dir().norm();}
  /* +1: s-t,s-p : ccw
   * -1: s-t,s-p : cw
   * +2: t-s-p
   * -2: s-t-p
   *  0: s-p-t */
  int ccw(const V& p) const {
    if (dir().cross(p-s) > eps) return +1;
    if (dir().cross(p-s) < -eps) return -1;
    if (dir().dot(p-s) < -eps) return +2;
    if (dir().dot(t-p) < -eps) return -2;
    return 0;
  }
  bool touch(const Line& l) const {
    int a = ccw(l.s)*ccw(l.t), b = l.ccw(s)*l.ccw(t);
    return !a || !b || (a == -1 && b == -1);
  }
  double distLP(const V& p) const { return abs(dir().cross(p-s)/norm());}
  double distSP(const V& p) const {
    if (dir().dot(p-s) < eps) return (p-s).norm();
    if (dir().rev().dot(p-t) < eps) return (p-t).norm();
    return distLP(p);
  }
  double distSS(const Line& l) const {
    if(touch(l)) return 0;
    return min(min(distSP(l.s),distSP(l.t)),min(l.distSP(s),l.distSP(t)));
  }
  V proj(const V& p) const {
    double a = (p-s).dot(dir())/dir().norm2();
    return s + dir()*a;
  }
  Line mid() const {
    V p = (s+t)/2, q = dir();
    return Line(p, p+V(q.y,-q.x));
  }
  V xp(const Line& l) const {
    V a = dir(), b = l.dir();
    if (abs(b.cross(a)) < eps) return V(inf,inf);
    return s + a*(b.cross(l.s-s)/b.cross(a));
  }
};

using Poly = vector<V>;
inline V pnxt(Poly& p, int i) { return p[(i+1)%sz(p)];}
inline V ppre(Poly& p, int i) { return p[(i-1+sz(p))%sz(p)];}
inline Line pline(Poly& p, int i) { return Line(p[i],pnxt(p,i));}
Poly conv(Poly a) {
  int n = sz(a);
  sort(rng(a));
  if (n <= 2) return a;
  Poly res(n*2);
  int k = 0;
  for (int i = 0; i < n; ++i){
    while (k > 1 && Line(res[k-1],res[k-2]).ccw(a[i]) != 1) --k; // <= -1 ok line
    res[k++] = a[i];
  }
  int pre = k;
  for (int i = n - 2; 0 <= i; --i){
    while (k > pre && Line(res[k-1],res[k-2]).ccw(a[i]) != 1) --k; // <= -1 ok line
    res[k++] = a[i];
  }
  res.resize(k-1);
  return res;
}
double area(Poly& a) {
  double res = 0;
  rep(i,sz(a)-2){
    res += abs(V(a[i+1]-a[0]).cross(V(a[i+2]-a[0])));
  }
  return res/2;
}
Poly convCut(Poly& a, Line b) {
  Poly g;
  rep(i,sz(a)){
    if (b.ccw(a[i]) == 1) g.pb(a[i]);
    Line l(a[i],pnxt(a,i));
    V x = b.xp(l);
    if (l.ccw(x) == 0 && !(a[i] == x)) g.pb(x);
  }
  return g;
}
vector<Poly> voronoi(Poly& p, Poly& c) {
  vector<Poly> g;
  rep(i,sz(p)) g.pb(c);
  rep(i,sz(p))rep(j,sz(p)) {
    if (i == j) continue;
    Line l = Line(p[i],p[j]).mid();
    if (l.ccw(p[i]) != 1) swap(l.s,l.t);
    g[i] = convCut(g[i],l);
  }
  return g;
}

struct Circle {
  V o; double r;
  Circle(V o=V(0,0), double r=0):o(o),r(r){}
  Poly xp(Circle c) {
    Poly res;
    double d = (o-c.o).norm();
    if (d > r+c.r) return res;
    if (d+min(r, c.r) < max(r, c.r)+eps) return Poly();
    double rcos = (d*d + r*r - c.r*c.r) / (2.0*d);
    double rsin = sqrt(r*r - rcos*rcos);
    V a = (c.o-o).normalize();
    res.pb(o + V(a.x*rcos - a.y*rsin, a.x*rsin + a.y*rcos));
    res.pb(o + V(a.x*rcos + a.y*rsin, -a.x*rsin + a.y*rcos));
    return res;
  }
  Poly xp(Line l) {
    Poly res;
    double h = l.distLP(o);
    if (h > r+eps) return res;
    V p = l.proj(o);
    double d = sqrt(max(0.0, r*r-h*h));
    V q = l.normalize();
    res.pb(p + q*d);
    res.pb(p - q*d);
    return res;
  }
  bool in(V p) { return (p-o).norm() < r+eps;}
  bool touch(Circle c) { return (c.o-o).norm() < c.r+r+eps;}
  double distCC(Circle c) { return max((c.o-o).norm()-c.r-r, 0.0);}
  Poly tang(V p) {
    Poly res;
    double a = (p-o).norm2(), b = a-r*r;
    if (b < -eps) return res;
    b = max(b,0.0);
    V h = o + (p-o)*(r*r/a);
    V v = (p-o).rotate90()*(r*sqrt(b)/a);
    res.pb(h+v);
    res.pb(h-v);
    return res;
  }
  vector<Line> tangC(Circle c) {
    vector<Line> res;
    if (abs(r-c.r) < eps) {
      V v = (c.o-o).rotate90().normalize()*r;
      res.pb(Line(o+v,c.o+v));
      res.pb(Line(o-v,c.o-v));
    } else {
      V p = (o*-c.r + c.o*r) / (r-c.r);
      Poly a = tang(p), b = c.tang(p);
      rep(i,sz(a))rep(j,sz(b)) {
        if (abs(Line(a[i],b[j]).ccw(p)) == 2) res.pb(Line(a[i],b[j]));
      }
    }
    V p = (o*c.r + c.o*r)/(r+c.r);
    Poly a = tang(p), b = c.tang(p);
    rep(i,sz(a))rep(j,sz(b)) {
      if (Line(a[i],b[j]).ccw(p) == 0) res.pb(Line(a[i],b[j]));
    }
    return res;
  }
  double TriArea(V a, V b) {
    if (a == o || b == o) return 0;
    a = a-o; b = b-o;
    double d = a.cross(b)/2;
    if (a.norm() > r+eps || b.norm() > r+eps){
      double e = (atan2(a.y,a.x)-atan2(b.y,b.x))/(PI*2);
      while (e < 0) e += 1;
      while (e > 1) e -= 1;
      return r*r*PI * min(e,1-e) * (d<0?-1:1);
    }
    return d;
  }
  double PolyArea(Poly p) {
    double res = 0;
    rep(i,sz(p)){
      V a = p[i], b = p[(i+1)%sz(p)];
      Poly x = xp(Line(a,b));
      if (sz(x) == 2 && (x[0]-a).norm() > (x[1]-a).norm()) swap(x[0],x[1]);
      Poly ps;
      ps.pb(a);
      rep(j,sz(x)) if (Line(a,b).ccw(x[j]) == 0) ps.pb(x[j]);
      ps.pb(b);
      rep(i,sz(ps)-1) res += TriArea(ps[i],ps[i+1]);
    }
    return abs(res);
  }
};
// geom

struct Solver {
  void solve() {
    int n, k;
    cin>>n>>k;
    Poly ps(n);
    cin>>ps;

    vd a;
    rep(i,n) a.pb(atan2(ps[i].y,ps[i].x));
    sort(rng(a));
    rep(i,n) a.pb(a[i]+PI*2);
    double ans = 0;
    rep(i,n) {
      maxs(ans, a[i+k]-a[i]);
    }
    printf("%.10f\n",ans);
  }
};

int main() {
  // cin.tie(nullptr); ios::sync_with_stdio(false);
  int ts = 1;
  scanf("%d",&ts);
  rep1(ti,ts) {
    Solver solver;
    solver.solve();
  }
  return 0;
}

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 4384kb

input:

5
1 1
0 1
8 2
1 0
1 1
0 1
-1 1
-1 0
-1 -1
0 -1
1 -1
4 2
-1 1
0 1
0 2
1 1
4 2
-1000000000 0
-998244353 1
998244353 1
1000000000 0
3 1
0 1
0 2
0 -1

output:

6.2831853072
1.5707963268
5.4977871438
3.1415926546
3.1415926536

result:

ok 5 numbers

Test #2:

score: 0
Accepted
time: 73ms
memory: 4284kb

input:

10000
16 1
-10 -6
-5 -6
-4 9
-2 5
-2 10
1 -7
1 -5
1 6
3 1
4 -9
6 -10
6 -3
6 1
8 -5
8 -4
9 -4
17 4
-9 2
-8 -4
-8 -3
-8 -1
-6 -2
-6 -1
-6 8
-5 -8
-5 10
-4 8
-2 -8
4 -9
4 0
5 -3
8 -5
9 -2
10 10
10 6
-7 2
-4 6
-2 -7
-2 -1
-1 7
1 -9
1 8
3 -4
7 -4
9 -2
14 3
-9 10
-8 -10
-8 -8
-6 -7
-6 -5
-1 -7
-1 -2
0 -1
...

output:

1.6929914975
2.5748634361
4.6527582673
2.7726331074
5.7427658069
4.8576989910
3.4198923126
2.8127999621
6.2831853072
6.2831853072
5.1172807667
6.1467827028
3.8420890235
2.3424967168
3.4633432080
6.2831853072
5.9614347528
3.3247034709
5.2627749281
5.6724593428
1.6738779353
1.1141908549
2.4087775518
6...

result:

ok 10000 numbers

Test #3:

score: 0
Accepted
time: 69ms
memory: 4396kb

input:

10000
19 7
-10 -6
-10 5
-3 0
-2 -5
-1 1
-1 6
0 3
0 7
1 9
3 -3
3 3
3 8
4 -1
5 8
6 -3
7 -5
7 4
8 10
9 -5
15 15
-9 -1
-8 6
-7 9
-6 -3
-4 -9
-1 -3
-1 8
1 -8
1 -7
3 -2
3 1
6 -9
7 -10
7 0
10 -9
10 3
-7 -1
-6 -2
-6 10
-5 2
-4 2
-3 -7
-2 -9
1 -3
3 4
7 7
15 4
-8 -8
-8 8
-7 0
-7 10
-6 -7
-5 6
-1 -3
-1 0
1 -2
...

output:

3.9269908170
6.2831853072
3.3602615995
2.6779450446
3.7703889400
1.7625844688
3.8402524783
5.4977871438
2.0344439358
1.8157749899
4.3471875306
6.1412882526
5.1760365894
5.4655402613
5.7690391513
4.3662530168
5.9947557487
4.8922424802
4.1719694801
5.6776406436
5.9614347528
3.5067941034
4.5429759365
5...

result:

ok 10000 numbers

Test #4:

score: 0
Accepted
time: 77ms
memory: 4324kb

input:

10000
18 12
-10 -4
-10 7
-8 -10
-7 -4
-6 5
-6 7
-5 0
-2 -7
-1 2
-1 10
0 2
1 1
3 -2
5 3
5 5
6 -3
8 -3
9 -2
10 1
-10 -9
-7 -7
-5 2
-4 -7
-3 1
3 1
3 3
5 -4
9 2
9 6
11 2
-8 1
-8 6
-7 -2
-6 0
-5 0
-1 -9
2 -8
3 5
6 0
10 -2
10 6
20 9
-10 -6
-10 6
-9 -8
-7 5
-6 -4
-4 -8
-2 -10
-2 -3
-2 4
-1 1
2 -5
3 -2
5 -6...

output:

4.9097845402
1.9756881131
1.9868608325
3.9269908170
3.6977588837
6.2831853072
6.1412882526
6.1938713142
5.8053542522
6.2528915473
5.7288778110
3.0900918426
1.8925468812
5.6341897482
2.8966139905
6.2831853072
2.9147938055
6.1476575932
1.9513027039
5.5643553076
5.4977871438
3.0981417582
4.3906384260
3...

result:

ok 10000 numbers

Test #5:

score: 0
Accepted
time: 69ms
memory: 4208kb

input:

10000
19 7
-10 -1
-8 2
-7 -10
-6 6
-4 7
-3 -5
-3 1
-3 8
-2 4
-1 -7
0 -8
0 9
1 -10
2 1
2 3
3 5
6 -4
10 2
10 3
14 10
-8 2
-6 0
-5 -10
-5 10
-4 7
-3 -6
-2 -6
1 4
1 6
2 -1
3 -6
8 -4
9 -10
10 -1
12 8
-9 5
-7 2
-4 2
0 -2
0 5
1 6
3 2
4 9
5 5
7 -6
9 -9
9 2
19 12
-10 -10
-10 2
-9 -6
-8 2
-7 -5
-6 8
-4 1
-1 -...

output:

3.2393195609
5.2757052419
5.3003915839
5.3871299226
5.8883941875
4.1173193567
1.1383885512
1.5152978215
6.1476575932
6.1588303126
2.5748634361
5.9401613668
1.6085142793
4.6099451269
5.0711596507
4.2345579254
3.7905882126
4.0376480382
3.9160022483
1.0636978224
4.2809882538
5.8572556506
3.4078447027
5...

result:

ok 10000 numbers

Test #6:

score: 0
Accepted
time: 69ms
memory: 4404kb

input:

10000
11 10
-10 -1
-9 4
-9 10
-7 -7
-5 4
-4 -1
-2 -10
0 -7
0 5
3 3
3 5
12 12
-9 6
-9 8
-3 -2
-2 2
0 -4
1 0
2 -3
3 5
5 -2
7 -1
10 3
10 9
14 12
-10 0
-9 -3
-9 1
-9 10
-8 -1
-8 7
-6 -1
-1 -6
-1 2
1 -1
3 -7
4 9
9 -3
10 1
10 4
-9 -3
-7 -1
-6 -10
-3 -2
-3 7
2 -2
2 3
5 2
6 9
9 6
10 2
-9 -9
-9 6
-8 3
-5 -9
...

output:

6.1378752965
6.2831853072
6.1180366298
3.2003484763
2.6537562149
6.2537820190
3.6052402626
3.5598169832
1.5091461562
5.9275494229
6.2587998980
2.6224465393
4.3938333033
5.4977871438
4.2487413714
5.4977871438
4.6292477485
3.5464844399
6.0048856482
1.1967518953
2.8854412710
6.2000440753
1.9237867146
5...

result:

ok 10000 numbers

Test #7:

score: 0
Accepted
time: 74ms
memory: 4300kb

input:

10000
14 1
-100 13
-96 -31
-82 -92
-77 -98
-50 1
-14 -57
-14 -31
-11 64
-8 75
9 68
25 100
54 -36
59 13
93 31
19 19
-76 -39
-60 95
-51 18
-39 11
-21 -46
-6 -94
-5 83
-3 -34
-3 72
0 -55
3 79
14 17
23 -88
32 37
50 70
61 -5
62 -43
84 -100
97 -50
13 7
-99 -63
-68 -87
-24 62
-20 -18
-2 -66
7 -49
13 -21
15...

output:

1.2713093975
6.2831853072
5.2225147207
6.0030657036
3.9258721355
5.5465289951
3.2103149237
3.0399300499
4.2275317818
3.0320196657
2.1912152338
3.0390080904
4.3313271506
6.2831853072
5.1100022651
2.9463140261
5.1760365894
5.6991835714
2.0611798651
6.2831853072
2.2278897855
6.1707748616
6.2831853072
6...

result:

ok 10000 numbers

Test #8:

score: 0
Accepted
time: 64ms
memory: 4420kb

input:

100
1413 755
-30 -30
-30 -28
-30 -27
-30 -26
-30 -21
-30 -12
-30 -10
-30 -8
-30 -5
-30 -1
-30 2
-30 4
-30 7
-30 9
-30 17
-30 19
-30 20
-30 23
-30 24
-30 30
-29 -29
-29 -23
-29 -15
-29 0
-29 4
-29 5
-29 9
-29 10
-29 11
-29 12
-29 14
-29 16
-29 17
-29 22
-29 27
-29 28
-28 -28
-28 -25
-28 -23
-28 -22
-...

output:

3.5891126287
2.9797552224
0.2837941092
2.0350277069
4.8879811423
1.0040671093
4.7457099763
5.3255963293
4.3102749647
5.6033836794
1.5798050921
4.3296454705
5.5472220968
1.4601391056
1.5310445514
2.8716749317
2.6325789669
3.1240505935
0.6805212247
5.4201656350
4.7789571442
2.4030352031
4.2799812048
4...

result:

ok 100 numbers

Test #9:

score: 0
Accepted
time: 70ms
memory: 4648kb

input:

20
9045 8319
-1000 -986
-1000 -683
-1000 -430
-1000 -292
-1000 53
-1000 667
-999 -855
-999 -350
-999 -174
-999 -51
-999 -43
-999 235
-999 465
-999 530
-998 -997
-998 -311
-998 21
-998 44
-998 182
-997 -313
-997 -195
-997 -13
-997 412
-997 425
-996 -542
-996 -348
-996 -126
-996 -59
-996 -40
-996 84
-...

output:

5.9115110039
3.7438685151
2.5384828583
2.1599673589
4.2950377096
4.7716744748
4.6824078126
5.0789843942
1.6008018214
3.3404025456
3.3687925283
2.1130160282
4.8553994101
4.3240010533
0.1078535611
0.1798211242
5.3766547607
4.4495660239
4.3944016652
2.9381848722

result:

ok 20 numbers

Test #10:

score: 0
Accepted
time: 83ms
memory: 12336kb

input:

1
166347 18723
-1000 -979
-1000 -975
-1000 -928
-1000 -914
-1000 -898
-1000 -889
-1000 -876
-1000 -873
-1000 -858
-1000 -840
-1000 -838
-1000 -801
-1000 -783
-1000 -744
-1000 -738
-1000 -733
-1000 -713
-1000 -712
-1000 -695
-1000 -689
-1000 -680
-1000 -675
-1000 -671
-1000 -646
-1000 -643
-1000 -608...

output:

0.8514491790

result:

ok found '0.8514492', expected '0.8514492', error '0.0000000'

Test #11:

score: 0
Accepted
time: 77ms
memory: 11112kb

input:

1
154903 84960
-1000 -979
-1000 -965
-1000 -956
-1000 -945
-1000 -920
-1000 -901
-1000 -878
-1000 -860
-1000 -858
-1000 -709
-1000 -693
-1000 -648
-1000 -619
-1000 -602
-1000 -579
-1000 -474
-1000 -473
-1000 -454
-1000 -443
-1000 -427
-1000 -407
-1000 -403
-1000 -384
-1000 -351
-1000 -279
-1000 -244...

output:

3.5389266854

result:

ok found '3.5389267', expected '3.5389267', error '0.0000000'

Test #12:

score: 0
Accepted
time: 75ms
memory: 11648kb

input:

1
158037 96343
-1000 -1000
-1000 -905
-1000 -881
-1000 -833
-1000 -804
-1000 -803
-1000 -782
-1000 -775
-1000 -765
-1000 -759
-1000 -756
-1000 -748
-1000 -722
-1000 -674
-1000 -669
-1000 -630
-1000 -610
-1000 -573
-1000 -443
-1000 -411
-1000 -409
-1000 -403
-1000 -388
-1000 -366
-1000 -349
-1000 -33...

output:

3.9720287783

result:

ok found '3.9720288', expected '3.9720288', error '0.0000000'

Test #13:

score: 0
Accepted
time: 107ms
memory: 4292kb

input:

10000
17 12
-853202371 684059854
-659446544 -924219854
-418025687 117998679
-399757126 -365708913
-331597239 -270896799
-204989763 869548983
-118492298 963842298
-77481232 672198731
45930201 -58234380
52605147 -900097542
78371985 940503934
235210685 595759114
391284089 234315077
416229789 -827244230...

output:

5.3985251100
5.3739078749
1.1735781729
1.5443652595
3.7782886494
3.5704715869
6.2829748588
5.0959252028
2.9875782466
2.3055665058
3.3907841642
5.7854732381
4.8109636123
0.9567574180
4.6294317310
4.7995080629
4.1702889056
5.7394776963
6.1210294480
3.5674682929
6.2280647244
6.2825675747
4.0146545584
0...

result:

ok 10000 numbers

Test #14:

score: 0
Accepted
time: 108ms
memory: 4408kb

input:

1000
133 108
-994106086 710243426
-991027749 -548437545
-983318226 -917527783
-943673956 -368162275
-935819096 616077188
-928022346 487569673
-924213856 -369318351
-914827619 426646545
-883935180 590882141
-870015071 -270471333
-834927107 -211343853
-829266515 354007200
-788041913 -60481736
-7822837...

output:

5.7428017921
1.9153642398
3.8043457981
1.7919162705
3.1695206706
6.0786462146
3.7860674595
3.6659690727
6.2265834530
5.9021521926
5.9443157093
0.7151676870
3.8315742530
1.2228457185
2.5984264669
5.5473289205
4.0791947428
0.7042209930
5.8578224268
0.6894854478
0.9379821529
1.4215226990
4.2713262792
3...

result:

ok 1000 numbers

Test #15:

score: 0
Accepted
time: 112ms
memory: 4492kb

input:

100
1367 924
-999416811 990355566
-997656126 346133696
-997071616 -657387469
-996176051 12622726
-995720693 334093112
-995478093 891631278
-994503890 341858449
-994297596 499383911
-993234202 533518057
-991636838 -4170504
-990563582 -407186200
-989454027 653116272
-989132124 -780605454
-988073521 -1...

output:

4.5051534906
2.7125589326
5.8396785810
6.0229771115
0.4616060431
0.9869912332
1.3219708488
1.9258417458
5.5086083533
4.6463553313
2.2876774102
2.1848725878
4.8094091918
0.4770789902
0.5563416050
1.0936191642
5.1827145536
3.1131846618
4.3802339550
2.7492592825
2.7917953347
6.2717333576
5.7538750453
2...

result:

ok 100 numbers

Test #16:

score: 0
Accepted
time: 112ms
memory: 5028kb

input:

10
13806 4955
-999669776 933068103
-999542354 721337508
-999499427 357140594
-999429088 -925180511
-999334813 -145726169
-999291694 -886327684
-999281647 811188099
-999145269 860687107
-998961821 -979442436
-998769313 446186367
-998591455 658309173
-998539751 -569480843
-998479467 279850955
-9984754...

output:

2.4170804680
6.1611922291
3.9600203768
3.9943617929
2.5515508362
0.5227238368
4.0978438279
6.2103826632
5.9817280293
0.7772236859

result:

ok 10 numbers

Test #17:

score: 0
Accepted
time: 87ms
memory: 7588kb

input:

1
112596 94970
-999980219 399324466
-999932413 952114487
-999894556 -951211102
-999891030 -996222974
-999864824 412806264
-999853190 -269700371
-999845814 -23906803
-999841507 -459154880
-999825178 716247149
-999761774 -154047106
-999729655 -171480333
-999709604 -666447277
-999704754 -22442485
-9996...

output:

5.4425938793

result:

ok found '5.4425939', expected '5.4425939', error '0.0000000'

Test #18:

score: 0
Accepted
time: 126ms
memory: 11352kb

input:

1
161568 13252
-999991243 -113889211
-999976572 -361096764
-999970140 -505012445
-999960654 600963873
-999959339 -269932510
-999956568 734634576
-999941447 716485764
-999940305 64397798
-999939982 746532931
-999939921 995002380
-999932747 185078659
-999927136 585216518
-999914684 898656539
-99990452...

output:

0.6424745907

result:

ok found '0.6424746', expected '0.6424746', error '0.0000000'

Test #19:

score: 0
Accepted
time: 140ms
memory: 11592kb

input:

1
186192 126483
-999998234 974001047
-999976292 -133179660
-999967957 112862981
-999957851 70030467
-999951528 743907713
-999931316 66002112
-999907988 888991267
-999905412 470798211
-999903986 -103943462
-999900422 255729004
-999898174 917068198
-999884392 -183592605
-999880179 -650076162
-99987469...

output:

4.4012456841

result:

ok found '4.4012457', expected '4.4012457', error '0.0000000'

Test #20:

score: 0
Accepted
time: 81ms
memory: 4396kb

input:

1000
133 9
-10 -839744900
-10 -620593257
-10 -322048342
-10 578093727
-10 898998949
-9 -833794004
-9 -704882916
-9 -570204575
-9 -506146571
-9 -109555290
-9 309734100
-9 396668416
-8 -928874025
-8 376566668
-8 596463598
-8 600491164
-8 894775141
-7 -281322833
-7 49984651
-7 154512939
-7 205573228
-7...

output:

3.1415925829
6.2831852482
3.1415926144
3.1415911741
6.2831852703
6.2831852953
3.1415926492
6.2831853037
3.1415926402
6.2831852507
6.2831852816
3.1415927592
3.1415926454
3.1415926238
3.1415926152
6.2831852733
3.1415926494
3.1415926537
3.1415926533
6.2831853047
6.2831852029
3.1415926592
3.1415926505
3...

result:

ok 1000 numbers

Test #21:

score: 0
Accepted
time: 71ms
memory: 5888kb

input:

5
23120 8224
-10 -999575056
-10 -997485895
-10 -995458183
-10 -986953157
-10 -985268102
-10 -983223383
-10 -980910524
-10 -980404283
-10 -973605147
-10 -972441960
-10 -972440422
-10 -969122114
-10 -965754004
-10 -964812113
-10 -964558462
-10 -963159275
-10 -962972564
-10 -962085557
-10 -961552443
-1...

output:

3.1415926424
3.1415926312
3.1415926068
3.1415926494
6.2831852722

result:

ok 5 numbers

Test #22:

score: 0
Accepted
time: 46ms
memory: 7444kb

input:

1
99995 60000
1 100001
1 100002
1 100003
1 100004
1 100005
1 100006
1 100007
1 100008
1 100009
1 100010
1 100011
1 100012
1 100013
1 100014
1 100015
1 100016
1 100017
1 100018
1 100019
1 100020
1 100021
1 100022
1 100023
1 100024
1 100025
1 100026
1 100027
1 100028
1 100029
1 100030
1 100031
1 10003...

output:

6.2831853069

result:

ok found '6.2831853', expected '6.2831853', error '0.0000000'

Extra Test:

score: 0
Extra Test Passed