heh
bendn 3 months ago
parent 8f8199e · commit 1fa79ed
-rw-r--r--src/inp.txt1322
-rw-r--r--src/main.rs360
2 files changed, 1206 insertions, 476 deletions
diff --git a/src/inp.txt b/src/inp.txt
index 50eac98..dc711e3 100644
--- a/src/inp.txt
+++ b/src/inp.txt
@@ -1,136 +1,1186 @@
-@@@@@@@@.@.@@@@.@@@@@@@@..@..@@@@.@.@.@..@@.@@@@@.@@.@@@@@@@@.....@.@.@..@@@.@@@@@@@.@@......@.@@@@...@.@@.@.@...@@@.@....@.@@@@..@@@.@@
-@..@.@@@@@@@.@@@.@@@@@@.@@@@@@.@...@....@.@.@.@....@@@...@..@..@@@..@@@@@@@@@@.@..@.@..@.@.@@@.@.@@@.@@.@@@...@@.@@@.@@@@.@@.@.@@@@.@@.@
-@.@@.@.@..@@@..@.@@@@@.@.@@.@@.@.@@...@.@.@.@@@@.@@@.@@@@@@@@@@@@.@@..@@.@@@@@@@..@@.@.@@@.@@..@@@@@@@.@@@.@..@@@@@@.@@@@..@@.@.@@..@@.@
-@@..@@@@@..@@@@@..@@@.@@.@@.@@@@@@@.@@.@@.@@..@.@@.@..@.@@...@@@@@@@@.@@@.@@@.@@@@@@.@@@.@..@..@..@.@@.@.@@@@.@@@.....@@..@@...@@@.@@.@@
-@..@..@@..@@.@@.@@@@@.@@@.@.@@@@@@.@@@..@.@@@@@..@.@@..@@@.@@@@@@.@@.@@@@@@@.@@@@@..@@.@@@.@@@@@@@.@..@.@@@@@@@@....@@@.@@@@..@@@@@@.@@.
-@@@@.@@@.@.@@.@@..@@@@@.@.@..@.@..@@@@@@.@@.@@@@@@.@@@...@.@.@@...@.@@.@.@.@.@.@@...@@@..@@@@...@.@.@@..@@@.@@@@.@@@@.@@@.@@@..@....@@@@
-@@@..@.@@@@@@@@@@...@@@@@@@@@@.@@.@....@.@@.@.@@..@@.@@@@@@@....@@@.@@@@.@.@@@@@@@@@@..@@.@@.@@.@@@.@.@@..@@@.@@..@@@@.@@@@@.@@.@@..@@.@
-@@@.@@@@@..@..@.@..@@.@@.@@@@@.@@@@...@@@...@@@@@.@@@@@@@@@@..@@@@@@@@@@@@@.@@@@@@@@@.@..@.@@@.@...@@@@.@.@.@.@@@@@.@..@.@.@@@@.@.@@.@@@
-@.@....@@@@@@@.@.@.@.@.@@@@...@....@@@.@@@.@@@@.@@..@@@@@@@@@@.@@@@.@@.@@.@@.@@@.@@@@....@@@@@@.@@@@@.....@.@.@@.@.@@@.@.@@@@.@@.....@@@
-@@@@@...@..@@.@.@@@@.@@@@@@.@...@.@.@@.@..@@.@.@.@@@@@..@@.@.@@@@..@@@..@.@@..@@@@@@..@@@...@@@@@.@@@.@@@.@.@@@@.@@@@.@@@@@@@@@@.@@@..@@
-@@@.@@.@@.@@@@@@@@..@@@.@@@@@@@@@.@@.@@@@@.@@@@@@@.....@@@@.@@@..@.@@....@@@@.@@..@@.@@.@@@@..@@@.@@@.@@@@@@@..@@@@@@@....@.@.@@@@@@.@@@
-@@@@@@@...@@@.@@@.....@@@..@...@...@.@@@@.@@@@@@@@.@@.@.@@@@@.@..@@@@@@@@@@....@@@@@@@..@.@..@@@..@@..@@..@.@.@@...@@@@@..@@@..@@.@@@@@.
-@@@@@@@@@@@.@@@@..@@.@@@.@@..@@..@@.@.@@@@@@.@@@.@@@@@...@@.@@@@...@@@@..@..@@@.@@.@@@@.@..@.@.@@@.@@@@@@@.@.@@.@@@@.@@.@@.@@.@...@@@...
-@.@.....@@.@@@@@@@.@@@@@@@..@@..@@@..@@.@..@..@@@@.@.@@@@.@..@@@@@@.@@@.@@@@@@.@.@@@@@.@@@@@@.@@.@@..@@@@@@@@.@@@.@@@@@.@.@.@@..@..@@.@.
-@@....@@.@@@.@.@@.@@@@@..@@@@@.@@@@@.@@@..@@@.@..@@@@@@.@.@.@@@@@.@@@.@@@@@@@@.@.@@.@.@@@@.@@@..@@.@@@@....@@@@@.@@@@.@@@@@@@@@.@@.@@...
-@@...@@@@@@@.@@@.@..@..@@@..@@@@@@@.@@@@.@.@.@@@@@@@@..@@@@.@.@.@@.@@@..@.@@@.@@@@@@.@.@@@@...@.@@@.@..@@@@@@.@@@@@@@..@@..@.@..@@.@@..@
-@@@@@@@.@@.@.@@@....@.@.@.@@@@@@@@@@@@@.@...@@.@@.@@..@@..@..@@@@@@@.@@..@@@@@@@@.@@@@@@..@.@@.@@@@@.@@...@...@@@@@@@..@@@@@@@..@@@.@.@@
-@@@.@@@@@@@...@@@.@@.@@@@@.@.@@@...@...@@@@.@@.@@@..@@@.@@@.@@@@.@@@@@@.@@...@@@@@@@@@.@.@@.@.@@@@@.@..@@..@@..@.@@...@@@.@@@@@.@@@@@@..
-@@@...@@@@@@@..@.@.@@@@@@@.@@@@@@@@@..@@@@...@@@@.@..@...@..@@@..@@@.@.@@.@@..@..@@..@@.@..@@.@..@@.@...@@@@@@...@@@@...@......@@@@@@@.@
-..@.@@.@@@@.@.@@@@..@@@.@@..@.@@@.@.@..@.@@.@.@.@.@@.@..@.@.@@@@@@.@@@.@@@.@@@@@@..@..@..@@.@@@..@.@.......@.@..@..@@@..@..@@@@@@@@@.@@.
-@...@.@.@@@@@@@.@@@@.@@.@@@@@.@...@@@@@.@@.@@@.....@@@@.@@@@.@@@..@@.....@@.@@@@@@@@...@@@@@@...@@.@@@@@@@@@@@@@.@@.@@@.@@@@@@@.@@@..@@@
-@...@@.@@.@@.@@@@.@@@.@@@@@.@@.@.@.@@.@@.@@.@@..@@@@@@@.@.@@@.@@@.@@.@@.......@.@@@@.@@@..@@..@@@@@@..@@@@@.@@@@....@..@@@@.@@@....@@..@
-.@@@@@@.@@@@@.@..@@.@@.@@.@.@@@.@.@..@@@@@@.@@@@@@@.@@.@.@@@.@@.@.@.@@..@..@@@@@@@.@@@@@.@@@@@..@@@@.@..@@.@.@@.@...@..@.@.@@@.@.@.@@@@.
-..@@@@@@@.@.@.@@@@.@@..@@@@@.@@.@.@@..@@...@.@.@@.@@..@.@..@@@.@..@....@@@@.@.@.@.@.@@@@@..@.@@@.@@@@...@@@@@@@@@@@@.@@@@.@@@@.@.@@@...@
-..@..@...@@@.@.@@@.@@@@@@@@@@@.@@...@@@@@.@@@@@...@.@@@@..@@@@.@@@@@.@@@@.@....@@@@@.@.@@@@@.@@@@.@..@.@@.@@@..@@.@@.@.@@@@@.@@@@@..@...
-..@@@...@..@@@@..@.@@.....@@@@@@@.@@..@@@..@@@@@..@@@@@@@@@.@@.@@...@.@@@.@@.@.@@@..@@.@@@..@@.@....@@@.@.@@@.@.@@...@..@@.@@..@.@@@.@@@
-@@@..@@@@.@@@.@.@.@@.@@@@@..@@.@@@@@..@..@@@.@@@..@.@@.@@@..@@@..@@.@@.@...@.@@@@@.@@@@@@@.@@..@..@@@@..@.@@..@.@@.@.@@@@@@@@..@..@@@@@@
-@@.@@@@@.@@@@@.@@@@@@@.@@..@@.@@@@@@@@@@.@.@..@@@.@@...@.@@@@..@@@@.@.@...@.@@@.@.@@.@@@@@@@.@.@@.@@@@@@@@.@@@...@@@.@@@@@@.@....@@..@@@
-@@@...@@@.@.@...@@@@@@@@@@@@@.@@.@@@@@.@@@@@@@@@@@.@@@..@@@@.@..@.@.@.@@@@@@.@..@@..@.@..@.@.@@...@.@@@.@@@@@@.@@..@@@.@.@..@@.@.@@@..@@
-.@.@@.@.@.@@.@@@@.@@@..@@..@..@@.@.@.@.@@..@.@@@@@.@@@@@@@@@@.@.@@.@@@@@@@.@@@.@@@@..@@@@@@@.@@@@@.@@@@.@@@.@@@@@.@@@..@@@@@@@@@@..@@@@.
-.@..@.@@..@@@..@@@...@@@@@@@@.@.@@@.@.@@.@@@@.@.@@@.@@@@.@@.@@@@...@@@@...@@.@@.@@.@@@@@@@@@@@@@.@.@@.@@@@@@@..@@@@@@..@...@.@.@@@@@@@@@
-..@@..@@..@@.@@@@@@@@@@.@@@@@@@@@.@.@@..@.@@@@@@@@@@...@@@@..@@@@@@.@@@@@.@.@@.@@.@..@@@@@@@@@.@@@@..@@@...@@@@@..@@@@.@@@@@@.@@@.@.@.@.
-..@.@.@...@@@@@@.@.@....@..@@@.@@@@@@@.@.@.@@@@.@.@@@.@@@@@.@.@@@@.@..@@@@.@@@@@.@.@@@@.@@@@@@..@@.@.@@@@@@@@@@@.@.@.@@.@...@@@@@...@@@@
-@.@@@@@..@.@@@.@@@..@.@@@@@@..@.@..@.@@..@.@.@@@@@@.@.@@@@.@.@.@@@@@@@.@.@@@@.@.@@.@@@@..@@@.@@@...@.@@@@@.@@@....@@@......@....@@@@@@@@
-@.@...@@@.@@@@@@.@@@@..@..@@@@@@.@@@@.@@.@.@.@@.@@@@.@.@.@@.@@.@.@..@....@@@@....@.@.@@@@.@.@.@@@..@@.@...@.@.@@@.@@@.@@@@@.@@@.@@@@...@
-.@@.@@.@@@..@@@@@..@@.@@@@@@@.@@@@@@@@@@@@.@.@@@@@.@@.@@..@@@.@@@@@@@.@@@.@.@..@@@@@..@.@.@@..@..@@@.@@@@@@..@...@.@@@.@@@@@@@@.@...@...
-.@@.@..@@@@@@@@@@@.@@@@..@.@@.@@@@@@@@...@.@@@.@@.@@...@@@@@@@@@@.@@.@..@@@.@..@@.@....@..@@@@@@@..@.@@@@.@@.@@@.@@@..@@@@@@.@@@@@@@.@.@
-@@@@.@.@.@@@@.@@@@@@...@@@.@.@.@@....@@....@..@@@@.@.@@.@..@.@@@@.@@@@@....@@@.@@.@.@@@.@@@@.@.@@@@@...@...@@..@@..@.@@@@@@@@...@@..@@..
-.@@@@.@@@@.@@@.@.@@@@.@@..@.@.@@@@@@@@@@...@@...@@.@@.@@.@@@@.@@.@@.@@.@@@.@@..@..@.@.@..@..@.@@.@.@@@@@@@@..@@.@@@@@@@.@.@.@.@..@.@@..@
-.@@..@@..@@@@@@@@.@@@@@@.@.@@..@.@.@.@...@@@@@@@@@..@@@.@@@@@@@@@@@.@@@@.@@@.@@@@.@@@..@..@.@@.@..@@@@@@.@@.@@@@@.@@.@@@@@.@.@.@.@@@.@.@
-@.@@@@.@@.....@@.@@@@@@@.@@@@.....@.@@@@.@@@@@@.@@@@..@.@@@..@@.@@@@@@@@@@@@@@....@@@.@@@@.@@@@@@@@..@..@@@@.@.@@...@.@@@@.@@@.@@.@@@@..
-@@..@@@@@@@@@@.@.@..@@.@.@@@@...@@@..@@..@..@.@.@@@@@@.....@@.@@.@@.@...@@.@@@@...@@@..@@@@@@@@@@@@..@@.@@.@@.@.@..@@@.@@@..@@@.@....@.@
-.@@@@@@@@@@@@.@@@.@.@@@@.@@@@.@.@.@.@@@@@.@..@..@@..@@@@@@.@.@..@..@@@@@@@.@@@@@@..@@.@@@...@@@@@.@....@@@@@.@@@@.@.@..@.@.@@.@.@@@@.@.@
-@..@@@@.@@@@@@..@.@@..@@@.@@@@@@.@.@@@.@@@@@.@.@.@.@@.@@@@.@@.@@@.@@@@@@@..@@.@@..@@...@.@@@@@.@@.@@@.@@...@@@@.@@.@@@.@..@@.@.@@@@@..@@
-@@@@.@@...@@..@.@@@@@@@.@.@@@@@@...@.@@.@@@@@@@.@@@...@@@@.@@....@@.@@@@@@.@@.@.@@.@.@@@..@@@@@....@@@@@...@@@@@@@@@@.@...@.@@@@...@.@@@
-@@.@@@@...@.@@@@.@@.@..@@@@@.@@@.@...@@..@..@@@@@.@@@@@@@.@.@@.@@@@@@.@@@@@@@@@@..@.@@@@...@.@@.@@@@@@@@.@.@@@@@@.@..@.@@@@@.@@.@@.@.@..
-@.@@@@@@@@@.@@@..@.@..@@.@@@...@@.@@@.@.@..@@@@.....@.@@.@.@@@@..@..@@..@..@@..@@...@@..@@@@@@@.@@.@...@@@@...@@@@.@@@@@.@..@@.@@@@@@...
-@@@.@..@.@..@..@.@.@..@@.@..@@@@@.@..@@@@.@@@.@@@.@...@.@@.@.@@@@....@@.@.@@.@@...@@@..@@....@@@@@...@@...@.@.@@.@.@..@@@@..@@..@@..@@.@
-@@.@@.@@@@@.@@@@@@@@@@@@.@.@@@@..@@@@@@@@@...@@@@@.@.@.@@@@.@..@@@.@....@@.@@@..@@@@..@@@.@.@@@@.@...@@.@@@..@.@..@@@@.@@..@@.@.@@..@@@.
-@@@.@@@.@@@@@.@@@@..@.@.@@@..@..@@@@@@@@@@@@@@@@@@.@@.@.....@@@@@@@.@@@.@@@.@@@@@@@@.@@@..@@@.@.@@.@@.@.@@..@@@@...@@@@@.@@@.@@@@@@@@.@@
-@@@@@.@..@@@.@.@.@.@@@...@@@.@@@@@@@.@@@@@@@@.@.@.@@@.@@.@@@.@.@@.@@@@@.@@@@@..@..@.@@@..@.@.@@.@@.@.@..@@@.@@@@@@.@.@...@@@@@@.@@.@@.@@
-@@@@.@@.@@@@@@@..@...@@@.@@@.@@.@@@@@@@@@@.@@@.@@@@..@@...@@.@.@@.@@@@@.@@@.@@@@.@@.@..@@@@@@.@@.@@@@@@@@@@..@@.@@@@@@.@..@@.@@@@@@@.@.@
-.@@@@@@@@@@.@@.@@@..@..@.@@@@@@@@....@@....@@.@@@@.@@@@.@.@@@@@@@.....@@@@@@.@...@..@@@.@.....@@.@@@.@@.@@.@...@@@@@@@.@@@@.@@@@...@.@@.
-..@..@@.@@@.@..@@..@@@.@..@.@@....@@@@.@@.@.@@....@.@.@.........@@...@@@..@@@@...@@..@.@@@@@...@@.@@@...@.@..@.@@@@@@@.@@@@...@@..@.@@..
-.@@@@@..@.@@@@@@.@@@.@@@@@.@@@@.@@@@@@@...@@.@.@@..@@@@@@.@@@@@.@@@..@@@@@@.@@.@.@@@@@...@@@@@@@@@@@@.@.@@.@.@@@.@@.@@.@.@@@.@@@@.@.@@.@
-@@@@@@@@@.@.@@@@@.@..@@@...@@.@@@@..@.@.@@@.@@@@..@@.@@@@@.@@@@@..@@..@@@.@@@@@@@.@..@..@@.@@.@..@@@...@.@@.@@..@@@.@@@@.@.@...@@.@@..@.
-@@...@@@@@..@@@.@@.@@@@.@@..@@..@@@@.@@@..@..@@@@@@.@@@.@@@@@@@@@...@.@.@@..@@@@.@@@..@...@...@@.@@@.@.@.@@.@.@@@@.@@@@..@@@@@@..@@@@@@@
-..@.@...@@@@@@.@@.@@.@@@.@@..@@@.@@@...@.@@...@@@@.@@.@@@@@..@.@.@@@@..@@@@@@.@@..@.@...@.@.@@@.@@.@@.@@....@@.@@.@@@.@@@@.@@@@.@@@@@..@
-@.....@@@@@..@@.@@@@@@@.@@@@@@..@@.@.@@.@@@@@@...@@..@..@@@.@.@@@.@@@@@@@..@@@..@.@@@@..@@@@@.@.@@...@@...@.@.@@.@@@.@@@.....@...@@@@@@@
-@@..@@@@.@.@@@@@..@@@@@@@.@...@@@@@@.@@@...@@@@..@.@@@@.@..@@@.@@.@@@@.@.@@..@@..@..@@.@@@@@@@..@.@@...@....@@@.@@.@@@.@.@@@...@@@....@@
-@.@@.@@.@..@@.@@.@@@.@@@@.@@@.@@.@@....@@@@.@@@@.@@.@.@.@@@.@.@@@@@@@@.@.@@.@@@.@.@@@@@@@.@@.@.@.@.@.@@@@.@@@@@.@@@.@..@.@@....@@..@@.@@
-.@@@@.@@@.@@@@.@@...@@.@@@@.@@@.@@@@@.@..@.@.@@.@....@@@@@@.@@.@@@..@@.@.@@.@@.@.@@@@..@@@.@..@@@@@@.@@@@@@@@.@...@.@.@@.@@.@@....@@@@.@
-@..@@@.@.@@@@@.@@...@@@@.@@@.@@.@@@@@.@@@@.@.@.@.@@.@.@.@@@@.@@.@@@@@@...@@@@.@@....@@@@...@@@...@...@@.@@...@.@@.@@@@..@@@@@@.@.@@..@.@
-@.@.@..@..@....@@@@@@.@@@.@.@@@.@@@@@@@@@@@@@.@@@@@.@@...@.@@...@@@@@..@.@@.@@.@@@..@@@@.@@@.@@...@@@.@@.@@@.@@@.@@@@.@@@@@@@@@@@@@.@@@@
-@@.@@.@@@@....@@@..@@.@@@@@@@.@@.@.@@@@@@@@@@@.@..@@.@@@.@.@@@@.@@@..@.@@..@@.@@.@@@@@@..@@@.@@.@@..@@@@.....@.....@.@.@.@.@@.@@.@@@@@@@
-@@@@..@@..@@@@.@@@@.@.@@@@.@.@@.@.@@@.@.@@@.@@.@.@@@@.@@@@@..@..@..@.@.@@@.@.@@...@@.@@@@@@@@@@@@@@@.@@@@@@.@@.@@@@@@@@..@@@@@..@@.@@@@@
-@@@@.@....@@@@..@@@@@@..@@@@@@@@@@@@@.@.@@@@@...@@...@@...@.@....@.@@.@.@@@@.@@.@@@@@..@.@@@@@@@..@@.@.@...@@@@.@@..@@@@@.@@@@@.@.@@.@.@
-@..@@@@@@..@@@@@..@@.@@@..@.@@@....@@@@@@.@..@@..@.@@@@@.@.@@@...@.@@@..@..@@..@@@@.@@@@@....@.@@.@..@...@@@@@@@@@@@@.@@@.@......@@@..@.
-@@..@@@@@@@.@.@@..@@..@@...@@..@@@..@.@@@@@.@.....@@@@@@@@@@...@@.@@@@..@@.@@@@@@@@.@.@.@@@.@@@@@@@.@@@@@.@.@@@@@@.@@.@@@@.....@...@@...
-@.@.....@@@@@.@@@..@.@..@.@@@@@@@@@@@@.@.@.@.@..@@@.@.@.@@@@@..@@@.@...@@@....@@.@@@@@@@@@@@@.@@.@@@@..@@.@...@@@@@.@@.@...@@@..@@@@@@.@
-..@@.@@@.@..@.@..@@@@.@@.@@@@@@..@.@@@@...@@.@@@.@..@@@.@.@@@@@@@@.@@.@@@@...@.@..@@@@@.@@@@@@@@@...@..@@@.@@...@@@@@@.@@@@@@..@.@.@.@..
-@.@@@@@.@.@@@@@.@..@..@@@@...@@.@...@.@@@...@.@@@@@@@@@@@@@@.@@@@.@@.@..@....@@@.@@@@.@@@.@@..@...@.@@@@@.@@@@....@@@@..@@@.@..@.@.@.@@@
-..@@@@.@..@@@@@.@@.@@@.@@@@@@.@@..@@@..@.@@@@@.@.@@@@.@..@@.@.@@@@.@@@@.@.@@@.@..@.....@.@@@.@@..@@.@..@@.@@@@@@..@.@..@@.@..@@@@@@.@..@
-@@..@@..@.@.@@@@.@@@@.@@@@@@@@@...@@@..@@@.@@@@.@.@@@@@...@@.@..@.@@@@@@@.@@@@@@@@..@.@.@@@@@.@..@@.@@@@@@@..@@@@@.@@@.@@.@@.@.@....@@..
-@.@@@..@@@@@.@@@@@@@.@@....@@@..@.@@.@.@@...@.@...@@.@@@@@@@@@@@@@.@@.@@@.@.@@...@@.@@@.@.@@@.@.@.@.@....@@@@.@@@@.@@@@@@@.@.@.@@@@@.@@@
-@..@@..@.@.@@@@@@@..@.@@.@@@@@.@.@.....@@@..@.@@..@@@..@@.@..@.@@@.@.@@@@..@......@.@@..@@@.@@..@@.@@@@..@@@@@.@@@.@@..@@@@@@@@.@@@@@@@@
-.@@..@...@@@@@@@.@@@@@@@..@...@@@..@@@.@@@@..@@@@@@@..@@.@.@@.@@@.@@@@......@......@.@@@@.@@@@@@...@.@@@...@.@.@@@@@@.@.@@@@@..@@@@.@@@@
-..@@.@..@@@.@.@.@@.@.@@@@@...@@@..@.@@.@@.@@@@@@@@@.@@@.@..@...@.@.@@@@@.....@@@@@@@@..@@@@.@@@.@@@@@....@.@@.@.@@@@@@@@..@@@@...@@...@.
-@@.@.@.@@.@@.@@..@@@@@@.....@..@@@.@@.@@@@@@.@@@@.@@@@@@@@.@@@..@.@@@.@..@...@..@@@@@.@@@@.@..@@.@@....@..@.@@@@@@.@..@@@@@@..@.@@@...@.
-@@.@@@@@@..@@.....@@.@@@@@@@@@..@@.@@.@@@@@@...@@@@@.@.@@@@..@@@@.@@@.@.@.@@@@.@.@@@@@@.@@@@@@@@.@@@@@@@@@...@@.@@@..@.@@@.@.@..@@..@...
-@@@.@...@.@@@@@@@.@@.@@@@@@@@@.@@.@@@@@@@.@.....@@@..@.@@.@.@@....@@@.@@@@..@@@...@...@@@@@@....@@@@.@@..@.@@@@@.@..@.@@@@@@@.@....@..@.
-..@@@@@..@@.@.@..@@@.@@.@@@@@@.@@@.@.@@@@@@@@@@.@@.@@@@@..@@@@.@@.@.@@@@.@@.@@@@@@@.@@.@@.@@.@@@.@@@@.@@@.@@@@@..@.@.@..@@..@@@@@...@.@@
-@@@@@@.@@@.@..@.@@@@@.@@...@..@.@@@@@..@@@..@@@.@.@@@..@@.@@@.@@..@@.@@.@@@@@.@@@@.@@.@.@@@........@@..@@.@@@.@@@..@@@@@@@.@@@@@@.@.@@.@
-...@@@@@@@.@.@@...@@@.@..@@.@..@@@@@@@@@@@.@.@.@@@@@@@@@@@.@@..@@.@@@@@@@@....@@.@..@.@@..@.@.@@@.@.@.@.@@.@@@...@...@@@@@@@@@@@@.@@.@@@
-@.@@@@..@@@@@@.@.@@..@@@@.@@@@@@@.@..@.@.@@.@@@.@@.@.....@@.@@@@@@@@.@@@@@@@@.@@.@@.@@@..@..@@@@.@@@..@@@@..@@..@@...@.@@@@@@@@.@...@.@@
-.@@@@@@@@...@.@@.@@@@@@@@.@@.@.@@.@.@@@@@@@@..@@@.@@@@@.@@@@.@.@..@...@.@@.@@@@@@@@@.@.@@@@.@.@@..@@@@.@.@@@.@.@@..@@..@@@@@.@@@@..@...@
-.@@@.@...@..@..@@.@@..@..@@@@.@.@@@@@@@@@@.@.@@.@..@.@@@@@@@@@..@@@@@..@@@@...@.@.@@@@.@.@.....@@..@@@@@@@.@@@@@.@.@@@.@@@@@@@@@@.@@@@@@
-@@.@..@@@@.@.@@@@@@.@.@..@@@.@@@@@.@@.@@.@@@@@...@..@.@@.@@..@...@@@.@@.@.@@@.@.@@@@@@@@@@@@@..@....@@..@.@@..@@.@.@.@.@@..@.@@@@@@@@@@@
-.@@.@@@@@.@.@@@.@@..@@@.@@@@@@.@@.@@@@@@@@.@@@@.@@...@.@.@@@@@....@@.....@.@.@.@@@@@.@@@@.@@@@@@@.@...@.@@.@.@.@.@@.@.@@@.@@...@@....@@@
-@..@@@..@@@@..@@@@@@.@@@..@@@@@@@@@@@..@@@@@@.@@@@..@@..@@@@@..@@@.@.@@@@..@.@@..@@.@@@@@@@@..@@@@@@@@@@@.@@..@.@@.@@@@.@.@@@.@....@@@.@
-.@@.@@...@.@@....@@.@.@@@@@.@@@@...@..@@@@@@@@@.@@@@@.@@.@@..@.@@...@.@@@@@.@@@@@...@....@@@@..@@@@@@@@@.@.@.@@@@@@..@...@..@@@@.@..@@@@
-@@@@@@@@..@@@@.@.@@..@@@@..@.@@...@@.@@@...@@@.@@.@...@..@@@@@.@@@..@.@@@@@@@@..@..@..@..@@.@@@.@@.@@....@@@@@@.@@@.@@@@@.@....@@@@@@@@@
-@.@@.@@@@@.@@@....@@@..@@..@.@@..@@@@@.@....@@@@@.@.@@.@@..@..@@..@@@@.@@@.@@@@@@@@@@.@@@@@.@.@.@@@.@.@@@.@@@@@..@@@@..@@...@..@@@@@@@@@
-@@@@@.@.@@@@@@...@@....@@@.@@...@@.@@@@@@@.@.@@.@@..@@@..@.@..@@@@.@@.@.@..@@@..@.@.@.@.@@@@.@@@...@@.@@@@@@@@@@..@@..@.@@@@@@@.@...@.@.
-.@.@..@@@@@@..@@@..@@..@@@@@..@@@.@@@@@.@..@.@.@@@.@...@@@@@..@...@@.@.@.@.@@@@@@@@@.@.@@@@.@...@@.@@@.@.@@@..@.@@@@.@.@@@.@...@...@..@@
-.@@..@@@@@.@@@@@@@@@..@@@@@@.@@..@@@@@@@@@@@..@.@....@@.@@@.....@@.@@@@@@@@.@@@.@@@.@@@@@@@@@@@@@@@@...@@@@.@..@@...@.@@@@...@@.@.....@.
-..@.@@@.@@@@@..@@@@@@@@...@@@.@.@@@.@@@@@.@@@.@.@@.@@@....@@...@@@.@@@@..@.@@@@.@@@@@@@@@@@..@@@.@@@@.@.@..@@@.@@@@.@.@..@@@@..@@@.@...@
-@@.@.@@@@.@.@@.@@@@.@.@@.@.@@@@@..@@@@...@.@@@@@@@...@.@@.@@@@.@@@.@..@@.@..@@@@@.@.@@.@@@..@.@@@@..@.@@@@@@..@@@.@.@@.@@@.@@.@@@@.@.@@@
-.@@.@.@@@@.@@..@@.@@.....@@@@@@@@@@..@@..@@@@...@@.@@..@.@@.@@@@@@..@@.@@@.@@@@@@...@@.@@@@@@..@@@@@.@@@@@..@@@@@.@..@@.@@@@@@@..@@@.@@@
-@@@@@.@@.@@@.@.@@...@....@...@@@@..@@@@.@@@@...@@..@@@@@...@@@@@...@.....@@..@@@..@@@@@@.@.@@@@.@@@@.@.@@.@@.@@@.@.@@.@...@@..@@@@.@@.@@
-..@@.@.@@@@@@.@@@@@.@@..@@.@@@...@.@@.@.@.@@.@@.@.@.@@@.@.@@@@@@@@@@.@.@.@.@@@@@....@@.@@@@@@@@@@@.@@@.@@@@@@.@@....@.@..@@...@..@@...@@
-@@@.@@.@@...@@..@@..@@@.@@.@.@.@@...@.@.@..@..@..@@.@@@..@@@@@.@.@.@@..@@@@....@@.@@@@.@@.@@..@@..@@@..@@...@@@@....@@@.@@@@@...@@.@@.@@
-.@.@.@@@.@@@@@@@@@.@@@@@@@@@@@...@@@@@@@@..@@@.@.@@.@@@@...@@@.@@.@.@@.@@@@@@@@@.@.@@..@@..@@@@@@..@@.@@@@@@.@@@@.@@@@@@@@@.@@@.@..@.@@@
-@@...@@.@.@@...@.@.@@@@@@.@..@@@@..@...@@..@@@@..@@@@...@@@@..@.@@.@@.....@@@@@@.@@@@@@@@@@..@.@.@@@@@@@@...@.@.@@@@@@@.@@.@@@..@.@@@.@.
-@@..@@@@.@@@@@.@.@.@@@@@@@@@..@@@@@@@@@@.@@@@@.@@@.@@@.@@.@@@@@@@.@@@..@@@.@.@@@.@.@.@@@@@@@..@@.@@@.@@.@@@.@@@@.@@@@.@@@@@@@@.@@@@.@.@@
-@..@.@..@@@@@..@@..@.@@@.@@@.@.....@..@@..@.@..@@@@.@...@...@@@@..@@.@.@..@@@...@....@@.@@@..@..@@.@.@@@@@.@.@@@@@@@@@...@@@.@@.@.@..@@@
-@@.@@@.@@@@@..@.@@@.@@@...@.@@@@.@@@@@.@@.@@.@@..@@@..@.@@@@.@@@@@@@@@@@.@@@.....@@@@@@......@@.@...@@@.@@@@.@.@@@@@@@@@.@...@..@@.@@.@@
-.@..@.@@@.@@@@@@.@@@@.@@.@.@.@@@.@@@@@..@.@@@.@@@@@@@@@@.@.@@@@..@.....@.@@@.@...@@@@@@@@.@..@@.@..@.@@@...@@@@@..@@@.@.@@@.@@@.@...@@@.
-.@.@..@@..@@....@.@@.@..@@.@.@....@@@...@.@@..@.@@.@@@...@@@.@.@@@.@@.@.@@@.@@@@...@@.@@@@@@..@@.@@.@@@@.@@@@@@@.@@@@@@.@@@@..@@@..@@@@@
-@@@.@@.@@@@@@@@@@..@@@.@@@@@@..@@@.@@@@@.@@@@@@.@.@.@.@@@@.@@..@@..@@@.@.@@.@..@...@@@..@@.@@@@.@.@.@@@@.@@.@@@.@...@@.....@@.@.@@@@..@@
-.@@...@@.@.@@@@.@@@@@@@@@@@...@@@@@.@@@.@@@@@@@@.@.@@@@@@@@@@@@@.@@...@@..@@@@@@.@@.@@@@@.@.@.@@@@@@@@...@..@@@@@@.@@@@@@..@.@..@@@.@.@@
-.@@..@.@@.@.@.@.@@.@@@.@@@@.@@@.@.@@@@@..@...@@@.@@@@@..@@@@..@.@@@@.@.@@@@.@@@@@@@@@..@.@@.@@.@.@@@@@@@@@@@@@@@@..@@..@@@.@..@@@@.@@@@.
-.@@@@@@.@@@.@@@@@....@@@.@@@@@.@@@@.@..@@@@.@@@.@@....@@@@@@..@@@@..@.@@@@@@.@@@@@@@@@...@@...@@@..@@@@@@@@@.@.@@@@.@..@@@.@@@@@@@..@...
-@@.@@.@@@@@@@@@@....@@@@@@.@..@..@.@.@@.@@.@...@.@@@@.@@.@.@@@.@@..@.@@@@@@..@...@@@.@@.@@@.@.......@@@@..@@@..@@.@@@@..@@@..@@@@.....@.
-.@.@@@@..@.@@@.@@..@..@@@.@.@@@@@@@@@@@@@.@@@@@@@@@...@.@@@@..@@@@@@......@@@@@.@@@@@.@@@..@.@.....@@.@@.@@@@@@.@.@@@.@@@.@@@.@.@.@...@@
-.@@.@.@..@@@@@.@@@@@..@@@@@@@@@@@.....@.@@@@@..@@@.@@.@@..@..@@@@@@.....@@..@@@@@@..@@@.@.@...@@@..@@@@.@@@@@@.@.@..@@..@@..@.@@...@.@@.
-@.@@@@@@....@...@@@.@@.@@@@..@@@@@@@@@.@@@..@@.@@@@@@@..@.@@@...@.@@@.@@@...@@@@@@@@@..@@@@@@@.@@@.@.@@..@.@@..@@@....@@@@....@@@@@.....
-@@@@..@@.@.@@@@..@@@@@...@@@@.@@..@.@@@@@@..@@.@.@.@@@@@@.@.@..@@.@@.@@@@.@@..@......@@@@@.@@@@.@@@.@.@.@@@@@@@@@@@@@@@@.@@@@@@@@@.@@@@@
-...@..@@@@@@@..@@.@@@@..@.@@.@@@@@@.@@@@@....@@..@@.@@@.@.@@.@@@.@@@@.@@@.@.....@@@@@@@@@@@@@@..@.@@@@.@@@@.@@..@.@@@@.@@@@@.@.@.@@@@@@@
-@@@@.@@@@.@.@@@@@@@@@...@..@@@.@.@@@@.@@@.@..@@.@@@@..@@@@.@@@@@@@@.@.@@.@@@@.@@@.@@@@@..@@@.@.@.@..@.@.@.@@@@.@@@@@@@@..@@@@@..@..@.@@@
-.@.@@@.@@..@@@@@..@@.@@@.@@.@@.@@@@@.@..@@@@@.@@@@@.@.@.@@@@@.@@..@@@@.@.@..@@..@@@.@@.@..@..@@.@..@@@@.@.@.@.@@@@@@@@@.@@@@@.@@@@..@.@@
-@@@..@.@@.@@@.@.@@@...@.@@@.@@@..@@..@@@..@.@@@...@..@@@.@@.@...@@@.@@.@@@.@@.@@@.@@@@.@@@@@@@@.@...@.@.@.@@@.@@@.@@@@@@@..@@@.@@@@@.@@.
-@@..@@@@@.@@@@@.@@@@@.@@@@..@@@@@.@@@.@@.@@@@@...@..@.@@@@@@@.@@.@@.@.@@@@..@@@@.@@.@@@.@.@...@@@..@.@.@@@.@@@.@@.@..@@@@@..@@@@.@.@@@@.
-@@@..@.@@@@..@@.@@@.@.@@..@@@@@.@@@.@@@.@..@@@@@@@@.@@@@@@@.@@.@@@@.@@@.@@@@..@@@..@@@..@@@@...@@.@.@@@@@.@@.@@.@@@@@....@.@@.@@@.@@@.@@
-@@.@@@..@@@@@@.....@@@@.@....@@@@.@@.@@@@@@.@@@.@@.@@@.@@@.@@@@@@@@.@..@@@@@.@.@@@@@..@@@@@@@@@....@@.@@@@.@@@@@@@...@.@..@@@@@@.@@@@@..
-@@.@.@@.@@@@@@@.@@@@@@@@@@.@..@....@@@@..@.@@@@...@@.@.@@.@@.@@@@..@@@@.@..@@..@@@@@..@@@@.@.@.@..@@.@@@@.@...@@@@@@..@@.@.@@@..@@@@.@@@
-@@@@@.@@.@@@.@@.@.@@.@@@.@@.@@@.@@...@@.@@@@@..@@.@@@@.@..@@@.@@.@@@@@@@@@.@.@@@@.@@.@@@@.@@@@@@..@@.@.@..@@@@@@@.@@@..@.@@@@@..@....@..
-.@@@@@@..@@.@.@@.@@@@..@.@.@@@@@@@.@@.@..@@@@@@@.@@@@@....@.@..@.@@@@@.@@@.@.@..@@@..@@@..@@@@@@@@.@@@.@.@@@@..@.@...@@@@@@@.@@@.@@...@@
-@@@@..@.@..@@@@@@.@@..@@..@.@@@.@@@@@@@@@@.@@@@@@@@@@.@.@@@@@.@@@...@@.@@@@.@@.@@.@.@.@.@.@@@...@@@@@@.@.@@.@.@.@@.@@@.@@@@.@.@@....@.@.
-@.@@@@@.@@@@.@@..@@@.@@@.@@@@@@..@.@@.@@@@@@@@.@@@@@@..@@@@@@...@@..@.@@@.@@..@@@@@.@@@.@.@.@.@.@@@.@.@.@..@@..@@@..@@...@.@@@@@@@.@@@@@
-@.@@.@..@@@@@.@.@@.@@.@@.@....@@@@..@@..@.@@.@..@@...@@@@@@.@@.@@@..@@@@@..@@..@@@.@@@....@@@@@@..@.@@@@.@@@....@@...@@@@...@@@@@@@..@.@
-@@@...@@@@@.@....@@@@@@@..@@@@..@@@@@.@@.@..@@@@@@@.@.@.@@.@.@@.@.@..@@@@@@@@@@@.@..@..@@@@@@@@@@@..@..@@.@@.@@@@.@@@@@@..@@@@.@@@..@@@@
-@@@.@@@@@@@@@@.@@.@@..@...@.@..@.@...@@.@..@@@@@..@.@@.@@@@@@@@...@@@@.@.@.@@@..@@.@...@@.@@@@.@@@@@@@@@..@..@.@.@.@.@@.@..@@...@.@.@...
-.@@@@@@@..@.@..@@@.@@@@@..@@.@@.@@@.@@@@@@@.@@@@@@@@..@@@@.@@.@@.@.@@..@@@@.@@@@.@@@@@..@@@@@@@...@@@@.@@.@@@@.@@@..@@@@@@..@@@@..@..@@@
-.@..@@@@@@.@....@@.@@@@@..@@@@..@@.@.@@@@...@@@@@@.@@@.@.@..@@@@.@@@@@...@@@@@@.@..@.@@.@.@@.@...@..@@@@@.@@@@@@.@@..@..@@@@@@@@@..@.@.@
-@@@@@@@@@@@@.....@..@@@@@.@..@@.@.@.@.@@@.@.@@..@..@@.@@@@..@.@@@@@..@@@@@@..@.@@.@@.@@@@@@@@.@....@.@@@@@.@...@.@@@.@.@.@.@@@@@..@@@@@@
+12522931128722-17835086076404
+384911260931092-386432466839642
+365270830395340-365971888864203
+335965656565989-338385913690745
+344444810072307-346735887081443
+517987696536841-521724333531860
+196616352567120-198928304566201
+153221685952097-153755911901684
+534143330816947-538769212631051
+182468249249495-187418315879123
+43144734757249-43577434669619
+96196757409900-97842950488786
+363494394902627-364104305337144
+323545976685828-328381600514770
+466365467671134-468743303650602
+33404129353255-39408988150975
+211180171561966-213266641390525
+205211856590532-208854464057250
+415721649347453-418094982195439
+254204192528400-260697055883379
+367873153721253-368016310110182
+42442739340807-43144734757249
+219253350919822-221053580591060
+43577434669619-44073101250782
+525856347827494-531481049142511
+81886655886201-83640283511310
+474954993123386-477586533724840
+534143330816947-538769212631051
+384131201179338-385573225027240
+447749683702651-450391818945542
+85178915987694-86897282432691
+561314402345593-561467755875554
+296769207971316-301237803346584
+369236321979649-369557094002763
+413858958468963-420801621640271
+561803939480482-562405452295386
+346735887081444-349433264449869
+123748864457105-130040447979081
+561803939480482-562107381752145
+114098974651581-117409557005873
+161894929122853-169121277933470
+555736617876554-556241804964044
+156239660754332-156389455668514
+388621919665330-389858455161035
+42139357182737-42831565435472
+558528122612271-558770826138679
+324617547245941-329941639145753
+12522931128722-15293222563191
+102614529425745-108649683941988
+213679961337545-215123497855253
+135857961289697-138332328930082
+236624785606395-239092217398990
+499835849397777-499835849397777
+363791433835044-364324982892722
+172738985769002-177518418069748
+558344787311370-558528122612271
+353084605827971-360393800154139
+365507310440850-366325903877499
+335965656565988-335965656565988
+453698284380589-453698284380589
+367539770344201-367873153721253
+462921956273886-465397950365611
+312484362041096-316126210732700
+382248542386326-383628575706719
+133582436738612-135857961289695
+42139357182737-42442739340807
+192126052775114-198928304566201
+389372362148921-390742801075286
+387680474913661-389091391390315
+372646859877968-380918608719276
+560362765835933-561079617055758
+83154152608943-84488314861730
+364324982892722-364798016791139
+437450269240455-441761281682837
+42442739340807-42642042567067
+372646859877968-372646859877968
+40597746185338-41317963814134
+558988099077195-559219039863863
+153917561839048-154491257171632
+385868222920649-387289408618892
+242127501119589-251045924420956
+368314044607872-368593252171558
+43577434669619-43816326444333
+361949183562057-362490604548609
+544538825545876-551850196688314
+153755911901684-154120537338723
+515031870020511-517987696536840
+393272531621358-401459444239884
+214685522373596-216529423211432
+383024284949594-384609577190183
+367324717063976-367873153721253
+91926437467533-96196757409899
+495241741768371-499835849397777
+80553444766235-82489739224950
+46198548440032-46384786108890
+54633221641607-58320458217135
+153755911901684-153917561839048
+490051825862601-490051825862601
+154632322317176-154944463744259
+558528122612271-558770826138679
+40597746185338-41047522349447
+215962563233885-217313482241748
+54633221641607-58320458217135
+312484362041096-319503879582902
+444366237309702-450391818945542
+365971888864203-366325903877499
+212321963245239-214162860750709
+7840509071694-7840509071694
+524948588738162-529035212328467
+154120537338723-154944463744259
+158696163972883-159423257729154
+260697055883379-260697055883379
+45962138792094-46582719251296
+40824152734012-41047522349447
+123748864457104-123748864457104
+386790280879461-388022546024271
+31928040599678-37248039217929
+216830351007525-218484949158117
+142276088645327-147302961991049
+367873153721253-368016310110182
+40423340293763-40597746185338
+48692453610489-48802024677799
+474954993123386-480660361113377
+161894929122852-161894929122852
+157285934165549-157414314320163
+557553809529440-557787588196231
+151644363299394-152323705076903
+504475275437867-511110648142284
+26247181903026-29053754105005
+86314041394632-88071434295956
+88711208308516-90157844014582
+223985658765899-224957794508313
+74637899483721-77966113379492
+153435925164007-154120537338723
+2950642929711-7840509071693
+84231261602243-85623539892872
+264589915959325-264589915959325
+279960191569408-279960191569408
+403313274504130-408550471437626
+62673226279069-66748530415611
+159218740380447-160036798771623
+218032157659338-219724216349802
+464503151143471-467159123081230
+485547951477011-490051825862600
+293658598000086-301237803346584
+264589915959325-269170168582266
+203933707868207-205211856590531
+143888728716909-150388601046439
+44699942858475-44897866077633
+304235838950091-306271582354185
+558528122612271-558988099077195
+273954440319661-279960191569407
+390397515822598-391773448382828
+366469810311525-366833518483883
+283113811880901-289507893815184
+233017178950241-236624785606393
+40824152734012-41317963814134
+504475275437867-504475275437867
+74637899483721-74637899483721
+403313274504130-408550471437626
+424049360878143-430561860667676
+369557094002763-370380378045753
+159423257729154-160152843291164
+546014180755517-548863085674027
+155281421601517-155640993360502
+401459444239884-401459444239884
+117409557005873-117409557005873
+87429373092901-89075485990396
+453698284380590-458980922165584
+223985658765899-229819818622131
+41938404915839-42642042567067
+103757325716610-107116318865718
+41047522349447-41317963814134
+154120537338723-154632322317176
+20857006754793-29053754105005
+433492782621418-437450269240453
+49093705913689-49370128993556
+554993059094151-555736617876554
+172738985769002-177518418069748
+360393800154140-360393800154140
+467828537120684-470611412555129
+469764595484234-472377077817814
+363791433835044-364450168874906
+245436601521647-248384470629033
+306271582354187-310811517471905
+
+464575741936896
+449716011715189
+33503816529736
+515570414377945
+286181164160689
+455624879767469
+339635858699547
+399055930659353
+258522764663337
+32318331411117
+359281233986929
+406914883912200
+246110831980290
+353773634826918
+194425682937849
+306280060690487
+437001763189239
+296309202586258
+217478185152367
+391289789949868
+473031200885500
+391536234185865
+323798674611122
+23386808045265
+437245258078880
+296969260093785
+487633428128540
+355750871571860
+98436354699088
+31685502908242
+266763035542892
+21633069647248
+389656282658546
+125294859101948
+540005159470225
+449157864408667
+81677119170432
+114346941445454
+426322925674305
+286931331195462
+400554598092211
+405465581079020
+288893185526460
+55367037402370
+397370313284278
+48145406679545
+497663179410892
+357692407910420
+206788269098330
+534676658518682
+265187960875211
+150555043513064
+354199188708652
+468630255934294
+537979001004171
+274825916494428
+224191072630022
+243262869158596
+383766905403067
+24483524305672
+13160458405168
+94624208706631
+217343520970647
+531453081644440
+4929210749236
+527068268122916
+526851626625060
+435324067879934
+358129887267202
+245050025795814
+337684077579171
+265913424520281
+559173529423903
+217164017354382
+346834010142005
+187100393918778
+478991223293952
+92553972820791
+26794785854467
+376592921903367
+367634173354162
+309527650955849
+285617525594043
+225871682807424
+72583827959127
+19654745557063
+363646906337212
+379780193993065
+559110151311168
+506822692127047
+279190573591881
+320985566602419
+26011120359210
+455356754807966
+373188456964884
+441103638926796
+558568190083331
+475636433530280
+114670549892829
+395930258752373
+213560365668079
+298359379574970
+529108234671708
+338485309970080
+145778892224059
+325829554965949
+62770670366108
+471687934206429
+431739250075386
+216149465211648
+518529859883712
+317465072018240
+257334244579878
+444512495005584
+154249221496949
+1128879305721
+135352382577999
+404817523546918
+250145777323513
+457811123229416
+103354747506339
+488641010821484
+460186112033802
+82257398820329
+96718731302961
+419442509815374
+313194073250752
+326003241928109
+196197307221175
+286574693138025
+133942994864186
+309192504617284
+286439236013758
+65564486043428
+560349434656632
+559438922009887
+507744877075324
+20484271491125
+266514502552763
+376398237780595
+267343498180669
+173160257347352
+137554247819710
+245494131483419
+336559639978331
+32550945946662
+215405097310874
+314797131688367
+511605134902755
+166291798129418
+287616711744930
+488763751530158
+155385498999463
+21159393440477
+94349152667468
+181096805941589
+360755636187001
+75259196225711
+246187005541492
+529632510538014
+112346701668337
+265246984966958
+490263686101606
+168467584679335
+213164707168001
+380672262634813
+320183312279456
+260035796199378
+290096518099046
+93437257180931
+300225604769184
+206156476832102
+349105579354557
+40991609981079
+338208725327093
+298870843098923
+314782547949619
+238254523057236
+197027106328367
+21438510431871
+238135175438583
+215695012518070
+164460034989825
+277636035375624
+377772190256546
+100099489711763
+72677568453150
+38563608297639
+295100361387236
+354963968162274
+246961602511263
+417672940953967
+523461535530843
+454725222079693
+32332013651089
+274539729185329
+343695205641705
+544240787272773
+454212099544203
+448023194654243
+207490514639315
+300241764216492
+126291301970142
+70826382035253
+357453133937495
+105601316224146
+106395110045179
+549567142373945
+373084002695325
+536416392002828
+365288048441076
+110488534505627
+14989939887467
+407294346156253
+153280863363966
+518577328973034
+455360908273962
+297771114552794
+327800810677255
+196333000214777
+492293413670991
+233080214818991
+312769369606409
+428014684455371
+506053861989886
+114832467944886
+312807254157348
+215177386538620
+136166772228378
+80486264089800
+206144959432096
+319159419721918
+214870104868132
+13900980552775
+297159538224450
+256192072687655
+196181388949293
+475238001797626
+406162671082306
+243035375770260
+465470292721709
+20945171232021
+354449016072506
+521121950288864
+171209205648002
+276055480588284
+555261911600112
+449779903349619
+65387442684392
+301718457345540
+445465164608056
+148746934697782
+317121265294944
+176939577067796
+333806297710727
+426574987085419
+446756288643667
+150506465918000
+283484464310025
+164421343844584
+446291518972397
+536867282946391
+214506720866834
+195987414309020
+288418263400408
+309920678059872
+449817946356193
+551385508715866
+272328873250791
+233355819297549
+217017738083262
+495535749430210
+550816844512401
+29885285812005
+394219951041550
+417780516888541
+407227372891055
+246207845043103
+400480469608346
+204551131556913
+217623190433326
+242945203384603
+307113118002556
+278083061375391
+89186281822538
+283767646453315
+193095727050743
+340651546205125
+217222100000535
+174766647365912
+45999740088807
+149079448723992
+308135371614203
+174147053790750
+507103476345907
+380029253396814
+91959790723493
+509914493730442
+106588800526070
+89239936400687
+364294750793189
+34099330154799
+406713328292063
+324370181314230
+37641494045412
+436465554825057
+185778980537787
+258422151014684
+554514309103814
+546452678314518
+339940546310935
+334902505000350
+434089697537007
+419144548465735
+520700611300347
+550143203791159
+414269774925933
+227594028466726
+149419794706599
+89799939696279
+441721296317618
+297786265819392
+124646772186871
+285446834190122
+145240781177000
+305026559603858
+258957070842288
+393752809111524
+88163281015470
+530221591752374
+220747152660524
+279755816442973
+65692700690699
+515857836908801
+518146938803116
+193661421749194
+155600359167190
+265983339943005
+515152700252424
+318736824350289
+267535550861338
+26818526477770
+21362973555470
+56745119970970
+330712493151396
+321959896254986
+414477663658609
+178567607200649
+516964632782252
+277566677498209
+5821200663307
+477846077919974
+134483863173177
+375332684569959
+561998858959251
+354698282360612
+534713671194081
+83895693369004
+248498612402062
+456577599192144
+204010133011462
+367859267528122
+378308115123468
+237088016427283
+506855929593889
+354480562855428
+431915903579271
+256670785169299
+314438219961071
+59653014555056
+424634556152198
+417461001568057
+127753221550587
+56046376154266
+289308286211067
+437861193201874
+225261628326617
+33372762161906
+227835228523507
+90096792291788
+206149174397458
+305997261857369
+393888733339245
+317305453066141
+435193487566662
+408746805937372
+305856697423288
+266009714302069
+368385987212456
+264644990850619
+148222881031290
+66066171710679
+366574964438133
+217334226765358
+107473403095499
+349202844949797
+145625368252612
+326307900448645
+287277181095815
+116943693486642
+307257306960551
+51441771274750
+441495841586677
+356549987407331
+30093812994223
+5407845996666
+209773297533403
+225470392722045
+300522766261898
+407600547362531
+456610077401716
+115976992903890
+490909727889438
+236134982899963
+213677532080118
+215799090680402
+348650698103114
+326449590055136
+349202313543588
+257889806969225
+153870532978941
+244475706115022
+278675122821548
+117272346939200
+526117255143654
+395735418900604
+446344537351001
+358014579610240
+17315625065060
+25029481538841
+457612013993212
+224653780998644
+213276350980836
+397304995127681
+278169935321594
+81296650581145
+379682989793588
+216372410840562
+466240798166216
+200386020180613
+313073720619344
+550568130364390
+219910866234318
+136752977591958
+306535406668983
+455812485014612
+375777002178257
+324910425296883
+260537273754822
+313118295769296
+435474607967844
+457898438010298
+151650802425698
+258692738588048
+367638558684850
+434059965879955
+525953265403976
+84035551122643
+219375433188719
+385809865124634
+548866747219321
+229195727491009
+456170419320067
+105480066063385
+13524815779141
+424120011636163
+276131307870978
+549610945914678
+315251194434085
+507228260958042
+429637876237352
+153418892585559
+337208518856651
+540351070227674
+151819468497179
+22331515546909
+107353246326566
+225145103958283
+83866122485357
+37660477717274
+29043209359129
+88935563280878
+347555425738601
+197410077477043
+267904885361234
+430160648023368
+165065144547414
+430359736442439
+5709152787538
+150384124450880
+351543193498763
+400590709246675
+126408275708730
+125026117040037
+447033626407122
+224123651327755
+554435095374877
+165434888063312
+532378042012420
+13761402997502
+55436648273051
+145467702842293
+448799566961931
+451875947155216
+428378587784240
+92094075368361
+536227997636129
+162856762896972
+480003416000608
+33168222110712
+384469451224704
+326183178281240
+365415186633321
+96926947403384
+391529329035795
+57855817212570
+279740022521368
+296690927773686
+35911191268751
+62894756523552
+357275923263842
+25809050752154
+164209653339771
+17217049442866
+130923143709308
+306053405949368
+507193806696147
+40767375043086
+546918960544741
+255835414990585
+31945284290842
+63442488231033
+406195970238033
+65999396646337
+205472394726902
+477923503514714
+328943293940174
+389212235652074
+470524480134826
+26156108746029
+527490071648245
+228369629472917
+226976361628920
+21564939939685
+299392009613825
+247342770673915
+215474940542527
+477497749010837
+85450410406703
+427180744824440
+439929503919026
+353875160350445
+347376198515311
+108217962728305
+378469692904115
+201259621566798
+161925076784289
+430140918369100
+375033205619878
+244332575416614
+212690749050406
+554207540004057
+73245188240001
+123908545096594
+289348776410391
+169105709160191
+149216632530864
+406625055690857
+454198765910504
+228364813703152
+289450692056859
+499463113580418
+499695104033142
+24409952341989
+20039241228470
+384401713800005
+306017225144160
+499395451223488
+185978034826003
+166686179655487
+12694078453811
+317700788924765
+92956917312864
+135934180470310
+389519605428084
+114415440190324
+387302478958593
+274232243538589
+259454744011292
+467018150469541
+96316925421230
+23904450071456
+41131254933679
+535826421662717
+235831938643785
+438720266595266
+320243147707847
+216592254701190
+304330176910934
+107701325174712
+516146199676949
+391457997579729
+244458144269666
+324949891858801
+468449196441040
+466329829119159
+203789955302392
+97404718107371
+284011066436927
+99684216354735
+505881137890754
+323738656967832
+519411375809407
+267865449714190
+534329158903859
+428192647242217
+121553636475645
+155540730436015
+2402703914462
+176879264327093
+528011104200405
+383515899695850
+378991960271316
+510002679624022
+3825348168190
+388389122122741
+345437967279331
+5895660452854
+468912175232845
+529503694438641
+349411006435339
+557748642467960
+348536997148020
+364779188749739
+313690094172735
+441583548101549
+351861041100534
+307998203031839
+235266499150544
+366477019352918
+245204868766512
+464182573333686
+238954530154438
+174882238360485
+252261761875338
+524327360381683
+477732508422558
+176218265351597
+229061767000708
+89587475153229
+206012979291833
+148338055814434
+258519913885954
+441062770382078
+329125898203814
+464236442274888
+25229215380557
+259408103114502
+285522901384889
+424291057400458
+468398019559812
+431820115622118
+548208698364870
+57686487341095
+488316447507054
+449744114669117
+245052836721601
+378985311349632
+309834998949372
+192497562162690
+499137593286897
+74599606446467
+253663596958272
+550759627673261
+266159225299305
+289318918469433
+69852778307795
+444463522799131
+285182582368821
+144076228718840
+377698922045535
+374045211014624
+482121574151856
+65420474501198
+468933283879746
+229221276147884
+254844013134863
+36518755792504
+295820238892460
+102391140365606
+34633080831174
+77520221513791
+458045941727572
+382762467154902
+286715607667263
+115436998031225
+417230070576677
+214758229799372
+394081728832238
+304843849112172
+384053000443955
+66147923438886
+419689635742059
+347717157219200
+126269616247564
+317518727392045
+216657906661103
+475796581880799
+389637237451496
+323780830819174
+358646469966531
+338042594784436
+139886375150861
+289165528043770
+379644123776860
+62729422591984
+49019477772874
+534943532174793
+495434583604081
+508342202121496
+249369441867994
+147668733862885
+467678743803342
+513372457192791
+154408618101001
+215307679962683
+471755442860493
+434825326224238
+487737263682989
+537161640215238
+305726324611456
+456953178610466
+38000737042158
+538616572601336
+539443487164328
+235588884023792
+380335569981207
+337763784254433
+436301709487486
+104901465488603
+542783024170342
+115809731741315
+95190668647771
+32352964701743
+317199545118859
+21031001463205
+127550877343476
+75882921750637
+522412630040347
+244962211287719
+151654511043446
+384802215663893
+10020388938877
+396770640884412
+548039397555834
+538239532903702
+385344379895711
+32435341611540
+81843527682187
+48447541872727
+76634179692142
+310325502145110
+1291408596019
+444919509163950
+424374530855242
+495676619032190
+447730061929989
+35466502001908
+258961951925069
+35655199098748
+232414890558097
+468295903231003
+550098825253324
+174437855288775
+447369080499823
+487524656678091
+434763156508009
+357658993659204
+388989022392574
+545138582112355
+308529247167732
+93650392030183
+124864047494072
+126808109626326
+171742418789281
+340369830361759
+439800938344933
+236082241336453
+449081595721094
+173216694158976
+416152938252120
+39081400949748
+517861832435553
+361330524380150
+441577421193410
+428969711915031
+301043582636830
+92733831976073
+560028678612995
+295469441894453
+358404798137745
+503748251529359
+545574869995640
+306191121915034
+275044241624045
+414085504605343
+547438568171398
+481405747978111
+515274503138078
+218639191485395
+82483188272484
+405046679546781
+144772578546771
+64760935936310
+15986922777259
+23629006767213
+32595737120329
+36763979355204
+476737193338769
+126121628789797
+150184918082353
+254514569506341
+480067732110611
+61156088671949
+242601815791237
+184569065875871
+320664940511356
+14345898397391
+225561341342384
+243527684910942
+433863032018264
+105863394299145
+309530909281902
+87584079928253
+448943828935342
+407614329525099
+489022526279883
+407040608004179
+511054786475003
+496285523655041
+375395089891639
+55074738323173
+24032138227626
+57039730645032
+150939966740327
+519317482615003
+200394236622875
+226015508925777
+426825561369807
+266691229466952
+358438432163847
+363786417028452
+496657342784178
+67943880278375
+206187061500055
+256014528105369
+176210037089866
+293623989295382
+86088418478495
+298842427478766
+497939270427048
+145695098683292
+84741583929412
+529478910014253
+397832433711910
+489837639814479
+229277258738177
+182826971277374
+424282373684548
+294865204794330
+537004265623768
+12840195605546
+159344373470038
+41979589069821
+327729634736560
+93879679608980
+424037537697725
+207315220624445
+347491280105809
+22624504826975
+511366618961856
+373282630876555
+347269385196378
+336701798181749
+445158396053304
+43543679973089
+406079391282527
+168068220807135
+458330100662171
+267480557068990
+159220388569735
+536763377808855
+370287178895828
+506570739564266
+214916586015345
+284247663192910
+220796403090831
+307730457553238
+496470723610590
+295826759770648
+248487496011814
+407107379797563
+371922636025072
+159460570323049
+217981826649310
+526587208555077
+21379238150137
+185889114926349
+207885442740045
+359639918987278
+220822936342586
+356383732500871
+359834955312391
+116281493691084
+119961519588838
+142659223698934
+167959577062815
+262977327987961
+457338375932829
+347042242336660
+27713895481032
+319496924654982
+373769928906406
+237937068737525
+236437792451989
+219556718369220
+419011108622658
+457858334477935
+83508940941198
+248854258628641
+187618818815070
+197565857491091
+325415639506101
+307518758428715
+295884309946893
+463870894072413
+50541046820065
+128055470090128
+372707091666051
+76149462414315
+226847332142383
+250776784198420
+276338524179546
+213555643756144
+471127882729963
+376375356346095
+408217190488698
+277647640492546
+312942323440954
+496672523512296
+435475510642285
+457562284009930
+498796087794909
+220295295095921
+434610329671379
+81820080697124
+415635543825752
+285396616117988
+555052506720249
+244166921033585
+454195744400460
+148909370817963
+124995536914663
+258202699333482
+293890985655176
+79519094150212
+172079354299528
+3475061115661
+397402266709258
+405869104474082
+456470632429817
+400624441220420
+538651102682813
+246793928381848
+125663055370687
+125532324733303
+299417281734928
+145425116995128
+57743830902352
+177061616170237
+34812525933430
+198473825344019
+345266069566382
+79545513591129
+548642757273548
+173246779899818
+127635734091023
+93384882254690
+515733224165399
+464044349386983
+399896045514746
+523700234136231
+246811621908007
+284830401974375
+107658878943845
+144337750031120
+298390038154556
+105866547281663
+397237950486249
+151171503137408
diff --git a/src/main.rs b/src/main.rs
index 506c65a..b910734 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -61,7 +61,7 @@ use std::{
hash::Hash,
hint::assert_unchecked,
mem::take,
- ops::{Coroutine, Deref},
+ ops::{Coroutine, Deref, RangeInclusive},
pin::Pin,
simd::prelude::*,
sync::atomic::{AtomicUsize, Ordering},
@@ -70,358 +70,38 @@ use std::{
use swizzle::array;
pub use util::prelude::*;
-#[unsafe(no_mangle)]
-fn p2(v: &[u8]) -> usize {
- let rows = memchr::memchr(b'\n', v).ψ();
- let cols = rows + 1;
-
- let mut degree = vec![0u8; rows * cols];
- let mut queue = VecDeque::with_capacity(2000);
-
- for i in memchr::memchr_iter(b'@', v) {
- let count = util::nb((i / cols, i % cols))
- .map(|(x, y)| (v.get(x * cols + y) == Some(&b'@')) as u8)
- .into_iter()
- .sum::<u8>()
- + 1;
-
- degree[i] = count as _;
-
- if count < 4 + 1 {
- queue.push_back(i as u16);
- }
- }
-
- let mut sum = 0;
- while let Some(i) = queue.pop_front() {
- let i = i as usize;
- if degree[i] == 0 {
- continue;
- }
-
- degree[i] = 0;
- sum += 1;
-
- util::nb((i / cols, i % cols))
- .into_iter()
- .map(|(x, y)| x * cols + y)
- .for_each(|i| {
- if let Some(d) = degree.get_mut(i)
- && *d != 0
- {
- *d -= 1;
- if *d < 4 + 1 {
- queue.push_back(i as u16);
- }
- }
- });
- }
- sum
-}
-
-macro_rules! nbors {
- ($width: literal, $tail:literal, $fname:ident) => {
- #[unsafe(no_mangle)]
- fn $fname(x: &[u8]) -> u32 {
- unsafe { core::hint::assert_unchecked(x.len() == $width * ($width + 1)) };
- let winc = $width + 1;
- let mut sum = 0;
- let mut l_tl;
- let mut r_tl;
- let mut t_tl;
-
- let mut l_tc;
- let mut r_tc;
- let mut t_tc;
-
- let mut l_tr;
- let mut r_tr;
- let mut t_tr;
-
- let t_mask = std::simd::Mask::<i8, _>::from([
- true, true, true, true, true, true, true, true, true, true, false, false, false,
- false, false, false,
- ]);
- {
- // first line
- // overlaps with right by 1
- let left = {
- let f = |i| u8x64::from_slice(&x[i..i + 64]) & Simd::splat(2);
- let cl =
- u8x64::from_slice(&x[..64]).shift_elements_right::<1>(2) & Simd::splat(2);
- l_tl = cl;
- l_tc = f(0);
- let cr = f(1);
- l_tr = cr;
- let bl = f(winc - 1);
- let bc = f(winc);
- let br = f(winc + 1);
-
- let b_ = cl + cr;
- let c_ = bl + bc + br;
- (b_ + c_).simd_ge(Simd::splat(4)) & l_tc.simd_eq(u8x64::splat(0))
- };
- // overlaps with left by 1
- // overlaps with tail by 1
- // covers the span of 63..127
- let right = {
- let f = |i| {
- let i = i + 63;
- u8x64::from_slice(&x[i..i + 64]) & Simd::splat(2)
- };
-
- let cl = u8x64::from_slice(&x[63 - 1..63 - 1 + 64]) & Simd::splat(2); // f(-1)
- r_tl = cl;
- // r_tl = u8x64::from_slice(&x[63 - 1..63 - 1 + 64]) &Simd::splat(2);
- r_tc = u8x64::from_slice(&x[63..63 + 64]) & Simd::splat(2);
- let cr = f(1);
- r_tr = cr;
- let bl = f(winc - 1);
- let bc = f(winc);
- let br = f(winc + 1);
-
- let b_ = cl + cr;
- let c_ = bl + bc + br;
-
- (b_ + c_).simd_ge(Simd::splat(4)) & r_tc.simd_eq(u8x64::splat(0))
- };
- // covers the span of 126..136
- let tail = {
- // last 10 (or 14)
- let f = |i| {
- let i = i + 126;
- u8x16::from_slice(&x[i..i + 16]) & Simd::splat(2)
- };
-
- let cl = u8x16::from_slice(&x[126 - 1..126 - 1 + 16]) & Simd::splat(2);
- t_tl = cl;
- t_tc = u8x16::load_or_default(&x[126..126 + $tail]) & Simd::splat(2);
- let cr = f(1);
- t_tr = cr;
- let bl = f(winc - 1);
- let bc = f(winc);
- let br = f(winc + 1);
-
- let b_ = cl + cr;
- let c_ = bl + bc + br;
- (b_ + c_).simd_ge(Simd::splat(4)) & t_tc.simd_eq(Simd::splat(0))
- };
-
- // for &el in left.to_array().iter().take(63) {
- // if el == true {
- // print!("x");
- // } else {
- // print!(" ");
- // }
- // }
-
- // for el in right.to_array().into_iter().take(63) {
- // if el == true {
- // print!("x");
- // } else {
- // print!(" ");
- // }
- // }
- // for el in tail.to_array().into_iter().take(10) {
- // if el == true {
- // print!("x");
- // } else {
- // print!(" ");
- // }
- // }
- // println!();
- let l = (left.to_bitmask() << 1).count_ones();
- let r = (right.to_bitmask() << 1).count_ones();
- let t = ((tail & t_mask).to_bitmask()).count_ones();
- sum += l + r + t;
- }
- for y in 1..$width - 1 {
- // overlaps with right by 1
- let left = {
- let f = |i| u8x64::from_slice(&x[i..i + 64]) & Simd::splat(2);
- let cl = f(y * winc - 1);
- // let rel =
- // u8x64::from_slice(&x[y * winc..y * winc + 64]).simd_eq(u8x64::splat(b'@'));
- let cr = f(y * winc + 1);
- let bl = f((y + 1) * winc - 1);
- let bc = f((y + 1) * winc);
- let br = f((y + 1) * winc + 1);
-
- let a_ = l_tl + l_tc + l_tr;
- l_tc = u8x64::from_slice(&x[y * winc..y * winc + 64]) & Simd::splat(2);
- (l_tl, l_tr) = (cl, cr);
- let b_ = cl + cr;
- let c_ = bl + bc + br;
-
- (a_ + b_ + c_).simd_ge(Simd::splat(10)) & l_tc.simd_eq(u8x64::splat(0))
- };
- // overlaps with left by 1
- // overlaps with tail by 1
- // covers the span of 63..127
- let right = {
- let f = |i| {
- let i = i + 63;
- u8x64::from_slice(&x[i..i + 64]) & Simd::splat(2)
- };
- let cl = f(y * winc - 1);
- let cr = f(y * winc + 1);
- let bl = f((y + 1) * winc - 1);
- let bc = f((y + 1) * winc);
- let br = f((y + 1) * winc + 1);
-
- let a_ = r_tl + r_tc + r_tr;
- (r_tl, r_tr) = (cl, cr);
- r_tc =
- u8x64::from_slice(&x[y * winc + 63..y * winc + 63 + 64]) & Simd::splat(2);
-
- let b_ = cl + cr;
- let c_ = bl + bc + br;
- // it double
- (a_ + b_ + c_).simd_ge(Simd::splat(10)) & r_tc.simd_eq(u8x64::splat(0))
- };
- // covers the span of 126..136
- let tail = {
- // last 8
- let f = |i| {
- let i = i + 126;
- u8x16::load_or_default(&x[i..i + $tail]) & Simd::splat(2)
- };
-
- let cl = f(y * winc - 1);
- let cr = f(y * winc + 1);
- let bl = f((y + 1) * winc - 1);
- let bc = f((y + 1) * winc);
- let br = f((y + 1) * winc + 1);
-
- let a_ = t_tl + t_tc + t_tr;
- (t_tl, t_tr) = (cl, cr);
- t_tc = u8x16::load_or_default(&x[y * winc + 126..y * winc + 126 + $tail])
- & Simd::splat(2);
- let b_ = cl + cr;
- let c_ = bl + bc + br;
- (a_ + b_ + c_).simd_ge(Simd::splat(10)) & t_tc.simd_eq(Simd::splat(0))
- };
- let l = (left.to_bitmask() << 1).count_ones();
- let r = (right.to_bitmask() << 1).count_ones();
- let t = ((tail & t_mask).to_bitmask()).count_ones();
- sum += l + r + t;
- }
- {
- // last line
- let y = $width - 1;
- // overlaps with right by 1
- let left = {
- let f = |i| u8x64::from_slice(&x[i..i + 64]) & Simd::splat(2);
- let cl = f(y * winc - 1);
- let rel =
- u8x64::from_slice(&x[y * winc..y * winc + 64]).simd_eq(u8x64::splat(b'@'));
- let cr = f(y * winc + 1);
-
- let a_ = l_tl + l_tc + l_tr;
- let b_ = cl + cr;
-
- (a_ + b_).simd_ge(Simd::splat(4)) & rel
- };
- // overlaps with left by 1
- // overlaps with tail by 1
- // covers the span of 63..127
- let right = {
- let f = |i| {
- let i = i + 63;
- u8x64::from_slice(&x[i..i + 64]) & Simd::splat(2)
- };
- let cl = f(y * winc - 1);
- let rel = u8x64::from_slice(&x[y * winc + 63..y * winc + 63 + 64])
- .simd_eq(u8x64::splat(b'@'));
- let cr = f(y * winc + 1);
-
- let a_ = r_tl + r_tc + r_tr;
- let b_ = cl + cr;
-
- (a_ + b_).simd_ge(Simd::splat(4)) & rel
- };
- // covers the span of 126..136
- let tail = {
- // last 8
- let f = |i| {
- let i = i + 126;
- u8x16::load_or_default(&x[i..i + $tail]) & Simd::splat(2)
- };
- let cl = f(y * winc - 1);
- let rel = u8x16::load_or_default(&x[y * winc + 126..y * winc + 126 + $tail])
- .simd_eq(u8x16::splat(b'@'));
- let cr = f(y * winc + 1);
-
- let a_ = t_tl + t_tc + t_tr;
- let b_ = cl + cr;
- (a_ + b_).simd_ge(Simd::splat(4)) & rel
- };
- let l = (left.to_bitmask() << 1).count_ones();
- let r = (right.to_bitmask() << 1).count_ones();
- let t = ((tail & t_mask).to_bitmask()).count_ones();
- sum += l + r + t;
- }
- sum
- }
- };
-}
-nbors!(136, 10, nbors136);
-nbors!(140, 14, nbors140);
-
+use atools::prelude::*;
#[unsafe(no_mangle)]
#[implicit_fn::implicit_fn]
-pub unsafe fn p1(x: &'static [u8]) -> impl Debug {
- let grid = x.行().collect::<Vec<_>>();
- let mut tot = 0;
- // want nbors of each cell
- // [0, @ , 0]
- // [0, [@], @]
- // [@, 0 , 0]
- // hmm
-
- // get nbor left and right
- // above + above >> 1 + above << 2
- let mut to = vec![vec![b'.'; 136]; 136];
- for roll in grid.clone().as_slice().find_iter(b'@') {
- let nb = util::nb(roll)
- .map(|(x, y)| {
- grid.get(y)
- .and_then(|y| y.get(x))
- .is_some_and(|x| *x == b'@') as u8
- })
- .into_iter()
- .sum::<u8>();
- if nb < 4 {
- tot += 1;
- // to[roll.1][roll.0] = b'x';
+pub unsafe fn p1(x: &'static [u8; ISIZE]) -> impl Debug {
+ let [range, nums] = x.splib(b"\n\n").carr();
+ let mut ranges_: Vec<RangeInclusive<u64>> = vec![];
+ for range in util::uints::<u64>(range)
+ .array_chunks::<2>()
+ .map(|[a, b]| a..=b)
+ .sorted_by_key(|x| *x.start())
+ {
+ if let Some(find) = ranges_
+ .iter()
+ .position(|sr| sr.contains(range.start()) || sr.contains(range.end()))
+ {
+ let find = &mut ranges_[find];
+ *find = *find.start().min(range.start())..=*find.end().max(range.end());
} else {
- // to[roll.1][roll.0] = b'@';
+ ranges_.push(range);
}
}
- // for l in to {
- // println!("{}", l.str());
- // }
- tot
+ ranges_.into_iter().map(|x| x.count()).sum::<usize>()
}
const ISIZE: usize = include_bytes!("inp.txt").len();
fn main() {
use atools::prelude::*;
-
- unsafe {
- println!(
- "{:?}",
- p1(include_bytes!(
- "/home/os/aoc_inputs_2025_4_53616c7465645f5f5021a2c6f2f1477957cf648aa98f5c84aded26838a2ede90785e4813a18ec8ac8a3d220956ea04b6b445865b32aee7b2e54bb761dc1fa967"
- ))
- )
- };
-
- // unsafe { println!("{:?}", p1(include_bytes!("inp.txt"))) };
+ unsafe { println!("{:?}", p1(include_bytes!("inp.txt"))) };
}
#[bench]
fn benc(b: &mut test::Bencher) {
let i = boxd(include_bytes!("inp.txt"));
- b.iter(|| unsafe { nbors136(i) });
+ b.iter(|| unsafe { p1(i) });
}