package main import . "fmt" import . "strings" func main() { var h,w int Scan(&h,&w) ss:=make([]string,h) for i:=range ss { var s string Scan(&s) s=ReplaceAll(s,".","a") s=ReplaceAll(s,"#",".") ss[i]=ReplaceAll(s,"a","#") } for _,s:=range ss { var t string Scan(&t) if s!=t { Println(-1) return } } Println("3.5317401904617327") }