QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#627886#5537. Storing Eggsucup-team5062#AC ✓56ms7964kbC++172.4kb2024-10-10 17:30:592024-10-10 17:30:59

Judging History

This is the latest submission verdict.

  • [2024-10-10 17:30:59]
  • Judged
  • Verdict: AC
  • Time: 56ms
  • Memory: 7964kb
  • [2024-10-10 17:30:59]
  • Submitted

answer

#include <cmath>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

double solve(int N, int K, const vector<string>& S) {
	vector<int> cand;
	for (int i = 0; i <= N; i++) {
		for (int j = 0; j <= 2; j++) {
			cand.push_back(i * i + j * j);
		}
	}
	sort(cand.begin(), cand.end());
	cand.erase(unique(cand.begin(), cand.end()), cand.end());
	vector<vector<int> > nxt(3, vector<int>(N + 1, N));
	for (int i = 0; i < 3; i++) {
		for (int j = N - 1; j >= 0; j--) {
			nxt[i][j] = (S[i][j] == '.' ? j : nxt[i][j + 1]);
		}
	}
	int l = -1, r = int(cand.size());
	while (r - l > 1) {
		int m = (l + r) / 2;
		int b = cand[m];
		vector<int> dp((N + 1) * (N + 1) * (N + 1), -1);
		auto encode = [&](int x, int y, int z) -> int {
			return (x + 1) * (N + 1) * (N + 1) + (y + 1) * (N + 1) + (z + 1);
		};
		int q0 = 0, q1 = 0, q2 = 0;
		while (q0 * q0 < b) q0++;
		while (q1 * q1 + 1 < b) q1++;
		while (q2 * q2 + 4 < b) q2++;
		auto dfs = [&](auto& self, int x, int y, int z) -> int {
			int h = encode(x, y, z);
			if (dp[h] != -1) {
				return dp[h];
			}
			int p = max({x, y, z});
			int xl = p + 1;
			int yl = (y == p || z == p ? p + 1 : p);
			int zl = (z == p ? p + 1 : p);
			if (x != -1) {
				xl = max(xl, x + q0);
				yl = max(yl, x + q1);
				zl = max(zl, x + q2);
			}
			if (y != -1) {
				xl = max(xl, y + q1);
				yl = max(yl, y + q0);
				zl = max(zl, y + q1);
			}
			if (z != -1) {
				xl = max(xl, z + q2);
				yl = max(yl, z + q1);
				zl = max(zl, z + q0);
			}
			xl = min(xl, N);
			yl = min(yl, N);
			zl = min(zl, N);
			xl = nxt[0][xl];
			yl = nxt[1][yl];
			zl = nxt[2][zl];
			int res = 0;
			if (xl != N) {
				int subres = self(self, xl, y, z);
				res = max(res, subres + 1);
			}
			if (yl != N) {
				int subres = self(self, x, yl, z);
				res = max(res, subres + 1);
			}
			if (zl != N) {
				int subres = self(self, x, y, zl);
				res = max(res, subres + 1);
			}
			dp[h] = res;
			return res;
		};
		int res = dfs(dfs, -1, -1, -1);
		if (res >= K) {
			l = m;
		} else {
			r = m;
		}
	}
	return (l != -1 ? sqrt(cand[l]) : -1);
}

int main() {
	int N, K;
	cin >> N >> K;
	vector<string> S(3);
	for (int i = 0; i < 3; i++) {
		cin >> S[i];
	}
	double ans = solve(N, K, S);
	if (ans != -1) {
		cout.precision(15);
		cout << ans << endl;
	} else {
		cout << -1 << endl;
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

4.47213595499958

result:

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

Test #2:

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

input:

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

output:

1

result:

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

Test #3:

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

input:

3 4
..#
...
...

output:

1.4142135623731

result:

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

Test #4:

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

input:

2 6
..
.#
..

output:

-1

result:

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

Test #5:

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

input:

1 2
.
.
.

output:

2

result:

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

Test #6:

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

input:

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

output:

99.0201999594022

result:

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

Test #7:

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

input:

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

output:

49.0407993409569

result:

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

Test #8:

score: 0
Accepted
time: 26ms
memory: 7960kb

input:

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

output:

2

result:

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

Test #9:

score: 0
Accepted
time: 52ms
memory: 7808kb

input:

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

output:

1.4142135623731

result:

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

Test #10:

score: 0
Accepted
time: 54ms
memory: 7908kb

input:

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

output:

1

result:

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

Test #11:

score: 0
Accepted
time: 55ms
memory: 7892kb

input:

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

output:

1

result:

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

Test #12:

score: 0
Accepted
time: 56ms
memory: 7896kb

input:

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

output:

1

result:

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

Test #13:

score: 0
Accepted
time: 9ms
memory: 4644kb

input:

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

output:

1

result:

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

Test #14:

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

input:

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

output:

2

result:

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

Test #15:

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

input:

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

output:

1

result:

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

Test #16:

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

input:

1 2
#
#
#

output:

-1

result:

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

Test #17:

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

input:

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

output:

2

result:

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

Test #18:

score: 0
Accepted
time: 8ms
memory: 7836kb

input:

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

output:

2.82842712474619

result:

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

Test #19:

score: 0
Accepted
time: 8ms
memory: 7896kb

input:

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

output:

2.82842712474619

result:

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

Test #20:

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

input:

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

output:

98.0051019080129

result:

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

Test #21:

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

input:

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

output:

81.0061726043145

result:

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

Test #22:

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

input:

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

output:

47.0106370941726

result:

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

Test #23:

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

input:

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

output:

42

result:

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

Test #24:

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

input:

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

output:

30.0665927567458

result:

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

Test #25:

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

input:

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

output:

28.0178514522438

result:

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

Test #26:

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

input:

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

output:

23.0217288664427

result:

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

Test #27:

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

input:

1 2
#
.
.

output:

1

result:

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

Test #28:

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

input:

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

output:

18.0277563773199

result:

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

Test #29:

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

input:

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

output:

17.1172427686237

result:

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

Test #30:

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

input:

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

output:

16.0312195418814

result:

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

Test #31:

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

input:

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

output:

15.1327459504216

result:

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

Test #32:

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

input:

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

output:

14.0356688476182

result:

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

Test #33:

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

input:

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

output:

12.1655250605964

result:

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

Test #34:

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

input:

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

output:

8.06225774829855

result:

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

Test #35:

score: 0
Accepted
time: 38ms
memory: 7940kb

input:

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

output:

1.4142135623731

result:

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

Test #36:

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

input:

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

output:

8.06225774829855

result:

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

Test #37:

score: 0
Accepted
time: 9ms
memory: 7872kb

input:

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

output:

2.23606797749979

result:

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

Test #38:

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

input:

1 3
#
.
.

output:

-1

result:

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

Test #39:

score: 0
Accepted
time: 17ms
memory: 6996kb

input:

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

output:

1.4142135623731

result:

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

Test #40:

score: 0
Accepted
time: 24ms
memory: 7236kb

input:

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

output:

1

result:

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

Test #41:

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

input:

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

output:

4.12310562561766

result:

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

Test #42:

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

input:

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

output:

4

result:

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

Test #43:

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

input:

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

output:

15.1327459504216

result:

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

Test #44:

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

input:

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

output:

6.32455532033676

result:

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

Test #45:

score: 0
Accepted
time: 9ms
memory: 7524kb

input:

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

output:

2.23606797749979

result:

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

Test #46:

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

input:

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

output:

1

result:

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

Test #47:

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

input:

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

output:

2

result:

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

Test #48:

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

input:

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

output:

4

result:

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

Test #49:

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

input:

1 3
.
.
.

output:

1

result:

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

Test #50:

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

input:

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

output:

32.0156211871642

result:

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

Test #51:

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

input:

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

output:

8.24621125123532

result:

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

Test #52:

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

input:

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

output:

2.23606797749979

result:

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

Test #53:

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

input:

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

output:

1

result:

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

Test #54:

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

input:

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

output:

2.23606797749979

result:

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

Test #55:

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

input:

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

output:

5

result:

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

Test #56:

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

input:

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

output:

28.0713376952364

result:

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

Test #57:

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

input:

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

output:

9.21954445729289

result:

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

Test #58:

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

input:

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

output:

2.23606797749979

result:

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

Test #59:

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

input:

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

output:

2.23606797749979

result:

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

Test #60:

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

input:

3 3
.##
.##
.##

output:

1

result:

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

Test #61:

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

input:

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

output:

5.09901951359278

result:

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

Test #62:

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

input:

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

output:

25

result:

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

Test #63:

score: 0
Accepted
time: 17ms
memory: 7580kb

input:

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

output:

-1

result:

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

Test #64:

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

input:

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

output:

2.82842712474619

result:

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

Test #65:

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

input:

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

output:

3

result:

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

Test #66:

score: 0
Accepted
time: 43ms
memory: 7760kb

input:

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

output:

1

result:

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

Test #67:

score: 0
Accepted
time: 52ms
memory: 7712kb

input:

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

output:

1.4142135623731

result:

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

Test #68:

score: 0
Accepted
time: 54ms
memory: 7880kb

input:

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

output:

1.4142135623731

result:

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