QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#709612#9478. Shift Puzzleucup-team902AC ✓38ms9656kbC++202.2kb2024-11-04 15:48:262024-11-04 15:48:28

Judging History

你现在查看的是最新测评结果

  • [2024-11-04 15:48:28]
  • 评测
  • 测评结果:AC
  • 用时:38ms
  • 内存:9656kb
  • [2024-11-04 15:48:26]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=100;
int n;
char s[N+5][N+5];
char t[N+5][N+5];
struct oper{
    int t,x;
    oper(int t=0,int x=0):t(t),x(x){}
};
vector<oper> op;
vector<pair<int,int>> dif[2];
void work(int tp,int x,int c){
    for(int i=0;i<c;i++)
        op.push_back({tp,x});
    if(tp==1){
        static char tmp[N+5];
        for(int i=0;i<n;i++) tmp[i]=s[x][i];
        for(int i=0;i<n;i++) s[x][(i+c)%n]=tmp[i];
    }
    else{
        static char tmp[N+5];
        for(int i=0;i<n;i++) tmp[i]=s[i][x];
        for(int i=0;i<n;i++) s[(i+c)%n][x]=tmp[i];
    }
}
void rotate(int x1,int y1,int x2,int y2,int tp){
    // printf("%d %d %d %d %d\n",x1,y1,x2,y2,tp);
    // puts("");
    // for(int i=0;i<n;i++)
    //     printf("%s\n",s[i]);
    if(tp==0){
        work(1,x1,(y2-y1+n)%n);
        work(2,y2,(x1-x2+n)%n);
        work(1,x1,(y1-y2+n)%n);
        work(2,y2,(x2-x1+n)%n);
    }
    else{
        work(2,y2,(x1-x2+n)%n);
        work(1,x1,(y2-y1+n)%n);
        work(2,y2,(x2-x1+n)%n);
        work(1,x1,(y1-y2+n)%n);
    }
    // puts("->");
    // for(int i=0;i<n;i++)
    //     printf("%s\n",s[i]);
    // puts("");
}
int main(){
    scanf("%d",&n);
    for(int i=0;i<n;i++)
        scanf("%s",s[i]);
    for(int j=0;j<n;j++)
        scanf("%s",t[j]);
    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)
            if(s[i][j]!=t[i][j]){
                dif[s[i][j]=='#'].push_back({i,j});
            }
    if(dif[0].size()!=dif[1].size()){
        puts("No");
        return 0;
    }
    for(int i=0;i<dif[0].size();i++){
        auto [x1,y1]=dif[0][i];
        auto [x2,y2]=dif[1][i];
        // printf("%d %d %d %d\n",x1,y1,x2,y2);
        if(x1!=x2&&y1!=y2){
            rotate(x1,y1,x2,y2,s[x1][y1]!=s[x1][y2]);
        }
        else if(x1!=x2){
            rotate(x1,(y1-1+n)%n,x2,y1,s[x1][(y1-1+n)%n]==s[x1][y1]);
        }
        else if(y1!=y2){
            rotate(x1,y1,(x1+1)%n,y2,s[(x1+1)%n][y2]==s[x1][y1]);
        }
    }
    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)
            assert(s[i][j]==t[i][j]);
    puts("Yes");
    printf("%d\n",op.size());
    for(auto [t,x]:op){
        printf("%d %d\n",t,x+1);
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

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

result:

ok AC

Test #2:

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

input:

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

output:

Yes
0

result:

ok AC

Test #3:

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

input:

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

output:

No

result:

ok AC

Test #4:

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

input:

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

output:

No

result:

ok AC

Test #5:

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

input:

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

output:

No

result:

ok AC

Test #6:

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

input:

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

output:

No

result:

ok AC

Test #7:

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

input:

2
..
..
..
..

output:

Yes
0

result:

ok AC

Test #8:

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

input:

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

output:

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

result:

ok AC

Test #9:

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

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: 3952kb

input:

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

output:

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

result:

ok AC

Test #11:

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

input:

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

output:

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

result:

ok AC

Test #12:

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

input:

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

output:

Yes
32
2 1
1 2
2 1
2 1
2 1
1 2
1 2
1 2
1 3
2 3
2 3
1 3
1 3
1 3
2 3
2 3
1 3
2 1
1 3
1 3
1 3
2 1
2 1
2 1
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: 0ms
memory: 3952kb

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: 0ms
memory: 3736kb

input:

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

output:

Yes
24
1 2
2 1
1 2
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
2 3
1 3
1 3
2 3
2 3

result:

ok AC

Test #15:

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

input:

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

output:

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

result:

ok AC

Test #16:

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

input:

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

output:

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

result:

ok AC

Test #17:

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

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
1 3
1 3
2 3
2 3
1 3
1 3
2 3
2 3
2 4
2 4
1 3
1 3
2 4
2 4
1 3
1 3
2 1
1 3
1 3
2 1
2 1
2 1
1 3
1 3
1 4
1 4
1 4
2 4
2 4
1 4
2 4
2 4
1 4
2 4
1 4
1 4
1 4
2 4
2 4
2 4
2 2
2 2
2 2
1 4
1 4
2 2
1 4
1 4

result:

ok AC

Test #18:

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

input:

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

output:

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

result:

ok AC

Test #19:

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

input:

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

output:

No

result:

ok AC

Test #20:

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

input:

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

output:

No

result:

ok AC

Test #21:

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

input:

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

output:

No

result:

ok AC

Test #22:

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

input:

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

output:

Yes
13720
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 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
1 1
1 1
1 1
1 1
2 1
1 1
1 1
1 ...

result:

ok AC

Test #23:

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

input:

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

output:

Yes
2788
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
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 10
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 #24:

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

input:

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

output:

Yes
5336
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
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 2
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
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4...

result:

ok AC

Test #25:

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

input:

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

output:

Yes
3240
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
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 1
1 1
1 1
1 1
1 1
1 1
1 1
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
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 6...

result:

ok AC

Test #26:

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

input:

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

output:

Yes
792
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 1
1 1
1 1
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 2
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
2 8
2 8
2 8
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 8
2 2
...

result:

ok AC

Test #27:

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

input:

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

output:

Yes
85184
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
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 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 #28:

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

input:

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

output:

Yes
1000
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
1 1
1 1
2 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
1 1
1 1
2 2
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
1 1
2 6
1 1
1 1
1 1
1 1
1 1
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
2 8
1 1
1 1
1 1...

result:

ok AC

Test #29:

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

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: 0ms
memory: 3968kb

input:

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

output:

Yes
1000
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
1 1
1 1
1 1
2 1
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 2
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
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
2 3
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 6
2 6
2 6
2 6
2 6...

result:

ok AC

Test #31:

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

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: 9ms
memory: 4240kb

input:

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

output:

Yes
112022
1 1
1 1
1 1
1 1
1 1
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17
2 17...

result:

ok AC

Test #33:

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

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: 8ms
memory: 4388kb

input:

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

output:

Yes
99224
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 #35:

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

input:

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

output:

Yes
40922
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
2 21
...

result:

ok AC

Test #36:

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

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: 33ms
memory: 9512kb

input:

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

output:

Yes
492960
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 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 #38:

score: 0
Accepted
time: 33ms
memory: 7804kb

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: 33ms
memory: 9656kb

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: 29ms
memory: 8688kb

input:

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

output:

Yes
492960
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
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
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 #41:

score: 0
Accepted
time: 37ms
memory: 7928kb

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: 26ms
memory: 9460kb

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: 37ms
memory: 8444kb

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: 37ms
memory: 9656kb

input:

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

output:

Yes
492960
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 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 #45:

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

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: 37ms
memory: 7664kb

input:

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

output:

Yes
492960
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
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
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 #47:

score: 0
Accepted
time: 19ms
memory: 5408kb

input:

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

output:

Yes
251840
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
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
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 #48:

score: 0
Accepted
time: 18ms
memory: 5316kb

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: 10ms
memory: 4400kb

input:

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

output:

Yes
124160
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 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 #50:

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

input:

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

output:

Yes
207360
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
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
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 1
2...

result:

ok AC

Test #51:

score: 0
Accepted
time: 15ms
memory: 5292kb

input:

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

output:

Yes
199520
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
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
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 #52:

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

input:

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

output:

Yes
512000
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
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
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 #53:

score: 0
Accepted
time: 30ms
memory: 8236kb

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: 38ms
memory: 8156kb

input:

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

output:

Yes
512000
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
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
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 #55:

score: 0
Accepted
time: 31ms
memory: 8120kb

input:

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

output:

Yes
512000
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
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
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 #56:

score: 0
Accepted
time: 34ms
memory: 7676kb

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: 34ms
memory: 9452kb

input:

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

output:

Yes
512000
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 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 #58:

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

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: 34ms
memory: 7796kb

input:

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

output:

Yes
512000
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
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
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 #60:

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

input:

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

output:

Yes
512000
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 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 #61:

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

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: 0ms
memory: 3820kb

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 1
2 1
2 1
2 1
1 1
1 1
1 1
2 1
1 1
1 1
2 2
2 2
2 2
2 2
1 2
1 2
1 2
1 2
2 2
1 2
1 2
1 2
2 1
2 1
2 1
2 1
1 2
1 2
1 2
2 1
2 3
2 3
2 3
2 3
1 2
1 2
1 2
2 3
1 2
1 2
1 3
1 3
1 3
2 5
2 5
2 5
2 5
1 3
1 3
2 5
1 4
1 4
1 4
...

result:

ok AC

Test #63:

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

input:

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

output:

Yes
120
2 1
2 1
2 1
2 1
1 1
1 1
2 1
1 1
1 1
1 1
2 2
1 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
2 3
2 3
2 3
2 3
2 5
1 2
2 5
2 5
2 5
2 5
1 2
1 2
1 2
1 2
1 3
2 2
1 3
1 3
1 3
1 3
2 2
2 2
2 2
2 2
1 3
1 3
1 3
2 1
2 1
2 1
2 1
1 3
1 3
2 1
1 3
1 3
1 3
1 3
2 4
2 4
2 4
2 4
1 3
2 4
2 1
2 1
2 1
...

result:

ok AC

Test #64:

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

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
2 3
2 3
1 4
2 3
2 3
2 3
1 4
1 4
1 4
1 4
2 5
2 5
2 5
1 5
1 5
1 5
2 5
2 5
1 5
1 5
1 5
1 5
2 1
1 5
1 5
1 5
2 1
2 1
2 1
2 1

result:

ok AC

Test #65:

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

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: 0ms
memory: 3808kb

input:

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

output:

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

result:

ok AC

Test #67:

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

input:

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

output:

Yes
50
1 1
1 1
1 1
2 3
2 3
2 3
2 3
1 1
1 1
2 3
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: 0ms
memory: 3792kb

input:

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

output:

Yes
216
1 1
1 1
1 1
1 1
2 1
2 1
2 1
2 1
2 1
1 1
1 1
2 1
1 1
1 1
1 1
1 1
2 2
2 2
2 2
2 2
2 2
1 1
1 1
2 2
1 1
1 1
2 1
2 1
2 1
2 1
2 1
1 1
1 1
1 1
1 1
2 1
1 1
1 1
2 2
2 2
2 2
2 2
2 2
1 1
1 1
1 1
1 1
2 2
1 2
2 4
2 4
2 4
2 4
2 4
1 2
1 2
1 2
1 2
1 2
2 4
2 6
2 6
2 6
2 6
2 6
1 2
2 6
1 2
1 2
1 2
1 2
1 2
2 2
...

result:

ok AC

Test #69:

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

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 3
2 3
2 3
2 3
2 3
1 1
1 1
1 1
1 1
1 1
2 3
1 1
1 2
1 2
2 5
1 2
1 2
1 2
1 2
2 5
2 5
2 5
2 5
2 5
1 2
1 2
2 6
1 2
1 2
1 2
1 2
2 6
2 6
2 6
2 6
2 6
2 1
2 1
2 1
2 1
2 1
1 2
1 2
2 1
1 2
1 2
1 2
1 2
2 2
2 2
2 2
2 2
2 2
1 2
1 2
2 2
1 2
1 2
1 2
1 2
1 3
...

result:

ok AC

Test #70:

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

input:

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

output:

Yes
0

result:

ok AC

Test #71:

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

input:

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

output:

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

result:

ok AC

Test #72:

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

input:

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

output:

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

result:

ok AC

Test #73:

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

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
2 5
2 5
1 3
1 3
2 5
2 5
2 5
2 5
1 3
1 3
1 3
1 3
1 4
1 4
1 4
1 4
1 4
2 6
2 6
2 6
1 4
2 6
2 6
2 6
1 4
1 4
1 4
1 4
2 6
2 6
1 4
1 4
2 6
2 6
2 6
2 6
2 1
1 4
1 4
1 4
1 4
2 1
2 1
2 1
2 1
2 1
1 4
1 4
2 5
...

result:

ok AC

Extra Test:

score: 0
Extra Test Passed