QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#577648#5537. Storing Eggspnlong27AC ✓396ms3948kbC++146.8kb2024-09-20 13:42:392024-09-20 13:42:40

Judging History

This is the latest submission verdict.

  • [2024-09-20 13:42:40]
  • Judged
  • Verdict: AC
  • Time: 396ms
  • Memory: 3948kb
  • [2024-09-20 13:42:39]
  • Submitted

answer

// Hello I'm Nekan
//
#include <bits/stdc++.h>
#define Nekan "test"
#define fi first
#define se second
#define pb push_back
#define zs(v) ((int)(v).size())
#define BIT(x, i) (((x) >> (i)) & 1)
#define pii pair<int, int>

typedef long double ld;
typedef long long ll;

const int N = 2e5 + 5;
const long long mod = 1e9 + 7; // 998244353;

using namespace std;

bool valid(vector<string> &s, int i, int cf, int dist) {
    int b2 = (cf / 4 % 2);
    int b1 = (cf / 2 % 2);
    int b0 = (cf % 2);

    int val = (s[0][i] == '.') * 4 + (s[1][i] == '.') * 2 + (s[2][i] == '.');

    // cout << "VL " << i << " " << cf << endl;
    // cout << "PP  " << b2 << b1 << b0 << endl;

    bool check_dis = true;
    if (dist > 4) {
        if (b0 + b1 + b2 > 1)
            return false;
    } else if (dist > 1) {
        if (b2 == 1 && b1 == 1)
            return false;
        if (b1 == 1 && b0 == 1)
            return false;
    }

    return (val == (val | cf));
}

bool check_pair(int dist, int i, int cf1, int j, int cf2) {
    for (int ii = 0; ii < 3; ii++) {
        for (int jj = 0; jj < 3; jj++) {
            if (((1 << ii) & cf1) && ((1 << jj) & cf2)) {
                if ((j - i) * (j - i) + (ii - jj) * (ii - jj) < dist)
                    return false;
            }
        }
    }
    return true;
}

int nbit(int a) {
    int re = 0;
    while (a > 0) {
        if (a % 2 == 1)
            re++;
        a /= 2;
    }
    return re;
}

bool check(int dist, int n, int k, vector<string> &s) {
    // cout << "CD:" << dist << endl;
    vector<vector<int>> dp(n + 1, vector<int>(8, 0));

    for (int i = 1; i <= n; i++) {
        // cout << i << endl;
        for (int cf = 0; cf <= 7; cf++) {
            if (i == 1 || valid(s, i - 2, cf, dist))
                dp[i][0] = max(dp[i][0], dp[i - 1][cf]);
            if (valid(s, i - 1, cf, dist)) {
                // cout << i << " " << cf << endl;
                dp[i][cf] = max(dp[i][cf], nbit(cf));
            }
        }

        for (int j = i - 1; j >= 1; j--) {
            for (int cf1 = 1; cf1 <= 7; cf1++) {
                for (int cf2 = 1; cf2 <= 7; cf2++) {
                    if (valid(s, i - 1, cf1, dist) &&
                        valid(s, j - 1, cf2, dist)) {
                        // cout << "YY: " << i << " " << cf1 << " " << j << " "
                        //      << cf2 << endl;
                        if (check_pair(dist, i, cf1, j, cf2)) {
                            // cout << "XX: " << i << " " << cf1 << " " << j <<
                            // " "
                            //<< cf2 << endl;
                 
                                dp[i][cf1] =
                                    max(dp[i][cf1], dp[j][cf2] + nbit(cf1));
                        
                 
                                
      
                        }
                    }
                }
            }
        }

        // cout << dp[i][5] << endl;
    }

    int ans = -1;
    for (int i = 1; i <= n; i++) {
        for (int cf = 0; cf <= 7; cf++) {
            ans = max(ans, dp[i][cf]);
        }
    }

    // cout << "DP:" << ans << endl;

    return (ans >= k);
}


bool check5(int dist, int n, int k, vector<string> &s) {
    // cout << "CD:" << dist << endl;
    vector<vector<int>> dp(n + 1, vector<int>(8, 0));
    vector<bool> dup(n+1, false);

    for (int i = 1; i <= n; i++) {
        // cout << i << endl;
        for (int cf = 0; cf <= 7; cf++) {
            if (i == 1 || valid(s, i - 2, cf, dist))
                dp[i][0] = max(dp[i][0], dp[i - 1][cf]);
            if (valid(s, i - 1, cf, dist)) {
                // cout << i << " " << cf << endl;
                dp[i][cf] = max(dp[i][cf], nbit(cf));
            }
        }

        for (int j = i - 1; j >= 1; j--) {
            for (int cf1 = 1; cf1 <= 7; cf1++) {
                for (int cf2 = 1; cf2 <= 7; cf2++) {
                    if (valid(s, i - 1, cf1, dist) &&
                        valid(s, j - 1, cf2, dist)) {
                        // cout << "YY: " << i << " " << cf1 << " " << j << " "
                        //      << cf2 << endl;
                        if (check_pair(dist, i, cf1, j, cf2)) {
                            // cout << "XX: " << i << " " << cf1 << " " << j <<
                            // " "
                            //<< cf2 << endl;
               
                               
                        
                            if(dp[j][cf2] + nbit(cf1) > dp[i][cf1]) {
                                if(i-j==1 && dup[j]) {
                                    
                                }
                                else if(i-j==1) {
                                    dp[i][cf1] = dp[j][cf2] + nbit(cf1);
                                    dup[i] = true;
                                }
                                else {
                                    dp[i][cf1] = dp[j][cf2] + nbit(cf1);
                                }
                            }
                            else if(dp[j][cf2] + 1 == dp[i][cf1]) {
                                if(dup[i] && i-j>1) {
                                    dup[i] = false;
                                }
                            }
                            
                        }
                    }
                }
            }
        }

        // cout << dp[i][5] << endl;
    }

    int ans = -1;
    for (int i = 1; i <= n; i++) {
        for (int cf = 0; cf <= 7; cf++) {
            ans = max(ans, dp[i][cf]);
        }
    }

    // cout << "DP:" << ans << endl;

    return (ans >= k);
}
void xuly() {
    int n, k;
    cin >> n >> k;
    vector<string> s(3);

    for (int i = 0; i < 3; i++) {
        cin >> s[i];
    }

    // cout << "XX" << endl;
    int ans = -1;
    for (int i = 2; i >= 0; i--) {
        for (int j = n - 1; j >= 0; j--) {
            int dist = i * i + j * j;
            // cout << "DIST: " << dist << endl;

            if (dist == 0)
                break;

            if (dist!=5 && check(dist, n, k, s)) {
                // cout << dist << endl;
                ans = max(ans, dist);
            }
            if(dist==5 && check5(5, n, k, s)) {
                ans = max(ans, 5);
            }
        }
    }

    if (ans > 0) {
        cout << fixed << setprecision(7) << (ld)sqrt((ld)ans) << endl;
        //cout << ans;
    } else {
        cout << "-1" << endl;
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    if (fopen(Nekan ".inp", "r")) {
        freopen(Nekan ".inp", "r", stdin);
        freopen(Nekan ".out", "w", stdout);
    }
    int t = 1;
    // cin >> t;
    while (t--)
        xuly();
}

// Surely nothing could go wrong.

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3848kb

input:

5 2
#....
.....
....#

output:

4.4721360

result:

ok found '4.4721360', expected '4.4721360', error '0.0000000'

Test #2:

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

input:

5 6
##.##
#####
.....

output:

1.0000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #3:

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

input:

3 4
..#
...
...

output:

1.4142136

result:

ok found '1.4142136', expected '1.4142140', error '0.0000003'

Test #4:

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

input:

2 6
..
.#
..

output:

-1

result:

ok found '-1.0000000', expected '-1.0000000', error '-0.0000000'

Test #5:

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

input:

1 2
.
.
.

output:

2.0000000

result:

ok found '2.0000000', expected '2.0000000', error '0.0000000'

Test #6:

score: 0
Accepted
time: 394ms
memory: 3944kb

input:

100 2
....................................................................................................
....................................................................................................
...............................................................................................

output:

99.0202000

result:

ok found '99.0202000', expected '99.0202000', error '0.0000000'

Test #7:

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

input:

100 3
....................................................................................................
....................................................................................................
...............................................................................................

output:

49.0407993

result:

ok found '49.0407993', expected '49.0407990', error '0.0000000'

Test #8:

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

input:

100 100
....................................................................................................
....................................................................................................
.............................................................................................

output:

2.0000000

result:

ok found '2.0000000', expected '2.0000000', error '0.0000000'

Test #9:

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

input:

100 150
....................................................................................................
....................................................................................................
.............................................................................................

output:

1.4142136

result:

ok found '1.4142136', expected '1.4142140', error '0.0000003'

Test #10:

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

input:

100 151
....................................................................................................
....................................................................................................
.............................................................................................

output:

1.0000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #11:

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

input:

100 200
....................................................................................................
....................................................................................................
.............................................................................................

output:

1.0000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #12:

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

input:

100 201
....................................................................................................
....................................................................................................
.............................................................................................

output:

1.0000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #13:

score: 0
Accepted
time: 86ms
memory: 3884kb

input:

60 130
............................................................
............................................................
............................................................

output:

1.0000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #14:

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

input:

100 100
....................................................................................................
####################################################################################################
.............................................................................................

output:

2.0000000

result:

ok found '2.0000000', expected '2.0000000', error '0.0000000'

Test #15:

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

input:

100 51
####################################################################################################
....................................................................................................
###########################################################################################...

output:

1.0000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #16:

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

input:

1 2
#
#
#

output:

-1

result:

ok found '-1.0000000', expected '-1.0000000', error '-0.0000000'

Test #17:

score: 0
Accepted
time: 283ms
memory: 3884kb

input:

99 50
###################################################################################################
...................................................................................................
##############################################################################################...

output:

2.0000000

result:

ok found '2.0000000', expected '2.0000000', error '0.0000000'

Test #18:

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

input:

100 47
#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.
.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#
#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#...

output:

2.8284271

result:

ok found '2.8284271', expected '2.8284270', error '0.0000000'

Test #19:

score: 0
Accepted
time: 318ms
memory: 3944kb

input:

100 43
.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#
#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.
.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#....

output:

2.8284271

result:

ok found '2.8284271', expected '2.8284270', error '0.0000000'

Test #20:

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

input:

99 2
#........#............#.#.#...................................#................##..............#...
............................##...#......#...##.............#.........#..#...#............#...#.....
#...............................................#..............#.....#.........#.........#........

output:

98.0051019

result:

ok found '98.0051019', expected '98.0051020', error '0.0000000'

Test #21:

score: 0
Accepted
time: 190ms
memory: 3880kb

input:

90 2
#############..######.###.##.#########.###.###########.####.##############################
#...##########.#.#################.############.########################.#################
###################.###.##.####.#######..##.########.#############################.#######

output:

81.0061726

result:

ok found '81.0061726', expected '81.0061730', error '0.0000000'

Test #22:

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

input:

95 3
#.#..............#.............#.......#..##.....#.#............#....#..................##.....
.....#.#........#...#...........#......................#...#.....#.........#.....#...........#.
#.......#.#....#.......#.......#.......#..#.#.#.#....#.#...#..#......#........#..........#....#

output:

47.0106371

result:

ok found '47.0106371', expected '47.0106370', error '0.0000000'

Test #23:

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

input:

92 3
#########################.###########################.####################################.#
#######.##############.#.#################.#########.########.#############################.
###.##.####.###.####.#####.########.#########.########.##.#######.##########################

output:

42.0000000

result:

ok found '42.0000000', expected '42.0000000', error '0.0000000'

Test #24:

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

input:

93 4
##..#.......................#.....#.#.#..............#.....#........#.....................#..
......#...................#..##...................#...............###.....#....#..........#.#
#......#.........#....#.................#......#...#......##..........#.........#.#..#.#..#.#

output:

30.0665928

result:

ok found '30.0665928', expected '30.0665930', error '0.0000000'

Test #25:

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

input:

92 4
###.###############.######.##.#########################.######.###.#####.###################
#.##..#####################.###########################.########..###############.#######...
#######################.###.############.##..####.#################.#.#..####.##############

output:

28.0178515

result:

ok found '28.0178515', expected '28.0178510', error '0.0000000'

Test #26:

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

input:

94 5
#........#....#.................................................#.....................#.......
#................#...............#..##..................#........#.......#...#................
##..................................................##................#.......#...............

output:

23.0217289

result:

ok found '23.0217289', expected '23.0217290', error '0.0000000'

Test #27:

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

input:

1 2
#
.
.

output:

1.0000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #28:

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

input:

94 5
##..#.######.##.########.#####.#####.############..##.##############################..########
#######.########.##########.#..################.####.#.###...######..##.######################
######.############.######.#####################.################.##.##############.##########

output:

18.0277564

result:

ok found '18.0277564', expected '18.0277560', error '0.0000000'

Test #29:

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

input:

90 6
#.................#....................#................#.#.........###...................
....................................#........#...................#...##...##....#.....#...
#.#...........#...#........#..#....#.#....................#.........#.....................

output:

17.1172428

result:

ok found '17.1172428', expected '17.1172430', error '0.0000000'

Test #30:

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

input:

100 6
##########.##.##################.###########.###########.##.######################.####.##.#########
##########...#########.#.########.#################.#.###########.#.##########.#.##.################
##############.#####..#######..##################.#######################.########.#########...

output:

16.0312195

result:

ok found '16.0312195', expected '16.0312200', error '0.0000000'

Test #31:

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

input:

92 7
#.#....#..#...#.......#.........................................#.......#...#.............#.
...............#......#............#...#.........................#.....#..............#.....
#..#......#...............#.................#....#............................#.............

output:

15.1327460

result:

ok found '15.1327460', expected '15.1327460', error '0.0000000'

Test #32:

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

input:

92 7
##.###########..######.###############.#.##.#################.##.#############.######.###.##
#############.###############.##..#####################.######.#..#########.###.############
.###.########.###################.########.###################..#######...#########.#####.##

output:

14.0356688

result:

ok found '14.0356688', expected '14.0356690', error '0.0000000'

Test #33:

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

input:

91 8
#..................#..#..............#......................#.......#..........#...#..#....
#....#.#.....#..#......#.....#.................#..#...........................#.........#..
#.......#......#..........#............#.....#...................#..............#.....#....

output:

12.1655251

result:

ok found '12.1655251', expected '12.1655250', error '0.0000000'

Test #34:

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

input:

93 8
############.###########.#######################.############.##.###.######################.#
############.####.###########.#######.####.##########.#######.####.###################.####..
#####.#######.###########.#####.#############.#.##################.##########################

output:

8.0622577

result:

ok found '8.0622577', expected '8.0622580', error '0.0000000'

Test #35:

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

input:

100 109
..#.....#..............#....................#..#.......#.............#................#.#...........
#............##.........#..........#.#....#...............#...#.......#................#...........#
.....#..#......#................................................................#............

output:

1.4142136

result:

ok found '1.4142136', expected '1.4142140', error '0.0000003'

Test #36:

score: 0
Accepted
time: 345ms
memory: 3948kb

input:

97 13
..##...#..........#.........##....##......#............#..........###........#.....#.........#...
##..#....#.............#....#...#.##............#........#.#.#.....................#.......#..#..
........#..#....##.........#.#....#.....#.......#.#...................#......#.......#......##...

output:

8.0622577

result:

ok found '8.0622577', expected '8.0622580', error '0.0000000'

Test #37:

score: 0
Accepted
time: 375ms
memory: 3944kb

input:

100 50
....#......#..................#.......#..#.....#........#.........#......#....#............##.......
#.....##........#.#...........##..#....##....#.#.........##....#.##...........#.....................
......##........#...#....#...#...#............#.......##.#..........##......##....##..#...#...

output:

2.2360680

result:

ok found '2.2360680', expected '2.2360680', error '0.0000000'

Test #38:

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

input:

1 3
#
.
.

output:

-1

result:

ok found '-1.0000000', expected '-1.0000000', error '-0.0000000'

Test #39:

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

input:

92 107
..#........#...#...#.....#....#........#...#.......#.........#..#.........#...##.......##.#.
..##.......#..#....##.#..##.#.##........#............#..#.......#..##..............#....#...
#...#.....#..........#........#.....##.#.................#....##...........#............#...

output:

1.4142136

result:

ok found '1.4142136', expected '1.4142140', error '0.0000003'

Test #40:

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

input:

95 125
...##.......#..#.#.............#..##...#..................#......#...##..#.....##....#.......#.
.........#.....#.#....#....#..##.....#...#...#......#...........##..#........#.#...#.#........#
.#..#....................##.........#...#...........#...........#...#...#..........##.....#.##.

output:

1.0000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #41:

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

input:

93 20
#############################################################################################
.#.....#.......###.#..#.###....#...............##...#.....#..#...#...........#.....#....#..#.
....##.....#....#.#......#......#...........#.....#................#......#...#.##........#..

output:

4.1231056

result:

ok found '4.1231056', expected '4.1231060', error '0.0000001'

Test #42:

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

input:

97 21
#################################################################################################
#################################################################################################
......###........#.....#...#.#.........##.#......#.####.##......#....#........#...##....#......#.

output:

4.0000000

result:

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

Test #43:

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

input:

93 7
#...#..##..#..#....#...#......#...####.###..##.##.#..#.#.###.##......#..###....#.#..#.#.#...#
.#.#....##..##.##.#...##..##.#..............####.....##.#.#.#.#.#..##....#...#.#.#.......#...
###.###......#.#.#.#...###....#.#.##..#..#...#...#.##.#..##...#.####.#..##.#.###....#.#...#.#

output:

15.1327460

result:

ok found '15.1327460', expected '15.1327460', error '0.0000000'

Test #44:

score: 0
Accepted
time: 260ms
memory: 3884kb

input:

91 15
.##.#..#......#.#####..###....##..#.#...#..##..#.##.....#....#.######.#.#.#......##..##..#.
..#..########....#..#...#.###.#............#.#.#..#..#..#.#.##...##....###.#...#.###..####.
...#.##..####..#.#.#.....#.#..#.#...##.##.#....#....#..#..##.......#####..###.#.#.#.##...#.

output:

6.3245553

result:

ok found '6.3245553', expected '6.3245550', error '0.0000000'

Test #45:

score: 0
Accepted
time: 335ms
memory: 3844kb

input:

98 58
.#..##.....#............###.#####.##.....#.#..#.#.....####..##.##.#.......##...##..#..#....#..#..#
#.#.##.#.#...#.....###...#....##..#..#...#####.##.#.#..#.#.##.#...####.##.#.....###.##.###.#....#.
....#..##..##.##..##...#..#....#.......###...#....#.##..#...#..#.....#....#.#.......####.#.#..#.#.

output:

2.2360680

result:

ok found '2.2360680', expected '2.2360680', error '0.0000000'

Test #46:

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

input:

92 92
.#.#####.......##.##.....#####.....#..#..##.#..###..###.#..#..#.###..##...##..#.#.##..#.....
#..#...#..........##.##.#.#..#.#..#..##..#...#..###.#.#....#..#.#..#..#.##........#....##.##
.........####..#...#.....###...###.##..#.##.#####...##...##.#....#.##..##.##.######.#.#...#.

output:

1.0000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #47:

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

input:

94 40
##############################################################################################
.#.........#.....##.########..#.....##..###..##.#.#..#.####..##...#..#..#....##.#..#....####.#
...#..#.##.#......#......####.....#.#..#.#.#..###.#..#.......##.#.###.#..##......#####.#..#..#

output:

2.0000000

result:

ok found '2.0000000', expected '2.0000000', error '0.0000000'

Test #48:

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

input:

95 21
###############################################################################################
###############################################################################################
..#..#.#....#.#..##.##..#.#.#.##.#.......##.#...#...#.##...#..#..###.#...#......#..##.......#.#

output:

4.0000000

result:

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

Test #49:

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

input:

1 3
.
.
.

output:

1.0000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #50:

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

input:

99 4
#...##.#.####.############.##.###..###.###.##.#.###.#####..#.#..#..#.#..###..##...#.#.#..##########
.##..##.###..##.#.#.#######..##...###..#.##.#.##..#...###...#.###...#####.######..#..########.##.#.
#######.##.####..##.##.#...#.###.###..####..###.######..###.##.#.#..#..#.#.###.#.###.#######.##...

output:

32.0156212

result:

ok found '32.0156212', expected '32.0156210', error '0.0000000'

Test #51:

score: 0
Accepted
time: 327ms
memory: 3768kb

input:

100 12
#.###.####...######.###.########.#.##.#..#......##...#####.#.#..#.#..##.##.#.##.###.##.#########..##
#.###..###.#####.##.#..##..#.###....###...##.##.#..#.#.#.##....#..#.#.#####.#.#########..#.#..#..###
#.#.######.########...#...##.#..#.##.####..#.#.#..#.###...#.#.#..###....#...####.#.##..###....

output:

8.2462113

result:

ok found '8.2462113', expected '8.2462110', error '0.0000000'

Test #52:

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

input:

100 36
..######.#.#####.##.##.#.#######.####.#.######.##.#...####.####....##.#.....##..#########..###.#.###
##.######.#.###.####.##..#..##.##..#.#######.##.######.#...#.##.##.#.#..#..####.###.#..#####.#.####.
##.###.#..#.#####.#....###..#....#.#...#...#.##..###.##.########.##.##.########.#####.####....

output:

2.2360680

result:

ok found '2.2360680', expected '2.2360680', error '0.0000000'

Test #53:

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

input:

97 74
..####.#..#.###.##...##.#########...#.....##.##.#####.#.###..##..##...###.#.##...####...##.###.##
..##....#.##.###.###..###..#..#..#####.###..#.##..#####.####.###..##.##...#..###.#####.########.#
...##.#.###.#.##.####.#..##.###.######..#.####.####..########..##.#.###..##..###..#..##.#.##..##.

output:

1.0000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #54:

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

input:

97 28
#################################################################################################
.###.##.##...########.##.###.#..#.###.#.#..#.##..##.#.##...##..#...##....#...##########.#####.###
.##.#####..##..#.####.##.#.###.###....##.##.########..###.####..####.###.##..#.#..###..####....##

output:

2.2360680

result:

ok found '2.2360680', expected '2.2360680', error '0.0000000'

Test #55:

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

input:

90 13
##########################################################################################
##########################################################################################
.##.###..####.####.###..###..###..#.##.#.##..###.###.###..#.#.####.#.###.#..#.######.....#

output:

5.0000000

result:

ok found '5.0000000', expected '5.0000000', error '0.0000000'

Test #56:

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

input:

94 4
###.#############..####..#.####.#####.################.####.#######..######.######.###########
.##############.#####.###.####.##..##########.#.##########.#####.##.####.#####.######.########
#.######.#######..###.########.##.##########.##########.####.######.##..##.##.#####.###.######

output:

28.0713377

result:

ok found '28.0713377', expected '28.0713380', error '0.0000000'

Test #57:

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

input:

100 9
###########.######.#.#.#.###.#####..##.###########..#######.#..####..############.#..#..#.##.#######
.####.##..#.####.#####.##.###.###.################.####.###.##..############################.##.####
###.######...####..#####.#..#.##.##.#.##..#######.#######.#####..############.#####.##.#####...

output:

9.2195445

result:

ok found '9.2195445', expected '9.2195440', error '0.0000001'

Test #58:

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

input:

93 27
##..###.#.#.#####.#############.###.###############.##.##.###########.#.#######..####.#..####
####.#.#####.#.###..####.##.##.#..####.#..##########..######.#########.######.##########..##.
#####...#####################...####.##.#.#####.######.#.###.##.#..########.#.###.#.####..#.#

output:

2.2360680

result:

ok found '2.2360680', expected '2.2360680', error '0.0000000'

Test #59:

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

input:

93 34
#######.#######.##.#.#.#####.##.#################.########...#######.#.#.#..#.##########.####
###...########.##########.##.########.#..##.####.##.#####..######..###.#####..#.###.####.####
#######.#########.#..#####.##.####.##.###.##.###.##.#.#...###.#.######.#####.###.##########.#

output:

2.2360680

result:

ok found '2.2360680', expected '2.2360680', error '0.0000000'

Test #60:

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

input:

3 3
.##
.##
.##

output:

1.0000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #61:

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

input:

94 14
##############################################################################################
##.#####.####.###.########.########.##.##.#######.##.#..#.#####.#.#.###########.#####.##.###.#
#.#.############.############.###.######..##.#######.##.###.####..#.#####.#####.######..#.#.##

output:

5.0990195

result:

ok found '5.0990195', expected '5.0990200', error '0.0000001'

Test #62:

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

input:

100 4
####################################################################################################
####################################################################################################
#########..###.####..#.####..#.##.#########.#.####..########.####.#.##.######..#####.#####.....

output:

25.0000000

result:

ok found '25.0000000', expected '25.0000000', error '0.0000000'

Test #63:

score: 0
Accepted
time: 357ms
memory: 3516kb

input:

99 208
.......###.##........###.....#...#.##..#.##.#.....#...#.#........#...##..##..#........#.###.#.#..#.
........#.##.#.#.....#..............###....#.........#.#....#..#........#.#..#.#..........#.#..#..#
#.##...#....#.##.#....##.#..#...#.##.#...##...#.#.#......#.....####.#.#.#.....#..#..#...#.......

output:

-1

result:

ok found '-1.0000000', expected '-1.0000000', error '-0.0000000'

Test #64:

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

input:

100 30
##################################################...##.#........#.###.#..#.......#..#....##########
........................................########..#..........#..#..###......#..........#..##########
################################################..#...##.........##.#..#.##....#..........#...

output:

2.8284271

result:

ok found '2.8284271', expected '2.8284270', error '0.0000000'

Test #65:

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

input:

100 30
.#..######..###..#######.#######...#.###.##.###.#.#..##.#######.#...............##.##.######.###...#
#.....#..#..####..####.##...##.#####..####..##..#..####..#####......#.....#.....########...###.#.###
.#.#.#.###.#...#..##.####..####.#.##..####..####.###..########.....#...#.......####.##.####...

output:

3.0000000

result:

ok found '3.0000000', expected '3.0000000', error '0.0000000'

Test #66:

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

input:

100 281
..............................................................................................######
..............................................................................................######
.............................................................................................

output:

1.0000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #67:

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

input:

99 149
...................................................................................................
...................................................................................................
................................................................................................

output:

1.4142136

result:

ok found '1.4142136', expected '1.4142140', error '0.0000003'

Test #68:

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

input:

100 150
....................................................................................................
....................................................................................................
.............................................................................................

output:

1.4142136

result:

ok found '1.4142136', expected '1.4142140', error '0.0000003'