QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#113850#5537. Storing EggsPetroTarnavskyi#WA 131ms16816kbC++172.3kb2023-06-19 18:30:202023-06-19 18:30:21

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-19 18:30:21]
  • Judged
  • Verdict: WA
  • Time: 131ms
  • Memory: 16816kb
  • [2023-06-19 18:30:20]
  • Submitted

answer

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

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define MP make_pair
#define PB push_back
#define F first
#define S second

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;

const int N = 474;
const int inf = 4747474;
string v[3];
int dp[N][N][8][8];

int res[8] = {inf, inf, inf, 1, inf, 4, 1, 1};
int r[8][8];

void setmax(int& a, int b)
{
	a = max(a, b);
}
void setmin(int& a, int b)
{
	a = min(a, b);
}

void f(int mask1, int mask2)
{
	int ans = inf;
	FOR (i, 0, 3)
	{
		if (((mask1 >> i) & 1) == 0)
			continue;
		FOR (j, 0, 3)
		{
			if (((mask2 >> j) & 1) == 0)
				continue;
				
			int d1 = abs(i - j);
			setmin(ans, d1 * d1);
		}
	}
	r[mask1][mask2] = ans;
}


bool ok(int m, int i)
{
	FOR (j, 0, 3)
	{
		if (((m >> j) & 1) && v[j][i] == '#')
			return false;
	}
	return true;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	FOR (i, 0, 8)
	{
		FOR (j, 0, 8)
		{
			f(i, j);
		}
	}
	
	int n, k;
	cin >> n >> k;
	FOR (i, 0, 3)
	{
		string s;
		cin >> s;
		v[i] = "#" + s;
	}
	FOR (i, 0, n + 1)
	{
		FOR(cnt, 0, k + 1)
		{
			FOR (m1, 0, 8)
			{
				FOR (m2, 0, 8)
					dp[i][cnt][m1][m2] = 0;
			}
		}
	}
	dp[0][0][0][0] = inf;
	FOR (now, 1, n + 1)
	{
		FOR (cnt, 0, k + 1)
		{
			FOR (col, 0, now)
			{
				FOR (m, 0, 8)
				{
					if (!ok(m, now))
						continue;
					FOR (mask, 0, 8)
					{
						if(mask == 0 && col != 0)
							continue;
						FOR (pmask, 0, 8)
						{
							int d = now - col;
							if (d > 2 && pmask > 0) break;
							int cur = dp[col][cnt][mask][pmask];
							cur = min(cur, r[mask][m] + d * d);
							cur = min(cur, r[pmask][m] + (d + 1) * (d + 1));
							cur = min(cur, res[m]);
							setmax(dp[now][cnt + __builtin_popcount(m)][m][col + 1 == now ? mask : 0], cur);
						}
					}
				}
			}
		}
	}
	
	int ans = 0;
	FOR (i, 0, 8)
	{
		FOR (j, 0, 8)
		{
			ans = max(ans, dp[n][k][i][j]);
		}
	}
	if (ans < 0.1) {
		cout << "-1\n";
	}
	else {
		cout << fixed << setprecision(10) << sqrt(ans) << '\n';
	}
	
	return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

4.4721359550

result:

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

Test #2:

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

input:

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

output:

1.0000000000

result:

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

Test #3:

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

input:

3 4
..#
...
...

output:

1.4142135624

result:

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

Test #4:

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

input:

2 6
..
.#
..

output:

-1

result:

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

Test #5:

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

input:

1 2
.
.
.

output:

2.0000000000

result:

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

Test #6:

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

input:

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

output:

99.0201999594

result:

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

Test #7:

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

input:

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

output:

49.0407993410

result:

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

Test #8:

score: 0
Accepted
time: 62ms
memory: 16084kb

input:

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

output:

2.0000000000

result:

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

Test #9:

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

input:

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

output:

1.4142135624

result:

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

Test #10:

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

input:

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

output:

1.0000000000

result:

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

Test #11:

score: 0
Accepted
time: 116ms
memory: 16028kb

input:

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

output:

1.0000000000

result:

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

Test #12:

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

input:

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

output:

1.0000000000

result:

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

Test #13:

score: 0
Accepted
time: 23ms
memory: 10316kb

input:

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

output:

1.0000000000

result:

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

Test #14:

score: 0
Accepted
time: 29ms
memory: 15924kb

input:

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

output:

2.0000000000

result:

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

Test #15:

score: 0
Accepted
time: 6ms
memory: 16148kb

input:

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

output:

1.0000000000

result:

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

Test #16:

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

input:

1 2
#
#
#

output:

-1

result:

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

Test #17:

score: 0
Accepted
time: 7ms
memory: 16044kb

input:

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

output:

2.0000000000

result:

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

Test #18:

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

input:

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

output:

2.8284271247

result:

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

Test #19:

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

input:

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

output:

2.8284271247

result:

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

Test #20:

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

input:

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

output:

98.0051019080

result:

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

Test #21:

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

input:

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

output:

81.0061726043

result:

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

Test #22:

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

input:

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

output:

47.0106370942

result:

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

Test #23:

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

input:

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

output:

42.0000000000

result:

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

Test #24:

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

input:

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

output:

30.0665927567

result:

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

Test #25:

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

input:

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

output:

28.0178514522

result:

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

Test #26:

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

input:

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

output:

23.0217288664

result:

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

Test #27:

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

input:

1 2
#
.
.

output:

1.0000000000

result:

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

Test #28:

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

input:

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

output:

18.0277563773

result:

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

Test #29:

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

input:

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

output:

17.1172427686

result:

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

Test #30:

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

input:

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

output:

16.0312195419

result:

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

Test #31:

score: 0
Accepted
time: 6ms
memory: 14124kb

input:

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

output:

15.1327459504

result:

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

Test #32:

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

input:

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

output:

14.0356688476

result:

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

Test #33:

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

input:

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

output:

12.1655250606

result:

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

Test #34:

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

input:

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

output:

8.0622577483

result:

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

Test #35:

score: 0
Accepted
time: 51ms
memory: 16080kb

input:

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

output:

1.4142135624

result:

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

Test #36:

score: 0
Accepted
time: 5ms
memory: 13892kb

input:

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

output:

8.0622577483

result:

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

Test #37:

score: 0
Accepted
time: 14ms
memory: 16024kb

input:

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

output:

2.2360679775

result:

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

Test #38:

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

input:

1 3
#
.
.

output:

-1

result:

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

Test #39:

score: 0
Accepted
time: 40ms
memory: 14124kb

input:

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

output:

1.4142135624

result:

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

Test #40:

score: 0
Accepted
time: 44ms
memory: 16044kb

input:

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

output:

1.0000000000

result:

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

Test #41:

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

input:

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

output:

4.1231056256

result:

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

Test #42:

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

input:

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

output:

4.0000000000

result:

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

Test #43:

score: 0
Accepted
time: 5ms
memory: 14096kb

input:

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

output:

15.1327459504

result:

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

Test #44:

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

input:

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

output:

6.3245553203

result:

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

Test #45:

score: 0
Accepted
time: 20ms
memory: 16016kb

input:

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

output:

2.2360679775

result:

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

Test #46:

score: 0
Accepted
time: 25ms
memory: 16028kb

input:

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

output:

1.0000000000

result:

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

Test #47:

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

input:

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

output:

2.0000000000

result:

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

Test #48:

score: 0
Accepted
time: 6ms
memory: 15980kb

input:

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

output:

4.0000000000

result:

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

Test #49:

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

input:

1 3
.
.
.

output:

1.0000000000

result:

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

Test #50:

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

input:

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

output:

32.0156211872

result:

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

Test #51:

score: 0
Accepted
time: 6ms
memory: 16128kb

input:

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

output:

8.2462112512

result:

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

Test #52:

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

input:

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

output:

2.2360679775

result:

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

Test #53:

score: 0
Accepted
time: 13ms
memory: 16024kb

input:

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

output:

1.0000000000

result:

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

Test #54:

score: 0
Accepted
time: 7ms
memory: 14060kb

input:

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

output:

2.2360679775

result:

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

Test #55:

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

input:

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

output:

5.0000000000

result:

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

Test #56:

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

input:

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

output:

28.0713376952

result:

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

Test #57:

score: 0
Accepted
time: 5ms
memory: 16132kb

input:

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

output:

9.2195444573

result:

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

Test #58:

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

input:

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

output:

2.2360679775

result:

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

Test #59:

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

input:

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

output:

2.2360679775

result:

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

Test #60:

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

input:

3 3
.##
.##
.##

output:

1.0000000000

result:

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

Test #61:

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

input:

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

output:

5.0990195136

result:

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

Test #62:

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

input:

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

output:

25.0000000000

result:

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

Test #63:

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

input:

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

output:

-1

result:

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

Test #64:

score: 0
Accepted
time: 12ms
memory: 16284kb

input:

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

output:

2.8284271247

result:

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

Test #65:

score: 0
Accepted
time: 5ms
memory: 16120kb

input:

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

output:

3.0000000000

result:

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

Test #66:

score: -100
Wrong Answer
time: 131ms
memory: 16816kb

input:

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

output:

-1

result:

wrong answer 1st numbers differ - expected: '1.0000000', found: '-1.0000000', error = '2.0000000'