Day 20 slooooow

This commit is contained in:
Christian
2024-12-20 13:24:10 +01:00
parent 57852ccfc1
commit 4e20f541f9
5 changed files with 193 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ case class Point(x: Int, y: Int):
def -(o: Point): Point = Point(x - o.x, y - o.y) def -(o: Point): Point = Point(x - o.x, y - o.y)
def *(n: Int): Point = Point(n * x, n * y) def *(n: Int): Point = Point(n * x, n * y)
def reduce: Point = { val g = gcd(x.abs, y.abs); Point(x / g, y / g) } def reduce: Point = { val g = gcd(x.abs, y.abs); Point(x / g, y / g) }
def manhattan: Int = x.abs + y.abs
val DIRS = Seq(Direction.Up, Direction.Right, Direction.Down, Direction.Left) val DIRS = Seq(Direction.Up, Direction.Right, Direction.Down, Direction.Left)

View File

@@ -21,7 +21,8 @@ val solvers = Map[Int, Solver](
16 -> Day16, 16 -> Day16,
17 -> Day17, 17 -> Day17,
18 -> Day18, 18 -> Day18,
19 -> Day19 19 -> Day19,
20 -> Day20
) )
def runSolver(solver: Solver, input: os.Path): Unit = def runSolver(solver: Solver, input: os.Path): Unit =

View File

@@ -0,0 +1,47 @@
package dev.ctsk.aoc.days
import dev.ctsk.aoc.*
import collection.parallel.CollectionConverters.*
object Day20 extends Solver(20):
private def manhattanBall(dist: Int, center: Point): Array[(Point, Int)] =
(for
x <- -dist to dist
y <- -(dist - x.abs) to (dist - x.abs)
yield (Point(center.x + x, center.y + y), x.abs + y.abs)).toArray
override def run(input: os.ReadablePath): (Timings, Solution) =
val grid = Grid(os.read.lines(input).map(_.toArray).toArray)
val start = grid.findFirst(_ == 'S').get
val end = grid.findFirst(_ == 'E').get
val trace = Iterator
.unfold((end, end))((cur, prev) =>
val n = DIRS.map(_(cur)).filter(_ != prev).find(!grid(_).contains('#'))
n.map(nxt => (cur, (nxt, cur)))
)
.concat(Seq(start))
.toArray
val distance = trace.zipWithIndex.toMap
def cheats(radius: Int): Int =
trace.zipWithIndex.par
.map((from, fromDist) => {
(for
(to, dist) <- manhattanBall(radius, from)
toDist <- distance.get(to)
cheat = fromDist - toDist
if cheat >= 100 + dist
yield ()).length
})
.sum
val p1 = timed { cheats(2) }
val p2 = timed { cheats(20) }
(
Timings(0, p1._1, p2._1),
Solution(Int.box(p1._2), Int.box(p2._2))
)

2
data/20.ans Normal file
View File

@@ -0,0 +1,2 @@
1445
1008040

141
data/20.in Normal file
View File

@@ -0,0 +1,141 @@
#############################################################################################################################################
#.........................#...###...#...#...#.............#...#...#...#.......###...#...#...###...#.....###...#...........#...#.........#...#
#.#######################.#.#.###.#.#.#.#.#.#.###########.#.#.#.#.#.#.#.#####.###.#.#.#.#.#.###.#.#.###.###.#.#.#########.#.#.#.#######.#.#.#
#...#...#...............#.#.#.....#.#.#...#.#.....#.......#.#.#.#...#.#.....#.#...#.#.#...#...#.#.#...#.#...#...#.........#.#...#...#...#.#.#
###.#.#.#.#############.#.#.#######.#.#####.#####.#.#######.#.#.#####.#####.#.#.###.#.#######.#.#.###.#.#.#######.#########.#####.#.#.###.#.#
###...#.#.#.............#.#.......#.#.....#...#...#.....#...#...#.....#...#.#.#...#...#.......#.#...#.#.#.#.......#.........#...#.#...###.#.#
#######.#.#.#############.#######.#.#####.###.#.#######.#.#######.#####.#.#.#.###.#####.#######.###.#.#.#.#.#######.#########.#.#.#######.#.#
#...###...#...#...#.....#.#.......#.#...#.#...#.#.....#.#...#...#.....#.#...#...#.#...#...#...#.#...#.#.#.#.#.......#...#.....#...###...#.#.#
#.#.#########.#.#.#.###.#.#.#######.#.#.#.#.###.#.###.#.###.#.#.#####.#.#######.#.#.#.###.#.#.#.#.###.#.#.#.#.#######.#.#.###########.#.#.#.#
#.#.#...#.....#.#.#.#...#.#.......#.#.#.#.#.#...#...#...###...#...#...#.....#...#...#.#...#.#.#.#...#.#.#.#.#.#.......#.#.....#...#...#.#.#.#
#.#.#.#.#.#####.#.#.#.###.#######.#.#.#.#.#.#.#####.#############.#.#######.#.#######.#.###.#.#.###.#.#.#.#.#.#.#######.#####.#.#.#.###.#.#.#
#.#.#.#.#.......#...#...#...#.....#...#.#.#.#...#...#...#...#.....#...#.....#.#...#...#.#...#.#.#...#.#.#.#...#.......#...#...#.#.#...#...#.#
#.#.#.#.###############.###.#.#########.#.#.###.#.###.#.#.#.#.#######.#.#####.#.#.#.###.#.###.#.#.###.#.#.###########.###.#.###.#.###.#####.#
#.#.#.#.###...#...#.....#...#.........#.#.#.###.#.###.#.#.#.#.....#...#.....#.#.#.#...#.#...#...#...#.#.#.#...........###...###.#...#.#.....#
#.#.#.#.###.#.#.#.#.#####.###########.#.#.#.###.#.###.#.#.#.#####.#.#######.#.#.#.###.#.###.#######.#.#.#.#.###################.###.#.#.#####
#.#...#.#...#.#.#.#.....#.......#...#.#.#.#.#...#.#...#...#...###.#...###...#...#...#.#.#...#.......#.#...#...........#...###...#...#.#.#...#
#.#####.#.###.#.#.#####.#######.#.#.#.#.#.#.#.###.#.#########.###.###.###.#########.#.#.#.###.#######.###############.#.#.###.###.###.#.#.#.#
#.....#...#...#.#.....#.......#.#.#...#...#...#...#...#.....#...#...#...#.......#...#.#.#...#.....#...#...............#.#...#...#.#...#.#.#.#
#####.#####.###.#####.#######.#.#.#############.#####.#.###.###.###.###.#######.#.###.#.###.#####.#.###.###############.###.###.#.#.###.#.#.#
#...#.#...#...#.....#.........#.#.........#.....#.....#...#...#.###...#.#...#...#...#.#.###.#.....#...#.#.........#...#.#...#...#.#.#...#.#.#
#.#.#.#.#.###.#####.###########.#########.#.#####.#######.###.#.#####.#.#.#.#.#####.#.#.###.#.#######.#.#.#######.#.#.#.#.###.###.#.#.###.#.#
#.#.#...#...#.......#.........#.###...###.#.....#.....#...###...#...#.#.#.#.#.....#.#.#...#.#.#...#...#...#.......#.#.#.#.###...#.#.#.....#.#
#.#.#######.#########.#######.#.###.#.###.#####.#####.#.#########.#.#.#.#.#.#####.#.#.###.#.#.#.#.#.#######.#######.#.#.#.#####.#.#.#######.#
#.#...#...#...#...#...###.....#.....#.....#.....#...#.#.......###.#.#.#.#.#...###.#...#...#.#.#.#.#.#.......###...#.#.#.#.#...#.#...#...#...#
#.###.#.#.###.#.#.#.#####.#################.#####.#.#.#######.###.#.#.#.#.###.###.#####.###.#.#.#.#.#.#########.#.#.#.#.#.#.#.#.#####.#.#.###
#...#.#.#...#...#...###...#.........#.....#.#...#.#.#.#.......#...#.#.#.#...#...#.#.....###.#...#...#.....#...#.#.#.#.#.#.#.#.#...#...#...###
###.#.#.###.###########.###.#######.#.###.#.#.#.#.#.#.#.#######.###.#.#.###.###.#.#.#######.#############.#.#.#.#.#.#.#.#.#.#.###.#.#########
#...#.#.#...###.......#.....#...###...#...#...#.#.#.#.#...#...#...#.#.#.#...#...#.#...#...#.#...#...#.....#.#...#.#.#.#.#.#.#...#.#.#...#...#
#.###.#.#.#####.#####.#######.#.#######.#######.#.#.#.###.#.#.###.#.#.#.#.###.###.###.#.#.#.#.#.#.#.#.#####.#####.#.#.#.#.#.###.#.#.#.#.#.#.#
#...#.#.#.#...#.....#.#.......#.......#.#.......#.#...#...#.#...#.#.#.#.#...#.#...#...#.#.#...#...#.#.#...#.#.....#.#...#...#...#.#...#...#.#
###.#.#.#.#.#.#####.#.#.#############.#.#.#######.#####.###.###.#.#.#.#.###.#.#.###.###.#.#########.#.#.#.#.#.#####.#########.###.#########.#
#...#...#.#.#...#...#.#...........#...#.#.#...#...#.....###...#.#.#.#.#...#.#.#...#.#...#...#...#...#...#...#...#...#...#.....#...#.........#
#.#######.#.###.#.###.###########.#.###.#.#.#.#.###.#########.#.#.#.#.###.#.#.###.#.#.#####.#.#.#.#############.#.###.#.#.#####.###.#########
#...#...#...#...#...#.#.......#...#...#.#.#.#.#.#...#...#...#.#.#.#.#...#.#.#.###.#.#...#...#.#.#.....#.........#.#...#...#...#...#.#.......#
###.#.#.#####.#####.#.#.#####.#.#####.#.#.#.#.#.#.###.#.#.#.#.#.#.#.###.#.#.#.###.#.###.#.###.#.#####.#.#########.#.#######.#.###.#.#.#####.#
###...#.....#.#...#.#.#.....#.#.....#.#.#.#.#...#...#.#.#.#.#.#.#.#...#.#.#.#...#.#...#.#...#.#.#...#.#...........#...###...#.###.#.#.#.....#
###########.#.#.#.#.#.#####.#.#####.#.#.#.#.#######.#.#.#.#.#.#.#.###.#.#.#.###.#.###.#.###.#.#.#.#.#.###############.###.###.###.#.#.#.#####
#...........#...#...#.......#.....#.#.#.#.#...#.....#.#.#.#.#.#...#...#.#.#.#...#.###.#...#.#.#...#.#.#.............#...#...#.....#...#...###
#.###############################.#.#.#.#.###.#.#####.#.#.#.#.#####.###.#.#.#.###.###.###.#.#.#####.#.#.###########.###.###.#############.###
#.......#.....#...#.......#.....#.#.#...#...#.#.#...#.#.#.#.#...###...#.#.#.#...#...#.#...#.#.#.....#.#...#...#...#.....###.#...........#...#
#######.#.###.#.#.#.#####.#.###.#.#.#######.#.#.#.#.#.#.#.#.###.#####.#.#.#.###.###.#.#.###.#.#.#####.###.#.#.#.#.#########.#.#########.###.#
#.......#.###...#...###...#.#...#...###...#...#.#.#.#.#.#.#.#...#.....#.#.#...#...#.#.#...#...#...#...###...#...#...###...#.#.........#...#.#
#.#######.#############.###.#.#########.#.#####.#.#.#.#.#.#.#.###.#####.#.###.###.#.#.###.#######.#.###############.###.#.#.#########.###.#.#
#.........#...#...#...#.....#...........#.....#.#.#.#.#.#.#.#.###...#...#...#.###.#.#.#...#.......#.#...............#...#...#.......#...#.#.#
###########.#.#.#.#.#.#######################.#.#.#.#.#.#.#.#.#####.#.#####.#.###.#.#.#.###.#######.#.###############.#######.#####.###.#.#.#
###...#.....#...#...#.....#...................#.#.#.#.#.#.#...#.....#.....#.#.#...#.#...###...#.....#...............#.#.......#.....#...#.#.#
###.#.#.#################.#.###################.#.#.#.#.#.#####.#########.#.#.#.###.#########.#.###################.#.#.#######.#####.###.#.#
#...#.#.#...#...#.......#...#.......#.......#...#.#.#.#.#.....#...#...#...#.#.#...#.........#.#.#...........#.....#...#.......#.....#.###...#
#.###.#.#.#.#.#.#.#####.#####.#####.#.#####.#.###.#.#.#.#####.###.#.#.#.###.#.###.#########.#.#.#.#########.#.###.###########.#####.#.#######
#.#...#...#...#...#...#.......#...#...#.....#.....#.#.#.#...#.#...#.#.#...#...###...#.....#.#.#.#...#.....#.#.###.....#.....#...###.#...#...#
#.#.###############.#.#########.#.#####.###########.#.#.#.#.#.#.###.#.###.#########.#.###.#.#.#.###.#.###.#.#.#######.#.###.###.###.###.#.#.#
#.#...###...###...#.#.#.........#.......###...#...#...#...#...#.#...#...#.....#.....#.###...#...###...#...#...#...###...###...#...#...#...#.#
#.###.###.#.###.#.#.#.#.###################.#.#.#.#############.#.#####.#####.#.#####.#################.#######.#.###########.###.###.#####.#
#...#.....#.....#...#.#.............###...#.#...#...#...#.......#.....#...#...#.....#...#...###.......#.........#...........#...#...#.......#
###.#################.#############.###.#.#.#######.#.#.#.###########.###.#.#######.###.#.#.###.#####.#####################.###.###.#########
###.................#.............#...#.#...#...#...#.#.#...#...#...#.###.#.###...#...#...#...#.....#.#.................#...###...#...#.....#
###################.#############.###.#.#####.#.#.###.#.###.#.#.#.#.#.###.#.###.#.###.#######.#####.#.#.###############.#.#######.###.#.###.#
#...#...............#...........#.#...#.#.....#.#.....#...#...#...#...#...#.#...#.#...#.....#.#.....#.#...#...........#...###...#.....#.#...#
#.#.#.###############.#########.#.#.###.#.#####.#########.#############.###.#.###.#.###.###.#.#.#####.###.#.#########.#######.#.#######.#.###
#.#.#...#...#.......#.###.......#.#.....#.....#.....#...#.....###.......#...#...#.#...#...#...#.....#...#...#.....#...#.......#.........#...#
#.#.###.#.#.#.#####.#.###.#######.###########.#####.#.#.#####.###.#######.#####.#.###.###.#########.###.#####.###.#.###.###################.#
#.#.....#.#.#.#...#...#...#.....#.#.....#...#.#...#...#.......#...#.....#...###.#.###.....###...###...#.....#...#...###.#...............#...#
#.#######.#.#.#.#.#####.###.###.#.#.###.#.#.#.#.#.#############.###.###.###.###.#.###########.#.#####.#####.###.#######.#.#############.#.###
#.....#...#...#.#.#...#...#.#...#...###...#.#...#...#...#...###.....###.....#...#.....#...#...#.#...#.....#...#...#...#.#.............#...###
#####.#.#######.#.#.#.###.#.#.#############.#######.#.#.#.#.#################.#######.#.#.#.###.#.#.#####.###.###.#.#.#.#############.#######
#...#.#.#.......#...#.#...#.#.............#.........#.#.#.#.....#...#####...#.......#.#.#.#...#...#.......###.#...#.#...#.............#.....#
#.#.#.#.#.###########.#.###.#############.###########.#.#.#####.#.#.#####.#.#######.#.#.#.###.###############.#.###.#####.#############.###.#
#.#.#...#...........#.#.....###...........#.........#.#.#.#.....#.#...#...#.#.......#...#.....#...#.........#.#.....#...#.........###...#...#
#.#.###############.#.#########.###########.#######.#.#.#.#.#####.###.#.###.#.#################.#.#.#######.#.#######.#.#########.###.###.###
#.#.#.............#.#.#.......#...........#.#######...#...#.....#.#...#...#...#...#.....#.....#.#.#.#...#...#.....#...#.....#...#...#.#...###
#.#.#.###########.#.#.#.#####.###########.#.###################.#.#.#####.#####.#.#.###.#.###.#.#.#.#.#.#.#######.#.#######.#.#.###.#.#.#####
#.#.#...........#.#.#.#.....#.#...#######...#################E#...#.#...#.....#.#.#.#...#.#...#.#...#.#.#.......#.#.......#...#...#...#.....#
#.#.###########.#.#.#.#####.#.#.#.###########################.#####.#.#.#####.#.#.#.#.###.#.###.#####.#.#######.#.#######.#######.#########.#
#.#.........#...#...#.......#...#..S###############.....#####.#...#...#.#.....#.#...#.#...#.....###...#.....#...#.#...#...#.....#.........#.#
#.#########.#.#####################################.###.#####.#.#.#####.#.#####.#####.#.###########.#######.#.###.#.#.#.###.###.#########.#.#
#.........#...#.......#.....#...#...#...#####.......#...#####.#.#.....#.#.......#...#...#.....#...#.......#...###.#.#.#.....#...###...###...#
#########.#####.#####.#.###.#.#.#.#.#.#.#####.#######.#######.#.#####.#.#########.#.#####.###.#.#.#######.#######.#.#.#######.#####.#.#######
###...#...#...#.#.....#.#...#.#...#...#.....#.....#...###...#.#.#...#...#.....#...#...###...#...#...#...#...#...#...#.........#.....#.......#
###.#.#.###.#.#.#.#####.#.###.#############.#####.#.#####.#.#.#.#.#.#####.###.#.#####.#####.#######.#.#.###.#.#.###############.###########.#
#...#...#...#.#.#...#...#.#...#...........#...#...#.......#.#...#.#.#...#...#.#...#...#...#.......#.#.#.....#.#.#...###.......#.....#.......#
#.#######.###.#.###.#.###.#.###.#########.###.#.###########.#####.#.#.#.###.#.###.#.###.#.#######.#.#.#######.#.#.#.###.#####.#####.#.#######
#.........###...###...###...###.........#.....#.#...........#...#.#.#.#.....#.....#...#.#.......#.#.#.........#...#.....#.....#.....#...#...#
#######################################.#######.#.###########.#.#.#.#.###############.#.#######.#.#.#####################.#####.#######.#.#.#
#.............###...........###.........###...#.#.......###...#.#.#.#.............#...#.......#...#.#...................#.......#.....#...#.#
#.###########.###.#########.###.###########.#.#.#######.###.###.#.#.#############.#.#########.#####.#.#################.#########.###.#####.#
#.......#...#...#.#...#...#.....#...###.....#...#.....#...#.#...#.#.#.....###...#.#.....#...#.....#.#.................#.....#...#...#.......#
#######.#.#.###.#.#.#.#.#.#######.#.###.#########.###.###.#.#.###.#.#.###.###.#.#.#####.#.#.#####.#.#################.#####.#.#.###.#########
###...#...#.#...#...#...#.........#.....#.........###...#.#.#.....#.#...#.....#.#.#...#...#.......#.....#...........#...#...#.#...#.........#
###.#.#####.#.###########################.#############.#.#.#######.###.#######.#.#.#.#################.#.#########.###.#.###.###.#########.#
#...#.....#.#.#...#.....#...............#.........#...#...#...#.....###.#.....#.#.#.#.........#.......#...#...#...#.....#.....###...........#
#.#######.#.#.#.#.#.###.#.#############.#########.#.#.#######.#.#######.#.###.#.#.#.#########.#.#####.#####.#.#.#.###########################
#.#.....#.#.#.#.#.#...#.#.............#.#.........#.#...###...#.......#...###.#.#...#...#.....#.###...#.....#...#.......###.................#
#.#.###.#.#.#.#.#.###.#.#############.#.#.#########.###.###.#########.#######.#.#####.#.#.#####.###.###.###############.###.###############.#
#...#...#...#...#.....#.###...#...#...#.#.#.......#...#...#.....#.....###...#.#.#...#.#.#...#...#...#...#...............#...#...#...#...#...#
#####.#################.###.#.#.#.#.###.#.#.#####.###.###.#####.#.#######.#.#.#.#.#.#.#.###.#.###.###.###.###############.###.#.#.#.#.#.#.###
#.....#.....#...#.....#.....#...#...###...#.#.....###...#.###...#...#...#.#.#.#.#.#.#.#.###...###...#.###.........#...###.#...#...#.#.#.#...#
#.#####.###.#.#.#.###.#####################.#.#########.#.###.#####.#.#.#.#.#.#.#.#.#.#.###########.#.###########.#.#.###.#.#######.#.#.###.#
#...#...###.#.#.#.#...#...................#.#.....#.....#.....#.....#.#...#.#.#.#.#.#.#.....#.....#.#.#.........#.#.#.....#.......#...#...#.#
###.#.#####.#.#.#.#.###.#################.#.#####.#.###########.#####.#####.#.#.#.#.#.#####.#.###.#.#.#.#######.#.#.#############.#######.#.#
###...#.....#.#.#.#...#.#.................#.....#.#...........#.#...#...#...#.#.#.#...#.....#...#.#...#.......#...#.#.............#...###.#.#
#######.#####.#.#.###.#.#.#####################.#.###########.#.#.#.###.#.###.#.#.#####.#######.#.###########.#####.#.#############.#.###.#.#
#.......#...#.#...#...#.#.#.....#.......#...#...#...#...#.....#.#.#...#.#...#.#.#.....#...#...#.#.#...........#...#.#.........#.....#...#.#.#
#.#######.#.#.#####.###.#.#.###.#.#####.#.#.#.#####.#.#.#.#####.#.###.#.###.#.#.#####.###.#.#.#.#.#.###########.#.#.#########.#.#######.#.#.#
#...#...#.#...#.....#...#.#...#.#.#.....#.#.#.....#.#.#.#...#...#.#...#...#.#.#.#...#.#...#.#.#.#.#.............#...#.......#...#...#...#.#.#
###.#.#.#.#####.#####.###.###.#.#.#.#####.#.#####.#.#.#.###.#.###.#.#####.#.#.#.#.#.#.#.###.#.#.#.###################.#####.#####.#.#.###.#.#
###...#.#.....#.....#...#...#.#...#.#...#.#...#...#.#.#...#.#.#...#.....#.#...#.#.#...#...#.#.#.#.#...#.....#.......#.....#.#.....#.#.#...#.#
#######.#####.#####.###.###.#.#####.#.#.#.###.#.###.#.###.#.#.#.#######.#.#####.#.#######.#.#.#.#.#.#.#.###.#.#####.#####.#.#.#####.#.#.###.#
#.....#.......###...#...#...#.#.....#.#...#...#...#.#.#...#.#.#.....#...#...###.#.....#...#.#.#.#.#.#.#...#.#.....#...#...#.#.#...#...#.#...#
#.###.###########.###.###.###.#.#####.#####.#####.#.#.#.###.#.#####.#.#####.###.#####.#.###.#.#.#.#.#.###.#.#####.###.#.###.#.#.#.#####.#.###
#...#.###...#...#.#...###.....#.....#...###.....#.#...#...#.#.#...#.#...#...#...#.....#...#.#...#...#.#...#.#...#.#...#...#.#...#...#...#...#
###.#.###.#.#.#.#.#.###############.###.#######.#.#######.#.#.#.#.#.###.#.###.###.#######.#.#########.#.###.#.#.#.#.#####.#.#######.#.#####.#
#...#.....#...#...#...#.........###.#...#.......#...#.....#.#.#.#...#...#...#...#.#...#...#.......###...###.#.#...#.#.....#.....#...#...#...#
#.###################.#.#######.###.#.###.#########.#.#####.#.#.#####.#####.###.#.#.#.#.#########.#########.#.#####.#.#########.#.#####.#.###
#...#.....#.......#...#...#...#.....#.#...#...#.....#.#.....#.#...#...#.....#...#.#.#...#...#...#.......#...#.....#.#.#...#...#...#.....#...#
###.#.###.#.#####.#.#####.#.#.#######.#.###.#.#.#####.#.#####.###.#.###.#####.###.#.#####.#.#.#.#######.#.#######.#.#.#.#.#.#.#####.#######.#
#...#...#.#.#.....#...###...#.......#.#...#.#.#.....#...#.....#...#...#.....#...#.#.#...#.#.#.#...#...#.#.....#...#.#...#...#.....#.#.......#
#.#####.#.#.#.#######.#############.#.###.#.#.#####.#####.#####.#####.#####.###.#.#.#.#.#.#.#.###.#.#.#.#####.#.###.#############.#.#.#######
#...#...#...#...#.....#.......#...#.#.###.#.#.#...#.....#.#...#.#.....#...#.#...#.#.#.#...#.#...#.#.#.#...#...#...#...#.....#.....#...#...###
###.#.#########.#.#####.#####.#.#.#.#.###.#.#.#.#.#####.#.#.#.#.#.#####.#.#.#.###.#.#.#####.###.#.#.#.###.#.#####.###.#.###.#.#########.#.###
#...#...#.......#.....#.#...#...#.#.#.#...#.#.#.#.#.....#...#.#.#...#...#.#.#.#...#.#.....#.#...#...#.#...#.#.....#...#...#.#...#...#...#...#
#.#####.#.###########.#.#.#.#####.#.#.#.###.#.#.#.#.#########.#.###.#.###.#.#.#.###.#####.#.#.#######.#.###.#.#####.#####.#.###.#.#.#.#####.#
#...#...#.......#.....#...#.....#...#.#...#.#.#.#.#.......#...#...#...###...#.#...#.#.....#.#.......#.#.#...#.....#.....#.#...#...#...#...#.#
###.#.#########.#.#############.#####.###.#.#.#.#.#######.#.#####.###########.###.#.#.#####.#######.#.#.#.#######.#####.#.###.#########.#.#.#
#...#.#.........#...#...#.......#...#...#.#.#.#.#.#...#...#...#...#...........#...#.#.#...#.........#...#...#.....#.....#...#.#.......#.#.#.#
#.###.#.###########.#.#.#.#######.#.###.#.#.#.#.#.#.#.#.#####.#.###.###########.###.#.#.#.#################.#.#####.#######.#.#.#####.#.#.#.#
#.#...#.......#...#.#.#...#.......#.#...#.#.#.#.#...#.#...#...#...#.....#.....#.###.#...#.................#.#.....#.#...#...#.#.....#...#.#.#
#.#.#########.#.#.#.#.#####.#######.#.###.#.#.#.#####.###.#.#####.#####.#.###.#.###.#####################.#.#####.#.#.#.#.###.#####.#####.#.#
#.#.#...###...#.#.#.#...#...#.......#.###.#.#.#.#.....#...#.#...#.#.....#.#...#...#.....#.....#...#.....#.#.#.....#...#...#...#.....#...#.#.#
#.#.#.#.###.###.#.#.###.#.###.#######.###.#.#.#.#.#####.###.#.#.#.#.#####.#.#####.#####.#.###.#.#.#.###.#.#.#.#############.###.#####.#.#.#.#
#.#.#.#.....#...#...###...###.....#...#...#.#...#...#...###...#...#.#.....#.#.....#.....#...#.#.#.#.###...#.#.............#...#.......#.#...#
#.#.#.#######.###################.#.###.###.#######.#.#############.#.#####.#.#####.#######.#.#.#.#.#######.#############.###.#########.#####
#...#.....#...#...#...#...#.......#...#...#...#.....#...........#...#.#.....#.....#...#...#.#...#.#.....###.#...#...#.....###...........#...#
#########.#.###.#.#.#.#.#.#.#########.###.###.#.###############.#.###.#.#########.###.#.#.#.#####.#####.###.#.#.#.#.#.###################.#.#
#...#.....#.###.#...#...#...#...#...#.###.....#...#...#.....#...#.....#...#.......#...#.#.#...###.....#...#...#...#.#.....................#.#
#.#.#.#####.###.#############.#.#.#.#.###########.#.#.#.###.#.###########.#.#######.###.#.###.#######.###.#########.#######################.#
#.#.#.....#...#.#...#...#...#.#.#.#.#.........#...#.#.#...#.#.#...#...#...#.......#...#.#...#.......#...#.........#.#.......#...#.....#...#.#
#.#.#####.###.#.#.#.#.#.#.#.#.#.#.#.#########.#.###.#.###.#.#.#.#.#.#.#.#########.###.#.###.#######.###.#########.#.#.#####.#.#.#.###.#.#.#.#
#.#.......#...#.#.#.#.#.#.#.#.#.#.#...#...#...#...#.#.#...#.#.#.#...#...#...#...#.#...#...#...#...#...#.#.....#...#.#...#...#.#.#...#.#.#.#.#
#.#########.###.#.#.#.#.#.#.#.#.#.###.#.#.#.#####.#.#.#.###.#.#.#########.#.#.#.#.#.#####.###.#.#.###.#.#.###.#.###.###.#.###.#.###.#.#.#.#.#
#...........###...#...#...#...#...###...#...#####...#...###...#...........#...#...#.......###...#.....#...###...###.....#.....#.....#...#...#
#############################################################################################################################################