def main1(h,w,s): ary=[] for i in range(h): for j in range(w): if s[i][j]=="#": ary.append((i,j)) if len(ary)%2==1:return False # 平行移動のパターンはH*W-1 # すべて試す ary_st=set(ary) for i in range(h): for j in range(w): if i==0 and j==0:continue mat=[[0]*w for _ in range(h)] flg=True for x,y in ary: if mat[x][y]==1:continue if 0<=x+i