QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#307043#5537. Storing EggsNYCU_CartesianTreeAC ✓137ms40044kbC++203.4kb2024-01-17 20:39:072024-01-17 20:39:08

Judging History

This is the latest submission verdict.

  • [2024-01-17 20:39:08]
  • Judged
  • Verdict: AC
  • Time: 137ms
  • Memory: 40044kb
  • [2024-01-17 20:39:07]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;

#define int long long 
#define F first 
#define S second 
#define pb push_back 

const int mol=998244353;

char a[5][105];
int dp[105][105][105];


int okbc[105][105][105],okac[105][105][105],okab[105][105][105];
void solve(){
    int n,q;
    cin>>n>>q;

    int cc=0;
    for(int i=1;i<=3;i++) for(int j=1;j<=n;j++) cin>>a[i][j];

    for(int i=1;i<=3;i++) for(int j=1;j<=n;j++){
        if(a[i][j]!='#') cc++;
    }
    if(cc<q){
        cout<<"-1\n";
        return;
    }

    int l=0,r=50000;
    while(l<r){
        int mid=l+r+1>>1;

        for(int i=0;i<=n;i++) for(int j=0;j<=n;j++) for(int k=0;k<=n;k++) dp[i][j][k]=0,okab[i][j][k]=0,okac[i][j][k]=0,okbc[i][j][k]=0;
        for(int i=n;i>=0;i--){
            for(int j=n;j>=0;j--){
                for(int k=n;k>=0;k--){
                    bool ok=1;
                    if(a[1][i]=='#') ok=0;
                    if(a[2][j]=='#') ok=0;
                    if(a[3][k]=='#') ok=0;
                    if((j-i)*(j-i)+1<mid&&i&&j) ok=0;
                    if((k-i)*(k-i)+4<mid&&i&&k) ok=0;
                    if(j&&(k-j)*(k-j)+1<mid&&k) ok=0;
                    if(!ok){
                        okab[i][j][k]=okab[i][j][k+1];
                        okac[i][j][k]=okac[i][j+1][k];
                        okbc[i][j][k]=okbc[i+1][j][k];
                    }
                    else
                    okab[i][j][k]=k,okac[i][j][k]=j,okbc[i][j][k]=i;
                }
            }
        }
        
        int ans=0;
        int t=sqrt(mid);
        while(t*t>=mid) t--;
        while(t*t<mid) t++;
        for(int i=0;i<=n;i++){
            for(int j=0;j<=n;j++){
                for(int k=0;k<=n;k++){
                    bool ok=1;
                    if(a[1][i]=='#') ok=0;
                    if((j-i)*(j-i)+1<mid&&i&&j) ok=0;
                    if(a[2][j]=='#') ok=0;
                    if(k){
                        if((k-i)*(k-i)+4<mid&&i) ok=0;
                        if(j&&(k-j)*(k-j)+1<mid) ok=0;
                    }
                    if(a[3][k]=='#') ok=0;
                    if(i) dp[i][j][k]=max(dp[i][j][k],dp[i-1][j][k]);
                    if(j) dp[i][j][k]=max(dp[i][j][k],dp[i][j-1][k]);
                    if(k) dp[i][j][k]=max(dp[i][j][k],dp[i][j][k-1]);
                    if(!ok){
                        continue;
                    }
                    int u=0;if(i) u++;if(j) u++;if(k) u++;
                    dp[i][j][k]=max({u,dp[i][j][k]});
                    

                    if(i+t<=n&&okbc[i+t][j][k]&&okbc[i+t][j][k]>=max({i,j,k})) dp[okbc[i+t][j][k]][j][k]=max(dp[okbc[i+t][j][k]][j][k],dp[i][j][k]+1);
                    if(j+t<=n&&okac[i][j+t][k]&&okac[i][j+t][k]>=max({i,j,k})) dp[i][okac[i][j+t][k]][k]=max(dp[i][okac[i][j+t][k]][k],dp[i][j][k]+1);
                    if(k+t<=n&&okab[i][j][k+t]&&okab[i][j][k+t]>=max({i,j,k})) dp[i][j][okab[i][j][k+t]]=max(dp[i][j][okab[i][j][k+t]],dp[i][j][k]+1);
                    ans=max(ans,dp[i][j][k]);
                }
            }
        }
        if(ans>=q) l=mid;
        else r=mid-1;
    }
    // cout<<l<<"\n";
    cout<<fixed<<setprecision(6)<<sqrt(l)<<"\n";
}

signed main(){
    ios::sync_with_stdio(0);cin.tie(0);
    // double t1=(double)clock()/CLOCKS_PER_SEC;
    solve();
    // double t2=(double)clock()/CLOCKS_PER_SEC;
    // cout<<fixed<<setprecision(10)<<t2-t1<<"\n";
    return 0;
}

詳細信息

Test #1:

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

input:

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

output:

4.472136

result:

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

Test #2:

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

input:

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

output:

1.000000

result:

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

Test #3:

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

input:

3 4
..#
...
...

output:

1.414214

result:

ok found '1.4142140', expected '1.4142140', error '0.0000000'

Test #4:

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

input:

2 6
..
.#
..

output:

-1

result:

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

Test #5:

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

input:

1 2
.
.
.

output:

2.000000

result:

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

Test #6:

score: 0
Accepted
time: 103ms
memory: 39644kb

input:

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

output:

99.020200

result:

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

Test #7:

score: 0
Accepted
time: 101ms
memory: 39600kb

input:

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

output:

49.040799

result:

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

Test #8:

score: 0
Accepted
time: 130ms
memory: 39704kb

input:

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

output:

2.000000

result:

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

Test #9:

score: 0
Accepted
time: 127ms
memory: 39712kb

input:

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

output:

1.414214

result:

ok found '1.4142140', expected '1.4142140', error '0.0000000'

Test #10:

score: 0
Accepted
time: 130ms
memory: 40044kb

input:

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

output:

1.000000

result:

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

Test #11:

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

input:

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

output:

1.000000

result:

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

Test #12:

score: 0
Accepted
time: 129ms
memory: 39700kb

input:

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

output:

1.000000

result:

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

Test #13:

score: 0
Accepted
time: 27ms
memory: 30548kb

input:

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

output:

1.000000

result:

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

Test #14:

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

input:

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

output:

2.000000

result:

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

Test #15:

score: 0
Accepted
time: 105ms
memory: 39516kb

input:

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

output:

1.000000

result:

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

Test #16:

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

input:

1 2
#
#
#

output:

-1

result:

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

Test #17:

score: 0
Accepted
time: 102ms
memory: 39804kb

input:

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

output:

2.000000

result:

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

Test #18:

score: 0
Accepted
time: 106ms
memory: 39704kb

input:

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

output:

2.828427

result:

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

Test #19:

score: 0
Accepted
time: 104ms
memory: 39740kb

input:

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

output:

2.828427

result:

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

Test #20:

score: 0
Accepted
time: 98ms
memory: 39612kb

input:

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

output:

98.005102

result:

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

Test #21:

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

input:

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

output:

81.006173

result:

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

Test #22:

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

input:

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

output:

47.010637

result:

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

Test #23:

score: 0
Accepted
time: 68ms
memory: 38796kb

input:

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

output:

42.000000

result:

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

Test #24:

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

input:

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

output:

30.066593

result:

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

Test #25:

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

input:

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

output:

28.017851

result:

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

Test #26:

score: 0
Accepted
time: 93ms
memory: 39776kb

input:

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

output:

23.021729

result:

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

Test #27:

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

input:

1 2
#
.
.

output:

1.000000

result:

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

Test #28:

score: 0
Accepted
time: 76ms
memory: 39208kb

input:

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

output:

18.027756

result:

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

Test #29:

score: 0
Accepted
time: 80ms
memory: 39476kb

input:

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

output:

17.117243

result:

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

Test #30:

score: 0
Accepted
time: 91ms
memory: 39824kb

input:

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

output:

16.031220

result:

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

Test #31:

score: 0
Accepted
time: 91ms
memory: 38808kb

input:

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

output:

15.132746

result:

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

Test #32:

score: 0
Accepted
time: 72ms
memory: 39180kb

input:

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

output:

14.035669

result:

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

Test #33:

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

input:

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

output:

12.165525

result:

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

Test #34:

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

input:

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

output:

8.062258

result:

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

Test #35:

score: 0
Accepted
time: 122ms
memory: 39652kb

input:

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

output:

1.414214

result:

ok found '1.4142140', expected '1.4142140', error '0.0000000'

Test #36:

score: 0
Accepted
time: 106ms
memory: 39388kb

input:

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

output:

8.062258

result:

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

Test #37:

score: 0
Accepted
time: 114ms
memory: 39836kb

input:

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

output:

2.236068

result:

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

Test #38:

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

input:

1 3
#
.
.

output:

-1

result:

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

Test #39:

score: 0
Accepted
time: 95ms
memory: 39020kb

input:

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

output:

1.414214

result:

ok found '1.4142140', expected '1.4142140', error '0.0000000'

Test #40:

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

input:

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

output:

1.000000

result:

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

Test #41:

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

input:

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

output:

4.123106

result:

ok found '4.1231060', expected '4.1231060', error '0.0000000'

Test #42:

score: 0
Accepted
time: 90ms
memory: 39868kb

input:

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

output:

4.000000

result:

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

Test #43:

score: 0
Accepted
time: 82ms
memory: 39016kb

input:

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

output:

15.132746

result:

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

Test #44:

score: 0
Accepted
time: 89ms
memory: 39064kb

input:

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

output:

6.324555

result:

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

Test #45:

score: 0
Accepted
time: 99ms
memory: 39484kb

input:

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

output:

2.236068

result:

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

Test #46:

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

input:

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

output:

1.000000

result:

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

Test #47:

score: 0
Accepted
time: 84ms
memory: 38996kb

input:

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

output:

2.000000

result:

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

Test #48:

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

input:

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

output:

4.000000

result:

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

Test #49:

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

input:

1 3
.
.
.

output:

1.000000

result:

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

Test #50:

score: 0
Accepted
time: 90ms
memory: 39668kb

input:

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

output:

32.015621

result:

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

Test #51:

score: 0
Accepted
time: 103ms
memory: 39656kb

input:

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

output:

8.246211

result:

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

Test #52:

score: 0
Accepted
time: 89ms
memory: 39672kb

input:

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

output:

2.236068

result:

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

Test #53:

score: 0
Accepted
time: 94ms
memory: 39392kb

input:

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

output:

1.000000

result:

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

Test #54:

score: 0
Accepted
time: 88ms
memory: 39388kb

input:

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

output:

2.236068

result:

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

Test #55:

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

input:

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

output:

5.000000

result:

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

Test #56:

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

input:

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

output:

28.071338

result:

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

Test #57:

score: 0
Accepted
time: 102ms
memory: 39900kb

input:

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

output:

9.219544

result:

ok found '9.2195440', expected '9.2195440', error '0.0000000'

Test #58:

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

input:

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

output:

2.236068

result:

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

Test #59:

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

input:

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

output:

2.236068

result:

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

Test #60:

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

input:

3 3
.##
.##
.##

output:

1.000000

result:

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

Test #61:

score: 0
Accepted
time: 80ms
memory: 39088kb

input:

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

output:

5.099020

result:

ok found '5.0990200', expected '5.0990200', error '0.0000000'

Test #62:

score: 0
Accepted
time: 91ms
memory: 39648kb

input:

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

output:

25.000000

result:

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

Test #63:

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

input:

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

output:

-1

result:

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

Test #64:

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

input:

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

output:

2.828427

result:

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

Test #65:

score: 0
Accepted
time: 101ms
memory: 39612kb

input:

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

output:

3.000000

result:

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

Test #66:

score: 0
Accepted
time: 125ms
memory: 39640kb

input:

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

output:

1.000000

result:

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

Test #67:

score: 0
Accepted
time: 129ms
memory: 39820kb

input:

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

output:

1.414214

result:

ok found '1.4142140', expected '1.4142140', error '0.0000000'

Test #68:

score: 0
Accepted
time: 137ms
memory: 39612kb

input:

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

output:

1.414214

result:

ok found '1.4142140', expected '1.4142140', error '0.0000000'