QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#679170#9478. Shift Puzzleucup-team4744#AC ✓50ms9572kbC++204.6kb2024-10-26 17:02:432024-10-26 17:02:44

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
.#.
#.#
.#.
#.#
...
#.#

output:

Yes
24
2 2
2 2
1 1
2 2
1 1
1 1
1 2
1 2
2 3
1 2
2 3
2 3
1 3
1 3
2 3
1 3
2 3
2 3
2 3
2 3
1 3
2 3
1 3
1 3

result:

ok AC

Test #2:

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

input:

3
.#.
#.#
.#.
.#.
#.#
.#.

output:

Yes
0

result:

ok AC

Test #3:

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

input:

13
.............
....#####....
......#......
......#......
......#......
......#......
.............
....#...#....
....#...#....
....#...#....
....#...#....
.....###.....
.............
....####.....
....#...#....
....####.....
....#........
....#........
.............
.....###.....
....#...#....
......

output:

No

result:

ok AC

Test #4:

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

input:

3
#.#
#.#
###
#.#
.#.
###

output:

No

result:

ok AC

Test #5:

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

input:

4
.#..
.#..
....
...#
....
..#.
#...
....

output:

No

result:

ok AC

Test #6:

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

input:

4
....
....
....
.#..
..##
##.#
####
..##

output:

No

result:

ok AC

Test #7:

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

input:

2
..
..
..
..

output:

Yes
0

result:

ok AC

Test #8:

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

input:

3
.##
##.
.#.
##.
..#
.##

output:

Yes
18
2 3
2 3
1 1
1 1
2 3
1 1
1 2
1 2
2 3
1 2
2 3
2 3
2 2
1 3
1 3
2 2
2 2
1 3

result:

ok AC

Test #9:

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

input:

3
...
#..
..#
...
#..
#..

output:

Yes
6
2 3
2 3
1 3
1 3
2 3
1 3

result:

ok AC

Test #10:

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

input:

3
..#
.##
###
#.#
.##
#.#

output:

Yes
6
1 3
1 3
2 1
2 1
1 3
2 1

result:

ok AC

Test #11:

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

input:

4
....
#...
...#
#.#.
#...
....
.#..
.##.

output:

Yes
24
1 2
1 2
1 2
2 1
1 2
2 1
2 1
2 1
2 4
2 4
1 3
1 3
2 4
2 4
1 3
1 3
1 4
2 2
2 2
2 2
1 4
1 4
1 4
2 2

result:

ok AC

Test #12:

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

input:

4
#.#.
##..
....
#..#
....
...#
.#.#
#.##

output:

Yes
32
2 1
1 2
2 1
2 1
2 1
1 2
1 2
1 2
1 3
1 3
1 3
2 1
1 3
2 1
2 1
2 1
1 3
1 3
1 3
2 3
2 3
1 3
2 3
2 3
1 4
1 4
1 4
2 2
2 2
1 4
2 2
2 2

result:

ok AC

Test #13:

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

input:

2
.#
.#
#.
#.

output:

Yes
8
1 1
2 2
1 1
2 2
2 2
1 2
2 2
1 2

result:

ok AC

Test #14:

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

input:

3
##.
.##
...
...
#..
###

output:

Yes
24
1 2
1 2
2 1
1 2
2 1
2 1
1 3
2 2
2 2
1 3
1 3
2 2
1 3
2 2
1 3
1 3
2 2
2 2
1 3
1 3
2 3
1 3
2 3
2 3

result:

ok AC

Test #15:

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

input:

3
.#.
##.
.#.
#.#
..#
#..

output:

Yes
24
1 1
2 2
2 2
1 1
1 1
2 2
2 3
1 2
1 2
2 3
2 3
1 2
2 3
1 2
2 3
2 3
1 2
1 2
2 2
2 2
1 3
2 2
1 3
1 3

result:

ok AC

Test #16:

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

input:

3
#.#
#..
#..
.#.
.##
.#.

output:

Yes
24
1 1
2 2
2 2
1 1
1 1
2 2
2 2
1 2
2 2
2 2
1 2
1 2
2 3
1 2
1 2
2 3
2 3
1 2
2 2
2 2
1 3
2 2
1 3
1 3

result:

ok AC

Test #17:

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

input:

4
####
#..#
...#
.#..
....
.##.
###.
#.##

output:

Yes
64
2 1
1 2
1 2
1 2
2 1
2 1
2 1
1 2
2 2
1 2
1 2
1 2
2 2
2 2
2 2
1 2
2 1
1 3
1 3
1 3
2 1
2 1
2 1
1 3
1 3
2 3
2 3
1 3
1 3
1 3
2 3
2 3
2 4
2 4
1 3
2 4
2 4
1 3
1 3
1 3
1 4
1 4
1 4
2 4
2 4
1 4
2 4
2 4
1 4
2 3
2 3
2 3
1 4
1 4
1 4
2 3
1 4
1 4
1 4
2 4
1 4
2 4
2 4
2 4

result:

ok AC

Test #18:

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

input:

4
.#.#
##..
.#.#
.##.
#.#.
..##
#.#.
#..#

output:

Yes
64
1 1
2 2
2 2
2 2
1 1
1 1
1 1
2 2
2 3
1 2
1 2
2 3
2 3
2 3
1 2
1 2
2 3
1 2
2 3
2 3
2 3
1 2
1 2
1 2
2 4
2 4
1 3
1 3
1 3
2 4
2 4
1 3
1 3
1 3
2 4
1 3
1 3
2 4
2 4
2 4
1 4
1 4
1 4
2 4
1 4
2 4
2 4
2 4
1 4
2 3
1 4
1 4
1 4
2 3
2 3
2 3
1 4
2 4
2 4
2 4
1 4
1 4
1 4
2 4

result:

ok AC

Test #19:

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

input:

19
.######.######..###
...###.##.###.#####
.#.####..#.##...###
.#####.##.######.##
.##.#############..
.#.....##..#.##.#.#
#####.###..#.###.##
#.####.#...##..#.##
.######.##.##..####
.#.###.###.###..###
#######.###.#..###.
#####.###.####.##.#
..#.######..###..#.
#.#.#..####..###.#.
########.####..##...

output:

No

result:

ok AC

Test #20:

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

input:

21
#####################
#####################
#####################
#####################
#####################
#####################
#####################
#########.###########
#####################
#####################
#####################
#####################
#####################
###########...

output:

No

result:

ok AC

Test #21:

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

input:

26
##.###....#######.....#...
.#.##.#####..#..#..###.###
.#.#####.##.##.#.#.##.#..#
###.###...##...#.#....#.#.
.##..###..#.##.#.##..#.#.#
#..##...##.#...####...####
##.#..###.#.####...###....
.##..#..##.##..#.##...#.##
####.###..#.#####..#####..
.#.#.##..###.###..###.####
##.##.#..#..#....###..###.
...

output:

No

result:

ok AC

Test #22:

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

input:

35
####.##.###.####..##.##############
####.####.##############.######.###
###########..######.###.######.###.
#.#.####.##.#####...###############
################.#####.############
#######...#.####.###..######.######
#.##.#############.####.######.#.##
##..####.####.#####################
#####.##....

output:

Yes
13720
1 1
1 1
1 1
1 1
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 5
1 2
1 2
1 ...

result:

ok AC

Test #23:

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

input:

34
.........#.................#......
...#.#............................
..........#.............#.........
.................................#
.......#..........................
..................................
.......................#..........
.................#................
....................

output:

Yes
2788
2 25
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
2 25
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1...

result:

ok AC

Test #24:

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

input:

23
####.####.#.#.#########
..####.##.##.###.######
#.###...#.#.###.###.###
###.#####.####..#######
#.#...##.######..#.#.##
.####.##.###########..#
##.#....##..###.#.#..##
##.#.####...##.###..#.#
##.###..###########.###
###.###..###.#.#.#.##.#
#.####.###..##.#####..#
###.######.##.####..#.#
.###.####...

output:

Yes
5336
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
1 1
1 1
1 1
2 5
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 4
1 2
1 2
1 2
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
1 2...

result:

ok AC

Test #25:

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

input:

20
#....###......##...#
.......##...#...#..#
......#.....#.#.....
..#....##.#..#.#....
#..#...#.#...##.#...
...#...#...##.....#.
#####.#........#....
....##...#.#..#.....
.#.#........#....#..
.#.#.###...#........
#.....#..##.##......
##....##..#.........
.#.#..............#.
#..............#..#.
##....

output:

Yes
3240
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 12
2 12
2 12
2 12
2 12
2 12
2 12
2 12
2 12
2 12
2 12
2 12
2 12
2 12
2 12
2 12
2 12
2 12
2 12
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 12
1 2
1 2
1 2
1 2
1 2
2 6
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
2 6
2 6
2 6
2 6
2 6
2 6
2 6...

result:

ok AC

Test #26:

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

input:

12
##..#.......
.#.##.###.#.
##.#..#.####
##.###..###.
.#.#.##.#.##
##.###.#...#
#..###..####
..####.#####
#.#.##.##.#.
.#.##.####..
.#.....#####
###.#..##.#.
.##.#######.
..###.#.####
#.###...##..
.#...##.#.##
.#.#########
#...##.#.##.
.##.##...##.
..####.#.###
...#.#######
..#.......#.
..#.#..##.#...

output:

Yes
792
1 1
1 1
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 3
2 6
1 2
1 2
1 2
1 2
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
2 8
1 2
1 2
1 2
1 2
1 2
2 8
2 8
2 8
2 8
2 8
2 8
2 8
2 8
2 8
2 8
2 8
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 3
...

result:

ok AC

Test #27:

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

input:

44
###...##.#....##.#####.##.##...####.##....##
#.#...##..#.#.##..#.###.......####..#..#..#.
..#.########..##.#.....##.....#..##...#.#.#.
#.#.##.#.#.#.#....#.#.######.#....#......###
#.#.#.##...##.#..#.#..#######.#.###..###.###
###..#...#...#........##..#...#.##..#..#..##
..##.#..#..#####......#..##...

output:

Yes
85184
1 1
1 1
1 1
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 ...

result:

ok AC

Test #28:

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

input:

10
##...#.#.#
###....###
#####.#...
....#....#
....#..##.
.#.#..##.#
##.##.#...
#..#..##.#
##..#.#.#.
######.#.#
..###.#.#.
...####...
.....#.###
####.####.
####.##..#
#.#.##..#.
..#..#.###
.##.##..#.
..##.#.#.#
......#.#.

output:

Yes
1000
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
1 1
1 1
2 3
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 4
2 5
1 2
1 2
1 2
1 2
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
1 2
1 2
1 2
1 2
1 2
1 2
2 7
1 2
1 2
1 2
1 2
1 2
2 7
2 7
2 7
2 7
2 7
2 7
2 7...

result:

ok AC

Test #29:

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

input:

44
..#.#.###.#.....#...#.#####.....#....#.#....
####.....#..##...##..#.####.#.#..#..#..#####
#.###.##########.##.#####..#####.#.##....#.#
#..#.##.##..###..#...#.....###.##..##.#.##..
.####.#..##.###.#.###....#..#..######...#.#.
##...#.#.##.##..#.##.####.###.#..#####.#.###
.#..####...##.####.....##.....

output:

Yes
85184
1 1
1 1
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 ...

result:

ok AC

Test #30:

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

input:

10
###..#...#
#.##.##..#
#..#..##.#
..#..###..
#..###...#
.##.##.##.
.##..##...
#.###.##..
.#####....
.#...#.#.#
...##.###.
.#..#..##.
.##.##..#.
##.##...##
.##...###.
#..#..#..#
#..##..###
.#...#..##
#.....####
#.###.#.#.

output:

Yes
1000
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
1 1
1 1
1 1
2 4
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 5
1 2
1 2
1 2
1 2
1 2
1 2
2 7
1 2
1 2
1 2
1 2
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
1 1
1 1
1 1
1 1
1 1
2 8
2 8
2 8
2 8
2 8
2 8
2 8
2 8...

result:

ok AC

Test #31:

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

input:

30
..#.#..#....##.#..###...##.#..
..###...#####.#..##.##......##
..###.#.####.....#...##..##.#.
#.#....####.#..##...##..###..#
#.##.#.........#.##.#.##......
#.##......##..#.######..##..##
###..#.##..##...#####.##..##.#
#####.#..#...###.....##..#.#.#
##..#.####.####....####......#
##.#..####.#..##.....

output:

Yes
27000
1 1
1 1
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 3
1 1
1 1
1 1
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 ...

result:

ok AC

Test #32:

score: 0
Accepted
time: 11ms
memory: 4488kb

input:

79
###########.#####.#.###################################################.######.
#####.#########.##.###.##.#.######.############.####.##.###########.##..#######
#########.##..########.###.###.##########..################.#########.####.###.
#####.####..##.#####.#.###.######.######################....

output:

Yes
112022
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
2 12
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
...

result:

ok AC

Test #33:

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

input:

79
..........##...............#..#.#...#...#.....##...............................
..#...#......#.........#..##...#.#....##.##.........##.#...#...#......#..##....
.##....#.........#........#...............#....#......#.......#....#..#....#...
...#...##...##...#...#.#.....................#.#............

output:

Yes
133510
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11
2 11...

result:

ok AC

Test #34:

score: 0
Accepted
time: 11ms
memory: 4208kb

input:

79
.......#..##.#.........#....#....#..#..#.........#.#...........#...............
..#.................#............#...........................#........#.#....#.
#........................#........#........#..................#..##...........#
....#...##.................#......##........................

output:

Yes
99224
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
2 11
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1...

result:

ok AC

Test #35:

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

input:

79
....................#..........................................................
.............#..#..#.........#............#...............................#....
.......................................................#.......................
.........................#....#......................#.#....

output:

Yes
40922
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
2 21
2 21
2 21
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4...

result:

ok AC

Test #36:

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

input:

79
...#####...######.#####.###...####.#.##.#.#....#..##..########.##.##.#.####..##
.##..##.####.#####.##.#######.####..#####..#..#.#####.#...####.#######.#..###.#
#..####.#.#####.###.####..##..##.#.#####..#.###..#..#....#.####..###.##.###.#.#
.##.####.####..######.###..##.#########.#.##.##.#####.......

output:

Yes
221516
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2...

result:

ok AC

Test #37:

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

input:

79
######.#####.##.....#..##.##.##.##.###.#####..#####.#.#######.##.#.###.#.###.#.
...#.....##.....#...#...#.####....#.#.#.######..#..####.#.#######.###..###.###.
.#.#....##.....##.###.#####...#......#.#..#.#..###.#######.#.##...##..###.#..#.
.##.#.#..##.#...###.##....##......#..#....##.##.#.#.#...#...

output:

Yes
492960
1 1
1 1
1 1
1 1
1 1
1 1
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2 7
2...

result:

ok AC

Test #38:

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

input:

79
..#.#..###.##.#.#.####.#.##.#..#....#...#######.#...#...#....#####..##..##.####
#.#..####.#.#.#..#..#.#....##...#.#..#..#.###.#.#.#.#.....####.####.#..#.#.###.
#...#...#.##.#..##.#####.#.#####.......#######...###.#.#...#.###.####.####..##.
#.##.#..#......##...#.##..#..###.##..#..###..#.##.....##....

output:

Yes
492960
1 1
1 1
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2...

result:

ok AC

Test #39:

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

input:

79
....#.#.##..#.#...........########..#..#..###########.###..#..####.#.###.#.....
.#..#...#...#.#####.#..##.#.#.#.#...#.##.##.#..##..##########....##.###.####.##
..###..#..###.....#..##..#.....##..##.###....##..####..##..##..#####.#####....#
#.#######..###..###.##.#.#..###########.##..#....#.#.#..#...

output:

Yes
492960
1 1
1 1
1 1
1 1
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2...

result:

ok AC

Test #40:

score: 0
Accepted
time: 41ms
memory: 8820kb

input:

79
###..#.#.#...##.##.###...#.####.####...#....#..#...###...#.#..#...#.#.#.##..#..
#####.###....#.#....#.####...#..###..#..#.##.##...#.###..#.#...####.####....#..
##.....#####.#..#.....#.#.#..#.#..#.############..#.#.#...#....#.###.#...##.##.
#.#...#.########..##....#####...##...#.#.#.#..#.#...##......

output:

Yes
492960
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2...

result:

ok AC

Test #41:

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

input:

79
.....###.##.#.#....####.#.###..#.###..#.##...###.##..#.##.#.####......#.###.#..
###.##..###.######.#.##..####.#####.#.#.####..#.##..######..#...#.##....###...#
#...##.####.#..#####..#####.##.#...####.#...####..##.##.#..####....#...#....###
####..###..#.##.......#...#..##.####.##.###...#####.#..#....

output:

Yes
492960
1 1
1 1
1 1
1 1
1 1
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2...

result:

ok AC

Test #42:

score: 0
Accepted
time: 39ms
memory: 7884kb

input:

79
..##.##.#..#.#.#.#..##.#.....#.#####...####.####..###..##..#....##.#.#...#....#
.###.#.####.###.###..#.#.#.#...#.#####...##..#.##..##..#.####..###.#.##.#.#.###
.##..###..##....#.#..#.#.##.#.##.###..#####.#..#.#.##.####...##....#.###..###..
#..##..###.#.###.###.##.######.#.#........##...##.##..#.#...

output:

Yes
492960
1 1
1 1
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2...

result:

ok AC

Test #43:

score: 0
Accepted
time: 47ms
memory: 8292kb

input:

79
...##...#..##......##..##....###....#.##..##.##.##..#.#..#.#..##...#........#..
####.#.#.#.#.###....#..#.##.....#.#.###.#.#.#.#...#.#####..##..###.##.#.#######
..#.#.#...#####.#####.#.##..#.#.#..###.##...##.#.#..#...#####.###..##...##..###
.#....#...#..##......#..##....#..##.#..#.##.###..##...#.#...

output:

Yes
492960
1 1
1 1
1 1
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2...

result:

ok AC

Test #44:

score: 0
Accepted
time: 47ms
memory: 8148kb

input:

79
#....#.##.###.....##.#####.#.#..##..#.######.#.###.#.######.#.##.#......#..#.##
.###.##.##......#..###.#.#....#....##.###.#.###.#......#...##..##..##...#.##...
.##.#..##...##...#.#....#...#...##..#.#.#.#...#.#.##...#.###..##.#####..#.#####
..###..#.###......#..#...###..#......###..##.....####..##...

output:

Yes
492960
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2...

result:

ok AC

Test #45:

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

input:

79
...#..####..##.#.#..#.....#..#.####...#.#..#.#....#..#..#.###.#####...#....#.##
..##......##.#.##..#.#.###..####.#.##.#.......##..##.....#.#.#####....#..###.#.
#..#.##.#.#.##..##.####..########.##.#.#..####.#####.##.######.##.#..####..##.#
##...#....##....####.#.#.#..#...##########.###.###.#..###...

output:

Yes
492960
1 1
1 1
1 1
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2...

result:

ok AC

Test #46:

score: 0
Accepted
time: 48ms
memory: 8728kb

input:

79
#...##..#.##..#.#.###..##.###.#####..#.#...###......#..#...#..######.#.#..#.#.#
#..#.##...#.###.#..#...#####.#.#.#...##..##.###..###..####..#.#.#..####.##.#..#
###..#.##..##.###..###.#.##..#..##....##.#..####.##.##..###..#..#.....#..#.##..
.#.#.....##...#.##..###.##.##.##..#..###.##...#.#.#####.#...

output:

Yes
492960
1 1
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2...

result:

ok AC

Test #47:

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

input:

80
##..#..#.#.##.######.####.##...#..#####.#..#.#####.##...#.####.##.##.#.#...#.#..
#.###.#.#.#...#.#...#.#.#.###....#.##.###..#....##.####.##.#####.####.##.##..#..
.###.##.###.##.####..#####..#####.###.#####.##....##.#.#.#..#####.#...###.#.##.#
#.###.###..##.#.##.##...###.#.####...##.###.#...##.#.#...

output:

Yes
251840
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2...

result:

ok AC

Test #48:

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

input:

80
.....#.##...#.#.###.......#..#.#...#..###.#.#..#..#.#...###......####..#.#.#..##
##..##...#.....##.#....###.#..#......###.#...#.##.....#.#.##..##...#....#.......
#.#.#..#.#.##..........#..............##..#.#..###.##..#.###...#......#.#...##..
....#...##.##.#.#.......#...#.#.##.#...#.###..#.#...##...

output:

Yes
236320
1 1
1 1
1 1
1 1
1 1
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2...

result:

ok AC

Test #49:

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

input:

80
###..####..############.########.########.###.########.#####.###.##.######..####
.#####.#.#####.###.######.###..##.################.###.#.#######################
########.#####.######..##.##.####.#.#####.#.#.###..#########...######.##.#######
##.############.#..#.##..########.####..####..#.######...

output:

Yes
124160
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2...

result:

ok AC

Test #50:

score: 0
Accepted
time: 21ms
memory: 5388kb

input:

80
#.###.##..#..##############.#.###..#######.#####.####.###.######...######.######
#.##...#.####.#.###..#.#####.####.#.#.######.#####.#...###.##..##.#.####.##..###
#####################.#..#####.######.###.####.##############.####.###.##.##.#.#
##.##.#.###.##..#####.###########.##.#.#.#.##..#.###.#...

output:

Yes
207360
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10
2 10...

result:

ok AC

Test #51:

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

input:

80
#####..##.###..###..##.#......#..####.##.####.#####.##.####.###.###..#..#.####..
####...######.#####.##.######..#####..####..#######.#..###########.#..##..#.####
.#..#..##..##..#..#.#.#####..##.#######.##.###..####.###.###..#.#.###.#######.##
.#.###.########..###.#.#.#####.###..##...####..#..###....

output:

Yes
199520
1 1
1 1
1 1
1 1
1 1
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2...

result:

ok AC

Test #52:

score: 0
Accepted
time: 50ms
memory: 7692kb

input:

80
##.#..#####...####.#.....#.#.#....##...#.....##...##....#..##....###.....#.##.#.
##.#...#..##.#####...#..#.......#..#..#.###.###########.###.#.##.##.##.########.
...##.##.#..###...###.#.###.#.##.#####..#.....##.####..##.#.####.#######.###.###
....#.##..#.##...##..##.##....#.#...###.#.##..##.##......

output:

Yes
512000
1 1
1 1
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2...

result:

ok AC

Test #53:

score: 0
Accepted
time: 49ms
memory: 9360kb

input:

80
.#..#.####..##.#..##...#.#..#.#.#...#.#####.#..##....#.####.#.####.##.#.#...#..#
.#.#...#....#.##.###..#.###..#.#.#.#...####.#..#..##...####..##..##..#.##.#..###
...##.#..###...#....#..###..#.#..##.#.#..#.##.####....###..#.######....#.#..####
...##..##...#.#...##...##.#.####.#...###..#...#####.##...

output:

Yes
512000
1 1
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2...

result:

ok AC

Test #54:

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

input:

80
####...####.#.#..####.....###...#.#.#......#..##.###.###.#.#.#...#..###.#...#..#
#...#.#..#.###.#.#.####..###..#.#...#.##.#...##.#..##..#..##.#.####.#..##..##.#.
#.########.###...#..##..##..######..#.#.#.###..##..#.#.#.###.#.###...#.####..###
#.##.#.####..####.#..##.###.##.##......#..##....###.##...

output:

Yes
512000
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
2...

result:

ok AC

Test #55:

score: 0
Accepted
time: 50ms
memory: 8824kb

input:

80
#..#..........###.#...#.######..###...###..####.#..#.####.##.###..##....#..#.##.
###..##.#.#.###......#####...#.##.#.#..#.....###.#...##.#.##.#......#.#..###...#
####.##...#.###..###.####..#.#.###.####..#.##.###.#.#..##.##.##....##...#.#...##
##.#.#..#.###....##..####.#......#####....##.#.##.#.##...

output:

Yes
512000
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2...

result:

ok AC

Test #56:

score: 0
Accepted
time: 42ms
memory: 7688kb

input:

80
.#..#...#...##...#....##.#.#.###....##.#.#..#.#.#......#####.#.##.#.#...#.###...
#..######.##.####..####..##..#####.##.....#.##...###.##.##.#....#.######....###.
#.#.#.##..##.#..#...##...###.#....#.######.#####....#.#..#.####..#....##..#...##
#.#####.##.#.....#.##.###.#####.#########.####.##....#...

output:

Yes
512000
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2...

result:

ok AC

Test #57:

score: 0
Accepted
time: 46ms
memory: 7784kb

input:

80
#.#.#....#.#.#......##.##..#.##...##.##..#######..#####..##.#....####.##.##.##..
...####...#.###...#.#........#.##....#...##..##...#.#########..#.#...##....#.#..
..#..#.###..#.#..###.##.###..##..####.#..##.#.##..#...#...##.....###.#....###.#.
##.######..#...###.##.####.#.#..##.#.##....#..#..#...#...

output:

Yes
512000
1 1
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2...

result:

ok AC

Test #58:

score: 0
Accepted
time: 42ms
memory: 7668kb

input:

80
...###.#.#..#....##.##....#.####.####..########.##..#####.##.#..##..##.#...#.#.#
#.#.....#.##...#.##..#..#...#..###.###.########.##....#..##..#.#.#.#.##.........
#..##...#.##.#.#.##...##.......###...##..#...##..####.####.##.##..#.##....#####.
#.##..##..#.#.#..#..##.#...##.##.#.....#....#.#.##..#....

output:

Yes
512000
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2...

result:

ok AC

Test #59:

score: 0
Accepted
time: 42ms
memory: 9572kb

input:

80
###..#.#..#.#.#.#.##.####..##.##......###.##..##.#.#....####....###.#....###.#.#
#######.#.##...##.....####.##...###..#.#..###..###.#..###.#.......#....#.#.#....
###.#.#.##...#...##.....###.##.#...#..###.#...###.##.#.##..#.#..#.#....######..#
#.#..##.#.######.#...##.#..#...#.#..#..#...#..##.#...#...

output:

Yes
512000
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2...

result:

ok AC

Test #60:

score: 0
Accepted
time: 45ms
memory: 8552kb

input:

80
##.##..##....#..#.#...#####....#.####....#.....#..####...#.##.#..#..#######..##.
.######.####..#.#####.##.....#.####....#.###.....##.#.#.#....#.##.#.#.###.##....
###.#..#.##.#.##.##.#.#.##.....##..#...#...#.#.##.#####.#....#..#..#.###.#.#.#.#
#..#..##..#.##..#..#.###.#.###..#...####.##....####......

output:

Yes
512000
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2...

result:

ok AC

Test #61:

score: 0
Accepted
time: 49ms
memory: 7784kb

input:

80
.#.##..####..#.#..#.##.##.##..#..#############..###.######.#.#..##.##....##.##.#
....#...##.#.####..#.##..#....#...#.#..##..##.###.######.###..#.#.####.#......#.
....##...###.#.#..#.#....#...#.#####..###.#.##...###.......#.####.####....#..##.
..###.#....##..#.#..#.#.##..###..#.##..##..#.####.#.##...

output:

Yes
512000
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2...

result:

ok AC

Test #62:

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

input:

5
...##
##...
#.#.#
#.#.#
#.#..
###..
..###
.#...
.#.#.
.#.##

output:

Yes
120
2 4
2 4
2 4
2 4
1 1
1 1
1 1
2 4
1 1
1 1
2 5
2 5
2 5
2 5
1 1
1 1
1 1
2 5
1 1
1 1
2 3
1 2
1 2
2 3
2 3
2 3
2 3
1 2
1 2
1 2
2 3
1 2
2 3
2 3
2 3
2 3
1 2
1 2
1 2
1 2
2 4
1 3
1 3
1 3
2 4
2 4
2 4
2 4
1 3
1 3
1 3
2 3
2 3
1 3
1 3
1 3
1 3
2 3
2 3
2 3
1 4
1 4
1 4
1 4
2 5
2 5
1 4
2 5
2 5
2 5
2 5
1 4
1 4
...

result:

ok AC

Test #63:

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

input:

5
###.#
.#...
#..#.
#..##
.#..#
...#.
#.#.#
.##.#
.##..
#.##.

output:

Yes
120
1 1
1 1
1 1
2 4
2 4
2 4
2 4
1 1
1 1
2 4
2 2
1 2
2 2
2 2
2 2
2 2
1 2
1 2
1 2
1 2
1 2
1 2
2 3
1 2
1 2
1 2
2 3
2 3
2 3
2 3
2 5
1 2
1 2
1 2
2 5
2 5
2 5
2 5
1 2
1 2
1 3
2 2
2 2
1 3
1 3
1 3
1 3
2 2
2 2
2 2
2 3
1 4
1 4
2 3
2 3
2 3
2 3
1 4
1 4
1 4
2 5
2 5
1 3
1 3
1 3
1 3
2 5
2 5
2 5
1 3
2 4
1 4
1 4
...

result:

ok AC

Test #64:

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

input:

5
..##.
..#.#
.....
#....
....#
#....
.....
.#...
..#..
.#.##

output:

Yes
50
1 1
1 1
2 3
2 3
2 3
2 3
1 1
1 1
1 1
2 3
1 3
1 3
2 4
2 4
1 3
1 3
1 3
2 4
2 4
2 4
1 4
1 4
2 3
2 3
1 4
1 4
1 4
2 3
2 3
2 3
1 5
1 5
1 5
1 5
2 1
1 5
2 1
2 1
2 1
2 1
2 5
2 5
2 5
1 5
2 5
2 5
1 5
1 5
1 5
1 5

result:

ok AC

Test #65:

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

input:

5
.#...
.....
.#.##
.....
.....
.....
.....
..##.
...#.
#....

output:

Yes
30
2 2
2 2
1 3
1 3
1 3
1 3
2 2
2 2
2 2
1 3
1 4
1 4
1 4
2 2
1 4
1 4
2 2
2 2
2 2
2 2
1 5
1 5
1 5
1 5
2 5
2 5
1 5
2 5
2 5
2 5

result:

ok AC

Test #66:

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

input:

5
...##
##.#.
.....
#.#.#
#.##.
...#.
.#..#
###.#
#..##
.#...

output:

Yes
70
2 5
1 2
1 2
1 2
1 2
2 5
2 5
2 5
2 5
1 2
1 3
1 3
1 3
1 3
2 5
2 5
1 3
2 5
2 5
2 5
1 3
1 3
2 4
1 3
1 3
1 3
2 4
2 4
2 4
2 4
2 3
1 4
1 4
2 3
2 3
2 3
2 3
1 4
1 4
1 4
2 5
2 5
1 5
1 5
1 5
1 5
2 5
2 5
2 5
1 5
2 3
2 3
2 3
2 3
1 5
2 3
1 5
1 5
1 5
1 5
1 5
1 5
1 5
2 4
1 5
1 5
2 4
2 4
2 4
2 4

result:

ok AC

Test #67:

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

input:

5
#.#..
###.#
.##.#
.#...
..#..
#...#
##..#
....#
#..##
.##..

output:

Yes
50
2 5
2 5
2 5
2 5
1 1
1 1
2 5
1 1
1 1
1 1
1 4
1 4
2 3
2 3
1 4
1 4
1 4
2 3
2 3
2 3
2 2
1 4
1 4
1 4
2 2
2 2
2 2
2 2
1 4
1 4
1 4
1 4
1 4
2 3
1 4
1 4
2 3
2 3
2 3
2 3
2 2
1 5
2 2
2 2
2 2
2 2
1 5
1 5
1 5
1 5

result:

ok AC

Test #68:

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

input:

6
##....
##.#.#
.###..
#..#.#
.###..
##..#.
..####
..#.#.
#...##
.##.#.
#...##
..##.#

output:

Yes
216
1 1
1 1
2 3
2 3
2 3
2 3
2 3
1 1
1 1
1 1
1 1
2 3
2 4
2 4
2 4
2 4
2 4
1 1
1 1
2 4
1 1
1 1
1 1
1 1
2 5
1 2
1 2
1 2
1 2
2 5
2 5
2 5
2 5
2 5
1 2
1 2
1 2
1 2
1 2
1 2
2 6
1 2
1 2
2 6
2 6
2 6
2 6
2 6
2 4
1 3
1 3
1 3
2 4
2 4
2 4
2 4
2 4
1 3
1 3
1 3
1 2
1 2
1 2
2 6
1 2
1 2
1 2
2 6
2 6
2 6
2 6
2 6
2 5
...

result:

ok AC

Test #69:

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

input:

6
.##.##
##....
..#...
.##.#.
.##..#
###.##
#..#..
..####
##.###
#..#.#
#..##.
...#..

output:

Yes
216
1 1
2 2
2 2
2 2
2 2
2 2
1 1
1 1
1 1
1 1
1 1
2 2
2 4
1 2
1 2
1 2
2 4
2 4
2 4
2 4
2 4
1 2
1 2
1 2
2 3
1 2
1 2
2 3
2 3
2 3
2 3
2 3
1 2
1 2
1 2
1 2
2 4
1 2
1 2
2 4
2 4
2 4
2 4
2 4
1 2
1 2
1 2
1 2
1 3
1 3
1 3
1 3
2 5
2 5
1 3
1 3
2 5
2 5
2 5
2 5
1 3
1 3
1 3
1 3
2 6
2 6
1 3
1 3
2 6
2 6
2 6
2 6
2 3
...

result:

ok AC

Test #70:

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

input:

6
......
......
......
......
......
......
......
......
......
......
......
......

output:

Yes
0

result:

ok AC

Test #71:

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

input:

6
###..#
##....
..#..#
#.#.##
.#.#.#
.#.###
##.#..
##..#.
.##.#.
.##...
#.###.
#.###.

output:

Yes
120
1 1
2 4
2 4
2 4
2 4
2 4
1 1
1 1
1 1
1 1
1 1
2 4
2 6
2 6
1 3
1 3
1 3
1 3
2 6
2 6
2 6
2 6
1 3
1 3
1 4
1 4
1 4
1 4
2 5
2 5
1 4
1 4
2 5
2 5
2 5
2 5
2 6
1 4
1 4
1 4
1 4
2 6
2 6
2 6
2 6
2 6
1 4
1 4
1 5
1 5
1 5
1 5
2 5
1 5
1 5
2 5
2 5
2 5
2 5
2 5
2 5
2 5
1 5
1 5
1 5
2 5
2 5
2 5
2 5
1 5
1 5
1 5
2 6
...

result:

ok AC

Test #72:

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

input:

6
.#..#.
#.####
...###
##....
#.####
#.#...
.##.#.
.###.#
#.##.#
#.#...
###..#
.##...

output:

Yes
84
1 2
1 2
2 3
1 2
1 2
1 2
1 2
2 3
2 3
2 3
2 3
2 3
1 2
1 2
1 2
2 5
1 2
1 2
1 2
2 5
2 5
2 5
2 5
2 5
1 3
1 3
1 3
1 3
2 5
2 5
1 3
1 3
2 5
2 5
2 5
2 5
2 3
1 4
2 3
2 3
2 3
2 3
2 3
1 4
1 4
1 4
1 4
1 4
1 5
1 5
1 5
1 5
1 5
2 3
1 5
2 3
2 3
2 3
2 3
2 3
1 5
1 5
1 5
2 5
2 5
2 5
2 5
1 5
1 5
1 5
2 5
2 5
2 2
2...

result:

ok AC

Test #73:

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

input:

6
.#####
.##..#
##.##.
......
##..##
....#.
...#..
####..
.###..
###.#.
..##.#
....##

output:

Yes
120
2 2
1 2
2 2
2 2
2 2
2 2
2 2
1 2
1 2
1 2
1 2
1 2
2 3
1 2
1 2
1 2
1 2
1 2
2 3
2 3
2 3
2 3
2 3
1 2
1 3
1 3
2 3
2 3
1 3
1 3
1 3
1 3
2 3
2 3
2 3
2 3
1 4
1 4
1 4
1 4
2 5
2 5
2 5
1 4
1 4
2 5
2 5
2 5
1 4
1 4
1 4
1 4
2 6
2 6
2 6
1 4
1 4
2 6
2 6
2 6
2 3
1 5
1 5
2 3
2 3
2 3
2 3
2 3
1 5
1 5
1 5
1 5
1 5
...

result:

ok AC

Extra Test:

score: 0
Extra Test Passed