QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#33144#1777. Fortune From FollyYaoBIG#AC ✓3ms4028kbC++173.5kb2022-05-28 21:25:232022-05-28 21:25:25

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-28 21:25:25]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:4028kb
  • [2022-05-28 21:25:23]
  • 提交

answer

#include "bits/stdc++.h"
#define rep(i, a, n) for(auto i = a; i <= (n); i++)
#define per(i, a, n) for(auto i = n; i >= (a); i--)
#define pb push_back
#define mp make_pair
#define FI first
#define SE second
#define all(a) a.begin(), a.end()
#define sz(a) (int)(a).size()
template<class T> inline bool chmax(T &a, T b) { if(a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, T b) { if(b < a) { a = b; return 1; } return 0; }
using namespace std;

template<class A, class B> string to_string(pair<A, B> p);
string to_string(const string &s) { return '"' + s + '"'; }
string to_string(const char *s) { return to_string((string) s); }
string to_string(char c) { return "'" + string(1, c) + "'"; }
string to_string(bool x) { return x ? "true" : "false"; }
template<class A> string to_string(A v)
{
    bool first = 1;
    string res = "{";
    for(const auto &x: v) 
    {
        if (!first) res += ", ";
        first = 0;
        res += to_string(x);
    }
    res += "}";
    return res;
}
template<class A, class B> string to_string(pair<A, B> p) { return "(" + to_string(p.FI) + ", " + to_string(p.SE) + ")"; }

void debug_out() { cerr << endl; }
template<class Head, class... Tail> void debug_out(Head H, Tail... T) 
{
    cerr << " " << to_string(H);
    debug_out(T...);
}
#ifndef ONLINE_JUDGE
    #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
    #define debug(...) if(0) puts("No effect.")
#endif

using ll = long long;
// using LL = __int128;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using db = double;
using ldb = long double;

const int maxn = 200'000;
const int inf = 0x3f3f3f3f;
const int mod = 998244353;

template<class T> struct Matrix
{
    static constexpr T eps = static_cast<T>(1e-9);
    using Mat = Matrix;
    using vt = vector<T>;

    int n, m;
    vector<vt> a;
    Matrix(int n, int m): n(n), m(m), a(n, vt(m)) {}
    Matrix(const vector<vt> a): n(sz(a)), m(sz(a[0])), a(a) {}
    vt& operator [](int i) const { return (vt&)a[i]; }
    Mat inverse()
    {
        assert(n == m);
        auto b = a;

        rep(i, 0, n - 1) b[i].resize(n * 2, 0), b[i][n + i] = 1;
        rep(c, 0, n - 1)
        {
            int id = -1;
            rep(i, c, n - 1) if(abs(b[i][c]) > Mat::eps) { id = i; break; }
            assert(id != -1);
            if(id != c) swap(b[c], b[id]);
        
            T tmp = b[c][c];
            for(auto &x: b[c]) x /= tmp;
            rep(i, 0, n - 1) if(i != c)
            {
                T tmp = b[i][c];
                rep(j, 0, n * 2 - 1) b[i][j] -= tmp * b[c][j];
            }
        }
        for(auto &row: b) row.erase(row.begin(), row.begin() + n);
        return Mat(b);
    }
};

using Mat = Matrix<db>;

int main()
{
    ios::sync_with_stdio(0); cin.tie(0);

    int n, k; db p; cin >> n >> k >> p;
    int tot = 0;
    int N = 1 << n;
    vi id(N);
    rep(msk, 0, N - 1) if(__builtin_popcount(msk) >= k) id[msk] = -1; else id[msk] = tot++;
    
    Mat A(tot, tot);
    rep(i, 0, tot - 1) A[i][i] = 1;

    rep(msk, 0, N - 1) if(__builtin_popcount(msk) < k)
    {
        vector<db> P{1 - p, p};
        rep(i, 0, 1)
        {
            int nmsk = (msk >> 1) | (i << (n - 1));
            int x = id[msk];
            int y = id[nmsk];
            if(y != -1) A[x][y] -= P[i];
        }
    }
    auto iA = A.inverse();
    db ans = 0;
    for(auto x: iA[0]) ans += x;
    printf("%.10f\n", ans);
    return 0;
}

詳細信息

Test #1:

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

input:

2 1 0.0006

output:

1666.6666666665

result:

ok found '1666.6666667', expected '1666.6666667', error '0.0000000'

Test #2:

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

input:

2 1 0.0043

output:

232.5581395349

result:

ok found '232.5581395', expected '232.5581395', error '0.0000000'

Test #3:

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

input:

2 1 0.4202

output:

2.3798191337

result:

ok found '2.3798191', expected '2.3798191', error '0.0000000'

Test #4:

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

input:

2 1 0.6729

output:

1.4861049190

result:

ok found '1.4861049', expected '1.4861049', error '0.0000000'

Test #5:

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

input:

2 1 0.9925

output:

1.0075566751

result:

ok found '1.0075567', expected '1.0075567', error '0.0000000'

Test #6:

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

input:

2 1 0.9999

output:

1.0001000100

result:

ok found '1.0001000', expected '1.0001000', error '0.0000000'

Test #7:

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

input:

2 2 0.0006

output:

2779444.4440968758

result:

ok found '2779444.4440969', expected '2779444.4444444', error '0.0000000'

Test #8:

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

input:

2 2 0.0072

output:

19429.0123456851

result:

ok found '19429.0123457', expected '19429.0123457', error '0.0000000'

Test #9:

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

input:

2 2 0.0848

output:

150.8543965824

result:

ok found '150.8543966', expected '150.8543966', error '0.0000000'

Test #10:

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

input:

2 2 0.7554

output:

3.0762535865

result:

ok found '3.0762536', expected '3.0762536', error '0.0000000'

Test #11:

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

input:

2 2 0.9980

output:

2.0060160401

result:

ok found '2.0060160', expected '2.0060160', error '0.0000000'

Test #12:

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

input:

2 2 0.9995

output:

2.0015010006

result:

ok found '2.0015010', expected '2.0015010', error '0.0000000'

Test #13:

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

input:

3 1 0.0008

output:

1250.0000000000

result:

ok found '1250.0000000', expected '1250.0000000', error '0.0000000'

Test #14:

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

input:

3 1 0.0063

output:

158.7301587302

result:

ok found '158.7301587', expected '158.7301587', error '0.0000000'

Test #15:

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

input:

3 1 0.4356

output:

2.2956841139

result:

ok found '2.2956841', expected '2.2956841', error '0.0000000'

Test #16:

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

input:

3 1 0.5963

output:

1.6770082173

result:

ok found '1.6770082', expected '1.6770082', error '0.0000000'

Test #17:

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

input:

3 1 0.9947

output:

1.0053282397

result:

ok found '1.0053282', expected '1.0053282', error '0.0000000'

Test #18:

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

input:

3 1 0.9997

output:

1.0003000900

result:

ok found '1.0003001', expected '1.0003001', error '0.0000000'

Test #19:

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

input:

3 2 0.0009

output:

618672.9645578376

result:

ok found '618672.9645578', expected '618672.9645624', error '0.0000000'

Test #20:

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

input:

3 2 0.0082

output:

7588.6145092568

result:

ok found '7588.6145093', expected '7588.6145093', error '0.0000000'

Test #21:

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

input:

3 2 0.3372

output:

8.2547364887

result:

ok found '8.2547365', expected '8.2547365', error '0.0000000'

Test #22:

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

input:

3 2 0.5760

output:

3.8527415817

result:

ok found '3.8527416', expected '3.8527416', error '0.0000000'

Test #23:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

3 2 0.9905

output:

2.0192733550

result:

ok found '2.0192734', expected '2.0192734', error '0.0000000'

Test #24:

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

input:

3 2 0.9999

output:

2.0002000300

result:

ok found '2.0002000', expected '2.0002000', error '0.0000000'

Test #25:

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

input:

3 3 0.0071

output:

2813968.8638152960

result:

ok found '2813968.8638153', expected '2813968.8637678', error '0.0000000'

Test #26:

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

input:

3 3 0.3459

output:

35.4118004661

result:

ok found '35.4118005', expected '35.4118005', error '0.0000000'

Test #27:

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

input:

3 3 0.6510

output:

7.5202708589

result:

ok found '7.5202709', expected '7.5202709', error '0.0000000'

Test #28:

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

input:

3 3 0.9908

output:

3.0560582326

result:

ok found '3.0560582', expected '3.0560582', error '0.0000000'

Test #29:

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

input:

3 3 0.9998

output:

3.0012004001

result:

ok found '3.0012004', expected '3.0012004', error '0.0000000'

Test #30:

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

input:

4 1 0.0007

output:

1428.5714285714

result:

ok found '1428.5714286', expected '1428.5714286', error '0.0000000'

Test #31:

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

input:

4 1 0.0021

output:

476.1904761905

result:

ok found '476.1904762', expected '476.1904762', error '0.0000000'

Test #32:

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

input:

4 1 0.2115

output:

4.7281323877

result:

ok found '4.7281324', expected '4.7281324', error '0.0000000'

Test #33:

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

input:

4 1 0.8072

output:

1.2388503469

result:

ok found '1.2388503', expected '1.2388503', error '0.0000000'

Test #34:

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

input:

4 1 0.9903

output:

1.0097950116

result:

ok found '1.0097950', expected '1.0097950', error '0.0000000'

Test #35:

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

input:

4 1 0.9994

output:

1.0006003602

result:

ok found '1.0006004', expected '1.0006004', error '0.0000000'

Test #36:

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

input:

4 2 0.0009

output:

413004.3375465430

result:

ok found '413004.3375465', expected '413004.3375486', error '0.0000000'

Test #37:

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

input:

4 2 0.0056

output:

10867.5697843755

result:

ok found '10867.5697844', expected '10867.5697844', error '0.0000000'

Test #38:

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

input:

4 2 0.4091

output:

5.5242095257

result:

ok found '5.5242095', expected '5.5242095', error '0.0000000'

Test #39:

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

input:

4 2 0.5130

output:

4.1531850202

result:

ok found '4.1531850', expected '4.1531850', error '0.0000000'

Test #40:

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

input:

4 2 0.9985

output:

2.0030045101

result:

ok found '2.0030045', expected '2.0030045', error '0.0000000'

Test #41:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

4 2 0.9991

output:

2.0018016222

result:

ok found '2.0018016', expected '2.0018016', error '0.0000000'

Test #42:

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

input:

4 3 0.0031

output:

11270438.0022761654

result:

ok found '11270438.0022762', expected '11270438.0012254', error '0.0000000'

Test #43:

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

input:

4 3 0.1912

output:

76.3158418933

result:

ok found '76.3158419', expected '76.3158419', error '0.0000000'

Test #44:

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

input:

4 3 0.5317

output:

7.8064292792

result:

ok found '7.8064293', expected '7.8064293', error '0.0000000'

Test #45:

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

input:

4 3 0.9975

output:

3.0075438443

result:

ok found '3.0075438', expected '3.0075438', error '0.0000000'

Test #46:

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

input:

4 3 0.9999

output:

3.0003000700

result:

ok found '3.0003001', expected '3.0003001', error '0.0000000'

Test #47:

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

input:

4 4 0.0067

output:

499597601.2739261389

result:

ok found '499597601.2739261', expected '499597610.8540066', error '0.0000000'

Test #48:

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

input:

4 4 0.0935

output:

14432.8651865001

result:

ok found '14432.8651865', expected '14432.8651865', error '0.0000000'

Test #49:

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

input:

4 4 0.8273

output:

6.5706677931

result:

ok found '6.5706678', expected '6.5706678', error '0.0000000'

Test #50:

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

input:

4 4 0.9968

output:

4.0322059528

result:

ok found '4.0322060', expected '4.0322060', error '0.0000000'

Test #51:

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

input:

4 4 0.9991

output:

4.0090162256

result:

ok found '4.0090162', expected '4.0090162', error '0.0000000'

Test #52:

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

input:

5 1 0.0006

output:

1666.6666666665

result:

ok found '1666.6666667', expected '1666.6666667', error '0.0000000'

Test #53:

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

input:

5 1 0.0097

output:

103.0927835052

result:

ok found '103.0927835', expected '103.0927835', error '0.0000000'

Test #54:

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

input:

5 1 0.2259

output:

4.4267374945

result:

ok found '4.4267375', expected '4.4267375', error '0.0000000'

Test #55:

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

input:

5 1 0.5171

output:

1.9338619223

result:

ok found '1.9338619', expected '1.9338619', error '0.0000000'

Test #56:

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

input:

5 1 0.9924

output:

1.0076582023

result:

ok found '1.0076582', expected '1.0076582', error '0.0000000'

Test #57:

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

input:

5 1 0.9997

output:

1.0003000900

result:

ok found '1.0003001', expected '1.0003001', error '0.0000000'

Test #58:

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

input:

5 2 0.0002

output:

6256875.3133941079

result:

ok found '6256875.3133941', expected '6256875.3125313', error '0.0000000'

Test #59:

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

input:

5 2 0.0013

output:

148986.9990943940

result:

ok found '148986.9990944', expected '148986.9990937', error '0.0000000'

Test #60:

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

input:

5 2 0.0382

output:

207.6353108306

result:

ok found '207.6353108', expected '207.6353108', error '0.0000000'

Test #61:

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

input:

5 2 0.7620

output:

2.6288961557

result:

ok found '2.6288962', expected '2.6288962', error '0.0000000'

Test #62:

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

input:

5 2 0.9971

output:

2.0058168690

result:

ok found '2.0058169', expected '2.0058169', error '0.0000000'

Test #63:

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

input:

5 2 0.9997

output:

2.0006001801

result:

ok found '2.0006002', expected '2.0006002', error '0.0000000'

Test #64:

score: 0
Accepted
time: 0ms
memory: 3764kb

input:

5 3 0.0008

output:

326477590.4377323389

result:

ok found '326477590.4377323', expected '326477592.8736092', error '0.0000000'

Test #65:

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

input:

5 3 0.0035

output:

3937589.9594860850

result:

ok found '3937589.9594861', expected '3937589.9586740', error '0.0000000'

Test #66:

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

input:

5 3 0.1415

output:

100.3937182431

result:

ok found '100.3937182', expected '100.3937182', error '0.0000000'

Test #67:

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

input:

5 3 0.7760

output:

3.9333966485

result:

ok found '3.9333966', expected '3.9333966', error '0.0000000'

Test #68:

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

input:

5 3 0.9920

output:

3.0241961208

result:

ok found '3.0241961', expected '3.0241961', error '0.0000000'

Test #69:

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

input:

5 3 0.9994

output:

3.0018010817

result:

ok found '3.0018011', expected '3.0018011', error '0.0000000'

Test #70:

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

input:

5 4 0.0092

output:

35630835.3877247572

result:

ok found '35630835.3877248', expected '35630835.3700849', error '0.0000000'

Test #71:

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

input:

5 4 0.4564

output:

19.6888464764

result:

ok found '19.6888465', expected '19.6888465', error '0.0000000'

Test #72:

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

input:

5 4 0.9210

output:

4.4092941291

result:

ok found '4.4092941', expected '4.4092941', error '0.0000000'

Test #73:

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

input:

5 4 0.9910

output:

4.0371408042

result:

ok found '4.0371408', expected '4.0371408', error '0.0000000'

Test #74:

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

input:

5 4 0.9999

output:

4.0004001400

result:

ok found '4.0004001', expected '4.0004001', error '0.0000000'

Test #75:

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

input:

5 5 0.2839

output:

755.7839472360

result:

ok found '755.7839472', expected '755.7839472', error '0.0000000'

Test #76:

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

input:

5 5 0.8893

output:

7.2075071940

result:

ok found '7.2075072', expected '7.2075072', error '0.0000000'

Test #77:

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

input:

5 5 0.9960

output:

5.0605645125

result:

ok found '5.0605645', expected '5.0605645', error '0.0000000'

Test #78:

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

input:

5 5 0.9995

output:

5.0075087588

result:

ok found '5.0075088', expected '5.0075088', error '0.0000000'

Test #79:

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

input:

6 1 0.0009

output:

1111.1111111111

result:

ok found '1111.1111111', expected '1111.1111111', error '0.0000000'

Test #80:

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

input:

6 1 0.0012

output:

833.3333333333

result:

ok found '833.3333333', expected '833.3333333', error '0.0000000'

Test #81:

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

input:

6 1 0.2567

output:

3.8955979743

result:

ok found '3.8955980', expected '3.8955980', error '0.0000000'

Test #82:

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

input:

6 1 0.9687

output:

1.0323113451

result:

ok found '1.0323113', expected '1.0323113', error '0.0000000'

Test #83:

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

input:

6 1 0.9985

output:

1.0015022534

result:

ok found '1.0015023', expected '1.0015023', error '0.0000000'

Test #84:

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

input:

6 1 0.9995

output:

1.0005002501

result:

ok found '1.0005003', expected '1.0005003', error '0.0000000'

Test #85:

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

input:

6 2 0.0003

output:

2226889.2891127747

result:

ok found '2226889.2891128', expected '2226889.2889489', error '0.0000000'

Test #86:

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

input:

6 2 0.0039

output:

13508.6190568285

result:

ok found '13508.6190568', expected '13508.6190568', error '0.0000000'

Test #87:

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

input:

6 2 0.1085

output:

30.3133398153

result:

ok found '30.3133398', expected '30.3133398', error '0.0000000'

Test #88:

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

input:

6 2 0.5517

output:

3.6585839916

result:

ok found '3.6585840', expected '3.6585840', error '0.0000000'

Test #89:

score: 0
Accepted
time: 0ms
memory: 3872kb

input:

6 2 0.9910

output:

2.0181634713

result:

ok found '2.0181635', expected '2.0181635', error '0.0000000'

Test #90:

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

input:

6 2 0.9995

output:

2.0010005003

result:

ok found '2.0010005', expected '2.0010005', error '0.0000000'

Test #91:

score: 0
Accepted
time: 0ms
memory: 3848kb

input:

6 3 0.0007

output:

292567880.8655235767

result:

ok found '292567880.8655236', expected '292567883.7721204', error '0.0000000'

Test #92:

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

input:

6 3 0.0021

output:

10912110.9629028309

result:

ok found '10912110.9629028', expected '10912110.9618026', error '0.0000000'

Test #93:

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

input:

6 3 0.2715

output:

18.1753700619

result:

ok found '18.1753701', expected '18.1753701', error '0.0000000'

Test #94:

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

input:

6 3 0.9570

output:

3.1348172121

result:

ok found '3.1348172', expected '3.1348172', error '0.0000000'

Test #95:

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

input:

6 3 0.9952

output:

3.0144694566

result:

ok found '3.0144695', expected '3.0144695', error '0.0000000'

Test #96:

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

input:

6 3 0.9990

output:

3.0030030030

result:

ok found '3.0030030', expected '3.0030030', error '0.0000000'

Test #97:

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

input:

6 4 0.0108

output:

7635364.7849683249

result:

ok found '7635364.7849683', expected '7635364.7867661', error '0.0000000'

Test #98:

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

input:

6 4 0.7815

output:

5.2914115752

result:

ok found '5.2914116', expected '5.2914116', error '0.0000000'

Test #99:

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

input:

6 4 0.9933

output:

4.0269852887

result:

ok found '4.0269853', expected '4.0269853', error '0.0000000'

Test #100:

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

input:

6 4 0.9993

output:

4.0028019665

result:

ok found '4.0028020', expected '4.0028020', error '0.0000000'

Test #101:

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

input:

6 5 0.0652

output:

196993.1404980165

result:

ok found '196993.1404980', expected '196993.1404996', error '0.0000000'

Test #102:

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

input:

6 5 0.9264

output:

5.5101079625

result:

ok found '5.5101080', expected '5.5101080', error '0.0000000'

Test #103:

score: 0
Accepted
time: 0ms
memory: 3960kb

input:

6 5 0.9956

output:

5.0224848866

result:

ok found '5.0224849', expected '5.0224849', error '0.0000000'

Test #104:

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

input:

6 5 0.9991

output:

5.0045202574

result:

ok found '5.0045203', expected '5.0045203', error '0.0000000'

Test #105:

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

input:

6 6 0.3775

output:

553.4778289455

result:

ok found '553.4778289', expected '553.4778289', error '0.0000000'

Test #106:

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

input:

6 6 0.7023

output:

24.6362155449

result:

ok found '24.6362155', expected '24.6362155', error '0.0000000'

Test #107:

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

input:

6 6 0.9975

output:

6.0528519786

result:

ok found '6.0528520', expected '6.0528520', error '0.0000000'

Test #108:

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

input:

6 6 0.9992

output:

6.0168359046

result:

ok found '6.0168359', expected '6.0168359', error '0.0000000'

Test #109:

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

input:

6 4 0.5948

output:

8.1759057333

result:

ok found '8.1759057', expected '8.1759057', error '0.0000000'

Test #110:

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

input:

3 3 0.6511

output:

7.5176403897

result:

ok found '7.5176404', expected '7.5176404', error '0.0000000'

Test #111:

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

input:

1 1 0.6444

output:

1.5518311608

result:

ok found '1.5518312', expected '1.5518312', error '0.0000000'

Test #112:

score: 0
Accepted
time: 0ms
memory: 3700kb

input:

6 2 0.9955

output:

2.0090406831

result:

ok found '2.0090407', expected '2.0090407', error '0.0000000'

Test #113:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

4 3 0.2783

output:

30.6298870345

result:

ok found '30.6298870', expected '30.6298870', error '0.0000000'

Test #114:

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

input:

3 1 0.1512

output:

6.6137566138

result:

ok found '6.6137566', expected '6.6137566', error '0.0000000'

Test #115:

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

input:

5 2 0.6382

output:

3.1611302480

result:

ok found '3.1611302', expected '3.1611302', error '0.0000000'

Test #116:

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

input:

2 1 0.8806

output:

1.1355893709

result:

ok found '1.1355894', expected '1.1355894', error '0.0000000'

Test #117:

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

input:

2 2 0.0128

output:

6181.6406249987

result:

ok found '6181.6406250', expected '6181.6406250', error '0.0000000'

Test #118:

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

input:

1 1 0.1259

output:

7.9428117554

result:

ok found '7.9428118', expected '7.9428118', error '0.0000000'

Test #119:

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

input:

2 1 0.8802

output:

1.1361054306

result:

ok found '1.1361054', expected '1.1361054', error '0.0000000'

Test #120:

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

input:

5 5 0.9329

output:

6.1881055272

result:

ok found '6.1881055', expected '6.1881055', error '0.0000000'

Test #121:

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

input:

6 2 0.9894

output:

2.0214271277

result:

ok found '2.0214271', expected '2.0214271', error '0.0000000'

Test #122:

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

input:

4 1 0.8710

output:

1.1481056257

result:

ok found '1.1481056', expected '1.1481056', error '0.0000000'

Test #123:

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

input:

5 2 0.5881

output:

3.4511787099

result:

ok found '3.4511787', expected '3.4511787', error '0.0000000'

Test #124:

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

input:

6 4 0.2645

output:

57.7209311903

result:

ok found '57.7209312', expected '57.7209312', error '0.0000000'

Test #125:

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

input:

3 3 0.0452

output:

11340.4993565001

result:

ok found '11340.4993565', expected '11340.4993565', error '0.0000000'

Test #126:

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

input:

1 1 0.0910

output:

10.9890109890

result:

ok found '10.9890110', expected '10.9890110', error '0.0000000'

Test #127:

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

input:

2 1 0.7867

output:

1.2711325791

result:

ok found '1.2711326', expected '1.2711326', error '0.0000000'

Test #128:

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

input:

6 1 0.2283

output:

4.3802014893

result:

ok found '4.3802015', expected '4.3802015', error '0.0000000'

Test #129:

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

input:

1 1 0.7313

output:

1.3674278682

result:

ok found '1.3674279', expected '1.3674279', error '0.0000000'

Test #130:

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

input:

2 2 0.0318

output:

1020.3314742296

result:

ok found '1020.3314742', expected '1020.3314742', error '0.0000000'

Test #131:

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

input:

4 3 0.5067

output:

8.5488449483

result:

ok found '8.5488449', expected '8.5488449', error '0.0000000'

Test #132:

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

input:

2 2 0.9787

output:

2.0657643444

result:

ok found '2.0657643', expected '2.0657643', error '0.0000000'

Test #133:

score: 0
Accepted
time: 0ms
memory: 3748kb

input:

2 1 0.1343

output:

7.4460163812

result:

ok found '7.4460164', expected '7.4460164', error '0.0000000'

Test #134:

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

input:

3 2 0.4793

output:

4.9488502644

result:

ok found '4.9488503', expected '4.9488503', error '0.0000000'

Test #135:

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

input:

3 2 0.4528

output:

5.3608761236

result:

ok found '5.3608761', expected '5.3608761', error '0.0000000'

Test #136:

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

input:

5 3 0.7107

output:

4.3790738749

result:

ok found '4.3790739', expected '4.3790739', error '0.0000000'

Test #137:

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

input:

6 6 0.1139

output:

516861.2466016365

result:

ok found '516861.2466016', expected '516861.2466018', error '0.0000000'

Test #138:

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

input:

6 4 0.2663

output:

56.5932354019

result:

ok found '56.5932354', expected '56.5932354', error '0.0000000'

Test #139:

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

input:

5 3 0.7535

output:

4.0736898172

result:

ok found '4.0736898', expected '4.0736898', error '0.0000000'

Test #140:

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

input:

4 4 0.0621

output:

71691.9848927353

result:

ok found '71691.9848927', expected '71691.9848929', error '0.0000000'

Test #141:

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

input:

2 1 0.5623

output:

1.7784101014

result:

ok found '1.7784101', expected '1.7784101', error '0.0000000'

Test #142:

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

input:

2 1 0.6205

output:

1.6116035455

result:

ok found '1.6116035', expected '1.6116035', error '0.0000000'

Test #143:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

4 1 0.0940

output:

10.6382978723

result:

ok found '10.6382979', expected '10.6382979', error '0.0000000'

Test #144:

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

input:

6 2 0.3503

output:

6.0831192304

result:

ok found '6.0831192', expected '6.0831192', error '0.0000000'

Test #145:

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

input:

5 4 0.8681

output:

4.8037623063

result:

ok found '4.8037623', expected '4.8037623', error '0.0000000'

Test #146:

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

input:

6 3 0.4649

output:

7.3672230881

result:

ok found '7.3672231', expected '7.3672231', error '0.0000000'

Test #147:

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

input:

6 1 0.4267

output:

2.3435669088

result:

ok found '2.3435669', expected '2.3435669', error '0.0000000'

Test #148:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

5 2 0.9766

output:

2.0479216668

result:

ok found '2.0479217', expected '2.0479217', error '0.0000000'

Test #149:

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

input:

5 5 0.1301

output:

30840.9678696929

result:

ok found '30840.9678697', expected '30840.9678697', error '0.0000000'

Test #150:

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

input:

2 2 0.8839

output:

2.4113018443

result:

ok found '2.4113018', expected '2.4113018', error '0.0000000'

Test #151:

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

input:

1 1 0.4261

output:

2.3468669326

result:

ok found '2.3468669', expected '2.3468669', error '0.0000000'

Test #152:

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

input:

6 2 0.3458

output:

6.1773845393

result:

ok found '6.1773845', expected '6.1773845', error '0.0000000'

Test #153:

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

input:

2 2 0.6271

output:

4.1375251202

result:

ok found '4.1375251', expected '4.1375251', error '0.0000000'

Test #154:

score: 0
Accepted
time: 0ms
memory: 3836kb

input:

4 4 0.9644

output:

4.3830213378

result:

ok found '4.3830213', expected '4.3830213', error '0.0000000'

Test #155:

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

input:

2 2 0.5972

output:

4.4783672319

result:

ok found '4.4783672', expected '4.4783672', error '0.0000000'

Test #156:

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

input:

6 2 0.5822

output:

3.4573936047

result:

ok found '3.4573936', expected '3.4573936', error '0.0000000'

Test #157:

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

input:

5 1 0.0190

output:

52.6315789474

result:

ok found '52.6315789', expected '52.6315789', error '0.0000000'

Test #158:

score: 0
Accepted
time: 0ms
memory: 3676kb

input:

2 1 0.7925

output:

1.2618296530

result:

ok found '1.2618297', expected '1.2618297', error '0.0000000'