QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#712674#9532. 长野原龙势流星群peaneval_kala20 169ms78684kbC++238.6kb2024-11-05 16:37:012024-11-05 16:37:01

Judging History

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

  • [2024-11-05 16:37:01]
  • 评测
  • 测评结果:20
  • 用时:169ms
  • 内存:78684kb
  • [2024-11-05 16:37:01]
  • 提交

answer

#pragma GCC optimize(3, "unroll-loops", "no-stack-protector")
#define atsum(l, r) accumulate(l, r, 0)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/hash_policy.hpp>
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr int inf = 0x3f3f3f3f;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
template <typename T>
inline void chkmin(T &x, T y) { x = min(x, y); }
template <typename T>
inline void chkmax(T &x, T y) { x = max(x, y); }
namespace FastIO
{
// ------------------------------
#define IN_HAS_NEG
#define OUT_HAS_NEG
#define CHK_EOF
#define DISABLE_MMAP
// ------------------------------
#if __cplusplus < 201400
#error Please use C++14 or higher.
#endif
#if __cplusplus > 201700
#define INLINE_V inline
#else
#define INLINE_V
#endif
#if ( defined(LOCAL) || defined (_WIN32) ) && !defined(DISABLE_MMAP)
#define DISABLE_MMAP
#endif
#ifndef DISABLE_MMAP
#include<sys/mman.h>
#endif
#ifdef LOCAL
    inline char gc() { return getchar(); }
    inline void pc(char c) { putchar(c); }
#else
#ifdef DISABLE_MMAP
    INLINE_V constexpr int _READ_SIZE = 1 << 18;
    INLINE_V static char _read_buffer[_READ_SIZE], *_read_ptr = nullptr, *_read_ptr_end = nullptr;
    inline char gc()
    {
        if ( __builtin_expect(_read_ptr == _read_ptr_end, false) )
        {
            _read_ptr = _read_buffer;
            _read_ptr_end = _read_buffer + fread(_read_buffer, 1, _READ_SIZE, stdin);
#ifdef CHK_EOF
            if ( __builtin_expect(_read_ptr == _read_ptr_end, false) ) return EOF;
#endif
        }
        return *_read_ptr++;
    }
#else
    INLINE_V static const char *_read_ptr = (const char *)mmap(nullptr, INT_MAX, 1, 2, 0, 0);
    inline char gc() { return *_read_ptr++; }
#endif
    INLINE_V constexpr int _WRITE_SIZE = 1 << 18;
    INLINE_V static char _write_buffer[_WRITE_SIZE], *_write_ptr = _write_buffer;
    inline void pc(char c)
    {
        *_write_ptr++ = c;
        if ( __builtin_expect(_write_buffer + _WRITE_SIZE == _write_ptr, false) )
        {
            fwrite(_write_buffer, 1, _write_ptr - _write_buffer, stdout);
            _write_ptr = _write_buffer;
        }
    }
    INLINE_V struct _auto_flush
    {
        ~_auto_flush() { fwrite(_write_buffer, 1, _write_ptr - _write_buffer, stdout); }
    }	_auto_flush;
#endif
#ifdef CHK_EOF
    inline bool _isdigit(char c) { return ( c & 16 ) && c != EOF; }
    inline bool _isgraph(char c) { return c > 32 && c != EOF; }
#else
    inline bool _isdigit(char c) { return c & 16; }
    inline bool _isgraph(char c) { return c > 32; }
#endif
    template < class T >
    INLINE_V constexpr bool _is_integer = numeric_limits < T >::is_integer;
    template < class T >
    INLINE_V constexpr bool _is_signed = numeric_limits < T >::is_signed;
    template < class T >
    INLINE_V constexpr bool _is_unsigned = _is_integer < T > && !_is_signed < T >;
    template <> INLINE_V constexpr bool _is_integer < __int128 > = true;
    template <> INLINE_V constexpr bool _is_integer < __uint128_t > = true;
    template <> INLINE_V constexpr bool _is_signed < __int128 > = true;
    template <> INLINE_V constexpr bool _is_unsigned < __uint128_t > = true;
#undef INLINE_V
    inline void read(char &c) { do c = gc(); while ( !_isgraph(c) ); }
    inline void read_cstr(char *s)
    {
        char c = gc(); while ( !_isgraph(c) ) c = gc();
        while ( _isgraph(c) ) *s++ = c, c = gc();
        *s = 0;
    }
    inline void read(string &s)
    {
        char c = gc(); s.clear(); while ( !_isgraph(c) ) c = gc();
        while ( _isgraph(c) ) s.push_back(c), c = gc();
    }
#ifdef IN_HAS_NEG
    template < class T, enable_if_t < _is_signed < T >, int > = 0 >
    inline void read(T &x)
    {
        char c = gc(); bool f = true; x = 0;
        while ( !_isdigit(c) ) { if ( c == 45 ) f = false; c = gc(); }
        if ( f ) while ( _isdigit(c) ) x = x * 10 + ( c & 15 ), c = gc();
        else     while ( _isdigit(c) ) x = x * 10 - ( c & 15 ), c = gc();
    }
    template < class T, enable_if_t < _is_unsigned < T >, int > = 0 >
#else
    template < class T, enable_if_t < _is_integer < T >, int > = 0 >
#endif
    inline void read(T &x)
    {
        char c = gc(); while ( !_isdigit(c) ) c = gc();
        x = 0; while ( _isdigit(c) ) x = x * 10 + ( c & 15 ), c = gc();
    }
    inline void write(char c) { pc(c); }
    inline void write_cstr(const char *s) { while ( *s ) pc(*s++); }
    inline void write(const string &s) { for ( char c : s ) pc(c); }
#ifdef OUT_HAS_NEG
    template < class T, enable_if_t < _is_signed < T >, int > = 0 >
    inline void write(T x)
    {
        char buffer[numeric_limits < T >::digits10 + 1]; int digits = 0;
        if ( x >= 0 )  do buffer[digits++] =  ( x % 10 ) | 48, x /= 10; while ( x );
        else { pc(45); do buffer[digits++] = -( x % 10 ) | 48, x /= 10; while ( x ); }
        while ( digits ) pc(buffer[--digits]);
    }
    template < class T, enable_if_t < _is_unsigned < T >, int > = 0 >
#else
    template < class T, enable_if_t < _is_integer < T >, int > = 0 >
#endif
    inline void write(T x)
    {
        char buffer[numeric_limits < T >::digits10 + 1]; int digits = 0;
        do buffer[digits++] = ( x % 10 ) | 48, x /= 10; while ( x );
        while ( digits ) pc(buffer[--digits]);
    }
    template < int N > struct _tuple_io_helper
    {
        template < class ...T >
        static inline void _read(tuple < T... > &x)
        { _tuple_io_helper < N - 1 >::_read(x), read(get < N - 1 > (x)); }
        template < class ...T >
        static inline void _write(const tuple < T... > &x)
        { _tuple_io_helper < N - 1 >::_write(x), pc(32), write(get < N - 1 > (x)); }
    };
    template <> struct _tuple_io_helper < 1 >
    {
        template < class ...T >
        static inline void _read(tuple < T... > &x) { read(get < 0 > (x)); }
        template < class ...T >
        static inline void _write(const tuple < T... > &x) { write(get < 0 > (x)); }
    };
    template < class ...T >
    inline void read(tuple < T... > &x) { _tuple_io_helper < sizeof...(T) >::_read(x); }
    template < class ...T >
    inline void write(const tuple < T... > &x) { _tuple_io_helper < sizeof...(T) >::_write(x); }
    template < class T1, class T2 >
    inline void read(pair < T1, T2 > &x) { read(x.first), read(x.second); }
    template < class T1, class T2 >
    inline void write(const pair < T1, T2 > &x) { write(x.first), pc(32), write(x.second); }
    template < class T1, class ...T2 >
    inline void read(T1 &x, T2 &...y) { read(x), read(y...); }
    template < class ...T >
    inline void read_cstr(char *x, T *...y) { read_cstr(x), read_cstr(y...); }
    template < class T1, class ...T2 >
    inline void write(const T1 &x, const T2 &...y) { write(x), write(y...); }
    template < class ...T >
    inline void write_cstr(const char *x, const T *...y) { write_cstr(x), write_cstr(y...); }
    template < class T >
    inline void print(const T &x) { write(x); }
    inline void print_cstr(const char *x) { write_cstr(x); }
    template < class T1, class ...T2 >
    inline void print(const T1 &x, const T2 &...y) { print(x), pc(32), print(y...); }
    template < class ...T >
    inline void print_cstr(const char *x, const T *...y) { print_cstr(x), pc(32), print_cstr(y...); }
    inline void println() { pc(10); }
    inline void println_cstr() { pc(10); }
    template < class ...T >
    inline void println(const T &...x) { print(x...), pc(10); }
    template < class ...T >
    inline void println_cstr(const T *...x) { print_cstr(x...), pc(10); }
}
using namespace FastIO;
template <typename T>
inline void clear(T &x) {
    T y;
    swap(x, y);
}
using lld = long double;
const int N = 2e5 + 10;
basic_string<int> vec[N];
int n, fa[N];
ll a[N], f[N];
int siz[N];
priority_queue<pair<lld, int> > q[N];
inline void operator+=(priority_queue<pair<lld, int> > &a, priority_queue<pair<lld, int> > &b) {
    if (a.size() > b.size()) swap(a, b);
    while (b.size()) a.push(b.top()), b.pop();
}
void dfs(int u) {
    siz[u] = 1, f[u] = a[u];
    for (int v : vec[u]) dfs(v), q[u].emplace(lld(f[v]) / siz[v], v);
    while (q[u].size() && q[u].top().first > lld(f[u]) / siz[u]) {
        auto [qwq, v] = q[u].top();
        q[u].pop();
        f[u] += f[v], siz[u] += siz[v], q[u] += q[v];
    }
}
int main() {
    read(n);
    for (int i = 2; i <= n; i++) read(fa[i]), vec[fa[i]] += i;
    for (int i = 1; i <= n; i++) read(a[i]);
    dfs(1);
    for (int i = 1; i <= n; i++) printf("%.10Lf\n", (long double)(f[i]) / siz[i] );
    return 0;
}

详细

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 7ms
memory: 21760kb

input:

2000
1 2 2 4 5 2 3 6 4 2 7 2 8 14 8 12 1 14 4 14 8 18 9 2 7 22 20 22 14 29 28 16 6 21 23 6 21 14 13 9 1 4 18 13 2 39 21 33 18 20 38 27 27 1 49 5 51 3 31 24 10 42 2 44 13 9 35 66 27 60 67 59 29 40 53 2 33 43 26 43 62 16 78 45 14 10 73 69 41 35 25 26 2 70 54 1 54 48 5 36 44 28 90 29 51 51 93 82 95 45 ...

output:

883838885.9230769231
887174926.0000000000
881025216.7096774193
912609654.6666666667
872318573.5000000000
831791515.1538461539
867874850.0000000000
892392319.1666666667
836427216.0000000000
869519853.8000000000
693335785.3750000000
925100890.0000000000
994728511.5000000000
950304719.0000000000
808673...

result:

ok 2000 numbers

Test #2:

score: 10
Accepted
time: 7ms
memory: 21740kb

input:

2000
1 1 1 1 1 6 6 6 8 1 7 6 9 4 11 10 17 1 9 20 4 2 7 22 13 21 5 26 19 20 9 8 24 22 32 24 24 8 30 7 22 22 7 14 4 18 30 38 9 45 21 38 53 16 39 6 44 12 10 34 14 17 54 14 65 55 17 21 40 9 27 65 54 53 61 30 3 52 57 49 31 34 16 32 11 85 81 43 36 43 3 45 42 93 83 37 86 77 2 23 41 77 19 18 51 91 68 22 85 ...

output:

794920955.2200000000
713825019.5000000000
734115991.8000000000
800547209.7837837838
734508347.0000000000
760946433.3750000000
750093634.8979591837
735976830.1111111111
765501191.9411764706
747665901.9523809524
816306482.5000000000
741938108.1111111111
790936468.7500000000
784791287.9047619047
686615...

result:

ok 2000 numbers

Test #3:

score: 10
Accepted
time: 7ms
memory: 22108kb

input:

2000
1 1 2 3 3 3 3 4 2 8 4 6 2 10 1 8 8 13 1 19 15 18 8 17 20 16 16 21 11 28 14 18 31 4 30 24 17 10 22 26 2 34 14 13 13 37 43 3 3 38 9 4 29 43 29 46 7 55 9 23 23 49 29 12 45 25 67 59 45 24 5 55 52 73 51 28 25 26 49 78 62 10 18 1 35 73 35 16 52 62 5 89 4 49 12 46 55 14 18 68 64 25 21 88 25 19 82 46 4...

output:

755177543.5161290322
762060513.2941176470
754126791.2625000000
777333185.5500000000
758703127.5000000000
756576527.2222222222
764146306.7857142857
750062914.1400000000
710728919.8125000000
770351278.7500000000
769495170.0000000000
776873566.5714285714
763361472.6000000000
718961316.4545454545
691159...

result:

ok 2000 numbers

Test #4:

score: 10
Accepted
time: 3ms
memory: 21752kb

input:

2000
1 1 3 4 1 1 4 3 3 2 1 3 11 3 1 7 17 9 7 18 4 5 16 10 16 14 12 6 16 22 28 32 27 4 4 19 36 38 12 31 28 18 30 44 35 43 44 29 10 29 7 18 18 35 23 42 12 24 23 2 42 59 8 24 14 49 16 62 38 46 7 34 41 41 10 20 53 71 18 38 63 54 26 76 39 84 28 36 9 53 26 19 39 34 26 49 86 10 64 34 74 43 19 70 97 35 92 4...

output:

914894038.5333333333
918141155.8333333333
911927555.0000000000
870659540.1538461539
777969562.2352941177
778920774.5555555556
876560725.0000000000
974455318.0000000000
858643515.2500000000
835985850.6190476191
963419161.2500000000
868819817.0000000000
813378295.0000000000
984875621.0000000000
762109...

result:

ok 2000 numbers

Test #5:

score: 10
Accepted
time: 0ms
memory: 21876kb

input:

2000
1 2 2 3 2 1 7 8 8 6 9 12 12 3 8 3 9 15 3 19 8 7 4 19 18 23 10 21 10 15 10 22 1 21 19 26 1 38 38 1 18 37 14 27 37 43 30 4 2 2 13 42 13 9 13 38 21 23 58 32 13 62 18 62 15 49 5 61 1 45 29 48 38 34 31 43 45 38 52 54 13 21 78 36 21 45 57 14 25 18 29 45 2 43 8 51 75 79 95 55 29 98 55 93 33 5 93 14 77...

output:

865975765.9540229885
864960665.6000000000
853815173.5555555556
725289681.8000000000
835914002.7500000000
751151162.3000000000
880779494.2631578947
883843482.9166666667
866946310.4600000000
875695250.2727272727
798984107.4000000000
869102654.8928571428
879836598.4166666667
911092097.0000000000
850227...

result:

ok 2000 numbers

Test #6:

score: 10
Accepted
time: 0ms
memory: 21240kb

input:

2000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 5...

output:

780031265.2857142857
709196423.6341463415
852016017.0000000000
710198590.8550724637
942523004.0000000000
795582647.0000000000
817131607.0000000000
723247621.6750000000
711787456.3214285714
702698215.8181818182
778948304.7500000000
825829512.6666666667
731540545.6842105263
717838198.7250000000
755917...

result:

ok 2000 numbers

Test #7:

score: 10
Accepted
time: 3ms
memory: 21100kb

input:

2000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 5...

output:

621161049.0487804878
460347579.9461538462
624970425.7239263804
386751620.2403100775
463913107.3178294574
565084289.9534883721
628866372.3798449612
344826388.2000000000
389755854.0156250000
428515994.7968750000
467520113.5312500000
517598544.1640625000
569478380.3046875000
614133627.3046875000
633756...

result:

ok 2000 numbers

Test #8:

score: 10
Accepted
time: 3ms
memory: 21276kb

input:

2000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 5...

output:

621374004.5748792270
487030122.8750000000
624597241.7000000000
939364019.0000000000
480110389.2480620155
578610053.0000000000
628514468.2138364780
497600202.0000000000
398302285.6701030928
430778150.1788617886
483844086.0234375000
534427093.2698412699
585697877.2592592593
623651552.6739130435
634659...

result:

ok 2000 numbers

Test #9:

score: 10
Accepted
time: 0ms
memory: 21564kb

input:

2000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 5...

output:

762088830.2333333333
781353370.1724137931
714336862.8333333333
723995695.1304347826
787379090.4642857143
708370854.0526315789
735529969.8260869565
725933828.3181818182
721088075.7380952381
810402666.8888888889
798070041.7142857143
761321868.0000000000
708379177.7407407407
806707103.0000000000
682416...

result:

ok 2000 numbers

Test #10:

score: 10
Accepted
time: 0ms
memory: 21228kb

input:

2000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 5...

output:

796409562.0000000000
777105384.2500000000
719995401.8400000000
755696351.5238095238
972657380.0000000000
705728479.9464285714
822339463.6666666667
756514023.7142857143
858700663.0000000000
980362468.0000000000
924539106.0000000000
708454243.0000000000
722158127.3103448276
856914923.0000000000
691671...

result:

ok 2000 numbers

Test #11:

score: 10
Accepted
time: 7ms
memory: 22228kb

input:

2000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

984618295.6153846154
902277197.0000000000
383235589.0000000000
742640716.0000000000
613666672.0000000000
291453150.0000000000
625937043.0000000000
958739025.0000000000
34831727.0000000000
240997073.0000000000
334863696.0000000000
223278814.0000000000
111864227.0000000000
669195136.0000000000
1725111...

result:

ok 2000 numbers

Test #12:

score: 10
Accepted
time: 3ms
memory: 21376kb

input:

2000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

506787773.3134328358
507473433.6541353384
508859284.1666666667
556160454.2500000000
620472531.0000000000
867793536.0000000000
786222333.0000000000
511025497.6808510638
532981265.4285714286
612986220.0000000000
767631955.6666666667
992646284.0000000000
966889609.0000000000
550282737.3333333333
558374...

result:

ok 2000 numbers

Test #13:

score: 10
Accepted
time: 5ms
memory: 21420kb

input:

2000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

470231718.6965000000
470466543.1960980490
470701431.4254254254
470936546.6349524286
471171816.9468937876
471407223.8461152882
471642829.7743229689
471878447.5554440542
472114168.7223895582
472349720.8051230538
472585326.9623115578
472820288.2855706385
473055435.2620724346
473290386.7760442879
473525...

result:

ok 2000 numbers

Test #14:

score: 10
Accepted
time: 3ms
memory: 21804kb

input:

2000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

483979076.4130000000
484220856.5642821411
484462747.6421421421
484704388.6274411617
484945699.8431863727
485187059.8977443609
485428332.7021063190
759340416.0000000000
485532302.7213855422
485773818.6077348066
485873366.3135678392
486115034.5515334339
486356702.8762575453
486598458.9672873679
486839...

result:

ok 2000 numbers

Test #15:

score: 10
Accepted
time: 3ms
memory: 21432kb

input:

2000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

685495666.5000000000
869312055.0000000000
517163136.7368421053
526888922.1666666667
654153657.0000000000
547770219.3333333333
569562360.3333333333
819660511.5000000000
847532860.0000000000
564798030.6000000000
855185985.0000000000
585505461.3333333333
854052921.5000000000
868020227.0000000000
543898...

result:

ok 2000 numbers

Test #16:

score: 10
Accepted
time: 6ms
memory: 21468kb

input:

2000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

491106693.5087719298
494822795.9285714286
501410786.1454545454
504759328.5925925926
512059105.3584905660
513949461.3636363636
522550566.9000000000
915653935.0000000000
537905061.0000000000
581374942.5714285714
920748817.0000000000
597709195.2000000000
913259553.0000000000
611387316.0000000000
733489...

result:

ok 2000 numbers

Test #17:

score: 10
Accepted
time: 3ms
memory: 21472kb

input:

2000
1 1 3 3 2 5 4 2 1 5 7 1 7 5 11 7 13 15 15 18 12 17 13 19 15 12 25 18 24 30 30 23 19 20 32 36 25 27 30 37 28 33 34 35 31 38 35 45 48 50 48 50 40 45 43 49 53 53 52 54 61 56 53 63 60 58 54 58 68 68 69 68 70 73 62 71 71 77 69 69 71 74 72 76 79 80 81 83 75 86 90 86 91 91 91 85 90 88 99 90 94 91 102 ...

output:

734060776.5000000000
907170094.0000000000
884436883.0000000000
248349393.0000000000
731751628.8571428572
122787902.0000000000
631204225.0000000000
3817027.0000000000
52135197.0000000000
803280314.0000000000
259513623.0000000000
590964999.5000000000
628669677.6666666667
438379256.0000000000
824486735...

result:

ok 2000 numbers

Test #18:

score: 10
Accepted
time: 4ms
memory: 22252kb

input:

2000
1 1 1 3 1 5 1 7 6 6 8 3 9 7 14 2 7 7 11 7 13 19 19 12 16 13 18 16 19 23 18 32 24 34 32 31 28 34 26 31 41 28 42 30 33 43 47 38 49 38 49 40 41 49 44 45 54 52 51 53 55 59 52 61 52 61 65 65 60 58 62 68 73 65 71 76 64 71 68 73 67 75 73 75 75 80 81 76 76 87 77 85 93 82 93 84 89 97 88 89 96 102 92 100...

output:

712001072.8392857143
4201358.5000000000
713061983.1445603577
2244053.0000000000
714122990.6149253731
5225148.3333333333
715187323.0059970015
5869207.0000000000
716256611.5939849624
3957454.0000000000
6429324.0000000000
7157175.0000000000
8323923.0000000000
717329802.2473604826
7273392.0000000000
718...

result:

ok 2000 numbers

Test #19:

score: 10
Accepted
time: 8ms
memory: 23008kb

input:

2000
1 1 1 2 1 6 2 5 1 2 9 11 1 13 10 12 5 5 13 13 14 17 14 22 13 15 16 16 28 21 31 18 26 21 21 26 34 28 39 31 36 32 34 40 34 40 44 46 46 46 50 47 45 53 42 42 46 46 49 47 60 62 59 61 59 59 66 63 67 60 62 70 68 64 62 70 68 70 79 76 81 75 80 70 80 85 85 85 85 83 80 88 89 92 83 90 93 95 99 93 100 88 89...

output:

697496384.3993610223
698611495.7040000000
143289881.0000000000
1583426.0000000000
9656032.7500000000
2424102.0000000000
2532741.0000000000
3850673.0000000000
7472201.0000000000
518530306.0000000000
699729704.7163461539
8643690.3333333333
700410693.5594855305
550989099.0000000000
10028394.0000000000
...

result:

ok 2000 numbers

Test #20:

score: 10
Accepted
time: 3ms
memory: 21532kb

input:

2000
1 1 1 3 1 4 3 7 5 6 7 3 7 8 10 6 13 4 12 18 16 16 10 15 20 18 15 24 15 19 24 21 32 22 25 25 33 30 37 37 40 29 31 32 40 39 44 38 39 45 50 52 46 45 48 45 46 47 56 48 51 49 63 51 57 63 61 57 58 58 64 61 63 60 61 63 71 77 66 78 77 70 81 70 85 80 83 84 84 77 78 86 84 85 91 82 83 85 92 92 88 92 101 1...

output:

788364530.6666666667
291116820.0000000000
705269522.0000000000
968497131.0000000000
479210979.5000000000
984278789.0000000000
749238791.0000000000
650055971.2631578947
330485123.0000000000
502037324.0000000000
306298229.0000000000
306940374.3333333333
516159818.7692307692
428612966.0000000000
666892...

result:

ok 2000 numbers

Test #21:

score: 10
Accepted
time: 0ms
memory: 21604kb

input:

2000
1 1 3 4 1 4 7 3 9 5 1 6 8 5 12 16 6 12 13 15 11 15 13 17 20 21 14 14 21 19 22 18 30 25 28 36 26 24 37 34 40 39 43 44 37 44 44 36 49 38 40 51 48 42 49 47 53 48 51 58 48 62 57 59 65 59 65 59 57 69 63 62 64 70 72 75 64 77 70 68 71 80 78 77 79 78 87 86 86 84 84 89 84 84 88 92 91 85 98 99 101 90 96 ...

output:

652426645.7215909091
506709211.0000000000
626941277.6666666667
640221680.0000000000
530323185.8333333333
829464142.0000000000
531001334.6666666667
577506393.8000000000
991902092.0000000000
1000662.0000000000
123643298.0000000000
660010334.0000000000
658531895.3333333333
806631985.0000000000
55044684...

result:

ok 2000 numbers

Test #22:

score: 10
Accepted
time: 6ms
memory: 21432kb

input:

2000
1 2 3 4 4 3 7 3 9 7 7 9 12 14 4 7 1 18 7 6 19 11 21 24 23 15 22 3 1 14 9 24 26 14 9 8 1 32 21 13 11 4 3 4 25 24 18 10 9 36 10 18 53 25 6 26 19 26 44 29 34 56 40 63 60 43 50 63 52 64 59 56 62 52 50 72 47 55 67 48 55 54 53 44 57 81 44 64 49 61 44 43 52 78 91 60 48 71 74 78 83 63 72 64 96 59 75 77...

output:

661041438.1833333333
709912195.8571428572
738067587.0000000000
723579217.4000000000
671235505.0000000000
661735797.6451612903
661572310.3958333333
592983701.0000000000
616968314.6875000000
649054462.9333333333
777022558.0000000000
455883204.2500000000
297814380.0000000000
627502618.0000000000
547794...

result:

ok 2000 numbers

Test #23:

score: 10
Accepted
time: 3ms
memory: 21544kb

input:

2000
1 2 1 1 3 3 5 3 1 8 3 7 12 2 6 13 6 18 1 4 17 12 5 4 4 8 9 21 24 17 13 26 3 9 23 28 9 38 18 1 29 35 14 43 40 23 46 25 13 30 40 23 7 45 39 39 28 58 24 32 31 56 39 35 21 26 27 48 39 65 52 24 45 39 52 62 66 30 64 45 60 56 67 57 47 56 47 49 70 51 67 47 51 64 66 79 70 80 92 64 73 68 63 61 64 79 107 ...

output:

784494649.5201612903
728336562.5640138408
730864296.5798611111
787670154.5910931174
53300176.8888888889
24228432.0000000000
97778937.7368421053
37729196.7142857143
733404194.5505226481
6499714.0000000000
6922127.0000000000
25869385.8333333333
102971758.8888888889
13920339.5000000000
7950030.00000000...

result:

ok 2000 numbers

Test #24:

score: 10
Accepted
time: 3ms
memory: 21648kb

input:

2000
1 2 1 4 4 3 3 4 6 2 5 10 11 9 11 16 13 12 6 12 19 12 14 9 23 8 8 28 5 14 21 20 8 5 5 16 9 33 39 24 25 3 19 29 15 7 46 39 32 42 45 13 34 40 21 29 29 39 18 59 59 18 43 37 29 43 31 22 66 40 47 47 56 25 58 60 62 68 51 41 51 42 64 46 54 84 85 52 74 70 67 48 76 49 89 82 69 49 77 58 62 75 99 100 102 7...

output:

783353173.8571428572
204903172.4545454545
229172725.6250000000
785254461.1480582524
16952640.9000000000
329675480.3750000000
199435398.0000000000
182894354.2222222222
787160780.5279805353
484557370.5000000000
15562280.1250000000
18638362.1111111111
965693369.0000000000
17293135.7142857143
789093560....

result:

ok 2000 numbers

Test #25:

score: 10
Accepted
time: 0ms
memory: 21448kb

input:

2000
1 1 2 1 2 3 5 8 9 4 9 1 1 9 8 6 8 1 8 9 14 16 7 4 10 13 19 24 21 23 6 3 28 21 8 33 21 17 26 20 25 27 11 28 21 42 32 27 16 30 28 29 31 25 8 51 31 54 12 38 15 23 21 28 42 33 30 54 38 33 53 71 71 33 38 74 45 57 77 69 76 80 81 64 51 66 83 52 75 49 47 86 74 52 81 53 66 65 72 86 57 73 69 100 96 96 70...

output:

712379791.0277777778
730937711.6250000000
594520594.1428571428
783452017.7142857143
750107897.2727272727
327405835.6666666667
533643015.7241379310
760578428.7000000000
716674385.6666666667
530704206.0000000000
873840570.0000000000
558880384.0000000000
700766288.0000000000
681959792.0000000000
625729...

result:

ok 2000 numbers

Test #26:

score: 10
Accepted
time: 3ms
memory: 21400kb

input:

2000
1 2 2 3 3 3 7 2 6 2 8 4 13 14 1 8 13 17 13 15 13 10 11 22 24 12 22 16 6 6 10 14 13 30 10 25 27 20 37 5 13 27 14 19 21 1 24 42 21 36 36 4 46 30 41 41 51 22 10 15 22 19 27 28 20 42 42 47 22 58 68 37 56 63 51 40 36 45 40 59 62 56 73 58 62 45 75 87 78 63 67 66 48 49 51 68 85 68 55 64 64 88 98 80 99...

output:

862103310.0000000000
646331770.1470588236
647879605.2089552239
937931035.0000000000
846045856.0000000000
653605854.8548387097
647401386.5789473684
763227900.0000000000
356421127.0000000000
664412500.5600000000
583588916.7500000000
678335454.3333333333
656739042.6250000000
502026450.3333333333
594368...

result:

ok 2000 numbers

Test #27:

score: 10
Accepted
time: 6ms
memory: 21340kb

input:

2000
1 2 1 1 5 3 2 3 2 2 5 12 7 12 14 5 8 7 15 11 2 2 1 17 21 13 6 19 16 17 7 24 29 23 7 9 4 17 18 22 16 30 4 44 18 4 44 33 41 30 2 1 50 39 8 52 54 25 18 25 57 8 39 14 10 19 49 50 28 28 29 60 15 28 65 3 43 70 16 52 65 47 30 34 37 51 54 55 86 39 70 87 86 80 27 54 6 93 75 93 98 18 68 85 60 98 45 18 78...

output:

822926380.2962962963
836531986.5217391304
864103360.3333333333
725945381.1333333334
779930151.9090909091
789866906.5714285714
724645048.2631578947
905205645.0000000000
849643920.0000000000
801687438.2000000000
801268636.5833333333
734015025.6000000000
639833705.0000000000
726743008.4375000000
952865...

result:

ok 2000 numbers

Test #28:

score: 10
Accepted
time: 6ms
memory: 21228kb

input:

2000
1 1 1 4 5 1 3 5 3 5 6 2 4 1 9 13 11 11 7 6 16 9 4 16 14 12 4 2 24 16 5 22 17 22 13 24 25 38 1 7 6 18 2 42 19 43 19 23 3 47 14 45 30 37 25 9 44 44 11 55 51 7 8 21 33 66 49 63 9 53 21 13 58 21 37 63 4 31 60 65 52 7 10 18 68 20 43 53 45 62 85 64 40 41 35 7 72 50 89 85 57 49 90 93 60 63 44 37 8 85 ...

output:

618462437.8846153846
567825893.2500000000
567302445.3255813954
619847729.7368421053
628079388.0625000000
587316194.7777777778
576029985.3333333333
592047118.0952380953
572320227.0697674418
534341960.2777777778
562681987.4375000000
572746051.1388888889
580113553.0285714286
559118719.5625000000
538947...

result:

ok 2000 numbers

Test #29:

score: 10
Accepted
time: 6ms
memory: 21324kb

input:

2000
1 2 1 3 3 5 1 8 2 2 7 10 9 5 7 16 5 2 10 18 18 14 16 24 7 14 24 2 10 11 19 29 2 16 12 18 19 5 16 10 35 12 37 14 28 20 10 8 38 8 22 9 33 16 3 14 22 47 18 32 56 58 6 22 22 39 36 33 17 40 10 46 29 17 17 11 11 21 62 20 51 7 47 52 83 81 7 60 61 83 42 69 82 77 48 77 44 58 23 23 29 33 63 63 102 49 36 ...

output:

640682607.6774193548
654794201.8965517241
623724048.0185185185
563367862.0000000000
629996062.6170212766
578005048.6250000000
644883765.9512195122
609658376.5142857143
627572405.1000000000
666070655.5384615384
552742688.0000000000
596053806.6216216216
709927841.8571428572
627611216.0000000000
589146...

result:

ok 2000 numbers

Test #30:

score: 10
Accepted
time: 5ms
memory: 21260kb

input:

2000
1 2 1 4 5 2 5 8 5 3 4 11 3 4 9 1 4 11 14 18 19 11 21 13 22 9 15 13 14 24 9 22 31 33 23 16 33 19 34 21 10 40 40 28 30 24 9 45 28 28 20 2 12 15 22 55 54 10 18 25 56 24 42 28 36 13 63 48 49 34 16 56 1 14 27 1 1 31 43 50 71 20 61 72 50 57 53 11 15 65 2 1 24 87 33 77 33 54 26 91 43 12 53 44 6 101 95...

output:

875749748.7500000000
980775550.0000000000
792393684.7333333333
877334746.0000000000
892872799.2500000000
692917302.4444444444
844673232.0000000000
968336393.0000000000
809407059.0000000000
841448499.6666666667
802109709.2272727273
822804828.6666666667
689116482.2500000000
820686932.6666666667
800229...

result:

ok 2000 numbers

Test #31:

score: 10
Accepted
time: 3ms
memory: 21364kb

input:

2000
1 2 3 2 1 5 2 7 1 10 6 2 11 4 3 16 10 3 14 12 3 22 9 15 11 11 17 6 16 15 14 14 1 15 32 14 16 29 25 31 3 24 26 37 3 24 38 24 46 5 13 7 31 3 3 32 42 18 16 5 46 60 57 33 34 55 42 23 63 26 57 62 32 40 57 75 47 73 37 28 57 70 78 6 82 86 61 53 17 60 3 7 19 10 36 72 55 95 45 5 15 22 34 57 105 58 18 69...

output:

947322572.5000000000
829209491.3750000000
924970046.0000000000
856705493.0000000000
797400719.5555555556
800729961.2500000000
740208777.0000000000
711780199.5000000000
712300705.8333333333
992631065.5000000000
993761731.0000000000
770162261.5000000000
636860759.5000000000
797242815.4210526316
782755...

result:

ok 2000 numbers

Subtask #2:

score: 10
Accepted

Test #32:

score: 10
Accepted
time: 104ms
memory: 37872kb

input:

200000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52...

output:

792545632.4154929577
794937150.3513513514
794843085.4776119403
804131414.2264150943
805846267.1666666667
806376230.0000000000
778037203.6904761905
815562308.1500000000
776087995.6012658228
809328819.5882352941
767722826.5953757226
771619640.6969696970
800107654.4769230769
879639965.3333333333
775670...

result:

ok 200000 numbers

Test #33:

score: 10
Accepted
time: 96ms
memory: 31564kb

input:

200000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52...

output:

647279839.4787689910
635973895.0667316123
647532087.5491036633
520992591.3328460039
636283816.4230019493
647784525.8479532163
406566953.6435884934
463185839.5329107752
521246596.0463188688
578740922.6221355436
636594030.4714773282
648037157.7063182527
350728412.3924050633
378574282.5988315482
406857...

result:

ok 200000 numbers

Test #34:

score: 10
Accepted
time: 88ms
memory: 31512kb

input:

200000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52...

output:

647754328.6135566810
636746616.8528265107
648006765.7346063913
521510675.0136518771
637057064.1545587518
648259391.9438596491
406874686.2233057045
464547475.6857142857
521775592.6519480519
579595626.9678048781
637367808.8653658536
648512210.6579563182
351934818.7283349562
380442260.0379746835
407073...

result:

ok 200000 numbers

Test #35:

score: 10
Accepted
time: 101ms
memory: 33176kb

input:

200000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52...

output:

645282008.9919064748
637131985.0808179163
645927540.9527162978
532495411.9310344828
637752960.4493177388
646578004.8590130917
427748181.9100000000
483202190.8700696056
532964564.7483296214
595909324.7582697201
638382656.9920713578
647229761.6673387097
387662294.1428571429
423468035.0000000000
428200...

result:

ok 200000 numbers

Test #36:

score: 10
Accepted
time: 96ms
memory: 37948kb

input:

200000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52...

output:

786262518.9269662921
780254007.0480000000
788435954.4367088607
771824213.5253456221
791202439.0967741936
796752745.7500000000
792549624.9646017699
776723747.1851851852
771848261.4579439252
795200761.6000000000
766509591.2608695652
773506193.3529411764
798299195.0000000000
797955826.4095238095
743353...

result:

ok 200000 numbers

Subtask #3:

score: 0
Time Limit Exceeded

Dependency #1:

100%
Accepted

Test #37:

score: 40
Accepted
time: 151ms
memory: 72740kb

input:

50000
1 2 2 1 3 5 3 8 6 9 10 4 3 8 9 11 14 9 9 13 8 3 14 10 1 21 12 18 27 13 24 11 33 19 34 26 33 21 19 19 40 22 12 32 29 33 12 11 42 48 51 16 51 17 7 5 49 21 50 58 16 37 15 30 6 43 22 63 22 33 56 52 14 45 75 12 66 1 70 78 46 7 8 10 21 68 9 85 40 51 73 17 48 74 57 62 14 51 21 79 74 58 66 13 94 46 3 ...

output:

971673085.5454545455
975121900.3125000000
969075132.6730769231
975664002.1333333334
960157266.2469135802
968562798.7794117647
960213680.3442622951
971201676.4629629630
967906002.1228070175
967354382.3157894737
970196379.8072289157
966188758.6796116505
959924831.3461538461
973710454.0652173913
952172...

result:

ok 50000 numbers

Test #38:

score: 40
Accepted
time: 161ms
memory: 78684kb

input:

50000
1 1 3 1 5 5 6 7 9 6 7 8 7 14 10 13 14 14 2 16 17 5 7 18 10 9 21 11 8 14 25 18 9 13 32 14 17 36 1 33 27 8 25 34 12 14 31 15 9 21 31 33 48 34 47 24 43 25 57 56 1 8 20 6 25 4 36 8 23 64 35 53 10 57 49 48 57 29 70 20 19 7 34 81 47 80 30 15 47 16 42 85 69 83 83 92 86 63 66 50 38 53 10 44 69 8 1 2 8...

output:

942224552.4444444444
938592235.6071428572
937276088.8645833333
939690058.9531250000
942753910.6623093682
942778448.9687500000
943085088.9360269360
939757973.0552147239
943331141.7462121212
947374272.3428571429
940465502.7586206897
928695506.7222222222
940004291.5102040817
942767630.2653061224
944213...

result:

ok 50000 numbers

Test #39:

score: 40
Accepted
time: 150ms
memory: 76500kb

input:

50000
1 1 1 1 2 1 1 7 6 8 4 12 3 4 11 14 6 15 11 15 20 4 9 9 25 21 9 11 4 30 19 28 28 6 16 7 32 16 33 4 4 41 18 31 14 26 43 38 9 26 33 22 42 17 25 4 56 55 39 30 50 61 35 46 21 56 41 14 46 18 20 22 6 48 16 67 17 14 1 2 43 37 23 48 70 57 20 47 43 8 66 22 24 18 54 49 33 38 19 79 82 35 39 3 87 53 11 30 ...

output:

944712388.4345238095
941100098.6875000000
943431999.1666666667
949572433.6944444444
928087523.5384615384
938832869.6935483871
944590270.0303030303
941495820.9050847458
938971215.9142857143
936958101.4285714286
942148662.7000000000
943199654.0606060606
939936969.1666666667
941081352.6380368098
947563...

result:

ok 50000 numbers

Test #40:

score: 40
Accepted
time: 168ms
memory: 78008kb

input:

50000
1 2 1 4 2 5 4 4 5 1 3 5 2 7 2 10 16 10 4 6 17 8 11 22 17 19 24 13 18 6 17 4 20 14 16 14 13 8 37 3 26 12 2 11 3 32 26 45 2 32 47 12 1 16 54 38 4 38 46 38 5 58 62 62 48 31 54 7 15 29 59 28 1 15 41 70 54 3 74 33 29 79 80 65 47 84 83 72 52 69 38 68 87 77 6 67 22 9 49 65 54 16 65 88 15 50 86 36 85 ...

output:

953956988.7942857143
955753576.4666666667
961681011.7254901961
948605589.3981042654
948679227.1145038168
943895226.6956521739
944979449.4736842105
955746751.5454545455
943245032.7735849057
952594647.5438596491
951420466.9740259741
967090881.7105263158
946560000.2500000000
937133420.4925373134
939004...

result:

ok 50000 numbers

Test #41:

score: 40
Accepted
time: 169ms
memory: 75860kb

input:

50000
1 2 1 2 1 5 2 1 7 2 10 7 6 13 15 13 16 9 3 3 3 9 7 5 4 5 9 12 17 7 18 15 8 16 8 25 18 13 25 38 37 40 31 33 37 5 45 44 17 38 13 33 27 7 6 36 1 43 20 51 10 37 29 55 51 22 45 43 62 68 16 72 14 37 63 71 3 44 26 43 79 11 29 63 64 23 65 37 46 40 78 14 18 33 37 8 72 31 42 4 97 100 1 54 92 95 39 52 4 ...

output:

964561950.5323076923
964711274.9206349207
962409995.2295081967
974365017.6923076923
965760173.4298642534
954599031.9230769231
967458305.4166666667
954314641.9186046512
958655949.5882352941
981998170.8333333333
962843546.6486486486
953611496.4666666667
971175392.2000000000
955701099.7619047619
962611...

result:

ok 50000 numbers

Test #42:

score: 40
Accepted
time: 28ms
memory: 25460kb

input:

50000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...

output:

773863494.0542635659
775841788.1973684211
830247017.0000000000
842347961.0000000000
791235723.0000000000
909353052.0000000000
757149328.3333333333
735430381.0725806452
772128189.2156862745
932157234.6666666667
779289752.6923076923
817520136.0000000000
776674244.4736842105
824709039.5000000000
746307...

result:

ok 50000 numbers

Test #43:

score: 40
Accepted
time: 16ms
memory: 23820kb

input:

50000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...

output:

643577475.0069025022
633928660.8229571984
644133215.9050086356
519853211.8958130477
634545875.2823758520
644689898.3120138289
404473778.4466019417
461771925.2388349515
520359827.6471734893
577875991.4434697856
635164272.6939571150
645326620.3586956522
349799083.3521400778
377487233.5505836576
405260...

result:

ok 50000 numbers

Test #44:

score: 40
Accepted
time: 21ms
memory: 23832kb

input:

50000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...

output:

642875596.4909404659
632905812.2062256809
643430748.1753022452
520071274.1802325581
633522063.7809152873
643986851.1737251513
405725519.9896238651
464198184.2873786408
521081065.1902912621
578111833.2619974060
634139500.1335282651
644645751.4813664596
349462370.8265107212
378264334.2456140351
406252...

result:

ok 50000 numbers

Test #45:

score: 40
Accepted
time: 28ms
memory: 24944kb

input:

50000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...

output:

873087446.0000000000
647700608.6039603960
658686109.0865671642
891514193.0000000000
649538346.7482517483
658779802.3113772455
539422730.5064935065
554330688.9285714286
578772977.4615384616
609731117.8333333333
654112106.4084507042
661957499.8598726115
496888141.8260869565
525738016.9677419355
541354...

result:

ok 50000 numbers

Test #46:

score: 40
Accepted
time: 29ms
memory: 25596kb

input:

50000
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...

output:

767297605.4731182796
767742339.2934782609
741039032.3365384616
761869530.6050420168
768896292.2637362637
974861468.0000000000
747382676.7254901961
764374664.2881355932
770469513.0508474576
756494391.6551724138
775626354.1269841270
743592645.4313725490
738873631.8167938931
724634886.0333333333
774840...

result:

ok 50000 numbers

Test #47:

score: 0
Time Limit Exceeded

input:

50000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:


result:


Subtask #4:

score: 0
Skipped

Dependency #2:

100%
Accepted

Dependency #3:

0%