QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#108855#5740. Testing Subjects Usually DiemaspyWA 179ms8160kbC++2314.2kb2023-05-26 19:48:402023-05-26 19:48:45

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-26 19:48:45]
  • 评测
  • 测评结果:WA
  • 用时:179ms
  • 内存:8160kb
  • [2023-05-26 19:48:40]
  • 提交

answer

#line 1 "library/my_template.hpp"
#if defined(LOCAL)
#include <my_template_compiled.hpp>
#else
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using u32 = unsigned int;
using u64 = unsigned long long;
using i128 = __int128;

template <class T>
constexpr T infty = 0;
template <>
constexpr int infty<int> = 1'000'000'000;
template <>
constexpr ll infty<ll> = ll(infty<int>) * infty<int> * 2;
template <>
constexpr u32 infty<u32> = infty<int>;
template <>
constexpr u64 infty<u64> = infty<ll>;
template <>
constexpr i128 infty<i128> = i128(infty<ll>) * infty<ll>;
template <>
constexpr double infty<double> = infty<ll>;
template <>
constexpr long double infty<long double> = infty<ll>;

using pi = pair<ll, ll>;
using vi = vector<ll>;
template <class T>
using vc = vector<T>;
template <class T>
using vvc = vector<vc<T>>;
template <class T>
using vvvc = vector<vvc<T>>;
template <class T>
using vvvvc = vector<vvvc<T>>;
template <class T>
using vvvvvc = vector<vvvvc<T>>;
template <class T>
using pq = priority_queue<T>;
template <class T>
using pqg = priority_queue<T, vector<T>, greater<T>>;

#define vv(type, name, h, ...) \
  vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...)   \
  vector<vector<vector<type>>> name( \
      h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
#define vvvv(type, name, a, b, c, ...)       \
  vector<vector<vector<vector<type>>>> name( \
      a, vector<vector<vector<type>>>(       \
             b, vector<vector<type>>(c, vector<type>(__VA_ARGS__))))

// https://trap.jp/post/1224/
#define FOR1(a) for (ll _ = 0; _ < ll(a); ++_)
#define FOR2(i, a) for (ll i = 0; i < ll(a); ++i)
#define FOR3(i, a, b) for (ll i = a; i < ll(b); ++i)
#define FOR4(i, a, b, c) for (ll i = a; i < ll(b); i += (c))
#define FOR1_R(a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR2_R(i, a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR3_R(i, a, b) for (ll i = (b)-1; i >= ll(a); --i)
#define overload4(a, b, c, d, e, ...) e
#define overload3(a, b, c, d, ...) d
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FOR_R(...) overload3(__VA_ARGS__, FOR3_R, FOR2_R, FOR1_R)(__VA_ARGS__)

#define FOR_subset(t, s) \
  for (ll t = (s); t >= 0; t = (t == 0 ? -1 : (t - 1) & (s)))
#define all(x) x.begin(), x.end()
#define len(x) ll(x.size())
#define elif else if

#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second

#define stoi stoll

int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(u32 x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int popcnt(u64 x) { return __builtin_popcountll(x); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 1, 2)
int topbit(int x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(u32 x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(ll x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
int topbit(u64 x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 0, 2)
int lowbit(int x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(u32 x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(ll x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
int lowbit(u64 x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }

template <typename T, typename U>
T ceil(T x, U y) {
  return (x > 0 ? (x + y - 1) / y : x / y);
}
template <typename T, typename U>
T floor(T x, U y) {
  return (x > 0 ? x / y : (x - y + 1) / y);
}
template <typename T, typename U>
pair<T, T> divmod(T x, U y) {
  T q = floor(x, y);
  return {q, x - q * y};
}

template <typename T, typename U>
T SUM(const vector<U> &A) {
  T sum = 0;
  for (auto &&a: A) sum += a;
  return sum;
}

#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define LB(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define UB(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define UNIQUE(x) \
  sort(all(x)), x.erase(unique(all(x)), x.end()), x.shrink_to_fit()

template <typename T>
T POP(deque<T> &que) {
  T a = que.front();
  que.pop_front();
  return a;
}
template <typename T>
T POP(pq<T> &que) {
  T a = que.top();
  que.pop();
  return a;
}
template <typename T>
T POP(pqg<T> &que) {
  assert(!que.empty());
  T a = que.top();
  que.pop();
  return a;
}
template <typename T>
T POP(vc<T> &que) {
  assert(!que.empty());
  T a = que.back();
  que.pop_back();
  return a;
}

template <typename F>
ll binary_search(F check, ll ok, ll ng, bool check_ok = true) {
  if (check_ok) assert(check(ok));
  while (abs(ok - ng) > 1) {
    auto x = (ng + ok) / 2;
    tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, x));
  }
  return ok;
}
template <typename F>
double binary_search_real(F check, double ok, double ng, int iter = 100) {
  FOR(iter) {
    double x = (ok + ng) / 2;
    tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, x));
  }
  return (ok + ng) / 2;
}

template <class T, class S>
inline bool chmax(T &a, const S &b) {
  return (a < b ? a = b, 1 : 0);
}
template <class T, class S>
inline bool chmin(T &a, const S &b) {
  return (a > b ? a = b, 1 : 0);
}

// ? は -1
vc<int> s_to_vi(const string &S, char first_char) {
  vc<int> A(S.size());
  FOR(i, S.size()) { A[i] = (S[i] != '?' ? S[i] - first_char : -1); }
  return A;
}

template <typename T, typename U>
vector<T> cumsum(vector<U> &A, int off = 1) {
  int N = A.size();
  vector<T> B(N + 1);
  FOR(i, N) { B[i + 1] = B[i] + A[i]; }
  if (off == 0) B.erase(B.begin());
  return B;
}

// stable sort
template <typename T>
vector<int> argsort(const vector<T> &A) {
  vector<int> ids(len(A));
  iota(all(ids), 0);
  sort(all(ids),
       [&](int i, int j) { return (A[i] == A[j] ? i < j : A[i] < A[j]); });
  return ids;
}

// A[I[0]], A[I[1]], ...
template <typename T>
vc<T> rearrange(const vc<T> &A, const vc<int> &I) {
  vc<T> B(len(I));
  FOR(i, len(I)) B[i] = A[I[i]];
  return B;
}
#endif
#line 1 "library/other/io.hpp"
// based on yosupo's fastio
#include <unistd.h>

namespace fastio {
#define FASTIO
// クラスが read(), print() を持っているかを判定するメタ関数
struct has_write_impl {
  template <class T>
  static auto check(T &&x) -> decltype(x.write(), std::true_type{});

  template <class T>
  static auto check(...) -> std::false_type;
};

template <class T>
class has_write : public decltype(has_write_impl::check<T>(std::declval<T>())) {
};

struct has_read_impl {
  template <class T>
  static auto check(T &&x) -> decltype(x.read(), std::true_type{});

  template <class T>
  static auto check(...) -> std::false_type;
};

template <class T>
class has_read : public decltype(has_read_impl::check<T>(std::declval<T>())) {};

struct Scanner {
  FILE *fp;
  char line[(1 << 15) + 1];
  size_t st = 0, ed = 0;
  void reread() {
    memmove(line, line + st, ed - st);
    ed -= st;
    st = 0;
    ed += fread(line + ed, 1, (1 << 15) - ed, fp);
    line[ed] = '\0';
  }
  bool succ() {
    while (true) {
      if (st == ed) {
        reread();
        if (st == ed) return false;
      }
      while (st != ed && isspace(line[st])) st++;
      if (st != ed) break;
    }
    if (ed - st <= 50) {
      bool sep = false;
      for (size_t i = st; i < ed; i++) {
        if (isspace(line[i])) {
          sep = true;
          break;
        }
      }
      if (!sep) reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_same<T, string>::value, int> = 0>
  bool read_single(T &ref) {
    if (!succ()) return false;
    while (true) {
      size_t sz = 0;
      while (st + sz < ed && !isspace(line[st + sz])) sz++;
      ref.append(line + st, sz);
      st += sz;
      if (!sz || st != ed) break;
      reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  bool read_single(T &ref) {
    if (!succ()) return false;
    bool neg = false;
    if (line[st] == '-') {
      neg = true;
      st++;
    }
    ref = T(0);
    while (isdigit(line[st])) { ref = 10 * ref + (line[st++] & 0xf); }
    if (neg) ref = -ref;
    return true;
  }
  template <typename T,
            typename enable_if<has_read<T>::value>::type * = nullptr>
  inline bool read_single(T &x) {
    x.read();
    return true;
  }
  bool read_single(double &ref) {
    string s;
    if (!read_single(s)) return false;
    ref = std::stod(s);
    return true;
  }
  bool read_single(char &ref) {
    string s;
    if (!read_single(s) || s.size() != 1) return false;
    ref = s[0];
    return true;
  }
  template <class T>
  bool read_single(vector<T> &ref) {
    for (auto &d: ref) {
      if (!read_single(d)) return false;
    }
    return true;
  }
  template <class T, class U>
  bool read_single(pair<T, U> &p) {
    return (read_single(p.first) && read_single(p.second));
  }
  template <size_t N = 0, typename T>
  void read_single_tuple(T &t) {
    if constexpr (N < std::tuple_size<T>::value) {
      auto &x = std::get<N>(t);
      read_single(x);
      read_single_tuple<N + 1>(t);
    }
  }
  template <class... T>
  bool read_single(tuple<T...> &tpl) {
    read_single_tuple(tpl);
    return true;
  }
  void read() {}
  template <class H, class... T>
  void read(H &h, T &... t) {
    bool f = read_single(h);
    assert(f);
    read(t...);
  }
  Scanner(FILE *fp) : fp(fp) {}
};

struct Printer {
  Printer(FILE *_fp) : fp(_fp) {}
  ~Printer() { flush(); }

  static constexpr size_t SIZE = 1 << 15;
  FILE *fp;
  char line[SIZE], small[50];
  size_t pos = 0;
  void flush() {
    fwrite(line, 1, pos, fp);
    pos = 0;
  }
  void write(const char val) {
    if (pos == SIZE) flush();
    line[pos++] = val;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  void write(T val) {
    if (pos > (1 << 15) - 50) flush();
    if (val == 0) {
      write('0');
      return;
    }
    if (val < 0) {
      write('-');
      val = -val; // todo min
    }
    size_t len = 0;
    while (val) {
      small[len++] = char(0x30 | (val % 10));
      val /= 10;
    }
    for (size_t i = 0; i < len; i++) { line[pos + i] = small[len - 1 - i]; }
    pos += len;
  }
  void write(const string s) {
    for (char c: s) write(c);
  }
  void write(const char *s) {
    size_t len = strlen(s);
    for (size_t i = 0; i < len; i++) write(s[i]);
  }
  void write(const double x) {
    ostringstream oss;
    oss << fixed << setprecision(15) << x;
    string s = oss.str();
    write(s);
  }
  void write(const long double x) {
    ostringstream oss;
    oss << fixed << setprecision(15) << x;
    string s = oss.str();
    write(s);
  }
  template <typename T,
            typename enable_if<has_write<T>::value>::type * = nullptr>
  inline void write(T x) {
    x.write();
  }
  template <class T>
  void write(const vector<T> val) {
    auto n = val.size();
    for (size_t i = 0; i < n; i++) {
      if (i) write(' ');
      write(val[i]);
    }
  }
  template <class T, class U>
  void write(const pair<T, U> val) {
    write(val.first);
    write(' ');
    write(val.second);
  }
  template <size_t N = 0, typename T>
  void write_tuple(const T t) {
    if constexpr (N < std::tuple_size<T>::value) {
      if constexpr (N > 0) { write(' '); }
      const auto x = std::get<N>(t);
      write(x);
      write_tuple<N + 1>(t);
    }
  }
  template <class... T>
  bool write(tuple<T...> tpl) {
    write_tuple(tpl);
    return true;
  }
  template <class T, size_t S>
  void write(const array<T, S> val) {
    auto n = val.size();
    for (size_t i = 0; i < n; i++) {
      if (i) write(' ');
      write(val[i]);
    }
  }
  void write(i128 val) {
    string s;
    bool negative = 0;
    if (val < 0) {
      negative = 1;
      val = -val;
    }
    while (val) {
      s += '0' + int(val % 10);
      val /= 10;
    }
    if (negative) s += "-";
    reverse(all(s));
    if (len(s) == 0) s = "0";
    write(s);
  }
};
Scanner scanner = Scanner(stdin);
Printer printer = Printer(stdout);
void flush() { printer.flush(); }
void print() { printer.write('\n'); }
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
  printer.write(head);
  if (sizeof...(Tail)) printer.write(' ');
  print(forward<Tail>(tail)...);
}

void read() {}
template <class Head, class... Tail>
void read(Head &head, Tail &... tail) {
  scanner.read(head);
  read(tail...);
}
} // namespace fastio
using fastio::print;
using fastio::flush;
using fastio::read;

#define INT(...)   \
  int __VA_ARGS__; \
  read(__VA_ARGS__)
#define LL(...)   \
  ll __VA_ARGS__; \
  read(__VA_ARGS__)
#define STR(...)      \
  string __VA_ARGS__; \
  read(__VA_ARGS__)
#define CHAR(...)   \
  char __VA_ARGS__; \
  read(__VA_ARGS__)
#define DBL(...)      \
  double __VA_ARGS__; \
  read(__VA_ARGS__)

#define VEC(type, name, size) \
  vector<type> name(size);    \
  read(name)
#define VV(type, name, h, w)                     \
  vector<vector<type>> name(h, vector<type>(w)); \
  read(name)

void YES(bool t = 1) { print(t ? "YES" : "NO"); }
void NO(bool t = 1) { YES(!t); }
void Yes(bool t = 1) { print(t ? "Yes" : "No"); }
void No(bool t = 1) { Yes(!t); }
void yes(bool t = 1) { print(t ? "yes" : "no"); }
void no(bool t = 1) { yes(!t); }
#line 3 "main.cpp"

using Re = long double;
void solve() {
  LL(N, c);
  vc<Re> P(N);
  FOR(i, N) {
    INT(x);
    P[i] = x;
  }
  Re sm = SUM<Re>(P);
  for (auto&& x: P) x /= sm;
  if (c == 100) {
    Re p = MAX(P);
    return print(1.0 / p);
  }

  vc<Re> ANS;

  auto check = [&](Re w) -> bool {
    vc<Re> Q(N);
    FOR(i, N) {
      Re x = sqrt(P[i]) * w - c;
      x /= 100 - c;
      Q[i] = max<Re>(x, 0);
    }
    ANS = Q;
    return SUM<Re>(Q) <= 1.0;
  };
  binary_search_real(check, 0.0, 10000, 200);

  vc<Re> Q = ANS;

  Re a = 0, b = 0;
  FOR(i, N) {
    a += P[i] / (c + (100 - c) * Q[i]);
    b += P[i] * Q[i] / (c + (100 - c) * Q[i]);
  }

  print(a / b);
}

signed main() {
  solve();
  return 0;
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3852kb

input:

4 100
25 25 25 25

output:

4.000000000000000

result:

ok found '4.0000000', expected '4.0000000', error '0.0000000'

Test #2:

score: 0
Accepted
time: 3ms
memory: 3632kb

input:

2 0
1 4

output:

1.800000000000000

result:

ok found '1.8000000', expected '1.8000000', error '0.0000000'

Test #3:

score: 0
Accepted
time: 3ms
memory: 3560kb

input:

5 0
245 802 95 452 756

output:

4.468530998519810

result:

ok found '4.4685310', expected '4.4685310', error '0.0000000'

Test #4:

score: 0
Accepted
time: 3ms
memory: 3788kb

input:

5 10
85 144 62 67 925

output:

3.082337330175940

result:

ok found '3.0823373', expected '3.0823373', error '0.0000000'

Test #5:

score: 0
Accepted
time: 3ms
memory: 3632kb

input:

5 20
573 598 705 893 279

output:

4.665564073352002

result:

ok found '4.6655641', expected '4.6655641', error '0.0000000'

Test #6:

score: 0
Accepted
time: 3ms
memory: 3868kb

input:

5 25
533 195 166 109 527

output:

3.933807930450654

result:

ok found '3.9338079', expected '3.9338079', error '0.0000000'

Test #7:

score: 0
Accepted
time: 2ms
memory: 3548kb

input:

5 50
498 942 71 637 663

output:

3.871885735863701

result:

ok found '3.8718857', expected '3.8718857', error '0.0000000'

Test #8:

score: 0
Accepted
time: 3ms
memory: 3804kb

input:

5 75
971 663 827 333 382

output:

3.748889876506241

result:

ok found '3.7488899', expected '3.7488899', error '0.0000000'

Test #9:

score: 0
Accepted
time: 3ms
memory: 3672kb

input:

5 90
736 303 722 239 696

output:

3.768820328410014

result:

ok found '3.7688203', expected '3.7688203', error '0.0000000'

Test #10:

score: 0
Accepted
time: 3ms
memory: 3612kb

input:

100 3
658 202 750 953 273 250 658 749 723 227 147 300 891 268 626 9 436 76 199 550 256 668 646 520 736 830 147 712 696 56 668 685 705 170 384 262 264 645 453 806 436 145 575 485 77 871 716 408 536 245 952 385 469 776 647 262 951 784 314 270 122 969 179 635 513 444 709 576 887 834 131 422 334 978 875...

output:

76.023880598904482

result:

ok found '76.0238806', expected '76.0238806', error '0.0000000'

Test #11:

score: 0
Accepted
time: 4ms
memory: 3868kb

input:

100 7
732 702 802 720 694 714 45 298 555 362 471 319 538 926 146 669 947 210 436 4 652 273 408 91 25 626 687 586 747 415 823 623 364 487 26 256 149 606 458 173 254 99 191 44 829 789 17 894 353 597 809 880 651 126 465 288 369 544 136 703 805 231 305 81 680 753 592 293 374 273 504 884 257 480 588 819 ...

output:

68.688643492581128

result:

ok found '68.6886435', expected '68.6886435', error '0.0000000'

Test #12:

score: 0
Accepted
time: 4ms
memory: 3568kb

input:

100 93
769 488 41 386 28 822 145 782 981 94 665 928 187 344 956 992 367 530 899 499 292 151 791 309 21 35 756 41 592 65 788 914 497 961 69 170 535 586 853 192 497 346 8 723 71 838 545 628 806 937 128 436 310 917 956 490 483 984 799 865 116 643 803 301 407 358 187 699 128 271 444 887 904 22 556 301 9...

output:

51.157808159980467

result:

ok found '51.1578082', expected '51.1578082', error '0.0000000'

Test #13:

score: 0
Accepted
time: 3ms
memory: 3812kb

input:

100 99
725 12 862 184 81 723 289 915 414 919 360 251 232 295 807 305 968 480 324 666 87 348 117 25 51 447 976 795 598 372 153 661 949 409 974 911 915 801 569 138 682 431 604 172 249 50 890 337 471 828 451 856 627 349 247 487 649 223 882 48 470 177 556 258 744 930 101 763 817 332 54 187 707 521 989 5...

output:

51.384584941617854

result:

ok found '51.3845849', expected '51.3845849', error '0.0000000'

Test #14:

score: 0
Accepted
time: 3ms
memory: 3660kb

input:

100 100
532 836 32 963 414 408 831 402 576 222 72 344 242 723 191 935 946 78 364 548 702 486 549 801 659 734 380 776 800 458 146 772 656 979 849 148 283 106 728 506 295 58 873 927 471 416 649 662 279 990 437 554 644 733 542 686 915 478 787 209 504 522 646 309 266 66 214 592 290 563 262 524 434 655 1...

output:

51.459595959595960

result:

ok found '51.4595960', expected '51.4596000', error '0.0000001'

Test #15:

score: 0
Accepted
time: 3ms
memory: 3628kb

input:

100 47
785 718 467 35 21 369 753 590 885 262 654 601 756 172 535 746 617 609 42 358 845 102 722 370 195 113 745 321 804 73 264 941 168 8 920 559 814 736 636 302 524 814 39 24 949 720 550 507 476 990 687 790 497 259 410 815 377 474 214 612 24 852 762 804 654 738 219 323 427 56 430 35 553 620 922 298 ...

output:

57.190930034996846

result:

ok found '57.1909300', expected '57.1909300', error '0.0000000'

Test #16:

score: 0
Accepted
time: 3ms
memory: 3540kb

input:

100 23
316 896 76 266 69 253 305 63 629 226 429 333 173 252 563 843 473 599 725 31 993 600 16 651 181 885 911 23 50 882 155 314 223 761 913 743 783 185 874 433 425 987 637 683 848 590 273 193 97 86 836 189 307 722 5 36 954 567 54 357 413 923 963 128 862 235 238 395 699 558 287 782 749 495 983 57 881...

output:

58.740146946791295

result:

ok found '58.7401469', expected '58.7401469', error '0.0000000'

Test #17:

score: 0
Accepted
time: 3ms
memory: 3824kb

input:

100 79
75 171 854 903 856 955 77 209 460 230 261 266 235 312 703 808 967 903 168 305 554 554 164 452 613 104 107 217 481 394 478 663 545 994 190 668 832 244 342 490 509 910 52 922 548 405 713 795 792 522 173 337 964 571 963 988 274 472 415 126 418 247 453 103 265 137 133 533 583 468 860 810 799 919 ...

output:

51.688115505862340

result:

ok found '51.6881155', expected '51.6881155', error '0.0000000'

Test #18:

score: 0
Accepted
time: 4ms
memory: 3908kb

input:

1000 0
255 862 615 652 905 237 800 500 35 648 990 91 27 877 913 715 541 374 599 163 251 476 381 750 458 706 546 924 112 924 319 47 432 994 164 314 323 822 732 881 131 4 914 386 402 907 660 934 585 379 766 387 837 95 547 130 875 931 847 346 25 800 270 144 699 417 904 608 823 785 827 643 744 813 537 3...

output:

893.810252507014910

result:

ok found '893.8102525', expected '893.8102525', error '0.0000000'

Test #19:

score: 0
Accepted
time: 1ms
memory: 3852kb

input:

1000 10
40 638 938 226 578 478 634 337 539 175 527 985 361 510 337 323 358 357 75 748 129 205 326 747 725 706 228 371 771 18 821 255 284 330 622 886 995 359 354 262 591 613 850 766 610 653 616 739 691 357 396 781 954 757 615 960 922 449 739 14 486 472 922 328 866 429 705 893 634 263 231 857 867 225 ...

output:

556.475712198812917

result:

ok found '556.4757122', expected '556.4757122', error '0.0000000'

Test #20:

score: 0
Accepted
time: 4ms
memory: 3588kb

input:

1000 20
661 481 103 543 806 209 681 171 44 106 335 829 408 339 167 930 416 1000 896 164 246 696 891 978 696 170 137 423 871 837 322 806 965 126 121 900 859 819 668 293 714 508 609 192 53 470 605 65 981 442 931 350 745 955 997 858 969 697 591 63 651 441 719 738 373 775 117 907 452 447 785 258 824 973...

output:

543.129921361327758

result:

ok found '543.1299214', expected '543.1299214', error '0.0000000'

Test #21:

score: 0
Accepted
time: 6ms
memory: 3572kb

input:

1000 25
185 794 825 463 270 775 648 695 952 22 752 348 525 546 469 669 274 397 497 943 95 178 365 387 242 924 43 183 660 999 898 204 329 495 814 224 774 130 459 696 596 328 491 986 48 603 718 782 30 31 569 471 712 226 917 701 128 462 580 297 795 965 372 565 278 569 404 75 315 513 824 504 203 524 546...

output:

529.578879924146277

result:

ok found '529.5788799', expected '529.5788799', error '0.0000000'

Test #22:

score: 0
Accepted
time: 3ms
memory: 3660kb

input:

1000 50
241 223 609 18 575 13 616 101 264 541 356 413 709 126 767 772 504 370 840 269 264 199 701 698 471 204 588 854 699 150 880 517 760 722 167 756 93 856 166 923 720 61 426 182 277 681 254 865 743 418 811 500 759 744 599 881 806 529 781 882 193 975 156 623 818 740 413 34 156 278 106 229 441 438 5...

output:

519.134383674448431

result:

ok found '519.1343837', expected '519.1343837', error '0.0000000'

Test #23:

score: 0
Accepted
time: 4ms
memory: 3668kb

input:

1000 75
10 589 345 900 100 698 776 404 378 87 787 772 627 103 571 120 321 867 495 866 173 92 560 825 242 554 757 137 762 691 535 454 414 84 446 1000 116 119 277 17 585 460 753 861 492 138 727 973 492 767 291 191 123 516 281 909 818 322 98 660 268 565 275 759 708 431 919 519 414 862 55 418 350 409 23...

output:

501.473383776329437

result:

ok found '501.4733838', expected '501.4733838', error '0.0000000'

Test #24:

score: 0
Accepted
time: 3ms
memory: 3716kb

input:

1000 90
751 611 489 19 184 10 360 548 330 115 238 270 755 448 879 570 573 43 63 567 344 977 937 64 450 157 94 914 452 875 804 647 229 637 331 462 429 189 876 987 776 119 414 637 336 453 144 122 144 952 456 83 985 498 254 575 709 76 843 150 434 249 852 502 984 886 16 954 60 128 401 658 65 774 244 810...

output:

488.565048051362269

result:

ok found '488.5650481', expected '488.5650481', error '0.0000000'

Test #25:

score: 0
Accepted
time: 3ms
memory: 3828kb

input:

1000 3
903 508 536 772 440 934 505 818 91 374 780 929 258 177 763 73 78 398 386 623 127 219 673 826 672 422 23 101 847 34 519 202 630 591 248 526 410 775 719 616 907 331 82 846 524 764 555 122 377 746 688 769 906 197 615 352 242 34 740 806 601 294 769 729 909 229 824 710 897 498 807 263 337 108 378 ...

output:

627.656643888096073

result:

ok found '627.6566439', expected '627.6566439', error '0.0000000'

Test #26:

score: 0
Accepted
time: 4ms
memory: 3712kb

input:

1000 7
100 854 58 604 988 576 86 197 836 523 675 272 146 550 432 994 953 541 189 103 706 977 829 972 210 897 134 668 5 994 377 972 670 890 316 477 114 224 220 744 353 667 843 144 288 43 427 266 906 810 386 547 641 563 627 871 138 2 319 238 404 338 224 770 379 687 328 258 213 482 966 941 887 824 883 ...

output:

552.891751149374134

result:

ok found '552.8917511', expected '552.8917511', error '0.0000000'

Test #27:

score: 0
Accepted
time: 3ms
memory: 3704kb

input:

1000 93
895 818 184 678 275 454 634 347 573 355 948 617 441 217 492 761 73 170 107 587 504 645 216 808 433 331 879 745 232 724 567 657 519 976 725 166 76 678 192 335 982 281 949 527 175 955 785 882 576 539 140 385 599 390 676 790 232 306 116 704 149 642 539 240 665 43 138 112 381 632 655 677 375 170...

output:

508.755092456040520

result:

ok found '508.7550925', expected '508.7550925', error '0.0000000'

Test #28:

score: 0
Accepted
time: 5ms
memory: 3656kb

input:

1000 99
552 468 534 484 878 913 529 892 756 66 582 586 782 821 355 122 281 285 197 581 964 993 73 448 271 632 83 481 418 750 961 721 585 271 596 212 715 436 501 688 856 391 260 93 657 494 653 107 179 323 711 217 202 227 848 455 650 230 872 728 845 508 974 123 998 988 943 69 146 582 57 494 416 186 43...

output:

493.742166943896418

result:

ok found '493.7421669', expected '493.7421669', error '0.0000000'

Test #29:

score: 0
Accepted
time: 3ms
memory: 3556kb

input:

1000 100
925 680 759 233 463 643 479 53 186 140 73 576 129 231 156 292 143 807 104 509 115 599 889 405 877 566 807 326 768 183 925 955 129 182 220 885 357 792 548 632 691 941 802 683 612 441 343 924 26 906 870 876 212 809 350 430 834 749 677 799 270 571 177 644 464 489 132 33 285 953 632 932 422 92 ...

output:

503.071000000000000

result:

ok found '503.0710000', expected '503.0710000', error '0.0000000'

Test #30:

score: 0
Accepted
time: 3ms
memory: 3668kb

input:

1000 47
162 298 475 310 802 473 488 340 969 425 62 905 482 710 159 871 644 506 126 485 584 925 682 857 437 675 382 227 924 921 593 654 305 287 70 885 123 927 354 771 550 993 198 741 250 778 750 383 710 733 592 706 251 193 249 100 759 523 666 260 836 835 283 447 108 23 740 366 74 895 981 556 965 164 ...

output:

523.592930820325061

result:

ok found '523.5929308', expected '523.5929308', error '0.0000000'

Test #31:

score: 0
Accepted
time: 5ms
memory: 3708kb

input:

1000 23
131 662 34 186 528 457 133 950 642 817 271 988 601 860 75 910 44 961 225 627 446 191 452 454 271 638 512 466 42 596 437 252 583 295 67 675 838 438 694 520 694 97 544 639 591 438 762 947 754 186 414 677 847 460 863 323 273 261 282 98 345 670 963 587 302 264 177 95 454 649 329 164 877 160 499 ...

output:

539.643852830602039

result:

ok found '539.6438528', expected '539.6438528', error '0.0000000'

Test #32:

score: 0
Accepted
time: 5ms
memory: 3620kb

input:

1000 79
529 135 855 239 519 892 231 53 170 562 564 312 176 154 103 709 572 731 222 924 965 796 696 907 816 805 579 929 755 945 580 472 250 203 540 479 414 501 393 767 430 734 283 42 893 562 761 711 616 278 705 965 888 632 773 826 504 815 273 712 536 432 76 795 199 694 496 154 349 832 816 9 260 85 78...

output:

523.791382913807907

result:

ok found '523.7913829', expected '523.7913829', error '0.0000000'

Test #33:

score: 0
Accepted
time: 179ms
memory: 7784kb

input:

100000 0
934 224 590 770 321 912 370 669 958 692 314 802 232 895 944 814 490 923 892 850 671 72 336 967 780 448 848 582 529 797 285 320 978 249 561 187 317 60 843 475 660 749 637 821 171 699 231 951 156 771 891 14 527 302 571 193 453 558 598 263 617 121 976 926 824 883 681 374 738 890 695 602 409 14...

output:

88990.499887535897564

result:

ok found '88990.4998875', expected '88990.4998875', error '0.0000000'

Test #34:

score: 0
Accepted
time: 168ms
memory: 8028kb

input:

100000 10
842 872 627 449 670 854 956 983 724 845 393 511 191 879 602 246 807 59 370 723 512 963 878 34 744 453 520 773 815 472 263 23 929 912 811 923 908 137 925 729 360 264 453 172 759 806 843 779 188 664 51 528 29 332 214 652 646 572 302 795 315 20 426 336 911 668 938 163 607 939 222 804 147 823 ...

output:

50677.419119556180174

result:

ok found '50677.4191196', expected '50677.4191196', error '0.0000000'

Test #35:

score: 0
Accepted
time: 165ms
memory: 7788kb

input:

100000 20
991 661 963 100 888 990 715 50 654 702 162 321 984 130 795 393 337 563 368 81 554 128 293 530 668 179 712 931 506 28 488 958 186 351 270 333 500 932 623 305 849 504 908 306 614 65 251 613 679 888 210 491 706 669 883 144 968 523 760 71 259 338 601 220 474 635 72 141 422 96 763 18 17 238 198...

output:

50527.097492532218315

result:

ok found '50527.0974925', expected '50527.0974925', error '0.0000000'

Test #36:

score: 0
Accepted
time: 172ms
memory: 8028kb

input:

100000 25
439 134 604 294 308 835 104 348 204 420 802 278 87 980 179 677 561 821 525 195 293 130 788 718 571 178 205 317 180 404 372 522 915 391 741 469 379 829 717 193 400 63 931 69 50 490 117 335 332 996 530 163 85 400 574 70 177 245 342 526 723 80 919 254 764 944 722 636 514 285 127 803 816 542 6...

output:

50350.847922401173918

result:

ok found '50350.8479224', expected '50350.8479224', error '0.0000000'

Test #37:

score: -100
Wrong Answer
time: 178ms
memory: 8160kb

input:

100000 50
985 471 801 198 231 903 723 772 348 463 138 767 161 589 522 389 881 364 880 499 719 925 801 460 926 306 103 740 328 607 796 424 220 308 790 98 103 967 696 565 708 966 339 395 74 519 852 110 327 981 424 477 54 8 727 707 528 598 76 314 263 225 880 70 61 238 292 758 670 194 188 814 401 363 65...

output:

inf

result:

wrong output format Expected double, but "inf" found