TLE version of 2B.go , most cost in I/O