Compare commits
2 commits
802af0fd8b
...
b6fda004b9
| Author | SHA1 | Date | |
|---|---|---|---|
| b6fda004b9 | |||
|
|
54c65907fb |
4 changed files with 416 additions and 0 deletions
179
04/README.md
Normal file
179
04/README.md
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
# --- Day 4: Printing Department ---
|
||||
|
||||
You ride the escalator down to the printing department. They're clearly getting ready for Christmas; they have lots of large rolls of paper everywhere, and there's even a massive printer in the corner (to handle the really big print jobs).
|
||||
|
||||
Decorating here will be easy: they can make their own decorations. What you really need is a way to get further into the North Pole base while the elevators are offline.
|
||||
|
||||
"Actually, maybe we can help with that," one of the Elves replies when you ask for help. "We're pretty sure there's a cafeteria on the other side of the back wall. If we could break through the wall, you'd be able to keep moving. It's too bad all of our forklifts are so busy moving those big rolls of paper around."
|
||||
|
||||
If you can optimize the work the forklifts are doing, maybe they would have time to spare to break through the wall.
|
||||
|
||||
The rolls of paper (@) are arranged on a large grid; the Elves even have a helpful diagram (your puzzle input) indicating where everything is located.
|
||||
|
||||
For example:
|
||||
|
||||
```txt
|
||||
..@@.@@@@.
|
||||
@@@.@.@.@@
|
||||
@@@@@.@.@@
|
||||
@.@@@@..@.
|
||||
@@.@@@@.@@
|
||||
.@@@@@@@.@
|
||||
.@.@.@.@@@
|
||||
@.@@@.@@@@
|
||||
.@@@@@@@@.
|
||||
@.@.@@@.@.
|
||||
```
|
||||
|
||||
The forklifts can only access a roll of paper if there are fewer than four rolls of paper in the eight adjacent positions. If you can figure out which rolls of paper the forklifts can access, they'll spend less time looking and more time breaking down the wall to the cafeteria.
|
||||
|
||||
In this example, there are 13 rolls of paper that can be accessed by a forklift (marked with x):
|
||||
|
||||
```txt
|
||||
..xx.xx@x.
|
||||
x@@.@.@.@@
|
||||
@@@@@.x.@@
|
||||
@.@@@@..@.
|
||||
x@.@@@@.@x
|
||||
.@@@@@@@.@
|
||||
.@.@.@.@@@
|
||||
x.@@@.@@@@
|
||||
.@@@@@@@@.
|
||||
x.x.@@@.x.
|
||||
```
|
||||
|
||||
Consider your complete diagram of the paper roll locations. How many rolls of paper can be accessed by a forklift?
|
||||
|
||||
## --- Part Two ---
|
||||
|
||||
Now, the Elves just need help accessing as much of the paper as they can.
|
||||
|
||||
Once a roll of paper can be accessed by a forklift, it can be removed. Once a roll of paper is removed, the forklifts might be able to access more rolls of paper, which they might also be able to remove. How many total rolls of paper could the Elves remove if they keep repeating this process?
|
||||
|
||||
Starting with the same example as above, here is one way you could remove as many rolls of paper as possible, using highlighted @ to indicate that a roll of paper is about to be removed, and using x to indicate that a roll of paper was just removed:
|
||||
|
||||
```txt
|
||||
Initial state:
|
||||
..@@.@@@@.
|
||||
@@@.@.@.@@
|
||||
@@@@@.@.@@
|
||||
@.@@@@..@.
|
||||
@@.@@@@.@@
|
||||
.@@@@@@@.@
|
||||
.@.@.@.@@@
|
||||
@.@@@.@@@@
|
||||
.@@@@@@@@.
|
||||
@.@.@@@.@.
|
||||
|
||||
Remove 13 rolls of paper:
|
||||
..xx.xx@x.
|
||||
x@@.@.@.@@
|
||||
@@@@@.x.@@
|
||||
@.@@@@..@.
|
||||
x@.@@@@.@x
|
||||
.@@@@@@@.@
|
||||
.@.@.@.@@@
|
||||
x.@@@.@@@@
|
||||
.@@@@@@@@.
|
||||
x.x.@@@.x.
|
||||
|
||||
Remove 12 rolls of paper:
|
||||
.......x..
|
||||
.@@.x.x.@x
|
||||
x@@@@...@@
|
||||
x.@@@@..x.
|
||||
.@.@@@@.x.
|
||||
.x@@@@@@.x
|
||||
.x.@.@.@@@
|
||||
..@@@.@@@@
|
||||
.x@@@@@@@.
|
||||
....@@@...
|
||||
|
||||
Remove 7 rolls of paper:
|
||||
..........
|
||||
.x@.....x.
|
||||
.@@@@...xx
|
||||
..@@@@....
|
||||
.x.@@@@...
|
||||
..@@@@@@..
|
||||
...@.@.@@x
|
||||
..@@@.@@@@
|
||||
..x@@@@@@.
|
||||
....@@@...
|
||||
|
||||
Remove 5 rolls of paper:
|
||||
..........
|
||||
..x.......
|
||||
.x@@@.....
|
||||
..@@@@....
|
||||
...@@@@...
|
||||
..x@@@@@..
|
||||
...@.@.@@.
|
||||
..x@@.@@@x
|
||||
...@@@@@@.
|
||||
....@@@...
|
||||
|
||||
Remove 2 rolls of paper:
|
||||
..........
|
||||
..........
|
||||
..x@@.....
|
||||
..@@@@....
|
||||
...@@@@...
|
||||
...@@@@@..
|
||||
...@.@.@@.
|
||||
...@@.@@@.
|
||||
...@@@@@x.
|
||||
....@@@...
|
||||
|
||||
Remove 1 roll of paper:
|
||||
..........
|
||||
..........
|
||||
...@@.....
|
||||
..x@@@....
|
||||
...@@@@...
|
||||
...@@@@@..
|
||||
...@.@.@@.
|
||||
...@@.@@@.
|
||||
...@@@@@..
|
||||
....@@@...
|
||||
|
||||
Remove 1 roll of paper:
|
||||
..........
|
||||
..........
|
||||
...x@.....
|
||||
...@@@....
|
||||
...@@@@...
|
||||
...@@@@@..
|
||||
...@.@.@@.
|
||||
...@@.@@@.
|
||||
...@@@@@..
|
||||
....@@@...
|
||||
|
||||
Remove 1 roll of paper:
|
||||
..........
|
||||
..........
|
||||
....x.....
|
||||
...@@@....
|
||||
...@@@@...
|
||||
...@@@@@..
|
||||
...@.@.@@.
|
||||
...@@.@@@.
|
||||
...@@@@@..
|
||||
....@@@...
|
||||
|
||||
Remove 1 roll of paper:
|
||||
..........
|
||||
..........
|
||||
..........
|
||||
...x@@....
|
||||
...@@@@...
|
||||
...@@@@@..
|
||||
...@.@.@@.
|
||||
...@@.@@@.
|
||||
...@@@@@..
|
||||
....@@@...
|
||||
```
|
||||
|
||||
Stop once no more rolls of paper are accessible by a forklift. In this example, a total of 43 rolls of paper can be removed.
|
||||
|
||||
Start with your original diagram. How many rolls of paper in total can be removed by the Elves and their forklifts?
|
||||
140
04/input/grid.txt
Normal file
140
04/input/grid.txt
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
@@@@@@@@@.@@@@@@@@@.@.@..@@..@@.@.@@.@@.@@@@@@..@@..@.@.@@..@.@.@@@@@.@@.@@@@@@..@@@@@@@....@@@@@@@@.@.@.@@@@@@@@@@.@..@@@@@@@@@@@@@@@@.@.@@
|
||||
@@@.@@@.@@@@@@..@..@@@@.@.@.@.@@@@.@.@@@@@@@..@@.@@.@.@@@@.@@@@@@.@@@@.@.@@@...@@.@@@@@@.@.@@@.@.@@@@@.@@@@@@@.@@.@@@@@@@@.@..@@@@.@@@@@@.@@
|
||||
@@..@@.@@@.@@@@..@@..@..@@@@@@.@.@@..@@@@....@@@@@@.@.@@.@..@@@@@.@@@@.@@@@@..@@@.@@.@@.@@..@@@@@@@@.@@@@.@@@.@@@@@@@@@@.@@.@@@@.@@@..@@@.@@
|
||||
@...@@.@...@@@@@@.@@..@@@@@@@.@...@@@@.@.@@...@@@.@@@@@@.@@@.@@@.@.@..@@@@@@@@.@.@@@@..@@@.....@.@@@@..@...@.@@@@@..@@@.@@@.@@....@.@@@...@.
|
||||
..@@@@@.@.@@.@@@..@@@@@@.@@@.@@@@.@@@@.@...@@@@@...@.@@@..@..@..@.@.@.@@@@..@....@@@...@@@@@.@@.@@.@..@.@@@..@@@@@@@@..@.@.@@.@@@..@@@..@@@@
|
||||
@@@.@@..@@.@@@..@@.....@@...@@@.@.@@@@@.@@@@..@.@@@@.@.@@@@@@.....@@.@@.@..@@@@@@@..@@.@@..@@@@.@@@.@..@@@.@@@@.@@@.@@@.@@@@@@..@@@@@@.@.@..
|
||||
.@@@@.@.@..@.@@@@...@.@..@.@@@.@..@.@...@@@.@@..@..@...@@@..@@@@.@@@.@@@.@@@@.@.@...@@@@.@..@@@.@@..@.@.@@...@.@@.@.@@.@.@.@@@@.@@..@@@@.@@.
|
||||
.@@@@@@@@@@@...@.@.@@@.@@.@.@.@.@@@@@@@.@@.@@@......@.@@.@@@.@@@@...@@@@@@@@@@@@@@@@.@@@.@@.@..@@.@@@@@..@@@@@@...@@@.@@@.@.@@@@.@@@@@@...@@
|
||||
@..@.@@.@@@..@@@.@@.@@@@@@@@@@@@@@.@....@...@@.@@@..@@@@.@@@@@@@@@.@.@@..@@.@@@.@.@.@@@.@.@@@.@@@......@@@@...@@.@@@@.@.@@@.@.@@..@@@@.@.@@@
|
||||
@@.@..@.@@@@@@@@.@.@@@@@.@.@.@@.@@@.@@@@@@@.@@@@@..@@@@.@@@@@@..@@@@@@..@.@.@@@.@@@@.@.@@.@@@.@@@@.@.@@...@@@@@@@.@@..@@@@.@@@.@@@.@@@@@..@@
|
||||
@..@.@.@..@.@@.@@@.@..@@@@.@.....@..@@@@@..@@@..@@.@@@@@@.@@@....@@..@@@@@@@@@..@@@.@@..@@@.@.@@@@@.@@.@@@..@...@@.@@@..@.@.@.@@...@@.@@@.@.
|
||||
.@@@.@@.@@@..@..@@.@.@@@@@@.@.@.@@@@.@@@@@@@@..@.@@@@@@@@.@@@@@@@@@@.@@.@@@...@@.@@@@@@@.@@@.@..@@.@....@@.@@...@@.@@..@.@..@@@@..@.@@@.@..@
|
||||
.@.@@@.@@.@..@.@.@.@@.@.@@...@.@@.@..@.@..@.@@.@@.@@@@@.@@.@.@.@@@@@@@@@@@.@@@@@.@.@@.@@@.@.@@@@.@@@@.@..@.@@@@@.@@@@@.@.@@@.@@@.@@@@.@@.@@.
|
||||
.@@..@.@@@@.@@@@@.@@@..@@@..@...@@@@@@.@.@.@.@@@@@@@.@@..@@@.....@@.@.@@@..@@@@..@@@..@.@@.@@@@@@.@@@...@...@@@@.@@@@@@@@@..@@@.@.@@.@@@@@..
|
||||
.@..@@.@..@@@@@@@@@@@@.@@@@.@..@.@@@......@@@@@@.@.@..@@.@.@@.@.@...@.@.@@@@@@.@@@.@@@@@@..@.@.@...@..@@.@..@@@...@.@@@..@@...@@@@@@@@@..@..
|
||||
@@.@...@@@@.@..@@.@@@.@@@.@.@.@.@.@.@.@@.@@@.@.@@@@@.@@@..@@..@..@@@@.@.@@@.@@.@.@@@@@@@@@.@.@.@.@@@@.@@@.@@@@.@@@.@..@.@@@@@@@.@@..@@@@..@@
|
||||
@@.@@.@@.@@@@.@@@.@@@.@@@@...@@@@@@@@@.@@@.@@.......@@@..@@.@@@@@@@@...@@.@@@@@@@@@.@@@@@@@@.@.@@@@.@.@@@@@.@@@@@.@.@@@.@@@@@@@@@.@@.@.@@@.@
|
||||
.@.@@@@@@@@@.@@@@..@.@.@.@@@@.@@@@@.@@....@.@.@.@@..@.@@@@@.@@@@@@@@.@.@@...@@@.@@@.@@@...@.@@@@@.@.@.@@@.@@@.@@@...@@.@@@....@.@@@@.@@@....
|
||||
@.@@@.@@.@@@@@@@@@@.@@.@@@@@@@@@@@.@@@@@@@@@@@.@@@.@@.@..@.@@@@.@.@.@@.@..@@@@.@@@@@@@..@@@@@@@@.@.@.@@@@@.@.@@@@@..@..@.@.@@@.@@.@@@@..@@@@
|
||||
.@...@@@@..@@@@...@@@@...@@@@.@...@.@@.@@@@@.@.@@@.@@@@@.@.@@@@@@....@@@@@@....@@@@.@.@@@@@@.@@@@@.@@.@..@.@@@@...@@@@@@.@..@@@@....@.@@.@@@
|
||||
..@.@@@..@@@@.@@@@..@@.@@....@@@@.....@.@.@@@.@.@@@.@@@@@...@@@@@@.@@@@@..@@.@@..@@@.@..@.@....@@@.@.@.@.@@.@@@@@@@.@@@@@@@@.@.@.@@@..@..@.@
|
||||
.@.@@@@@@@@@@@..@.@@@@.@@.@@@@..@...@..@@@.@.@@@@...@.@.@@..@.@@@@@@@@.@@.@.@..@@@.@.@@...@.@@@@..@.@@.....@.@@@@@.......@@@@@..@@@@@@@.@.@@
|
||||
@@.@.@@@@@@@@@@@@.@@.@@@@@@.@@@.@.@.@@@@@@@.....@..@@.@@@@.@.@@@@@@.@@...@@.@@.@@@@.@.@....@...@.@.@@@@@@.....@@..@.@.@@.@@@@...@@@@@.@@@@@@
|
||||
.@@@@..@@@@@@..@.@..@.@@.@...@@@@.@@@.@@.@@....@.@@@...@.@@....@.@@.@@@..@@@@.@@@@.@..@.@.@@@@.@@@@....@@.@@..@@@@@@.@@.@@.@..@@.@.@@@....@@
|
||||
.@@.@@.@@@@@@@.@@@@@@.@@.@.@@@.@@..@.@@.@.@@@@@@.@@@.@@@@@@@@.@....@@@@@@..@...@.@.@@@@@@@.@.@@@@.@.@@@@.@@@....@@@@@@.@@@@@@@@@.@@@.@@@@@@.
|
||||
@...@@@@@@.@@@.@..@@@.@.@@.@@.@@@@.@@@...@.@@@@@@@@@@@..@@@..@@..@@.@.@@.@@@@@@@.@@@@@.@@.@..@@.@@...@@@..@@@@....@@.@@@@@@@@@....@.@.@.@@.@
|
||||
.@.@.@@@@@@@.@@.@.@@.@.@@@@.@@@..@@@@@@.@@@.@@.@@@@@.@..@@@@.@@@...@@@..@..@@..@.@@@@@@.@@@@@@.@@@@@.@@@@@..@@@.@@@@.@@.@@.@@@@@@@@@...@.@@@
|
||||
@.@@@@@.@.@.@..@.@..@..@.@@@@@.@@@@@@@@@@.@@@@@@@.@.@@.@@@@@@..@@.@.@@@.@..@.@@@..@.@@@.@@@..@@@.@@@@@@.@@.@@.@.@@@@..@@@@@@@...@@@@@@...@@@
|
||||
.@@@@@@.@@@.@@.@@@..@@.@@@@@@@.....@@@@.@@@@@@@@.....@.@@@.@@@@@@@..@.@@@@..@@.@....@.@.@.@@@@@@@@.@..@..@..@@@@..@@...@@@.@@@@..@@@@..@@@@.
|
||||
@@.@@@@.@@@@@@.@@.@@.@@@@@@@@@@@.@@.@@..@@@@.@@@.@@.@@@@@.@.@@@@@@..@@@.@@@@@.@@.....@@@.@@.@@@@@@@@.@@@..@@..@@.@@.......@.@@@@...@@@@.@@..
|
||||
@.@.....@@@...@@@.@@..@.@@@@@.@...@@.@@.@@@@@.@@..@@@@@@@@@@@.@@@.@@.@@@@..@...@@@..@@@.@.@.@.@.@@@@..@@....@.@..@.@@@.@..@....@.@@.@.@.@@@@
|
||||
@@.@@@..@@@@@.@.@@.@@@@@@@@.@..@@@@..@@@@@@..@.@@.@@@@@@@@@@@@@..@@.@@@@.@@.@@.@@@.@@.@.@@@@@@@.@@.@@.@@@@@@@.@@....@@@...@@@@@@@@@..@@.@.@@
|
||||
@..@..@@@.@..@@@@...@@.@.@...@.@@.@.@@.@.@.@.@@@@@.@.@@@@@@@@@@@..@@.@.@..@@.@@.@@.@.@.@@.@@.@@@.@@@..@..@@.@@.@@@@..@...@@@.@@@.@.@@@@@.@@@
|
||||
@@@.@@.@.@.@@@@@.@@@....@@@@@@@.@@@@.@@..@@@@@@.@.@@.@.@.@@@.@.@@@@@.@@@...@@@.@.@@...@.@@.@@@@..@@@@.@.@..@@@@.@@.@@@@@@@@@@..@@@@.@@@.@@.@
|
||||
@@.@@@..@@..@.@@@..@.@@@@@.@..@@@.@.@@.@@.@@@.@@@@@@.@@.@@.@@@@.@.@@@@@.@@@@.@@.@@@.@@..@@@@.....@@@@.@@@@@@@.@@@.@@.@@@@@..@@.@@...@@@@@@.@
|
||||
@@@@.@.@@@@.@@.@@@@@..@.@@@@.@@.@.@@@@@@.@@.@@.@@.@@@.@@.@@@.@@@.@@@...@@@@..@@.@@@@@@@@@..@@@..@.@.@.@@..@@.@@@@.@@@.@.@@@..@@@.@@@@@@@@@.@
|
||||
@@.@@..@@@.@@.....@...@@@.@@.@.@..@.@.@@@@@@.@.@@.@.@.@@.@.@@@@@@@@..@@@@.@@@.@.@@..@.@.@@@@@@@@@.@@@@@@.@.@..@@..@...@......@@@.@@.@@@@@@@.
|
||||
@@@@..@...@@@@.@@@@@@@@.@@...@.@...@@@@.@@@@@@@@.@@@..@@.@@@@@.@@@@.@.....@@.@@.@.@..@.@@.@@@@@.@@@@@.@@@@@@@.@@@@..@@@@@@@@..@..@@.@@.@.@@@
|
||||
.@@@@@@.@@.@@@@@@@.@@.@@.@.@@....@@.@.@@@@@@..@@@.@.@.....@.@@@@@@@@.@@@...@.@@.@.@@@@@.@...@@..@@.@@@@..@....@@@..@@@..@..@@@@@.@@....@@..@
|
||||
@@@.....@.@@@@@@@@@.@@@@@@@@.@.@@.@@@...@@@.@@@.@@@@@@@.@@@.@..@@@@.@@@@@.@@@@.@@@@.@@.@@@@.@.@@@.@..@@@@.@@..@@.@.@.@@.@@..@@.....@@@@@@@.@
|
||||
@@@...@.@@.@@@@..@@@@@.@@@@@@@...@@..@@@.@.@@@.@@..@@@@.@@@@.@@.@@..@@..@.@@@@.@@@..@@@@.@@@@.@@..@@..@.@@@.@..@@@@@@@.@.....@.@.@.@..@@@@@.
|
||||
..@...@@.@@@@.@.@.@...@@..@@.@.@@.@@@.@@@@@@@@.@.@@...@.@@@@@@@@.@.@@@@@@@.@@@@..@@@@@@@@..@@@@@@.@@@...@@@@..@@.@@@..@.@@@@@@@.@@@..@@@@@@@
|
||||
.@.@.@.@@@@@@@@.@@@@@..@@..@@...@.@.@@....@@...@@@....@@.@.@.@@.@@.@@.@...@@@...@..@.@.@.@.@@@.@@@.@@.@@@@@@.@...@.@@@@@@.@@.@.@@@@@@@@.@@@.
|
||||
@@@..@@.@@@@@.@.@@@.@@@@..@....@..@@..@@@.@.@@@.@@...@@.@@.@.@@...@@@.@@.@@@@@.@.@.@@@.@@.@@@...@@.@....@@@.@@@.@@.@@@@.@@.@.@@@@@@.@@...@@@
|
||||
@@@@.@.@@@@@@.@@.@@@@@@@@.@@@@@@@@@@.@@@@.@@@@.@@@.@.@@.@.@@..@@.@.@@.@@@..@@.@...@@.@@..@@@@.@@.@@....@@@...@@.@..@@@@@.@.@.@.@.@@.@@@.@@@@
|
||||
@@@@@...@@@@.@.@@..@@@.@..@@@.@.@.@..@@@...@@.@@@..@@.@@..@.@@@..@@@..@@@@@...@@@@@.@@@...@@@@.@.@..@.@.@@.@@@...@@@@@.@@..@@..@@@.@@@@..@..
|
||||
..@@@@..@@@@@@.......@@..@.@@.@@@...@@.@@@@@.@@@@.@...@@@@.@@.@@.@@@@.@@.@.@.@@@.....@@...@@@@.@@@..@@@.@.....@..@@@@...@@@@@@..@@@@@.@..@@@
|
||||
@.@@@@@.@@...@.@@@@@@@@.@@@@@...@.@.@@@@..@.@@@.@@@.@@.@@.......@@.@@@@.@.@@@@@@@.@.@@..@@@@.@.@@.@@@@@..@@@.@.@...@.@@..@@@@@@.@.@@@...@@..
|
||||
@@@..@......@.@@@...@@@@.@..@@@@@@.@@@..@@@@@@@@@@@@@.@@@@@@@@@.@.@..@.@@@..@.@.@.@@@@.@@@@..@@.@@..@..@@@@@@@@@@@@@@@@@@@.@@..@@.@@@@@@@@@.
|
||||
.@@.@@@@@@@.@@.@@@@.@.@..@@@@@..@...@..@...@@@@@@@@@@....@...@@..@@@.@@.@@@@@@@.@@...@@@@.@@@@..@...@@@.@@.@.@@@@@@@.@.@.@@@@@@@..@.@..@@@..
|
||||
@@@..@..@@.@.@@@.@@@.@@.@@@.@.@.@.@@.@@@@..@@.@.@@.@..@@@@@@.@@@..@@@@@@@@@.@@@@...@@@@@@.@@@@@.@...@@.....@.@.@@.@.@.@@@@@@@.@..@@@@.@.@@.@
|
||||
@@@@@@@@....@..@.@@@@.@@@@.@@@@.@@@.@@@@.@@@@@@@.@@@@.@.@.@@@@@@..@@@@@..@@@@.@.@@@@@@.@.@.@@@....@...@.@.@.@@....@..@@@@@@@@@@@@@@@@@@.@@@@
|
||||
@.@@@@@@@@@@...@@@.@.....@.@@@..@@.@.@@.@.@.@@@@@@@@@@@@.@@.@@@@...@.@.@@.@...@@@@..@@@@@@.@@@.@.@@@.@@.@.@@@@@@@@@.@@@...@@@@@@@@.@@@.@@@@@
|
||||
@@@.@.@@@.@.@@@..@@@..@@@.....@.@.@@@@@..@@@..@@...@.@.@@.@.@@@..@..@@.@.@@..@@@..@@.@@@@..@..@@.@@@@@..@@@@@@.@@@@@@@@@.@@@@...@@..@@@@@@@.
|
||||
.@.@@@@.@@@@@.@..@@@@....@@.@.@..@@@.@@.@.@.@.@@@@....@.@@@@...@@@@@@@...@@.@..@@.@@.@.@@.@.@@@@@.@.@....@@.@@@.@.@@...@.@@@@@@@.@@.@@@...@@
|
||||
@@..@@@..@@@@.@@@@@..@.@@.@@@..@.@@@@@@@....@.@@@@.@@..@@...@..@@.@@@.@.@@@@.@@@@.@@..@@.@@@@...@@..@@@@@@@..@@.@@.@@...@@@@.@@@@.@@..@@@@.@
|
||||
@..@@.@..@.@@@...@@@@.@..@@@.@.@@@@@.@@@.@@@@.@.@.@..@@..@@@.@@@@@...@@.@..@@@.@..@@.@.@@@@@@@@@@@@@@@.@@@@@...@@@.@@.@@.@@@@@@@.@..@.@@...@
|
||||
@..@..@@@.@.@@@@.@...@@@..@.@@@@.@@@@.@@@.@@.@@@..@@@.@@@.@@@@@@.@.@@@@@@@.@@@..@@.@.@@..@@..@@@@.@.@@@.@@@.@@@..@..@@..@@@@@...@@@@....@@@.
|
||||
@.@.@@@@.@@.@@@@@@@..@..@.@@@@.@.@..@@@@@..@...@@@..@@@.@.....@@...@..@.@@@.@@..@@.@.@@.@@@@@@@@@@.@.@@.@@@@......@.@.@.@@.@.@@.@@@@@@.@@..@
|
||||
@.@.@.@@@@@@.@.@@@@.@@@@.@..@@@..@@@@@@@@@@.@@.@@@@..@.@......@.@.@@@@...@@@@@@..@.@@@@@@@@@@@..@.@@@@@.@@.@@@.@@@....@....@@@@@@@.@@.@@.@@@
|
||||
@@@@@.@@.@..@@@@@@@.@@.@@@.@@.@@@@@@..@..@@@@@@@@@.@@@@@@@.@@@@..@@@@..@@..@@@.@@@..@.@@@..@@@.@.@@@@@@@..@@.@@.@@@.@@.@@@.@@@@@@@@@@@..@@@@
|
||||
@@@@....@.@.@.@.@.@@@@@.@@..@@@@..@@@.@@@@@@@@@@...@@@..@@@@..@@@@@.@@@.@@.@@@@@.@..@....@.@.@@@...@@@@.@@@@@@.@@.@@@.@@....@.@@@@@@@@...@.@
|
||||
@.@@.@...@.@@@@@..@@@@.@@@...@@@@@.@@@.@....@@.@@@..@..@@.@.@@@.@@@...@@@.@@..@.@@@.@@@@.@@..@..@.@..@...@@@@...@@@..@..@@@@..@@.@@..@@@@@.@
|
||||
@@.@@.@@@@.@@@..@@@.@@.@@@.@.@...@@.@@@@.@@...@.@....@.@@@@.@..@@.@@@@@@@@@@@.@@..@@.@@@@@..@.@..@@@@@@@.@.@@.@@@@@@@...@@@@@..@@@@@@.@@@.@@
|
||||
..@..@@@@@@@@..@@@.@...@.@@@.@@@....@@@@...@@@@@@.@.@@@.@@@@...@@@@...@@.@@.@.@@@@@@@.@..@.@@@@@.@@@@@@@@@@.@@@@@@.@..@@..@@@@@.@@@@@@.@.@@@
|
||||
..@.@@@@@@..@@@@@.@.@@@..@.@@@@@.@@@.@..@@@@@@@.@@@@.@@@@@@@...@@@@..@.@@.@@@..@.@@@@@@...@@@@@..@..@@.@@@.@@@@@@@@..@@@@@@@@@.@..@.@@@..@.@
|
||||
.@@@.@@@@@@.@@@@.@@@@@@.@.@@@.@.....@@.@@@@.@..@..@.@.@...@...@.@.@@..@@@@@@@.@@.@@.@.@@.@.@@@@@@@.@@@....@@.@@@@@@@.@@@@@@.....@..@@@.@@@.@
|
||||
..@...@@.@@@@..@@@@@@@.@.@.@@@@@@@@..@.@@@.@@@.@@@.@@@@@@@..@@@...@@@.@@@..@.@.@@@@@@...@@@.....@@@@@@@..@@@@@@@@@@@..@@@@@..@@@@.@.@.@@@.@@
|
||||
@.@..@@@.@@@@@@..@.@.@...@@@@@@@..@@@@@@@@@@@@@@..@@.@@.@@...@..@@.@@..@@...@@@...@@@@@@@@@@@@...@@@.@@@@@@@@@...@.@@@....@@@@@@.@@@.@@@@@@@
|
||||
.@@@.@@@@@@.@@.@@..@@@@@@.@.@..@.@@.@@@@.@@@..@.@@@.@@@@.@@@@@..@@..@.....@.@@@@@@....@@@@@@@@..@@@@@..@..@@.@....@.@@@.@..@..@.@@...@@@@.@@
|
||||
@@@.@.@@.@@.@..@.@.@@@@.@.@@...@@.@.@.@@@@@...@@@@.@@.@@@..@@.@@@.@@@.@...@@.@.@@.@@.@@...@@.@@..@@.@.@@@@@@@@.@@...@@@@@@@@@@@.@@..@@@@@@..
|
||||
.@.@.@@..@.@.@@.@@@@@..@@.@@@@.@...@@@.@.@@.@@@.@@@@@@@@..@@..@@@.@@@..@.@@.@.@@@@@.@@@@@@..@@@@@@@@@@@@.@@@@.@@@.@@@.@@@.@@@@..@.@@@@.@@.@.
|
||||
.@@@.@..@.@@..@@@.@@@@.....@@@@@@@@@@.@.@.@@@.@@@@@....@@@.@@@.@@...@@@.@@@..@.@@.@@@@@@.@...@@.@.@@@.@..@@@@@@..@@@@@..@.@.@..@@.@@@@@@@@@@
|
||||
.@.@@@.@.@@@.@.@@.@@.@@..@.@@@.@..@@..@@@@@.@.@..@.@..@..@@.@@@.@@.@@...@@@@@@@.@.@@@.@@...@.@@..@.@.@@@@@@@@@@@@@@@@@@@.@.@@@@@..@..@@@@@@.
|
||||
...@.@.@@.@@@@.@.@@......@.@.@..@@..@@@.@@@@....@@@.@...@.@@.@@@@@@@@@...@@..@.@.@.@@...@@.@@.@...@@.@..@@.@.@....@@..@@.@@@..@@.@.@@@..@@@@
|
||||
@.@@@...@.@@@@.@@.@..@@@@..@@@@@@@@..@@@...@@@@@.@...@@@@@@@@@@...@@@@@@@@@@.@@@@@@@@@...@@.@@..@@.@@..@...@@@@@@@.@@..@.@.@.@.@@@.@.@.@.@@@
|
||||
@@.@@.@@@@....@.@...@...@@@@@@@.@@@@@@@@@@@.@@@...@@@@@@@@@@@@@@@.@@..@.@@@.@@@.@@@@..@.@@@@..@@@@..@.@.@@.@@@@@@@.@@@@@@@@.@.@@@@@@@@@@.@@.
|
||||
@@@@@..@@..@@@@@.@@@.@@@@@.@@@@@@@.@@@@@.@@..@@@.@.@@@@@.@.@@@..@@.@...@@@.@@..@.@.@@@.@.@@@@@@..@@@@.@@@@..@@..@@@.@@@@@.@.@...@@@@.@@...@@
|
||||
@....@@@@@.@.@@@..@.@.@@.@..@.@@.@@@@.@@@...@@.@@@@..@.@.@.@@.@@.@@.@@@.@.@.....@@@@@.@.@@@..@..@.@.@@.....@@@@@....@..@@@@@@@@@@@@.@@.@@@.@
|
||||
@@@@@@...@@@..@.@@.@..@.@@@@.@@@@@.@@@@..@@@@.@@@@@@..@..@@@@@@..@.@@@..@.@@.@@@@.@@.@@..@@@@..@..@.@@.@.@@.@@.@@@.@@@.@@@@@@@@....@@.@@.@@.
|
||||
@@@@@@.@@@.@@@@@@@..@@..@@@.@@@@@@@@@@@@.@@@.@@.@.@@@.@@@.@@@@.@@@@@.@.@.@@@..@@@@@@@@..@@@@@.@@@@@.@@@..@@.@.@@@.@@@@..@@@.........@@@@@@@@
|
||||
@@@..@.@@@@..@@@@@.@.@@@..@@.@..@@..@@..@.@@@.@@@.@.@.@..@@@.@.@@.@@.@...@@.@@@@.@.@.@@..@...@.@.@@@@...@@@....@@@.@@@@.@.@@@@@@.@@@@.@@@@.@
|
||||
@@.@@@@@@@@..@.@.@@@@..@.@@@@@.@@@@@@@@@.@@@@@@.@@@@.@@@@@@.@@@@..@@@...@@@.@@@@.@@.@@..@@@@.@.@.@.@@@@@@...@@@.@...@.@.@.@@@@@@@@@@.@@@@@@@
|
||||
@@@@@.@@..@@.@@.@@@@@@@@.@@@@@...@..@@@@.@@..@.@..@@@..@@.@@@@.@.@@.@.@@@@.@@@@@.@..@@.@@.@@@.@@@@.@@@@..@@@@..@@@@@.@@..@.@@@@@@.@..@@@.@@@
|
||||
@.@@...@..@@@@@@@.@@..@..@.@@.@@..@...@..@.@.@.@.@@@@..@@@.@.@@@.@..@...@.@@@.@@@@..@@.@@@@@.@@..@@@@.@.@@@....@@@@.@..@.@@@.@.@@..@.@@..@@@
|
||||
@@@.@@@..@@@@.@..@@@..@@.@@@@@....@.@@@@...@@@@@@..@.@@@..@@@@@@@.@@.@.@@...@.@@@.@..@@..@.....@@@@..@@.@@@@@.@..@.@@@@@@@@..@@@..@@@.@@..@@
|
||||
.@@@..@.@@.@.@@@@.@@..@.@@@@@@@@.@@.@@@@@@@.@@@...@.@.@@.@.@.@@@@@@@@@..@@@@@..@@...@.@.@@.@@@@@..@@.@..@.......@@@@@....@.@.@@@@.@@..@@@.@.
|
||||
.@..@@.@@@..@@@.@@@@@@.@.@...@@@@@@..@@.@@@@@@@@.@.@@@@@@@@..@@@@.@@..@@@@@@@@.@@@..@@@@.@.@@.@.@@@.@@@..@@@..@.@@.@..@@@.@@@.@.@@...@.@@.@.
|
||||
@@@@.@@@@@.@@@.@.@@@.@.@....@..@.@@@@@.@..@@@@...@.@.@@@@..@@.@@@.@@..@@@..@@@.@...@@.@@@@@.@@@.@.@@@.@...@.@..@.@..@@@@@.@@@@@@@@.@@.@@.@..
|
||||
..@@@..@@@@@@@@@@@@..@@@@.@@@.@@.@@@..@@@.@.@@@@@.@.@@@@.@@@@.@.@@@@@@@@@.@@@.@@..@@@@@..@.@@.@.@@@..@.@.@@..@.@.@@@..@......@@@@.@@@@.@.@@@
|
||||
@@@@.@..@.@...@.@.@@@@@.@@@..@@@@.@@@..@@@@.@...@@..@@@..@.@@.@@@@@@.@@@.@@@@@@...@@.@@@..@.@@.@.@.@@@@.@@.@@@@.@@@@@@.@@@@@@@@@..@@..@.@.@@
|
||||
.@.@@@@..@.@.@@@.@..@@@.@.@@@@.@.@.@@..@.@@@@..@...@@@@@@@@@.@@..@.@@@@@@@@.@@..@.@@@.@.@.@@@.@@@@@.@.@@@@@@..@.@.@.@@@@@@.@@.@@@@@.@@.@.@@@
|
||||
@..@@@@@@@.@@@@@.@.@@@@.@@@..@@.@@@...@..@@@@@.@@.@@@@@..@.@@.@..@@@..@@..@@@@@@@@@.@@@@@..@@@@@@@@@.@..@@.@...@@@.@..@@.@...@@@.@@@.....@@@
|
||||
...@@@@@@@.@.@@@.@.@@.@@@.@@@@@..@@@@@@@@..@..@.@.@@@.@@@@...@.@@..@..@.@@.@...@@.@@.@.@@@@....@..@@@@@@@@...@@.@.@.@@@@@..@@@@@@.@..@@@.@@@
|
||||
.@@@.@.@@....@@@..@@@@@@@..@...@@.@@@@.@@@@@.@@.@..@@@..@@.@@@@@.@..@@@..@@@@@@@.@.@@...@@@..@@@@@@..@@@@..@@.@@..@.@@..@@.@@@@.@@@@@@@@@@@@
|
||||
....@@.@@@.@.@@...@..@.@@@.@...@@@@.@.@@@@@.@@@@...@@..@@.@@@.@..@@....@..@@@@@.@@@.@@@..@.@...@...@.@@@@.@..@@.@.@@@..@.@@@@@@@@@@.@@@@...@
|
||||
.@@@...@.@@@@....@..@@@@@@@@@@@@.@@@.@@@@@@@@@@@...@.@@.@@.@@.@..@@@@.@@@@@@@.@@@..@@@.@@@@@.@@@..@.@@.@.@.@@@@@@.@@@@@@@.@.@..@@@@@.@@.@@..
|
||||
.@@@@@@@.@@..@..@@@@@@@@@.@.@@@@@.@@@@.@@@..@@.@@..@@.@@@@..@@@@@@@.@.@@@@@@.@@.@@@@@@@@@@@@@@.@@.@@@@@@@@@@...@..@@...@@@@..@@.@..@..@@@@@.
|
||||
.@@@@.@@.@@..@@@.@@.@.@@@.@.@.@@....@@@..@@.@@@@@@@@@@.@@@@@.@.@@@...@@@@@@@@....@@.@@@.@....@@@@@.@@@@.@@@..@@...@...@.@@@..@@@.@@@@@@@@@..
|
||||
@.@@@..@@.@@@..@@.@.@.@..@@@@@@@@@@@@..@.@@.@@@@@@@.@@@@@@@@..@.@@.@.@@@..@@@..@.@@@@@@..@@.@@.@@@@.@@@...@@@@...@.@..@@.@@@.@.@@@@@@@.@@@@.
|
||||
..@@@@.@@.@.@.@@@.@@@..@..@@@@@@..@.@@@.@@.@.@@@@@.@@.@@@@@...@.@.@@.@.@@@@@.@@@@@@@@@@@@...@.@.@@@..@.@@@@@@..@.@..@@@.@..@.@.@@@.@.@@@....
|
||||
..@@@.@..@@@.@@@..@@.@.@@@@.@@.@@@@@@@@@@.@@@@.@@.@@@@@.@..@...@@..@@@....@@@.@.@..@@@@@.@..@@..@@.@.@@@@..@@@@@.@.@..@@.@@.@@.@@@@..@@@.@@.
|
||||
@@.@@.@.@@@@@@@@@.@@.@...@@@@@..@@@@.@.@@@@@@@@.@@@.@@.@...@@..@@@@@.@..@@@@.@@@.@..@@@@@..@@@@@.@@@.@@.@@@@.@@@@@@@.@@.@@.@.@..@.@@..@@@@@@
|
||||
@.@@..@.@@.@..@@@@@@@.@@.@@.@@@.@.@.@@@...@.@...@.@...@.@@@@@..@.@@@@@@@.@.@.@@..@.@.@@.....@.@@@@@@@@@@@@@.@@.@.@..@.@...@@@..@@@@.@@@@@...
|
||||
@@@@@@@@@@@@@@.@.@@@@@.@.@@@@@@@@.@@.@.@@@.@@@@@@@..@@@@.@@@@.@@@@.@@.@@@@.@@@@@@@@.@@@@@@@.@@.@.@..@@.@.@@..@..@.@@@.@.@@.@@.@.@.@@.@@@.@@@
|
||||
@..@...@..@@@@@.@.@@@@@@@@@...@@@.@@@.@@.@@@@@@@.@..@@@.@@.@..@@@@.@@.@@@...@@@@@@@.@.@.@@.@@....@@....@.@@.@@@@..@@@@@@..@..@@@.@.@@@@@@.@.
|
||||
@.@.@..@..@@..@@@.@..@@...@@@@@@@.@@.@.@..@..@....@@.@@.@..@@@...@@@@@@.@@@@@@.@@.@.....@@..@.@.@.@@@.@@.@.@@..@@@.@@@@@..@@@..@@.@..@..@@@.
|
||||
@@@@..@.@.@@.@..@@@@@@@..@.@@@.@@.@..@...@@@@@.@.@@@@@..@@.@@@@@@@.@@@@@.....@.@.@..@.@@..@..@@@@@@.@.@..@..@@@@@.@.@@@@.@@@@@..@@.@.@..@.@@
|
||||
@@..@@@@@@@@@@@@@....@..@@@@@@@.@@@@@@.@@@@.@.@@@@@@@@@@@..@@@@..@.@.@..@@@@..@@.@..@.@@@@@....@@@@@...@@@.@@@...@.@.@.@@@.@.@@@.@.@.@@@.@.@
|
||||
@@@@.@.@@@...@..@.@..@@@@@@@@@.@.@@..@.@@@..@@@@@@@.@.@.@@@@.@...@@@@@@@@..@.@....@@.@@..@@...@@.@@.@@@.@.@..@.@@..@..@@.@@..@@@@@@@@@.@@@@@
|
||||
@@.@.@..@@@.@@.@..@.@.@@@@@@@@..@@.@@.@.@@.@.......@.@@...@..@..@.@@.@@@..@@..@..@@@@@@@..@@.@@.@.@@...@@@@@@.@@@@@@.@..@..@@@.@@@.@@.@@@@..
|
||||
@@@...@....@.@.@.@.@.@@....@@@@@.@@@...@@@@@@.@@@..@@.@@..@.@@.@@@@.....@..@@@.@..@.@@.@@.@@@.@@@.@@@@@@.@@@@@@.@..@@@.@@..@@.@@@@@@@@@..@@@
|
||||
@@.@@.@.@@@@@.@@.....@@@.@@@@..@@..@.@...@@@..@@.@@@.@@.@@@.@.@@.@.@..@..@@@@@.@.@@@@.@..@.@@.@@..@.@@@@@@@..@@@..@.@@@...@@@..@@@@@......@.
|
||||
.@@..@@@@@@@.@.@@@@@@@@..@@@@@@@..@.@@@....@@@..@..@@@..@.@.@.@@@@@.....@@.@@@@@..@@@@..@.....@..@@@@.@@@.@@@.@@@@.@@@@.@.@..@.@.@...@@.@.@@
|
||||
@.@@@.@.@@@@....@.@@@..@@..@@.@@@@@.....@@.@@@@@@@..@@@@@.@.@..@@@@@@@....@.@.@@@@@@.@@@@@@@.@@.@.@@@.@@@@@@@@@.@@@@.@@@.@@@.@@.@.@@.@@.@...
|
||||
.@@.@.@@@@@.@@....@@@.@@@@@@.@@@.@.@@..@@@.@.@..@.@...@.@@@..@.@......@@@@@@@@@@@.@.@.@.@@@.@.@@....@@@..@@@.@@@@@@@...@@@@@.@@@@@@.@......@
|
||||
.@@.@@....@..@@@@.@@@.@.@.@.@@.@@@.@@@.@@@.@@...@@.@@@@@.@@@@..@@.@..@@@@@@@@@.@@@@@@@.@..@@@.@.@@...@@@@@@@.@@@@@@@@.@.@@@.@@@@@@.@@@@.@@@@
|
||||
..@@@@.@.@@...@@..@@@...@@.@@@@@@@@@@@.@@@..@@@.@@.....@@...@@@.@@.@..@..@@.@.@@@.@.@@@.@.@@@@@.@@.@@@..@@@@@@@@@@..@.@@@@@@@@.@@.@@@@..@@@.
|
||||
.@@.@@@@@@..@@@@@.@.@@@@@@@.@@@@..@@.@.@@...@@@...@..@@....@@.@.@@@.@.@@@..@@@.@@...@.@.@@..@@..@@.@@@@@@@@@.@@.@@@@@@@@@@..@.@@@.@.@@@.@@@.
|
||||
@.@@.@..@......@@@@@.@@.@@.@@@@@@@@.@.@@.@.@@..@...@...@.@@@.@@@.@@@@@.@..@.@@@@@@@.@@@@@@..@@@@..@@@.@.@@@@..@..@@@@@..@@.@@.@@..@..@@.@@..
|
||||
@@.@@.@@@@@@.....@@@.@.@@.@@@@.@.@@..@.@.@@.@@@.@..@.@@.@@@@.@@@@@..@@..@@@...@.@.@@@@..@@@...@@@.@@@@@.@..@@@@@@@@@..@@.@@@@@.@@@@@@..@@.@.
|
||||
....@@@@.@....@@@@@@@@..@@@@@@.@..@@@@..@.@@@@..@.@@@@@@@@.@@@@@@@@@@.@@@@@@@@@@@.@.@@@.@.@@.@@.@@@@.@...@@.@@@@@@@@.@@.@.@@..@@@.@.@.@.@.@@
|
||||
.@.@.@.@.@@@@@@.@@..@@...@.@@.@@@.@@.@@@.@.@@.@@.@.@@@.@..@@.@......@@@@@...@..@@@@@@@@@.@@@@@@@@@@....@@@@.@...@@@.@@@@.@.@@@@@.@@@...@.@@@
|
||||
@@.@@.@@@@.@@@@.@..@......@@@.@.@...@@.@@@.@@@@@@@@@@@@@..@@@.@.@...@@@@@.@@.@@@@..@.@@@.@.@@.@@@@.@..@.@@@@.@@..@@.@..@@@.@@@@@.@@...@@@.@.
|
||||
.@@@@.@@@.@@@@@@@@@@@@@@.@@@@@@@@..@.@@@@@@@.@@.@@@.@.@@.@@@.@@@@@@.@@@@.@@.@@@@.@.@@.@@@..@@@.@.@@@....@@.@..@@@.@.@@@..@@@@.@@..@.@.@@@@.@
|
||||
@@@..@@@@.@@..@@@@@@@@@..@@.@.@.@@@@@@.@@.@@.@@.@.@@@@@.@@..@.@@@.@.@@@@.@@....@@@@.@...@@.@..@@..@..@@@@@@@@.@.@@@.@@.@..@.@..@.@.@@@...@.@
|
||||
@.@@@..@..@@@.@@@@@@.@@@@@@@.@.@.@.@@@..@.@@@.@@@@..@..@@.@.@@@@@.@.@@.@.@..@@.@@@@@@.@.@.@@.@@@@@@@.@@@..@@...@@@..@@.@@@.@@@@@@..@@.@@.@@@
|
||||
.@@@@@.@@@...@@@@.@..@@@..@@..@.@@@@..@........@@@.@@.@@.@.@@@.@@@@...@@@@@@..@@@.@.@...@@.@@.@@.@@@...@.@@@.@@.@.@@.@..@@..@.@@@@@@@@...@@.
|
||||
@@@...@@@@@@@@@@....@@@@@.@.@.@..@..@.@@...@.@.@..@@@@.@.....@@.@..@..@...@@@@.@@.@@@@@@@.@@.@@.@@@@.@@@@@.@@.@@.@@@@@.@@@...@@@@@.......@..
|
||||
@@@..@..@@@@@...@@@@@@@@.@@.@@@@@.@@.@@.@@@@...@.@@@@@@@@@@@@@@@..@.@@..@@@.@....@@.@@@@@.@@@.@@@@@..@@@@.@@@@.@@.@....@@@@..@@@@@@@@@@.@..@
|
||||
@@.@@@@@@@..@@.@@@@..@@@@.@@@@@.@@.@@.@@@@@@@.@@@@@.@.@...@@@..@.@@..@@@@@..@@@@@.@@@@.@@@@.@.@@.@@@@@@.@@@@.@@.@..@.@@@..@.@@@.@@.@@@@.@.@@
|
||||
..@@..@.@@@@@@.@@.@@@@@@@@@.@..@.@.@@..@.@@@@@@@@@@@@.....@.@..@@@...@@@.@@..@@.@@@.@.@@@@@@.@@@....@@.@@..@@.@@@@@.@@..@@.@@@@@@..@@@.@@..@
|
||||
@@..@.@.@.@@.@@.@@@@@.@..@@...@.@@@..@@..@@@.@@@..@@.@@@@@@@....@.@@@@@@..@@.@@.@@..@.@@@@@@...@@@@.@@@....@@@..@@..@@..@.@@.@....@@.@.@@@@.
|
||||
@...@@.@@@.@.@@@.@.@@@@@@@...@@.@@.@@@..@@@@.@@@.@@@.@.@.@@@@@@.@..@@@@@@@@@@.@@.@.@@.@.@.@@@.@@.@@@..@.@@@.@.@.@@@@..@...@..@@@@.@..@.@.@@.
|
||||
..@@@@...@@@.@@.@.@@@@@@@..@@@.@.@@@@@.@@@@@@@@@.@..@@@@@@.@@@.@...@@.@@@@@@@@.@.@.@..@@@@@..@@@.@.@.@@.@@...@.@@....@@@@@.@@@@.@..@..@@@@.@
|
||||
.@@.@@...@.@.@..@.@@@@.@@@.@.@.@.@@@..@@@.@@@@@@@@@@@.@.@@@@@.@@@.@.@@.@.@.@.@@.@@@@.@@@.@@@@..@@@@@@@@@@@...@@@@@.@@@@...@...@@.@@.@@.@@.@@
|
||||
.@...@@@@.@@@.@@..@@@@@@@.@......@@.@..@@@@@@.@@@@.@@@.@@@@..@@...@.@@@@@@@.@.@@..@@.@..@@.@@@@@@..@@@@@@@@@@@@@@...@.@.@@@@@.@@@.@@.@@@..@@
|
||||
@@.@@.@.@@.@@.@.@@..@@.@@..@...@.@@@@.@@@..@@@@.@@@@@@@@..@@@.@@.@..@@@@.@@@.@..@@@@@@@@@@@..@@@.@...@@..@..@@@@.@@@@@.@@@@@@...@@.@.@.@@.@@
|
||||
@@.@@@.@@@@@@.@.@@@@@@@.@@@@@@@@@..@@.@..@@@@.@..@.@@.@@@.@.@.@.@@@@.@.@.@.@.@@.@.@.@@@@@@@@@@@..@@......@@@.@@.@@@@@@@@@@@..@..@..@@@@@@@@@
|
||||
@@@@.@@.@@@.@.@.@@@@..@@@@@@@@@..@..@.@@@.@@@@@..@@@@@.@@@@@..@@@@.@@.@...@@...@@.@..@..@@@...@..@...@@.@@@.@@.@..@@..@@@@@@@@@@@@.@@@@.@@@.
|
||||
10
04/input/test_grid.txt
Normal file
10
04/input/test_grid.txt
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
..@@.@@@@.
|
||||
@@@.@.@.@@
|
||||
@@@@@.@.@@
|
||||
@.@@@@..@.
|
||||
@@.@@@@.@@
|
||||
.@@@@@@@.@
|
||||
.@.@.@.@@@
|
||||
@.@@@.@@@@
|
||||
.@@@@@@@@.
|
||||
@.@.@@@.@.
|
||||
87
04/main.py
Executable file
87
04/main.py
Executable file
|
|
@ -0,0 +1,87 @@
|
|||
#!/bin/python
|
||||
|
||||
from logging import debug, DEBUG, basicConfig
|
||||
from sys import argv
|
||||
|
||||
|
||||
def parse_input(input_filepath: str) -> list[str]:
|
||||
grid: list[str] = []
|
||||
|
||||
with open(file=input_filepath, mode="r") as input_file:
|
||||
input_data: list[str] = input_file.readlines()
|
||||
|
||||
debug(f"\n\nRAW INPUT: {input_data}\n\n")
|
||||
|
||||
for line in input_data:
|
||||
grid.append(line.strip())
|
||||
|
||||
return grid
|
||||
|
||||
|
||||
def is_accessessible(grid: list[str], row: int, col: int) -> bool:
|
||||
if grid[row][col] != "@":
|
||||
return False
|
||||
count = 0
|
||||
adjacent_spots = [[""] * 3] * 3
|
||||
for x_offset in range(-1, 2):
|
||||
for y_offset in range(-1, 2):
|
||||
if (
|
||||
row + x_offset < 0
|
||||
or row + x_offset > len(grid) - 1
|
||||
or col + y_offset < 0
|
||||
or col + y_offset > len(grid[0]) - 1
|
||||
):
|
||||
continue
|
||||
adjacent_spots[x_offset + 1][y_offset + 1] = grid[row + x_offset][
|
||||
col + y_offset
|
||||
]
|
||||
if grid[row + x_offset][col + y_offset] == "@":
|
||||
count += 1
|
||||
return count < 5
|
||||
|
||||
|
||||
def get_accessible_paper_rolls(grid: list[str]) -> list[tuple[int, int, str]]:
|
||||
accessible_paper_rolls: list[tuple[int, int, str]] = []
|
||||
for row in range(len(grid)):
|
||||
for col in range(len(grid[row])):
|
||||
if is_accessessible(grid, row, col):
|
||||
accessible_paper_rolls.append((row, col, grid[row][col]))
|
||||
return accessible_paper_rolls
|
||||
|
||||
|
||||
def remove_accessible_paper_rolls(
|
||||
current_grid: list[str], paper_rolls: list[tuple[int, int, str]]
|
||||
) -> list[str]:
|
||||
for paper_roll in paper_rolls:
|
||||
current_grid[paper_roll[0]] = (
|
||||
current_grid[paper_roll[0]][: paper_roll[1]]
|
||||
+ "x"
|
||||
+ current_grid[paper_roll[0]][(paper_roll[1] + 1):]
|
||||
)
|
||||
debug("GRID AFTER REMOVALS:")
|
||||
for row in current_grid:
|
||||
debug(f"{row}")
|
||||
return current_grid
|
||||
|
||||
|
||||
def main() -> None:
|
||||
input_filepath = "input/test_grid.txt"
|
||||
input_grid = parse_input(input_filepath)
|
||||
paper_rolls = get_accessible_paper_rolls(input_grid)
|
||||
count = len([x[2] for x in paper_rolls])
|
||||
print(f"Paper rolls initially accessible by the forklift: {count}")
|
||||
current_grid = input_grid
|
||||
remove_accessible_paper_rolls(current_grid, paper_rolls)
|
||||
while len(paper_rolls) > 0:
|
||||
paper_rolls = get_accessible_paper_rolls(current_grid)
|
||||
count += len([x[2] for x in paper_rolls])
|
||||
current_grid = remove_accessible_paper_rolls(current_grid, paper_rolls)
|
||||
print(f"Total paper rolls accessible by the forklift: {count}")
|
||||
return
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if "-d" in argv or "--debug" in argv:
|
||||
basicConfig(filename="debug.log", level=DEBUG)
|
||||
main()
|
||||
exit(0)
|
||||
Loading…
Reference in a new issue