From 7267c0fa74db510564dc59587dd076372640114f Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Thu, 22 Dec 2016 22:41:47 +0000 Subject: [PATCH] Day 22, with stack build system --- adventofcode16/Setup.hs | 2 + adventofcode16/adventofcode16.cabal | 355 ++++++ adventofcode16/app/Main.hs | 6 + advent01.hs => adventofcode16/app/advent01.hs | 2 +- advent02.hs => adventofcode16/app/advent02.hs | 6 +- advent03.hs => adventofcode16/app/advent03.hs | 2 +- advent04.hs => adventofcode16/app/advent04.hs | 2 +- advent05.hs => adventofcode16/app/advent05.hs | 4 +- .../app/advent06-old.hs | 0 advent06.hs => adventofcode16/app/advent06.hs | 2 +- advent07.hs => adventofcode16/app/advent07.hs | 5 +- advent08.hs => adventofcode16/app/advent08.hs | 4 +- advent09.hs => adventofcode16/app/advent09.hs | 2 +- advent10.hs => adventofcode16/app/advent10.hs | 7 +- advent11.hs => adventofcode16/app/advent11.hs | 2 + .../app/advent11a.hs | 2 + .../app/advent11h.hs | 3 +- .../app/advent11p.hs | 2 + advent12.hs => adventofcode16/app/advent12.hs | 5 +- advent13.hs => adventofcode16/app/advent13.hs | 2 + advent14.hs => adventofcode16/app/advent14.hs | 2 + .../app/advent14c.hs | 2 + .../app/advent14parallel.hs | 2 + advent15.hs => adventofcode16/app/advent15.hs | 4 +- .../app/advent15l.hs | 4 +- advent16.hs => adventofcode16/app/advent16.hs | 7 +- .../app/advent16i.hs | 2 + advent17.hs => adventofcode16/app/advent17.hs | 4 +- advent18.hs => adventofcode16/app/advent18.hs | 2 + .../app/advent18f.hs | 2 + advent19.hs => adventofcode16/app/advent19.hs | 2 + advent20.hs => adventofcode16/app/advent20.hs | 5 +- advent21.hs => adventofcode16/app/advent21.hs | 4 +- adventofcode16/app/advent22.hs | 156 +++ adventofcode16/app/advent22library.hs | 143 +++ adventofcode16/app/advent22search.hs | 156 +++ adventofcode16/app/advent22showgrid.hs | 77 ++ .../data/advent01.txt | 0 .../data/advent02.txt | 0 .../data/advent03.txt | 0 .../data/advent04.txt | 0 .../data/advent06.txt | 0 .../data/advent07.txt | 0 .../data/advent08.txt | 0 .../data/advent09.txt | 0 .../data/advent10-test.txt | 0 .../data/advent10.txt | 0 .../data/advent12.txt | 0 .../data/advent15.test.txt | 0 .../data/advent15.txt | 0 .../data/advent20.txt | 0 .../data/advent21.txt | 0 adventofcode16/data/advent22.txt | 1066 +++++++++++++++++ adventofcode16/src/Lib.hs | 6 + adventofcode16/stack.yaml | 10 + adventofcode16/test/Spec.hs | 2 + day22.html | 208 ++++ 57 files changed, 2250 insertions(+), 31 deletions(-) create mode 100644 adventofcode16/Setup.hs create mode 100644 adventofcode16/adventofcode16.cabal create mode 100644 adventofcode16/app/Main.hs rename advent01.hs => adventofcode16/app/advent01.hs (98%) rename advent02.hs => adventofcode16/app/advent02.hs (92%) rename advent03.hs => adventofcode16/app/advent03.hs (94%) rename advent04.hs => adventofcode16/app/advent04.hs (97%) rename advent05.hs => adventofcode16/app/advent05.hs (89%) rename advent06-old.hs => adventofcode16/app/advent06-old.hs (100%) rename advent06.hs => adventofcode16/app/advent06.hs (83%) rename advent07.hs => adventofcode16/app/advent07.hs (97%) rename advent08.hs => adventofcode16/app/advent08.hs (97%) rename advent09.hs => adventofcode16/app/advent09.hs (96%) rename advent10.hs => adventofcode16/app/advent10.hs (97%) rename advent11.hs => adventofcode16/app/advent11.hs (99%) rename advent11a.hs => adventofcode16/app/advent11a.hs (99%) rename advent11h.hs => adventofcode16/app/advent11h.hs (99%) rename advent11p.hs => adventofcode16/app/advent11p.hs (99%) rename advent12.hs => adventofcode16/app/advent12.hs (96%) rename advent13.hs => adventofcode16/app/advent13.hs (99%) rename advent14.hs => adventofcode16/app/advent14.hs (97%) rename advent14c.hs => adventofcode16/app/advent14c.hs (98%) rename advent14parallel.hs => adventofcode16/app/advent14parallel.hs (98%) rename advent15.hs => adventofcode16/app/advent15.hs (94%) rename advent15l.hs => adventofcode16/app/advent15l.hs (94%) rename advent16.hs => adventofcode16/app/advent16.hs (81%) rename advent16i.hs => adventofcode16/app/advent16i.hs (97%) rename advent17.hs => adventofcode16/app/advent17.hs (96%) rename advent18.hs => adventofcode16/app/advent18.hs (97%) rename advent18f.hs => adventofcode16/app/advent18f.hs (98%) rename advent19.hs => adventofcode16/app/advent19.hs (96%) rename advent20.hs => adventofcode16/app/advent20.hs (95%) rename advent21.hs => adventofcode16/app/advent21.hs (98%) create mode 100644 adventofcode16/app/advent22.hs create mode 100644 adventofcode16/app/advent22library.hs create mode 100644 adventofcode16/app/advent22search.hs create mode 100644 adventofcode16/app/advent22showgrid.hs rename advent01.txt => adventofcode16/data/advent01.txt (100%) rename advent02.txt => adventofcode16/data/advent02.txt (100%) rename advent03.txt => adventofcode16/data/advent03.txt (100%) rename advent04.txt => adventofcode16/data/advent04.txt (100%) rename advent06.txt => adventofcode16/data/advent06.txt (100%) rename advent07.txt => adventofcode16/data/advent07.txt (100%) rename advent08.txt => adventofcode16/data/advent08.txt (100%) rename advent09.txt => adventofcode16/data/advent09.txt (100%) rename advent10-test.txt => adventofcode16/data/advent10-test.txt (100%) rename advent10.txt => adventofcode16/data/advent10.txt (100%) rename advent12.txt => adventofcode16/data/advent12.txt (100%) rename advent15.test.txt => adventofcode16/data/advent15.test.txt (100%) rename advent15.txt => adventofcode16/data/advent15.txt (100%) rename advent20.txt => adventofcode16/data/advent20.txt (100%) rename advent21.txt => adventofcode16/data/advent21.txt (100%) create mode 100644 adventofcode16/data/advent22.txt create mode 100644 adventofcode16/src/Lib.hs create mode 100644 adventofcode16/stack.yaml create mode 100644 adventofcode16/test/Spec.hs create mode 100644 day22.html diff --git a/adventofcode16/Setup.hs b/adventofcode16/Setup.hs new file mode 100644 index 0000000..9a994af --- /dev/null +++ b/adventofcode16/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/adventofcode16/adventofcode16.cabal b/adventofcode16/adventofcode16.cabal new file mode 100644 index 0000000..39c0942 --- /dev/null +++ b/adventofcode16/adventofcode16.cabal @@ -0,0 +1,355 @@ +name: adventofcode16 +version: 0.1.0.0 +synopsis: Initial project template from stack +description: Please see README.md +homepage: https://github.com/neilnjae/adventofcode16#readme +license: BSD3 +license-file: LICENSE +author: Neil Smith +maintainer: noone@njae.me.uk +copyright: 2016 Neil Smith +category: None +build-type: Simple +extra-source-files: README.md +cabal-version: >=1.10 + +library + hs-source-dirs: src + exposed-modules: Lib + build-depends: base >= 4.7 && < 5 + default-language: Haskell2010 + +executable advent01 + hs-source-dirs: app + main-is: advent01.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , split + default-language: Haskell2010 + +executable advent02 + hs-source-dirs: app + main-is: advent02.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , array + default-language: Haskell2010 + +executable advent03 + hs-source-dirs: app + main-is: advent03.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , split + default-language: Haskell2010 + +executable advent04 + hs-source-dirs: app + main-is: advent04.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , split + , containers + default-language: Haskell2010 + +executable advent05 + hs-source-dirs: app + main-is: advent05.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , containers + , MissingH + default-language: Haskell2010 + +executable advent06 + hs-source-dirs: app + main-is: advent06.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + default-language: Haskell2010 + +executable advent07 + hs-source-dirs: app + main-is: advent07.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , parsec + default-language: Haskell2010 + +executable advent08 + hs-source-dirs: app + main-is: advent08.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , array + , parsec + default-language: Haskell2010 + +executable advent09 + hs-source-dirs: app + main-is: advent09.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , split + default-language: Haskell2010 + +executable advent10 + hs-source-dirs: app + main-is: advent10.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , parsec + , text + , mtl + default-language: Haskell2010 + +executable advent11 + hs-source-dirs: app + main-is: advent11.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + default-language: Haskell2010 + +executable advent11a + hs-source-dirs: app + main-is: advent11a.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + default-language: Haskell2010 + +executable advent11h + hs-source-dirs: app + main-is: advent11h.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + default-language: Haskell2010 + +executable advent11p + hs-source-dirs: app + main-is: advent11p.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , pqueue + default-language: Haskell2010 + +executable advent12 + hs-source-dirs: app + main-is: advent12.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , parsec + , parsec-numbers + , mtl + default-language: Haskell2010 + +executable advent13 + hs-source-dirs: app + main-is: advent13.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , MissingH + default-language: Haskell2010 + +executable advent14 + hs-source-dirs: app + main-is: advent14.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , MissingH + default-language: Haskell2010 + +executable advent14c + hs-source-dirs: app + main-is: advent14c.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , bytestring + , cryptonite + default-language: Haskell2010 + +executable advent14parallel + hs-source-dirs: app + main-is: advent14parallel.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , parallel + , bytestring + , cryptonite + default-language: Haskell2010 + +executable advent15 + hs-source-dirs: app + main-is: advent15.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , parsec + , parsec-numbers + default-language: Haskell2010 + +executable advent15l + hs-source-dirs: app + main-is: advent15l.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , parsec + , parsec-numbers + default-language: Haskell2010 + +executable advent16 + hs-source-dirs: app + main-is: advent16.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + default-language: Haskell2010 + +executable advent16i + hs-source-dirs: app + main-is: advent16i.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + default-language: Haskell2010 + +executable advent17 + hs-source-dirs: app + main-is: advent17.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , bytestring + , cryptonite + default-language: Haskell2010 + +executable advent18 + hs-source-dirs: app + main-is: advent18.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + default-language: Haskell2010 + +executable advent18f + hs-source-dirs: app + main-is: advent18f.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + default-language: Haskell2010 + +executable advent19 + hs-source-dirs: app + main-is: advent19.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , containers + default-language: Haskell2010 + +executable advent20 + hs-source-dirs: app + main-is: advent20.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , parsec + , parsec-numbers + default-language: Haskell2010 + +executable advent21 + hs-source-dirs: app + main-is: advent21.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , parsec + , parsec-numbers + , mtl + default-language: Haskell2010 + +executable advent22 + hs-source-dirs: app + main-is: advent22.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , parsec + , parsec-numbers + default-language: Haskell2010 + +executable advent22search + hs-source-dirs: app + main-is: advent22search.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , parsec + , parsec-numbers + default-language: Haskell2010 + +executable advent22showgrid + hs-source-dirs: app + main-is: advent22showgrid.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , parsec + , parsec-numbers + default-language: Haskell2010 + +executable advent22library + hs-source-dirs: app + main-is: advent22library.hs + ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + , parsec + , parsec-numbers + , containers + , astar + , unordered-containers + , hashable + default-language: Haskell2010 + + +executable adventofcode16-exe + hs-source-dirs: app + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , adventofcode16 + default-language: Haskell2010 + +test-suite adventofcode16-test + type: exitcode-stdio-1.0 + hs-source-dirs: test + main-is: Spec.hs + build-depends: base + , adventofcode16 + ghc-options: -threaded -rtsopts -with-rtsopts=-N + default-language: Haskell2010 + +source-repository head + type: git + location: https://github.com/neilnjae/adventofcode16 diff --git a/adventofcode16/app/Main.hs b/adventofcode16/app/Main.hs new file mode 100644 index 0000000..de1c1ab --- /dev/null +++ b/adventofcode16/app/Main.hs @@ -0,0 +1,6 @@ +module Main where + +import Lib + +main :: IO () +main = someFunc diff --git a/advent01.hs b/adventofcode16/app/advent01.hs similarity index 98% rename from advent01.hs rename to adventofcode16/app/advent01.hs index a896944..b76195d 100644 --- a/advent01.hs +++ b/adventofcode16/app/advent01.hs @@ -18,7 +18,7 @@ instance Eq Position where main :: IO () main = do - instructions <- readFile "advent01.txt" + instructions <- readFile "data/advent01.txt" part1 instructions part2 instructions diff --git a/advent02.hs b/adventofcode16/app/advent02.hs similarity index 92% rename from advent02.hs rename to adventofcode16/app/advent02.hs index d4abc55..747001d 100644 --- a/advent02.hs +++ b/adventofcode16/app/advent02.hs @@ -43,19 +43,19 @@ findKey kb c = fst $ head $ filter (\a -> (snd a) == c) $ assocs kb main :: IO () main = do - instrText <- readFile "advent02.txt" + instrText <- readFile "data/advent02.txt" let instructions = lines instrText part1 instructions part2 instructions part1 :: [String] -> IO () part1 instructions = do - print $ followInstructions keyboard1 instructions + putStrLn $ followInstructions keyboard1 instructions part2 :: [String] -> IO () part2 instructions = do - print $ followInstructions keyboard2 instructions + putStrLn $ followInstructions keyboard2 instructions followInstructions :: Keyboard -> [String] -> String diff --git a/advent03.hs b/adventofcode16/app/advent03.hs similarity index 94% rename from advent03.hs rename to adventofcode16/app/advent03.hs index e97dd66..ef40bcc 100644 --- a/advent03.hs +++ b/adventofcode16/app/advent03.hs @@ -7,7 +7,7 @@ type Triple = [Integer] main :: IO () main = do - instrText <- readFile "advent03.txt" + instrText <- readFile "data/advent03.txt" let triangles = map (parseLine) $ lines instrText part1 triangles part2 triangles diff --git a/advent04.hs b/adventofcode16/app/advent04.hs similarity index 97% rename from advent04.hs rename to adventofcode16/app/advent04.hs index b8c095e..85b7555 100644 --- a/advent04.hs +++ b/adventofcode16/app/advent04.hs @@ -12,7 +12,7 @@ data Room = Room { name :: String main :: IO () main = do - instrText <- readFile "advent04.txt" + instrText <- readFile "data/advent04.txt" let rooms = map (parseLine) $ lines instrText part1 rooms part2 rooms diff --git a/advent05.hs b/adventofcode16/app/advent05.hs similarity index 89% rename from advent05.hs rename to adventofcode16/app/advent05.hs index c86b14c..82a035e 100644 --- a/advent05.hs +++ b/adventofcode16/app/advent05.hs @@ -16,11 +16,11 @@ main = do part1 :: IO () part1 = do - print $ take 8 [h!!5 | h <- filter (interesting) $ md5sequence input 0] + putStrLn $ take 8 [h!!5 | h <- filter (interesting) $ md5sequence input 0] part2 :: IO () part2 = do - print $ Map.foldr (:) [] password + putStrLn $ Map.foldr (:) [] password where interestingHashes = [(read [h!!5], h!!6) | h <- filter (interesting) (md5sequence input 0), diff --git a/advent06-old.hs b/adventofcode16/app/advent06-old.hs similarity index 100% rename from advent06-old.hs rename to adventofcode16/app/advent06-old.hs diff --git a/advent06.hs b/adventofcode16/app/advent06.hs similarity index 83% rename from advent06.hs rename to adventofcode16/app/advent06.hs index e2a41e7..96c4aa2 100644 --- a/advent06.hs +++ b/adventofcode16/app/advent06.hs @@ -5,7 +5,7 @@ import Data.Tuple (swap) main :: IO () main = do - text <- readFile "advent06.txt" + text <- readFile "data/advent06.txt" let message = lines text part1 message part2 message diff --git a/advent07.hs b/adventofcode16/app/advent07.hs similarity index 97% rename from advent07.hs rename to adventofcode16/app/advent07.hs index 2705b9d..8700958 100644 --- a/advent07.hs +++ b/adventofcode16/app/advent07.hs @@ -1,5 +1,6 @@ +module Main(main) where + import Text.Parsec -import Control.Applicative ((<$), (<*), (*>), liftA) import Data.List (partition, union, intersect, tails) import Data.Char (isAlphaNum) @@ -25,7 +26,7 @@ isIncludeV (Excludev _) = False main :: IO () main = do - text <- readFile "advent07.txt" + text <- readFile "data/advent07.txt" part1 text part2 text diff --git a/advent08.hs b/adventofcode16/app/advent08.hs similarity index 97% rename from advent08.hs rename to adventofcode16/app/advent08.hs index 7def6d1..ccf2de0 100644 --- a/advent08.hs +++ b/adventofcode16/app/advent08.hs @@ -2,8 +2,6 @@ module Main(main) where import Data.Array.IArray import Text.Parsec --- import Control.Applicative -import Control.Applicative ((<$), (<*), (*>), (<*>), pure, liftA) import Control.Monad (liftM, ap) -- Row 1 is top, column 1 is left @@ -35,7 +33,7 @@ screen0 = mkScreen 50 6 main :: IO () main = do - text <- readFile "advent08.txt" + text <- readFile "data/advent08.txt" let instrs = successfulParse $ parseCommands text part1 instrs part2 instrs diff --git a/advent09.hs b/adventofcode16/app/advent09.hs similarity index 96% rename from advent09.hs rename to adventofcode16/app/advent09.hs index a68ce82..a3ce495 100644 --- a/advent09.hs +++ b/adventofcode16/app/advent09.hs @@ -7,7 +7,7 @@ type Chunk = (Int, String) main :: IO () main = do - textL <- readFile "advent09.txt" + textL <- readFile "data/advent09.txt" let text = filter (not . isSpace) textL part1 text part2 text diff --git a/advent10.hs b/adventofcode16/app/advent10.hs similarity index 97% rename from advent10.hs rename to adventofcode16/app/advent10.hs index 7097c7a..70e80e0 100644 --- a/advent10.hs +++ b/adventofcode16/app/advent10.hs @@ -1,9 +1,8 @@ import Text.Parsec hiding (State) --- import Control.Applicative ((<$), (<*), (*>), (<*>), liftA) --- import Data.List (partition, union, intersect, tails) import Data.Text (pack, unpack, toTitle) import Control.Monad.State.Lazy import Data.List (partition, findIndices, sort, find) +import Data.Maybe (fromJust) data Destination = Bot | Output deriving (Show, Read, Eq) -- Rule bot low-destination high-destination @@ -43,7 +42,7 @@ emptyFactory = ([], [], []) main :: IO () main = do - text <- readFile "advent10.txt" + text <- readFile "data/advent10.txt" let instructions = successfulParse $ parseIfile text part1 instructions part2 instructions @@ -53,7 +52,7 @@ part1 :: [Instruction] -> IO () part1 instructions = do let (_, _, events) = snd $ runState (runFactory instructions) emptyFactory -- let (places, instructions, events) = snd finalFactory - print $ findDelivery events 17 61 + print $ deliveryId $ fromJust $ findDelivery events 17 61 part2 :: [Instruction] -> IO () part2 instructions = diff --git a/advent11.hs b/adventofcode16/app/advent11.hs similarity index 99% rename from advent11.hs rename to adventofcode16/app/advent11.hs index 33bfe3c..0286d77 100644 --- a/advent11.hs +++ b/adventofcode16/app/advent11.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Data.List (subsequences, (\\), sort, sortBy) import Data.Ord (comparing) diff --git a/advent11a.hs b/adventofcode16/app/advent11a.hs similarity index 99% rename from advent11a.hs rename to adventofcode16/app/advent11a.hs index 6eb5156..c5349c8 100644 --- a/advent11a.hs +++ b/adventofcode16/app/advent11a.hs @@ -4,6 +4,8 @@ -- This version is A* search, using a list for the agenda. +module Main(main) where + import Data.List (subsequences, (\\), sort, sortOn, nub, findIndices) import Data.Ord (comparing) import Data.Char (isDigit) diff --git a/advent11h.hs b/adventofcode16/app/advent11h.hs similarity index 99% rename from advent11h.hs rename to adventofcode16/app/advent11h.hs index ae6e566..d362ee8 100644 --- a/advent11h.hs +++ b/adventofcode16/app/advent11h.hs @@ -3,7 +3,8 @@ -- plus my extension of represening the pairs as an integer. -- This version is hillclimbing search, using a list for the agenda. - +module Main(main) where + import Data.List (subsequences, (\\), sort, sortOn, nub, findIndices) import Data.Ord (comparing) import Data.Char (isDigit) diff --git a/advent11p.hs b/adventofcode16/app/advent11p.hs similarity index 99% rename from advent11p.hs rename to adventofcode16/app/advent11p.hs index cdcf030..4136e8f 100644 --- a/advent11p.hs +++ b/adventofcode16/app/advent11p.hs @@ -4,6 +4,8 @@ -- This version is A* search, using a priority queue for the agenda. +module Main(main) where + import Data.List (subsequences, (\\), sort, sortOn, nub, findIndices) import Data.Ord (comparing) import Data.Char (isDigit) diff --git a/advent12.hs b/adventofcode16/app/advent12.hs similarity index 96% rename from advent12.hs rename to adventofcode16/app/advent12.hs index 21ed32d..906c185 100644 --- a/advent12.hs +++ b/adventofcode16/app/advent12.hs @@ -1,6 +1,7 @@ +module Main(main) where + import Text.Parsec hiding (State) import Text.ParserCombinators.Parsec.Number -import Control.Applicative ((<$), (<*), (*>), (<*>), liftA) import Data.List (partition, union, intersect, tails) import Data.Char (isDigit) import Control.Monad.State.Lazy @@ -25,7 +26,7 @@ emptyMachine = Machine {a=0, b=0, c=0, d=0, pc=0, instructions=[]} main :: IO () main = do - text <- readFile "advent12.txt" + text <- readFile "data/advent12.txt" let instructions = successfulParse $ parseIfile text part1 instructions part2 instructions diff --git a/advent13.hs b/adventofcode16/app/advent13.hs similarity index 99% rename from advent13.hs rename to adventofcode16/app/advent13.hs index 719bc6a..86981df 100644 --- a/advent13.hs +++ b/adventofcode16/app/advent13.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Data.List ((\\), nub, sortOn) import Data.Bits (popCount) import Data.Maybe (fromMaybe) diff --git a/advent14.hs b/adventofcode16/app/advent14.hs similarity index 97% rename from advent14.hs rename to adventofcode16/app/advent14.hs index 22491dd..c6c092e 100644 --- a/advent14.hs +++ b/adventofcode16/app/advent14.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Data.List (nub, tails, null) import Data.Hash.MD5 (md5s, Str(..)) diff --git a/advent14c.hs b/adventofcode16/app/advent14c.hs similarity index 98% rename from advent14c.hs rename to adventofcode16/app/advent14c.hs index af8a4af..ea699ed 100644 --- a/advent14c.hs +++ b/adventofcode16/app/advent14c.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Data.List (nub, tails) import Data.ByteString.Char8 (pack) import Crypto.Hash (hash, Digest, MD5) diff --git a/advent14parallel.hs b/adventofcode16/app/advent14parallel.hs similarity index 98% rename from advent14parallel.hs rename to adventofcode16/app/advent14parallel.hs index 482b5e0..b0ca781 100644 --- a/advent14parallel.hs +++ b/adventofcode16/app/advent14parallel.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Data.List (nub, tails) import Data.ByteString.Char8 (pack) import Crypto.Hash (hash, Digest, MD5) diff --git a/advent15.hs b/adventofcode16/app/advent15.hs similarity index 94% rename from advent15.hs rename to adventofcode16/app/advent15.hs index 27793c1..5970bd6 100644 --- a/advent15.hs +++ b/adventofcode16/app/advent15.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Text.Parsec import Text.ParserCombinators.Parsec.Number @@ -5,7 +7,7 @@ type Disk = (Int -> Bool) main :: IO () main = do - text <- readFile "advent15.txt" + text <- readFile "data/advent15.txt" let disks = successfulParse $ parseIfile text part1 disks part2 disks diff --git a/advent15l.hs b/adventofcode16/app/advent15l.hs similarity index 94% rename from advent15l.hs rename to adventofcode16/app/advent15l.hs index f04ab9c..67e2ac0 100644 --- a/advent15l.hs +++ b/adventofcode16/app/advent15l.hs @@ -1,9 +1,11 @@ +module Main(main) where + import Text.Parsec import Text.ParserCombinators.Parsec.Number main :: IO () main = do - text <- readFile "advent15.txt" + text <- readFile "data/advent15.txt" let disks = successfulParse $ parseIfile text part1 disks part2 disks diff --git a/advent16.hs b/adventofcode16/app/advent16.hs similarity index 81% rename from advent16.hs rename to adventofcode16/app/advent16.hs index 0c7bfbb..88b8b59 100644 --- a/advent16.hs +++ b/adventofcode16/app/advent16.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Data.List (nub) input = "11100010111110100" @@ -12,12 +14,11 @@ main = do part1 part2 - part1 :: IO () -part1 = print $ checksum $ take disk1length $ expand disk1length input +part1 = putStrLn $ checksum $ take disk1length $ expand disk1length input part2 :: IO () -part2 = print $ checksum $ take disk2length $ expand disk2length input +part2 = putStrLn $ checksum $ take disk2length $ expand disk2length input expand :: Int -> String -> String diff --git a/advent16i.hs b/adventofcode16/app/advent16i.hs similarity index 97% rename from advent16i.hs rename to adventofcode16/app/advent16i.hs index 4cf13f6..897559d 100644 --- a/advent16i.hs +++ b/adventofcode16/app/advent16i.hs @@ -1,3 +1,5 @@ +module Main(main) where + input = "11100010111110100" disk1length = 272 disk2length = 35651584 diff --git a/advent17.hs b/adventofcode16/app/advent17.hs similarity index 96% rename from advent17.hs rename to adventofcode16/app/advent17.hs index d8be772..e757def 100644 --- a/advent17.hs +++ b/adventofcode16/app/advent17.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Data.ByteString.Char8 (pack) import qualified Crypto.Hash as C @@ -16,7 +18,7 @@ main = do part2 part1 :: IO () -part1 = print $ path $ extractJust $ bfs initialAgenda +part1 = putStrLn $ path $ extractJust $ bfs initialAgenda part2 :: IO () part2 = print $ bfs2 initialAgenda 0 diff --git a/advent18.hs b/adventofcode16/app/advent18.hs similarity index 97% rename from advent18.hs rename to adventofcode16/app/advent18.hs index e7c304f..2b1462f 100644 --- a/advent18.hs +++ b/adventofcode16/app/advent18.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Data.List (tails) -- input = "..^^." diff --git a/advent18f.hs b/adventofcode16/app/advent18f.hs similarity index 98% rename from advent18f.hs rename to adventofcode16/app/advent18f.hs index a1cd59b..d1650e6 100644 --- a/advent18f.hs +++ b/adventofcode16/app/advent18f.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Data.List (tails, foldl') -- input = "..^^." diff --git a/advent19.hs b/adventofcode16/app/advent19.hs similarity index 96% rename from advent19.hs rename to adventofcode16/app/advent19.hs index a544da6..009a07c 100644 --- a/advent19.hs +++ b/adventofcode16/app/advent19.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Prelude hiding (length, take, drop) import Data.Sequence diff --git a/advent20.hs b/adventofcode16/app/advent20.hs similarity index 95% rename from advent20.hs rename to adventofcode16/app/advent20.hs index 3f43710..8830c45 100644 --- a/advent20.hs +++ b/adventofcode16/app/advent20.hs @@ -1,6 +1,7 @@ +module Main(main) where + import Text.Parsec import Text.ParserCombinators.Parsec.Number -import Control.Applicative ((<$), (<*), (*>), (<*>), liftA) import Data.List (foldl') data Interval = Interval Int Int deriving (Show, Eq) @@ -13,7 +14,7 @@ high (Interval _ h) = h main :: IO () main = do - text <- readFile "advent20.txt" + text <- readFile "data/advent20.txt" let intervals = successfulParse $ parseIfile text part1 intervals part2 intervals diff --git a/advent21.hs b/adventofcode16/app/advent21.hs similarity index 98% rename from advent21.hs rename to adventofcode16/app/advent21.hs index d51bd10..2415974 100644 --- a/advent21.hs +++ b/adventofcode16/app/advent21.hs @@ -1,3 +1,5 @@ +module Main(main) where + import Text.Parsec hiding (State) import Text.ParserCombinators.Parsec.Number import Data.Maybe (fromJust) @@ -50,7 +52,7 @@ main = do -- let ti = successfulParse $ parseIfile testInstructions -- part1 ti "abcde" -- part2 (reverse ti) "decab" - text <- readFile "advent21.txt" + text <- readFile "data/advent21.txt" let instructions = successfulParse $ parseIfile text part1 instructions initial part2 (reverse instructions) final diff --git a/adventofcode16/app/advent22.hs b/adventofcode16/app/advent22.hs new file mode 100644 index 0000000..f2e084a --- /dev/null +++ b/adventofcode16/app/advent22.hs @@ -0,0 +1,156 @@ +module Main(main) where + +import GHC.Generics (Generic) +import Text.Parsec +import Text.ParserCombinators.Parsec.Number +import Data.Maybe (catMaybes, fromJust) +import Data.List (find, delete, sort, sortOn, reverse) + +data Node = Node { x :: Int + , y :: Int + , size :: Int + , used :: Int + , available :: Int + , use_pc :: Int + } deriving (Show, Eq, Ord) + +data SearchState = SearchState { cx :: Int + , cy :: Int + , grid :: [Node] + } deriving (Show) +instance Ord SearchState where + s1 `compare` s2 = (heuristic s1) `compare` (heuristic s2) +instance Eq SearchState where + s1 == s2 = equivalentState s1 s2 + +equivalentState :: SearchState -> SearchState -> Bool +equivalentState s1 s2 = + let h1 = fromJust $ find (\n -> used n == 0) $ grid s1 + h2 = fromJust $ find (\n -> used n == 0) $ grid s2 + in + cx s1 == cx s2 && cy s1 == cy s2 && + x h1 == x h2 && y h1 == y h2 + + +testGrid = "\ +\Filesystem Size Used Avail Use%\n\ +\/dev/grid/node-x0-y0 10T 8T 2T 80%\n\ +\/dev/grid/node-x0-y1 11T 6T 5T 54%\n\ +\/dev/grid/node-x0-y2 32T 28T 4T 87%\n\ +\/dev/grid/node-x1-y0 9T 7T 2T 77%\n\ +\/dev/grid/node-x1-y1 8T 0T 8T 0%\n\ +\/dev/grid/node-x1-y2 11T 7T 4T 63%\n\ +\/dev/grid/node-x2-y0 10T 6T 4T 60%\n\ +\/dev/grid/node-x2-y1 9T 8T 1T 88%\n\ +\/dev/grid/node-x2-y2 9T 6T 3T 66%\n\ +\" + +main :: IO () +main = do + text <- readFile "data/advent22.txt" + let sizes = successfulParse $ parseFile text + part1 sizes + part2 sizes + +part1 :: [Node] -> IO () +part1 sizes = print $ length viable + where viable = [(a, b) | a <- sizes, + b <- sizes, + a /= b, + (used a) > 0, + (used a) <= (available b)] + + +part2 :: [Node] -> IO () +part2 sizes = + -- do let testSizes = successfulParse $ parseFile testGrid + -- putStrLn $ searchTraceH $ reverse $ aStar [[startSt testSizes]] [] + print (26 + 26 + 29 + 5 * 36) + + +aStar :: [[SearchState]] -> [SearchState] -> [SearchState] +aStar [] _ = [] +aStar (currentPath:agenda) closed = + if isGoal reached then currentPath + else if reached `elem` closed + then aStar agenda closed + else aStar newAgenda (reached:closed) + where + reached = head currentPath + successorPaths = map (:currentPath) $ successors reached + newAgenda = sortOn (cost) $ successorPaths ++ agenda + + +searchTrace :: [SearchState] -> String +searchTrace ss = unlines $ map (sst) ss + where sst s = "(" ++ show (cx s) ++ ", " ++ show (cy s) ++ ")" + +searchTraceH :: [SearchState] -> String +searchTraceH ss = unlines $ map (sst) ss + where sst s = "(" ++ show (cx s) ++ ", " ++ show (cy s) ++ ") :: " ++ holeS s + hole sk = fromJust $ find (\n -> used n == 0) $ grid sk + holeS sk = "(" ++ show (x $ hole sk) ++ ", " ++ show (y $ hole sk) ++ ")" + +startSt :: [Node] -> SearchState +startSt nodes = SearchState {cx = maximum xs, cy = 0, grid = nodes} + where xs = map (\n -> x n) nodes + +isGoal :: SearchState -> Bool +isGoal st = cx st == 0 && cy st == 0 + +adjacent :: Node -> Node -> Bool +adjacent n1 n2 = abs ((x n1) - (x n2)) + abs ((y n1) - (y n2)) == 1 + +-- A move of data from n1 to n2 is legal. +legal :: Node -> Node -> Bool +legal n1 n2 = adjacent n1 n2 && used n1 > 0 && used n1 <= available n2 + +heuristic :: SearchState -> Int +heuristic st = (cx st) + (cy st) + +successors :: SearchState -> [SearchState] +successors st = map (newState st current) possibleMoves + where nodes = grid st + current = fromJust $ find (\n -> (x n) == (cx st) && (y n) == (cy st)) nodes + possibleMoves = [(n1, n2) | n1 <- nodes, n2 <- nodes, legal n1 n2] + + +-- Moving data from n1 to n2 +newState :: SearchState -> Node -> (Node, Node) -> SearchState +newState st current (n1, n2) = st {cx = cx', cy = cy', grid = grid'} + where cx' = if current == n1 then x n2 else x current + cy' = if current == n1 then y n2 else y current + grid' = sort $ (n2 {used = (used n2 + used n1), available = (available n2 - used n1)}): + (n1 {used = 0, available = (size n1)}): + (delete n1 $ delete n2 (grid st)) + +cost :: [SearchState] -> Int +cost p = (heuristic $ head p) + (length p) + + + +duFile = duLine `sepEndBy` newline +-- duLine = (optionMaybe nodeL) + +duLine = (nodeL >>= return . Just) <|> (headerL >> return Nothing) + +headerL = (many (noneOf "\r\n")) + +nodeL = nodeify <$> (string "/dev/grid/node-x" *> int) + <*> (string "-y" *> int) + <*> (spaces *> int <* string "T") + <*> (spaces *> int <* string "T") + <*> (spaces *> int <* string "T") + <*> (spaces *> int <* string "%") + where nodeify x y size used available use_pc = + Node {x=x, y=y, size=size, used=used, available=available, use_pc=use_pc} + +parseFile :: String -> Either ParseError [Maybe Node] +parseFile input = parse duFile "(unknown)" input + +parseLine :: String -> Either ParseError (Maybe Node) +parseLine input = parse duLine "(unknown)" input + +successfulParse :: Either ParseError [Maybe a] -> [a] +successfulParse (Left _) = [] +successfulParse (Right a) = catMaybes a diff --git a/adventofcode16/app/advent22library.hs b/adventofcode16/app/advent22library.hs new file mode 100644 index 0000000..bad3621 --- /dev/null +++ b/adventofcode16/app/advent22library.hs @@ -0,0 +1,143 @@ +{-# LANGUAGE DeriveGeneric #-} + +module Main(main) where + +import GHC.Generics (Generic) +import Text.Parsec +import Text.ParserCombinators.Parsec.Number +import Data.Maybe (catMaybes, fromJust) +import Data.List (find, delete, sort) +import Data.Graph.AStar +import Data.Hashable +import qualified Data.HashSet + +data Node = Node { x :: Int + , y :: Int + , size :: Int + , used :: Int + , available :: Int + , use_pc :: Int + } deriving (Show, Eq, Ord, Generic) +instance Hashable Node + +data SearchState = SearchState { cx :: Int + , cy :: Int + , grid :: [Node] + } deriving (Show, Eq, Generic) +instance Hashable SearchState +instance Ord SearchState where + s1 `compare` s2 = (heuristic s1) `compare` (heuristic s2) + + +testGrid = "\ +\Filesystem Size Used Avail Use%\n\ +\/dev/grid/node-x0-y0 10T 8T 2T 80%\n\ +\/dev/grid/node-x0-y1 11T 6T 5T 54%\n\ +\/dev/grid/node-x0-y2 32T 28T 4T 87%\n\ +\/dev/grid/node-x1-y0 9T 7T 2T 77%\n\ +\/dev/grid/node-x1-y1 8T 0T 8T 0%\n\ +\/dev/grid/node-x1-y2 11T 7T 4T 63%\n\ +\/dev/grid/node-x2-y0 10T 6T 4T 60%\n\ +\/dev/grid/node-x2-y1 9T 8T 1T 88%\n\ +\/dev/grid/node-x2-y2 9T 6T 3T 66%\n\ +\" + +main :: IO () +main = do + text <- readFile "data/advent22.txt" + let sizes = successfulParse $ parseFile text + part1 sizes + part2 sizes + +part1 :: [Node] -> IO () +part1 sizes = print $ length viable + where viable = [(a, b) | a <- sizes, + b <- sizes, + a /= b, + (used a) > 0, + (used a) <= (available b)] + + +part2 :: [Node] -> IO () +part2 sizes = + -- do let testSizes = successfulParse $ parseFile testGrid + -- putStrLn $ searchTrace $ fromJust $ + -- aStar successors + -- (\_ _ -> 1) + -- heuristic + -- isGoal + -- (startSt testSizes) + putStrLn $ searchTrace $ fromJust $ + aStar successors + (\_ _ -> 1) + heuristic + isGoal + (startSt sizes) + + + +searchTrace :: [SearchState] -> String +searchTrace ss = unlines $ map (sst) ss + where sst s = "(" ++ show (cx s) ++ ", " ++ show (cy s) ++ ") :: " ++ holeS s + hole sk = fromJust $ find (\n -> used n == 0) $ grid sk + holeS sk = "(" ++ show (x $ hole sk) ++ ", " ++ show (y $ hole sk) ++ ")" + +startSt :: [Node] -> SearchState +startSt nodes = SearchState {cx = maximum xs, cy = 0, grid = nodes} + where xs = map (\n -> x n) nodes + +isGoal :: SearchState -> Bool +isGoal st = cx st == 0 && cy st == 0 + +adjacent :: Node -> Node -> Bool +adjacent n1 n2 = abs ((x n1) - (x n2)) + abs ((y n1) - (y n2)) == 1 + +-- A move of data from n1 to n2 is legal. +legal :: Node -> Node -> Bool +legal n1 n2 = adjacent n1 n2 && used n1 > 0 && used n1 <= available n2 + +heuristic :: SearchState -> Int +heuristic st = (cx st) + (cy st) + +successors :: SearchState -> Data.HashSet.HashSet SearchState +successors st = Data.HashSet.fromList $ map (newState st current) possibleMoves + where nodes = grid st + current = fromJust $ find (\n -> (x n) == (cx st) && (y n) == (cy st)) nodes + possibleMoves = [(n1, n2) | n1 <- nodes, n2 <- nodes, legal n1 n2] + + +-- Moving data from n1 to n2 +newState :: SearchState -> Node -> (Node, Node) -> SearchState +newState st current (n1, n2) = st {cx = cx', cy = cy', grid = grid'} + where cx' = if current == n1 then x n2 else x current + cy' = if current == n1 then y n2 else y current + grid' = sort $ (n2 {used = (used n2 + used n1), available = (available n2 - used n1)}): + (n1 {used = 0, available = (size n1)}): + (delete n1 $ delete n2 (grid st)) + + +duFile = duLine `sepEndBy` newline +-- duLine = (optionMaybe nodeL) + +duLine = (nodeL >>= return . Just) <|> (headerL >> return Nothing) + +headerL = (many (noneOf "\r\n")) + +nodeL = nodeify <$> (string "/dev/grid/node-x" *> int) + <*> (string "-y" *> int) + <*> (spaces *> int <* string "T") + <*> (spaces *> int <* string "T") + <*> (spaces *> int <* string "T") + <*> (spaces *> int <* string "%") + where nodeify x y size used available use_pc = + Node {x=x, y=y, size=size, used=used, available=available, use_pc=use_pc} + +parseFile :: String -> Either ParseError [Maybe Node] +parseFile input = parse duFile "(unknown)" input + +parseLine :: String -> Either ParseError (Maybe Node) +parseLine input = parse duLine "(unknown)" input + +successfulParse :: Either ParseError [Maybe a] -> [a] +successfulParse (Left _) = [] +successfulParse (Right a) = catMaybes a diff --git a/adventofcode16/app/advent22search.hs b/adventofcode16/app/advent22search.hs new file mode 100644 index 0000000..32ada24 --- /dev/null +++ b/adventofcode16/app/advent22search.hs @@ -0,0 +1,156 @@ +module Main(main) where + +import GHC.Generics (Generic) +import Text.Parsec +import Text.ParserCombinators.Parsec.Number +import Data.Maybe (catMaybes, fromJust) +import Data.List (find, delete, sort, sortOn, reverse) + +data Node = Node { x :: Int + , y :: Int + , size :: Int + , used :: Int + , available :: Int + , use_pc :: Int + } deriving (Show, Eq, Ord) + +data SearchState = SearchState { cx :: Int + , cy :: Int + , grid :: [Node] + } deriving (Show) +instance Ord SearchState where + s1 `compare` s2 = (heuristic s1) `compare` (heuristic s2) +instance Eq SearchState where + s1 == s2 = equivalentState s1 s2 + +equivalentState :: SearchState -> SearchState -> Bool +equivalentState s1 s2 = + let h1 = fromJust $ find (\n -> used n == 0) $ grid s1 + h2 = fromJust $ find (\n -> used n == 0) $ grid s2 + in + cx s1 == cx s2 && cy s1 == cy s2 && + x h1 == x h2 && y h1 == y h2 + + +testGrid = "\ +\Filesystem Size Used Avail Use%\n\ +\/dev/grid/node-x0-y0 10T 8T 2T 80%\n\ +\/dev/grid/node-x0-y1 11T 6T 5T 54%\n\ +\/dev/grid/node-x0-y2 32T 28T 4T 87%\n\ +\/dev/grid/node-x1-y0 9T 7T 2T 77%\n\ +\/dev/grid/node-x1-y1 8T 0T 8T 0%\n\ +\/dev/grid/node-x1-y2 11T 7T 4T 63%\n\ +\/dev/grid/node-x2-y0 10T 6T 4T 60%\n\ +\/dev/grid/node-x2-y1 9T 8T 1T 88%\n\ +\/dev/grid/node-x2-y2 9T 6T 3T 66%\n\ +\" + +main :: IO () +main = do + text <- readFile "data/advent22.txt" + let sizes = successfulParse $ parseFile text + part1 sizes + part2 sizes + +part1 :: [Node] -> IO () +part1 sizes = print $ length viable + where viable = [(a, b) | a <- sizes, + b <- sizes, + a /= b, + (used a) > 0, + (used a) <= (available b)] + + +part2 :: [Node] -> IO () +part2 sizes = + -- do let testSizes = successfulParse $ parseFile testGrid + -- putStrLn $ searchTraceH $ reverse $ aStar [[startSt testSizes]] [] + print $ length $ aStar [[startSt sizes]] [] + + +aStar :: [[SearchState]] -> [SearchState] -> [SearchState] +aStar [] _ = [] +aStar (currentPath:agenda) closed = + if isGoal reached then currentPath + else if reached `elem` closed + then aStar agenda closed + else aStar newAgenda (reached:closed) + where + reached = head currentPath + successorPaths = map (:currentPath) $ successors reached + newAgenda = sortOn (cost) $ successorPaths ++ agenda + + +searchTrace :: [SearchState] -> String +searchTrace ss = unlines $ map (sst) ss + where sst s = "(" ++ show (cx s) ++ ", " ++ show (cy s) ++ ")" + +searchTraceH :: [SearchState] -> String +searchTraceH ss = unlines $ map (sst) ss + where sst s = "(" ++ show (cx s) ++ ", " ++ show (cy s) ++ ") :: " ++ holeS s + hole sk = fromJust $ find (\n -> used n == 0) $ grid sk + holeS sk = "(" ++ show (x $ hole sk) ++ ", " ++ show (y $ hole sk) ++ ")" + +startSt :: [Node] -> SearchState +startSt nodes = SearchState {cx = maximum xs, cy = 0, grid = nodes} + where xs = map (\n -> x n) nodes + +isGoal :: SearchState -> Bool +isGoal st = cx st == 0 && cy st == 0 + +adjacent :: Node -> Node -> Bool +adjacent n1 n2 = abs ((x n1) - (x n2)) + abs ((y n1) - (y n2)) == 1 + +-- A move of data from n1 to n2 is legal. +legal :: Node -> Node -> Bool +legal n1 n2 = adjacent n1 n2 && used n1 > 0 && used n1 <= available n2 + +heuristic :: SearchState -> Int +heuristic st = (cx st) + (cy st) + +successors :: SearchState -> [SearchState] +successors st = map (newState st current) possibleMoves + where nodes = grid st + current = fromJust $ find (\n -> (x n) == (cx st) && (y n) == (cy st)) nodes + possibleMoves = [(n1, n2) | n1 <- nodes, n2 <- nodes, legal n1 n2] + + +-- Moving data from n1 to n2 +newState :: SearchState -> Node -> (Node, Node) -> SearchState +newState st current (n1, n2) = st {cx = cx', cy = cy', grid = grid'} + where cx' = if current == n1 then x n2 else x current + cy' = if current == n1 then y n2 else y current + grid' = sort $ (n2 {used = (used n2 + used n1), available = (available n2 - used n1)}): + (n1 {used = 0, available = (size n1)}): + (delete n1 $ delete n2 (grid st)) + +cost :: [SearchState] -> Int +cost p = (heuristic $ head p) + (length p) + + + +duFile = duLine `sepEndBy` newline +-- duLine = (optionMaybe nodeL) + +duLine = (nodeL >>= return . Just) <|> (headerL >> return Nothing) + +headerL = (many (noneOf "\r\n")) + +nodeL = nodeify <$> (string "/dev/grid/node-x" *> int) + <*> (string "-y" *> int) + <*> (spaces *> int <* string "T") + <*> (spaces *> int <* string "T") + <*> (spaces *> int <* string "T") + <*> (spaces *> int <* string "%") + where nodeify x y size used available use_pc = + Node {x=x, y=y, size=size, used=used, available=available, use_pc=use_pc} + +parseFile :: String -> Either ParseError [Maybe Node] +parseFile input = parse duFile "(unknown)" input + +parseLine :: String -> Either ParseError (Maybe Node) +parseLine input = parse duLine "(unknown)" input + +successfulParse :: Either ParseError [Maybe a] -> [a] +successfulParse (Left _) = [] +successfulParse (Right a) = catMaybes a diff --git a/adventofcode16/app/advent22showgrid.hs b/adventofcode16/app/advent22showgrid.hs new file mode 100644 index 0000000..aec4309 --- /dev/null +++ b/adventofcode16/app/advent22showgrid.hs @@ -0,0 +1,77 @@ +{-# LANGUAGE DeriveGeneric #-} + +module Main(main) where + +import GHC.Generics (Generic) +import Text.Parsec +import Text.ParserCombinators.Parsec.Number +import Data.Maybe (catMaybes, fromJust) +import Data.List (find, delete, sort, sortOn, reverse) + +data Node = Node { x :: Int + , y :: Int + , size :: Int + , used :: Int + , available :: Int + , use_pc :: Int + } deriving (Show, Eq, Ord) + + +testGrid = "\ +\Filesystem Size Used Avail Use%\n\ +\/dev/grid/node-x0-y0 10T 8T 2T 80%\n\ +\/dev/grid/node-x0-y1 11T 6T 5T 54%\n\ +\/dev/grid/node-x0-y2 32T 28T 4T 87%\n\ +\/dev/grid/node-x1-y0 9T 7T 2T 77%\n\ +\/dev/grid/node-x1-y1 8T 0T 8T 0%\n\ +\/dev/grid/node-x1-y2 11T 7T 4T 63%\n\ +\/dev/grid/node-x2-y0 10T 6T 4T 60%\n\ +\/dev/grid/node-x2-y1 9T 8T 1T 88%\n\ +\/dev/grid/node-x2-y2 9T 6T 3T 66%\n\ +\" + +main :: IO () +main = do + text <- readFile "data/advent22.txt" + let sizes = successfulParse $ parseFile text + let maxX = maximum $ map (\n -> x n) sizes + let maxY = maximum $ map (\n -> y n) sizes + putStrLn $ unlines $ map (showRow maxX sizes) [0..(maxY-1)] + + +showRow maxX sizes r = map (charOf) row + where row = sortOn (\c -> x c) $ filter (\c -> y c == r) sizes + charOf c = if (used c) == 0 + then '+' + else if (used c) > 100 + then '#' + else '_' + + + + +duFile = duLine `sepEndBy` newline +-- duLine = (optionMaybe nodeL) + +duLine = (nodeL >>= return . Just) <|> (headerL >> return Nothing) + +headerL = (many (noneOf "\r\n")) + +nodeL = nodeify <$> (string "/dev/grid/node-x" *> int) + <*> (string "-y" *> int) + <*> (spaces *> int <* string "T") + <*> (spaces *> int <* string "T") + <*> (spaces *> int <* string "T") + <*> (spaces *> int <* string "%") + where nodeify x y size used available use_pc = + Node {x=x, y=y, size=size, used=used, available=available, use_pc=use_pc} + +parseFile :: String -> Either ParseError [Maybe Node] +parseFile input = parse duFile "(unknown)" input + +parseLine :: String -> Either ParseError (Maybe Node) +parseLine input = parse duLine "(unknown)" input + +successfulParse :: Either ParseError [Maybe a] -> [a] +successfulParse (Left _) = [] +successfulParse (Right a) = catMaybes a diff --git a/advent01.txt b/adventofcode16/data/advent01.txt similarity index 100% rename from advent01.txt rename to adventofcode16/data/advent01.txt diff --git a/advent02.txt b/adventofcode16/data/advent02.txt similarity index 100% rename from advent02.txt rename to adventofcode16/data/advent02.txt diff --git a/advent03.txt b/adventofcode16/data/advent03.txt similarity index 100% rename from advent03.txt rename to adventofcode16/data/advent03.txt diff --git a/advent04.txt b/adventofcode16/data/advent04.txt similarity index 100% rename from advent04.txt rename to adventofcode16/data/advent04.txt diff --git a/advent06.txt b/adventofcode16/data/advent06.txt similarity index 100% rename from advent06.txt rename to adventofcode16/data/advent06.txt diff --git a/advent07.txt b/adventofcode16/data/advent07.txt similarity index 100% rename from advent07.txt rename to adventofcode16/data/advent07.txt diff --git a/advent08.txt b/adventofcode16/data/advent08.txt similarity index 100% rename from advent08.txt rename to adventofcode16/data/advent08.txt diff --git a/advent09.txt b/adventofcode16/data/advent09.txt similarity index 100% rename from advent09.txt rename to adventofcode16/data/advent09.txt diff --git a/advent10-test.txt b/adventofcode16/data/advent10-test.txt similarity index 100% rename from advent10-test.txt rename to adventofcode16/data/advent10-test.txt diff --git a/advent10.txt b/adventofcode16/data/advent10.txt similarity index 100% rename from advent10.txt rename to adventofcode16/data/advent10.txt diff --git a/advent12.txt b/adventofcode16/data/advent12.txt similarity index 100% rename from advent12.txt rename to adventofcode16/data/advent12.txt diff --git a/advent15.test.txt b/adventofcode16/data/advent15.test.txt similarity index 100% rename from advent15.test.txt rename to adventofcode16/data/advent15.test.txt diff --git a/advent15.txt b/adventofcode16/data/advent15.txt similarity index 100% rename from advent15.txt rename to adventofcode16/data/advent15.txt diff --git a/advent20.txt b/adventofcode16/data/advent20.txt similarity index 100% rename from advent20.txt rename to adventofcode16/data/advent20.txt diff --git a/advent21.txt b/adventofcode16/data/advent21.txt similarity index 100% rename from advent21.txt rename to adventofcode16/data/advent21.txt diff --git a/adventofcode16/data/advent22.txt b/adventofcode16/data/advent22.txt new file mode 100644 index 0000000..8821df9 --- /dev/null +++ b/adventofcode16/data/advent22.txt @@ -0,0 +1,1066 @@ +root@ebhq-gridcenter# df -h +Filesystem Size Used Avail Use% +/dev/grid/node-x0-y0 88T 66T 22T 75% +/dev/grid/node-x0-y1 85T 65T 20T 76% +/dev/grid/node-x0-y2 88T 67T 21T 76% +/dev/grid/node-x0-y3 92T 68T 24T 73% +/dev/grid/node-x0-y4 87T 64T 23T 73% +/dev/grid/node-x0-y5 90T 64T 26T 71% +/dev/grid/node-x0-y6 85T 64T 21T 75% +/dev/grid/node-x0-y7 93T 66T 27T 70% +/dev/grid/node-x0-y8 90T 69T 21T 76% +/dev/grid/node-x0-y9 88T 69T 19T 78% +/dev/grid/node-x0-y10 90T 69T 21T 76% +/dev/grid/node-x0-y11 90T 65T 25T 72% +/dev/grid/node-x0-y12 86T 73T 13T 84% +/dev/grid/node-x0-y13 92T 67T 25T 72% +/dev/grid/node-x0-y14 90T 70T 20T 77% +/dev/grid/node-x0-y15 90T 66T 24T 73% +/dev/grid/node-x0-y16 86T 66T 20T 76% +/dev/grid/node-x0-y17 87T 67T 20T 77% +/dev/grid/node-x0-y18 85T 64T 21T 75% +/dev/grid/node-x0-y19 91T 67T 24T 73% +/dev/grid/node-x0-y20 93T 73T 20T 78% +/dev/grid/node-x0-y21 91T 72T 19T 79% +/dev/grid/node-x0-y22 86T 64T 22T 74% +/dev/grid/node-x0-y23 85T 73T 12T 85% +/dev/grid/node-x0-y24 93T 65T 28T 69% +/dev/grid/node-x0-y25 89T 67T 22T 75% +/dev/grid/node-x0-y26 94T 64T 30T 68% +/dev/grid/node-x0-y27 85T 69T 16T 81% +/dev/grid/node-x1-y0 85T 68T 17T 80% +/dev/grid/node-x1-y1 93T 69T 24T 74% +/dev/grid/node-x1-y2 85T 68T 17T 80% +/dev/grid/node-x1-y3 89T 69T 20T 77% +/dev/grid/node-x1-y4 92T 70T 22T 76% +/dev/grid/node-x1-y5 92T 65T 27T 70% +/dev/grid/node-x1-y6 87T 69T 18T 79% +/dev/grid/node-x1-y7 93T 65T 28T 69% +/dev/grid/node-x1-y8 85T 69T 16T 81% +/dev/grid/node-x1-y9 88T 64T 24T 72% +/dev/grid/node-x1-y10 88T 65T 23T 73% +/dev/grid/node-x1-y11 85T 66T 19T 77% +/dev/grid/node-x1-y12 85T 69T 16T 81% +/dev/grid/node-x1-y13 90T 73T 17T 81% +/dev/grid/node-x1-y14 93T 68T 25T 73% +/dev/grid/node-x1-y15 94T 68T 26T 72% +/dev/grid/node-x1-y16 85T 67T 18T 78% +/dev/grid/node-x1-y17 87T 71T 16T 81% +/dev/grid/node-x1-y18 90T 73T 17T 81% +/dev/grid/node-x1-y19 86T 66T 20T 76% +/dev/grid/node-x1-y20 89T 71T 18T 79% +/dev/grid/node-x1-y21 94T 69T 25T 73% +/dev/grid/node-x1-y22 90T 70T 20T 77% +/dev/grid/node-x1-y23 92T 70T 22T 76% +/dev/grid/node-x1-y24 91T 70T 21T 76% +/dev/grid/node-x1-y25 94T 70T 24T 74% +/dev/grid/node-x1-y26 90T 64T 26T 71% +/dev/grid/node-x1-y27 92T 73T 19T 79% +/dev/grid/node-x2-y0 88T 72T 16T 81% +/dev/grid/node-x2-y1 88T 70T 18T 79% +/dev/grid/node-x2-y2 89T 68T 21T 76% +/dev/grid/node-x2-y3 89T 72T 17T 80% +/dev/grid/node-x2-y4 93T 66T 27T 70% +/dev/grid/node-x2-y5 92T 65T 27T 70% +/dev/grid/node-x2-y6 91T 66T 25T 72% +/dev/grid/node-x2-y7 86T 70T 16T 81% +/dev/grid/node-x2-y8 94T 66T 28T 70% +/dev/grid/node-x2-y9 88T 71T 17T 80% +/dev/grid/node-x2-y10 90T 64T 26T 71% +/dev/grid/node-x2-y11 88T 68T 20T 77% +/dev/grid/node-x2-y12 86T 70T 16T 81% +/dev/grid/node-x2-y13 90T 68T 22T 75% +/dev/grid/node-x2-y14 85T 70T 15T 82% +/dev/grid/node-x2-y15 93T 70T 23T 75% +/dev/grid/node-x2-y16 87T 73T 14T 83% +/dev/grid/node-x2-y17 92T 66T 26T 71% +/dev/grid/node-x2-y18 88T 70T 18T 79% +/dev/grid/node-x2-y19 89T 69T 20T 77% +/dev/grid/node-x2-y20 92T 64T 28T 69% +/dev/grid/node-x2-y21 85T 67T 18T 78% +/dev/grid/node-x2-y22 89T 70T 19T 78% +/dev/grid/node-x2-y23 94T 70T 24T 74% +/dev/grid/node-x2-y24 87T 72T 15T 82% +/dev/grid/node-x2-y25 91T 73T 18T 80% +/dev/grid/node-x2-y26 91T 65T 26T 71% +/dev/grid/node-x2-y27 90T 70T 20T 77% +/dev/grid/node-x3-y0 92T 72T 20T 78% +/dev/grid/node-x3-y1 91T 71T 20T 78% +/dev/grid/node-x3-y2 93T 71T 22T 76% +/dev/grid/node-x3-y3 89T 72T 17T 80% +/dev/grid/node-x3-y4 88T 68T 20T 77% +/dev/grid/node-x3-y5 92T 73T 19T 79% +/dev/grid/node-x3-y6 86T 64T 22T 74% +/dev/grid/node-x3-y7 86T 67T 19T 77% +/dev/grid/node-x3-y8 85T 73T 12T 85% +/dev/grid/node-x3-y9 86T 72T 14T 83% +/dev/grid/node-x3-y10 88T 67T 21T 76% +/dev/grid/node-x3-y11 94T 67T 27T 71% +/dev/grid/node-x3-y12 91T 66T 25T 72% +/dev/grid/node-x3-y13 85T 67T 18T 78% +/dev/grid/node-x3-y14 94T 68T 26T 72% +/dev/grid/node-x3-y15 94T 73T 21T 77% +/dev/grid/node-x3-y16 92T 71T 21T 77% +/dev/grid/node-x3-y17 92T 73T 19T 79% +/dev/grid/node-x3-y18 86T 66T 20T 76% +/dev/grid/node-x3-y19 88T 69T 19T 78% +/dev/grid/node-x3-y20 90T 73T 17T 81% +/dev/grid/node-x3-y21 87T 71T 16T 81% +/dev/grid/node-x3-y22 92T 72T 20T 78% +/dev/grid/node-x3-y23 87T 71T 16T 81% +/dev/grid/node-x3-y24 93T 66T 27T 70% +/dev/grid/node-x3-y25 94T 65T 29T 69% +/dev/grid/node-x3-y26 91T 67T 24T 73% +/dev/grid/node-x3-y27 88T 69T 19T 78% +/dev/grid/node-x4-y0 93T 68T 25T 73% +/dev/grid/node-x4-y1 93T 67T 26T 72% +/dev/grid/node-x4-y2 85T 67T 18T 78% +/dev/grid/node-x4-y3 89T 65T 24T 73% +/dev/grid/node-x4-y4 85T 73T 12T 85% +/dev/grid/node-x4-y5 86T 72T 14T 83% +/dev/grid/node-x4-y6 86T 66T 20T 76% +/dev/grid/node-x4-y7 89T 66T 23T 74% +/dev/grid/node-x4-y8 94T 73T 21T 77% +/dev/grid/node-x4-y9 89T 72T 17T 80% +/dev/grid/node-x4-y10 86T 66T 20T 76% +/dev/grid/node-x4-y11 92T 70T 22T 76% +/dev/grid/node-x4-y12 93T 69T 24T 74% +/dev/grid/node-x4-y13 85T 68T 17T 80% +/dev/grid/node-x4-y14 93T 73T 20T 78% +/dev/grid/node-x4-y15 87T 67T 20T 77% +/dev/grid/node-x4-y16 86T 66T 20T 76% +/dev/grid/node-x4-y17 90T 70T 20T 77% +/dev/grid/node-x4-y18 92T 69T 23T 75% +/dev/grid/node-x4-y19 93T 71T 22T 76% +/dev/grid/node-x4-y20 94T 66T 28T 70% +/dev/grid/node-x4-y21 88T 73T 15T 82% +/dev/grid/node-x4-y22 93T 71T 22T 76% +/dev/grid/node-x4-y23 87T 68T 19T 78% +/dev/grid/node-x4-y24 89T 70T 19T 78% +/dev/grid/node-x4-y25 87T 69T 18T 79% +/dev/grid/node-x4-y26 87T 69T 18T 79% +/dev/grid/node-x4-y27 89T 71T 18T 79% +/dev/grid/node-x5-y0 88T 66T 22T 75% +/dev/grid/node-x5-y1 91T 70T 21T 76% +/dev/grid/node-x5-y2 91T 71T 20T 78% +/dev/grid/node-x5-y3 90T 68T 22T 75% +/dev/grid/node-x5-y4 85T 72T 13T 84% +/dev/grid/node-x5-y5 89T 64T 25T 71% +/dev/grid/node-x5-y6 90T 71T 19T 78% +/dev/grid/node-x5-y7 91T 64T 27T 70% +/dev/grid/node-x5-y8 87T 71T 16T 81% +/dev/grid/node-x5-y9 89T 72T 17T 80% +/dev/grid/node-x5-y10 86T 68T 18T 79% +/dev/grid/node-x5-y11 91T 66T 25T 72% +/dev/grid/node-x5-y12 89T 69T 20T 77% +/dev/grid/node-x5-y13 85T 72T 13T 84% +/dev/grid/node-x5-y14 92T 69T 23T 75% +/dev/grid/node-x5-y15 88T 68T 20T 77% +/dev/grid/node-x5-y16 92T 72T 20T 78% +/dev/grid/node-x5-y17 93T 70T 23T 75% +/dev/grid/node-x5-y18 87T 65T 22T 74% +/dev/grid/node-x5-y19 86T 64T 22T 74% +/dev/grid/node-x5-y20 89T 68T 21T 76% +/dev/grid/node-x5-y21 89T 68T 21T 76% +/dev/grid/node-x5-y22 89T 71T 18T 79% +/dev/grid/node-x5-y23 91T 67T 24T 73% +/dev/grid/node-x5-y24 88T 64T 24T 72% +/dev/grid/node-x5-y25 92T 73T 19T 79% +/dev/grid/node-x5-y26 94T 64T 30T 68% +/dev/grid/node-x5-y27 88T 73T 15T 82% +/dev/grid/node-x6-y0 88T 64T 24T 72% +/dev/grid/node-x6-y1 87T 71T 16T 81% +/dev/grid/node-x6-y2 93T 65T 28T 69% +/dev/grid/node-x6-y3 90T 71T 19T 78% +/dev/grid/node-x6-y4 85T 68T 17T 80% +/dev/grid/node-x6-y5 93T 70T 23T 75% +/dev/grid/node-x6-y6 91T 70T 21T 76% +/dev/grid/node-x6-y7 89T 65T 24T 73% +/dev/grid/node-x6-y8 91T 65T 26T 71% +/dev/grid/node-x6-y9 92T 65T 27T 70% +/dev/grid/node-x6-y10 94T 73T 21T 77% +/dev/grid/node-x6-y11 86T 71T 15T 82% +/dev/grid/node-x6-y12 87T 68T 19T 78% +/dev/grid/node-x6-y13 93T 68T 25T 73% +/dev/grid/node-x6-y14 87T 68T 19T 78% +/dev/grid/node-x6-y15 85T 71T 14T 83% +/dev/grid/node-x6-y16 85T 70T 15T 82% +/dev/grid/node-x6-y17 85T 66T 19T 77% +/dev/grid/node-x6-y18 90T 66T 24T 73% +/dev/grid/node-x6-y19 85T 73T 12T 85% +/dev/grid/node-x6-y20 92T 73T 19T 79% +/dev/grid/node-x6-y21 90T 68T 22T 75% +/dev/grid/node-x6-y22 85T 68T 17T 80% +/dev/grid/node-x6-y23 85T 67T 18T 78% +/dev/grid/node-x6-y24 87T 65T 22T 74% +/dev/grid/node-x6-y25 85T 68T 17T 80% +/dev/grid/node-x6-y26 88T 70T 18T 79% +/dev/grid/node-x6-y27 86T 65T 21T 75% +/dev/grid/node-x7-y0 89T 66T 23T 74% +/dev/grid/node-x7-y1 92T 67T 25T 72% +/dev/grid/node-x7-y2 94T 69T 25T 73% +/dev/grid/node-x7-y3 86T 72T 14T 83% +/dev/grid/node-x7-y4 90T 68T 22T 75% +/dev/grid/node-x7-y5 87T 72T 15T 82% +/dev/grid/node-x7-y6 92T 71T 21T 77% +/dev/grid/node-x7-y7 90T 71T 19T 78% +/dev/grid/node-x7-y8 92T 70T 22T 76% +/dev/grid/node-x7-y9 85T 73T 12T 85% +/dev/grid/node-x7-y10 92T 68T 24T 73% +/dev/grid/node-x7-y11 94T 69T 25T 73% +/dev/grid/node-x7-y12 88T 71T 17T 80% +/dev/grid/node-x7-y13 87T 73T 14T 83% +/dev/grid/node-x7-y14 92T 70T 22T 76% +/dev/grid/node-x7-y15 87T 68T 19T 78% +/dev/grid/node-x7-y16 85T 65T 20T 76% +/dev/grid/node-x7-y17 93T 64T 29T 68% +/dev/grid/node-x7-y18 91T 67T 24T 73% +/dev/grid/node-x7-y19 87T 66T 21T 75% +/dev/grid/node-x7-y20 94T 72T 22T 76% +/dev/grid/node-x7-y21 85T 72T 13T 84% +/dev/grid/node-x7-y22 88T 73T 15T 82% +/dev/grid/node-x7-y23 91T 66T 25T 72% +/dev/grid/node-x7-y24 94T 70T 24T 74% +/dev/grid/node-x7-y25 85T 65T 20T 76% +/dev/grid/node-x7-y26 88T 64T 24T 72% +/dev/grid/node-x7-y27 93T 69T 24T 74% +/dev/grid/node-x8-y0 92T 65T 27T 70% +/dev/grid/node-x8-y1 89T 69T 20T 77% +/dev/grid/node-x8-y2 93T 64T 29T 68% +/dev/grid/node-x8-y3 85T 65T 20T 76% +/dev/grid/node-x8-y4 91T 69T 22T 75% +/dev/grid/node-x8-y5 85T 70T 15T 82% +/dev/grid/node-x8-y6 86T 64T 22T 74% +/dev/grid/node-x8-y7 94T 67T 27T 71% +/dev/grid/node-x8-y8 88T 68T 20T 77% +/dev/grid/node-x8-y9 94T 69T 25T 73% +/dev/grid/node-x8-y10 91T 73T 18T 80% +/dev/grid/node-x8-y11 89T 73T 16T 82% +/dev/grid/node-x8-y12 87T 68T 19T 78% +/dev/grid/node-x8-y13 89T 70T 19T 78% +/dev/grid/node-x8-y14 86T 67T 19T 77% +/dev/grid/node-x8-y15 90T 68T 22T 75% +/dev/grid/node-x8-y16 92T 72T 20T 78% +/dev/grid/node-x8-y17 89T 68T 21T 76% +/dev/grid/node-x8-y18 89T 67T 22T 75% +/dev/grid/node-x8-y19 85T 68T 17T 80% +/dev/grid/node-x8-y20 88T 64T 24T 72% +/dev/grid/node-x8-y21 90T 72T 18T 80% +/dev/grid/node-x8-y22 93T 73T 20T 78% +/dev/grid/node-x8-y23 92T 68T 24T 73% +/dev/grid/node-x8-y24 92T 66T 26T 71% +/dev/grid/node-x8-y25 93T 70T 23T 75% +/dev/grid/node-x8-y26 92T 64T 28T 69% +/dev/grid/node-x8-y27 85T 64T 21T 75% +/dev/grid/node-x9-y0 94T 71T 23T 75% +/dev/grid/node-x9-y1 91T 71T 20T 78% +/dev/grid/node-x9-y2 93T 66T 27T 70% +/dev/grid/node-x9-y3 86T 73T 13T 84% +/dev/grid/node-x9-y4 90T 69T 21T 76% +/dev/grid/node-x9-y5 85T 70T 15T 82% +/dev/grid/node-x9-y6 88T 67T 21T 76% +/dev/grid/node-x9-y7 90T 64T 26T 71% +/dev/grid/node-x9-y8 93T 66T 27T 70% +/dev/grid/node-x9-y9 90T 73T 17T 81% +/dev/grid/node-x9-y10 90T 73T 17T 81% +/dev/grid/node-x9-y11 89T 69T 20T 77% +/dev/grid/node-x9-y12 89T 69T 20T 77% +/dev/grid/node-x9-y13 93T 68T 25T 73% +/dev/grid/node-x9-y14 94T 64T 30T 68% +/dev/grid/node-x9-y15 94T 66T 28T 70% +/dev/grid/node-x9-y16 89T 71T 18T 79% +/dev/grid/node-x9-y17 89T 69T 20T 77% +/dev/grid/node-x9-y18 86T 65T 21T 75% +/dev/grid/node-x9-y19 88T 71T 17T 80% +/dev/grid/node-x9-y20 90T 72T 18T 80% +/dev/grid/node-x9-y21 91T 71T 20T 78% +/dev/grid/node-x9-y22 88T 66T 22T 75% +/dev/grid/node-x9-y23 93T 69T 24T 74% +/dev/grid/node-x9-y24 502T 496T 6T 98% +/dev/grid/node-x9-y25 89T 73T 16T 82% +/dev/grid/node-x9-y26 92T 71T 21T 77% +/dev/grid/node-x9-y27 94T 70T 24T 74% +/dev/grid/node-x10-y0 85T 73T 12T 85% +/dev/grid/node-x10-y1 92T 64T 28T 69% +/dev/grid/node-x10-y2 92T 64T 28T 69% +/dev/grid/node-x10-y3 92T 71T 21T 77% +/dev/grid/node-x10-y4 89T 71T 18T 79% +/dev/grid/node-x10-y5 87T 72T 15T 82% +/dev/grid/node-x10-y6 93T 68T 25T 73% +/dev/grid/node-x10-y7 93T 65T 28T 69% +/dev/grid/node-x10-y8 87T 67T 20T 77% +/dev/grid/node-x10-y9 90T 64T 26T 71% +/dev/grid/node-x10-y10 91T 70T 21T 76% +/dev/grid/node-x10-y11 86T 66T 20T 76% +/dev/grid/node-x10-y12 90T 71T 19T 78% +/dev/grid/node-x10-y13 86T 65T 21T 75% +/dev/grid/node-x10-y14 93T 69T 24T 74% +/dev/grid/node-x10-y15 87T 64T 23T 73% +/dev/grid/node-x10-y16 85T 68T 17T 80% +/dev/grid/node-x10-y17 89T 65T 24T 73% +/dev/grid/node-x10-y18 94T 73T 21T 77% +/dev/grid/node-x10-y19 94T 73T 21T 77% +/dev/grid/node-x10-y20 88T 68T 20T 77% +/dev/grid/node-x10-y21 93T 73T 20T 78% +/dev/grid/node-x10-y22 87T 67T 20T 77% +/dev/grid/node-x10-y23 90T 67T 23T 74% +/dev/grid/node-x10-y24 510T 491T 19T 96% +/dev/grid/node-x10-y25 90T 71T 19T 78% +/dev/grid/node-x10-y26 94T 67T 27T 71% +/dev/grid/node-x10-y27 93T 67T 26T 72% +/dev/grid/node-x11-y0 91T 64T 27T 70% +/dev/grid/node-x11-y1 91T 67T 24T 73% +/dev/grid/node-x11-y2 86T 70T 16T 81% +/dev/grid/node-x11-y3 87T 65T 22T 74% +/dev/grid/node-x11-y4 86T 66T 20T 76% +/dev/grid/node-x11-y5 85T 71T 14T 83% +/dev/grid/node-x11-y6 91T 65T 26T 71% +/dev/grid/node-x11-y7 86T 65T 21T 75% +/dev/grid/node-x11-y8 91T 71T 20T 78% +/dev/grid/node-x11-y9 94T 71T 23T 75% +/dev/grid/node-x11-y10 89T 65T 24T 73% +/dev/grid/node-x11-y11 94T 71T 23T 75% +/dev/grid/node-x11-y12 88T 64T 24T 72% +/dev/grid/node-x11-y13 85T 67T 18T 78% +/dev/grid/node-x11-y14 87T 71T 16T 81% +/dev/grid/node-x11-y15 90T 71T 19T 78% +/dev/grid/node-x11-y16 87T 73T 14T 83% +/dev/grid/node-x11-y17 89T 68T 21T 76% +/dev/grid/node-x11-y18 94T 64T 30T 68% +/dev/grid/node-x11-y19 92T 68T 24T 73% +/dev/grid/node-x11-y20 86T 67T 19T 77% +/dev/grid/node-x11-y21 91T 73T 18T 80% +/dev/grid/node-x11-y22 91T 69T 22T 75% +/dev/grid/node-x11-y23 88T 72T 16T 81% +/dev/grid/node-x11-y24 509T 493T 16T 96% +/dev/grid/node-x11-y25 93T 68T 25T 73% +/dev/grid/node-x11-y26 86T 72T 14T 83% +/dev/grid/node-x11-y27 86T 65T 21T 75% +/dev/grid/node-x12-y0 93T 65T 28T 69% +/dev/grid/node-x12-y1 93T 65T 28T 69% +/dev/grid/node-x12-y2 86T 68T 18T 79% +/dev/grid/node-x12-y3 92T 65T 27T 70% +/dev/grid/node-x12-y4 87T 65T 22T 74% +/dev/grid/node-x12-y5 93T 68T 25T 73% +/dev/grid/node-x12-y6 90T 67T 23T 74% +/dev/grid/node-x12-y7 93T 69T 24T 74% +/dev/grid/node-x12-y8 88T 72T 16T 81% +/dev/grid/node-x12-y9 90T 72T 18T 80% +/dev/grid/node-x12-y10 89T 64T 25T 71% +/dev/grid/node-x12-y11 85T 69T 16T 81% +/dev/grid/node-x12-y12 90T 69T 21T 76% +/dev/grid/node-x12-y13 94T 66T 28T 70% +/dev/grid/node-x12-y14 89T 69T 20T 77% +/dev/grid/node-x12-y15 92T 68T 24T 73% +/dev/grid/node-x12-y16 90T 73T 17T 81% +/dev/grid/node-x12-y17 85T 67T 18T 78% +/dev/grid/node-x12-y18 90T 67T 23T 74% +/dev/grid/node-x12-y19 94T 65T 29T 69% +/dev/grid/node-x12-y20 89T 68T 21T 76% +/dev/grid/node-x12-y21 88T 71T 17T 80% +/dev/grid/node-x12-y22 87T 73T 14T 83% +/dev/grid/node-x12-y23 94T 64T 30T 68% +/dev/grid/node-x12-y24 505T 499T 6T 98% +/dev/grid/node-x12-y25 86T 67T 19T 77% +/dev/grid/node-x12-y26 94T 64T 30T 68% +/dev/grid/node-x12-y27 92T 66T 26T 71% +/dev/grid/node-x13-y0 89T 65T 24T 73% +/dev/grid/node-x13-y1 92T 65T 27T 70% +/dev/grid/node-x13-y2 92T 67T 25T 72% +/dev/grid/node-x13-y3 91T 71T 20T 78% +/dev/grid/node-x13-y4 87T 66T 21T 75% +/dev/grid/node-x13-y5 92T 71T 21T 77% +/dev/grid/node-x13-y6 92T 67T 25T 72% +/dev/grid/node-x13-y7 90T 73T 17T 81% +/dev/grid/node-x13-y8 91T 67T 24T 73% +/dev/grid/node-x13-y9 90T 64T 26T 71% +/dev/grid/node-x13-y10 85T 73T 12T 85% +/dev/grid/node-x13-y11 91T 65T 26T 71% +/dev/grid/node-x13-y12 94T 65T 29T 69% +/dev/grid/node-x13-y13 94T 73T 21T 77% +/dev/grid/node-x13-y14 91T 71T 20T 78% +/dev/grid/node-x13-y15 85T 65T 20T 76% +/dev/grid/node-x13-y16 88T 68T 20T 77% +/dev/grid/node-x13-y17 94T 65T 29T 69% +/dev/grid/node-x13-y18 92T 70T 22T 76% +/dev/grid/node-x13-y19 86T 72T 14T 83% +/dev/grid/node-x13-y20 88T 71T 17T 80% +/dev/grid/node-x13-y21 94T 72T 22T 76% +/dev/grid/node-x13-y22 92T 66T 26T 71% +/dev/grid/node-x13-y23 90T 69T 21T 76% +/dev/grid/node-x13-y24 510T 492T 18T 96% +/dev/grid/node-x13-y25 94T 73T 21T 77% +/dev/grid/node-x13-y26 87T 68T 19T 78% +/dev/grid/node-x13-y27 93T 71T 22T 76% +/dev/grid/node-x14-y0 87T 73T 14T 83% +/dev/grid/node-x14-y1 86T 69T 17T 80% +/dev/grid/node-x14-y2 91T 71T 20T 78% +/dev/grid/node-x14-y3 88T 67T 21T 76% +/dev/grid/node-x14-y4 88T 70T 18T 79% +/dev/grid/node-x14-y5 92T 73T 19T 79% +/dev/grid/node-x14-y6 88T 66T 22T 75% +/dev/grid/node-x14-y7 85T 68T 17T 80% +/dev/grid/node-x14-y8 87T 70T 17T 80% +/dev/grid/node-x14-y9 88T 71T 17T 80% +/dev/grid/node-x14-y10 89T 66T 23T 74% +/dev/grid/node-x14-y11 90T 69T 21T 76% +/dev/grid/node-x14-y12 89T 71T 18T 79% +/dev/grid/node-x14-y13 89T 64T 25T 71% +/dev/grid/node-x14-y14 91T 72T 19T 79% +/dev/grid/node-x14-y15 94T 69T 25T 73% +/dev/grid/node-x14-y16 86T 73T 13T 84% +/dev/grid/node-x14-y17 88T 70T 18T 79% +/dev/grid/node-x14-y18 91T 68T 23T 74% +/dev/grid/node-x14-y19 91T 67T 24T 73% +/dev/grid/node-x14-y20 85T 65T 20T 76% +/dev/grid/node-x14-y21 85T 71T 14T 83% +/dev/grid/node-x14-y22 90T 70T 20T 77% +/dev/grid/node-x14-y23 85T 70T 15T 82% +/dev/grid/node-x14-y24 504T 494T 10T 98% +/dev/grid/node-x14-y25 94T 69T 25T 73% +/dev/grid/node-x14-y26 92T 64T 28T 69% +/dev/grid/node-x14-y27 86T 73T 13T 84% +/dev/grid/node-x15-y0 88T 72T 16T 81% +/dev/grid/node-x15-y1 91T 67T 24T 73% +/dev/grid/node-x15-y2 90T 67T 23T 74% +/dev/grid/node-x15-y3 90T 68T 22T 75% +/dev/grid/node-x15-y4 92T 70T 22T 76% +/dev/grid/node-x15-y5 89T 69T 20T 77% +/dev/grid/node-x15-y6 89T 70T 19T 78% +/dev/grid/node-x15-y7 93T 71T 22T 76% +/dev/grid/node-x15-y8 86T 64T 22T 74% +/dev/grid/node-x15-y9 91T 71T 20T 78% +/dev/grid/node-x15-y10 94T 72T 22T 76% +/dev/grid/node-x15-y11 91T 70T 21T 76% +/dev/grid/node-x15-y12 93T 71T 22T 76% +/dev/grid/node-x15-y13 94T 66T 28T 70% +/dev/grid/node-x15-y14 93T 68T 25T 73% +/dev/grid/node-x15-y15 85T 67T 18T 78% +/dev/grid/node-x15-y16 88T 64T 24T 72% +/dev/grid/node-x15-y17 94T 72T 22T 76% +/dev/grid/node-x15-y18 93T 67T 26T 72% +/dev/grid/node-x15-y19 89T 68T 21T 76% +/dev/grid/node-x15-y20 93T 71T 22T 76% +/dev/grid/node-x15-y21 90T 70T 20T 77% +/dev/grid/node-x15-y22 86T 65T 21T 75% +/dev/grid/node-x15-y23 90T 68T 22T 75% +/dev/grid/node-x15-y24 506T 494T 12T 97% +/dev/grid/node-x15-y25 91T 71T 20T 78% +/dev/grid/node-x15-y26 86T 70T 16T 81% +/dev/grid/node-x15-y27 87T 64T 23T 73% +/dev/grid/node-x16-y0 93T 64T 29T 68% +/dev/grid/node-x16-y1 91T 69T 22T 75% +/dev/grid/node-x16-y2 89T 66T 23T 74% +/dev/grid/node-x16-y3 89T 68T 21T 76% +/dev/grid/node-x16-y4 91T 65T 26T 71% +/dev/grid/node-x16-y5 85T 71T 14T 83% +/dev/grid/node-x16-y6 93T 69T 24T 74% +/dev/grid/node-x16-y7 87T 69T 18T 79% +/dev/grid/node-x16-y8 85T 72T 13T 84% +/dev/grid/node-x16-y9 92T 67T 25T 72% +/dev/grid/node-x16-y10 92T 69T 23T 75% +/dev/grid/node-x16-y11 93T 72T 21T 77% +/dev/grid/node-x16-y12 92T 73T 19T 79% +/dev/grid/node-x16-y13 88T 70T 18T 79% +/dev/grid/node-x16-y14 91T 71T 20T 78% +/dev/grid/node-x16-y15 88T 66T 22T 75% +/dev/grid/node-x16-y16 88T 70T 18T 79% +/dev/grid/node-x16-y17 88T 73T 15T 82% +/dev/grid/node-x16-y18 92T 72T 20T 78% +/dev/grid/node-x16-y19 90T 73T 17T 81% +/dev/grid/node-x16-y20 94T 73T 21T 77% +/dev/grid/node-x16-y21 86T 71T 15T 82% +/dev/grid/node-x16-y22 88T 68T 20T 77% +/dev/grid/node-x16-y23 88T 73T 15T 82% +/dev/grid/node-x16-y24 506T 496T 10T 98% +/dev/grid/node-x16-y25 85T 69T 16T 81% +/dev/grid/node-x16-y26 90T 64T 26T 71% +/dev/grid/node-x16-y27 92T 64T 28T 69% +/dev/grid/node-x17-y0 88T 73T 15T 82% +/dev/grid/node-x17-y1 87T 65T 22T 74% +/dev/grid/node-x17-y2 90T 64T 26T 71% +/dev/grid/node-x17-y3 93T 71T 22T 76% +/dev/grid/node-x17-y4 90T 64T 26T 71% +/dev/grid/node-x17-y5 87T 64T 23T 73% +/dev/grid/node-x17-y6 86T 72T 14T 83% +/dev/grid/node-x17-y7 90T 65T 25T 72% +/dev/grid/node-x17-y8 85T 71T 14T 83% +/dev/grid/node-x17-y9 93T 68T 25T 73% +/dev/grid/node-x17-y10 87T 65T 22T 74% +/dev/grid/node-x17-y11 87T 71T 16T 81% +/dev/grid/node-x17-y12 90T 73T 17T 81% +/dev/grid/node-x17-y13 92T 71T 21T 77% +/dev/grid/node-x17-y14 91T 69T 22T 75% +/dev/grid/node-x17-y15 88T 73T 15T 82% +/dev/grid/node-x17-y16 88T 73T 15T 82% +/dev/grid/node-x17-y17 88T 71T 17T 80% +/dev/grid/node-x17-y18 87T 66T 21T 75% +/dev/grid/node-x17-y19 89T 71T 18T 79% +/dev/grid/node-x17-y20 91T 72T 19T 79% +/dev/grid/node-x17-y21 93T 69T 24T 74% +/dev/grid/node-x17-y22 85T 68T 17T 80% +/dev/grid/node-x17-y23 93T 67T 26T 72% +/dev/grid/node-x17-y24 505T 494T 11T 97% +/dev/grid/node-x17-y25 88T 72T 16T 81% +/dev/grid/node-x17-y26 93T 72T 21T 77% +/dev/grid/node-x17-y27 85T 72T 13T 84% +/dev/grid/node-x18-y0 92T 70T 22T 76% +/dev/grid/node-x18-y1 89T 72T 17T 80% +/dev/grid/node-x18-y2 85T 66T 19T 77% +/dev/grid/node-x18-y3 90T 68T 22T 75% +/dev/grid/node-x18-y4 92T 69T 23T 75% +/dev/grid/node-x18-y5 91T 70T 21T 76% +/dev/grid/node-x18-y6 87T 68T 19T 78% +/dev/grid/node-x18-y7 93T 66T 27T 70% +/dev/grid/node-x18-y8 87T 64T 23T 73% +/dev/grid/node-x18-y9 89T 72T 17T 80% +/dev/grid/node-x18-y10 86T 69T 17T 80% +/dev/grid/node-x18-y11 90T 73T 17T 81% +/dev/grid/node-x18-y12 92T 72T 20T 78% +/dev/grid/node-x18-y13 90T 70T 20T 77% +/dev/grid/node-x18-y14 87T 72T 15T 82% +/dev/grid/node-x18-y15 89T 70T 19T 78% +/dev/grid/node-x18-y16 90T 73T 17T 81% +/dev/grid/node-x18-y17 92T 66T 26T 71% +/dev/grid/node-x18-y18 87T 73T 14T 83% +/dev/grid/node-x18-y19 90T 70T 20T 77% +/dev/grid/node-x18-y20 94T 66T 28T 70% +/dev/grid/node-x18-y21 88T 73T 15T 82% +/dev/grid/node-x18-y22 87T 72T 15T 82% +/dev/grid/node-x18-y23 85T 65T 20T 76% +/dev/grid/node-x18-y24 504T 498T 6T 98% +/dev/grid/node-x18-y25 89T 70T 19T 78% +/dev/grid/node-x18-y26 86T 69T 17T 80% +/dev/grid/node-x18-y27 94T 70T 24T 74% +/dev/grid/node-x19-y0 89T 69T 20T 77% +/dev/grid/node-x19-y1 90T 72T 18T 80% +/dev/grid/node-x19-y2 91T 68T 23T 74% +/dev/grid/node-x19-y3 85T 64T 21T 75% +/dev/grid/node-x19-y4 92T 66T 26T 71% +/dev/grid/node-x19-y5 89T 65T 24T 73% +/dev/grid/node-x19-y6 85T 64T 21T 75% +/dev/grid/node-x19-y7 87T 66T 21T 75% +/dev/grid/node-x19-y8 90T 65T 25T 72% +/dev/grid/node-x19-y9 86T 73T 13T 84% +/dev/grid/node-x19-y10 91T 73T 18T 80% +/dev/grid/node-x19-y11 91T 64T 27T 70% +/dev/grid/node-x19-y12 91T 69T 22T 75% +/dev/grid/node-x19-y13 93T 71T 22T 76% +/dev/grid/node-x19-y14 88T 67T 21T 76% +/dev/grid/node-x19-y15 85T 66T 19T 77% +/dev/grid/node-x19-y16 92T 65T 27T 70% +/dev/grid/node-x19-y17 85T 67T 18T 78% +/dev/grid/node-x19-y18 86T 72T 14T 83% +/dev/grid/node-x19-y19 90T 72T 18T 80% +/dev/grid/node-x19-y20 87T 65T 22T 74% +/dev/grid/node-x19-y21 93T 64T 29T 68% +/dev/grid/node-x19-y22 91T 73T 18T 80% +/dev/grid/node-x19-y23 93T 65T 28T 69% +/dev/grid/node-x19-y24 510T 495T 15T 97% +/dev/grid/node-x19-y25 86T 69T 17T 80% +/dev/grid/node-x19-y26 94T 68T 26T 72% +/dev/grid/node-x19-y27 86T 66T 20T 76% +/dev/grid/node-x20-y0 91T 67T 24T 73% +/dev/grid/node-x20-y1 92T 67T 25T 72% +/dev/grid/node-x20-y2 88T 64T 24T 72% +/dev/grid/node-x20-y3 93T 68T 25T 73% +/dev/grid/node-x20-y4 88T 71T 17T 80% +/dev/grid/node-x20-y5 94T 68T 26T 72% +/dev/grid/node-x20-y6 85T 68T 17T 80% +/dev/grid/node-x20-y7 89T 65T 24T 73% +/dev/grid/node-x20-y8 85T 64T 21T 75% +/dev/grid/node-x20-y9 91T 66T 25T 72% +/dev/grid/node-x20-y10 94T 64T 30T 68% +/dev/grid/node-x20-y11 87T 68T 19T 78% +/dev/grid/node-x20-y12 90T 71T 19T 78% +/dev/grid/node-x20-y13 90T 67T 23T 74% +/dev/grid/node-x20-y14 91T 64T 27T 70% +/dev/grid/node-x20-y15 85T 72T 13T 84% +/dev/grid/node-x20-y16 87T 65T 22T 74% +/dev/grid/node-x20-y17 89T 71T 18T 79% +/dev/grid/node-x20-y18 87T 66T 21T 75% +/dev/grid/node-x20-y19 88T 71T 17T 80% +/dev/grid/node-x20-y20 94T 71T 23T 75% +/dev/grid/node-x20-y21 91T 68T 23T 74% +/dev/grid/node-x20-y22 92T 71T 21T 77% +/dev/grid/node-x20-y23 88T 68T 20T 77% +/dev/grid/node-x20-y24 507T 498T 9T 98% +/dev/grid/node-x20-y25 87T 71T 16T 81% +/dev/grid/node-x20-y26 88T 69T 19T 78% +/dev/grid/node-x20-y27 87T 69T 18T 79% +/dev/grid/node-x21-y0 92T 70T 22T 76% +/dev/grid/node-x21-y1 89T 64T 25T 71% +/dev/grid/node-x21-y2 86T 67T 19T 77% +/dev/grid/node-x21-y3 88T 66T 22T 75% +/dev/grid/node-x21-y4 89T 68T 21T 76% +/dev/grid/node-x21-y5 86T 67T 19T 77% +/dev/grid/node-x21-y6 87T 68T 19T 78% +/dev/grid/node-x21-y7 89T 73T 16T 82% +/dev/grid/node-x21-y8 87T 71T 16T 81% +/dev/grid/node-x21-y9 90T 71T 19T 78% +/dev/grid/node-x21-y10 92T 69T 23T 75% +/dev/grid/node-x21-y11 92T 70T 22T 76% +/dev/grid/node-x21-y12 92T 64T 28T 69% +/dev/grid/node-x21-y13 91T 69T 22T 75% +/dev/grid/node-x21-y14 89T 64T 25T 71% +/dev/grid/node-x21-y15 92T 67T 25T 72% +/dev/grid/node-x21-y16 93T 65T 28T 69% +/dev/grid/node-x21-y17 89T 69T 20T 77% +/dev/grid/node-x21-y18 86T 73T 13T 84% +/dev/grid/node-x21-y19 93T 67T 26T 72% +/dev/grid/node-x21-y20 88T 70T 18T 79% +/dev/grid/node-x21-y21 93T 68T 25T 73% +/dev/grid/node-x21-y22 94T 64T 30T 68% +/dev/grid/node-x21-y23 90T 71T 19T 78% +/dev/grid/node-x21-y24 504T 496T 8T 98% +/dev/grid/node-x21-y25 94T 72T 22T 76% +/dev/grid/node-x21-y26 93T 70T 23T 75% +/dev/grid/node-x21-y27 88T 71T 17T 80% +/dev/grid/node-x22-y0 94T 66T 28T 70% +/dev/grid/node-x22-y1 92T 71T 21T 77% +/dev/grid/node-x22-y2 92T 66T 26T 71% +/dev/grid/node-x22-y3 93T 64T 29T 68% +/dev/grid/node-x22-y4 88T 65T 23T 73% +/dev/grid/node-x22-y5 91T 67T 24T 73% +/dev/grid/node-x22-y6 91T 67T 24T 73% +/dev/grid/node-x22-y7 85T 69T 16T 81% +/dev/grid/node-x22-y8 85T 69T 16T 81% +/dev/grid/node-x22-y9 85T 72T 13T 84% +/dev/grid/node-x22-y10 85T 69T 16T 81% +/dev/grid/node-x22-y11 87T 73T 14T 83% +/dev/grid/node-x22-y12 91T 67T 24T 73% +/dev/grid/node-x22-y13 94T 73T 21T 77% +/dev/grid/node-x22-y14 91T 73T 18T 80% +/dev/grid/node-x22-y15 86T 73T 13T 84% +/dev/grid/node-x22-y16 85T 73T 12T 85% +/dev/grid/node-x22-y17 92T 66T 26T 71% +/dev/grid/node-x22-y18 86T 67T 19T 77% +/dev/grid/node-x22-y19 88T 73T 15T 82% +/dev/grid/node-x22-y20 91T 72T 19T 79% +/dev/grid/node-x22-y21 92T 65T 27T 70% +/dev/grid/node-x22-y22 85T 65T 20T 76% +/dev/grid/node-x22-y23 93T 69T 24T 74% +/dev/grid/node-x22-y24 501T 494T 7T 98% +/dev/grid/node-x22-y25 93T 69T 24T 74% +/dev/grid/node-x22-y26 89T 72T 17T 80% +/dev/grid/node-x22-y27 94T 71T 23T 75% +/dev/grid/node-x23-y0 89T 70T 19T 78% +/dev/grid/node-x23-y1 93T 64T 29T 68% +/dev/grid/node-x23-y2 94T 65T 29T 69% +/dev/grid/node-x23-y3 86T 67T 19T 77% +/dev/grid/node-x23-y4 91T 72T 19T 79% +/dev/grid/node-x23-y5 86T 64T 22T 74% +/dev/grid/node-x23-y6 88T 69T 19T 78% +/dev/grid/node-x23-y7 88T 66T 22T 75% +/dev/grid/node-x23-y8 87T 64T 23T 73% +/dev/grid/node-x23-y9 85T 69T 16T 81% +/dev/grid/node-x23-y10 85T 68T 17T 80% +/dev/grid/node-x23-y11 92T 65T 27T 70% +/dev/grid/node-x23-y12 94T 70T 24T 74% +/dev/grid/node-x23-y13 88T 67T 21T 76% +/dev/grid/node-x23-y14 91T 67T 24T 73% +/dev/grid/node-x23-y15 91T 73T 18T 80% +/dev/grid/node-x23-y16 91T 73T 18T 80% +/dev/grid/node-x23-y17 89T 68T 21T 76% +/dev/grid/node-x23-y18 86T 73T 13T 84% +/dev/grid/node-x23-y19 87T 72T 15T 82% +/dev/grid/node-x23-y20 88T 66T 22T 75% +/dev/grid/node-x23-y21 89T 71T 18T 79% +/dev/grid/node-x23-y22 89T 66T 23T 74% +/dev/grid/node-x23-y23 92T 73T 19T 79% +/dev/grid/node-x23-y24 503T 493T 10T 98% +/dev/grid/node-x23-y25 86T 68T 18T 79% +/dev/grid/node-x23-y26 94T 68T 26T 72% +/dev/grid/node-x23-y27 92T 65T 27T 70% +/dev/grid/node-x24-y0 91T 70T 21T 76% +/dev/grid/node-x24-y1 87T 73T 14T 83% +/dev/grid/node-x24-y2 92T 66T 26T 71% +/dev/grid/node-x24-y3 86T 72T 14T 83% +/dev/grid/node-x24-y4 88T 70T 18T 79% +/dev/grid/node-x24-y5 90T 65T 25T 72% +/dev/grid/node-x24-y6 88T 67T 21T 76% +/dev/grid/node-x24-y7 86T 68T 18T 79% +/dev/grid/node-x24-y8 91T 73T 18T 80% +/dev/grid/node-x24-y9 93T 71T 22T 76% +/dev/grid/node-x24-y10 86T 69T 17T 80% +/dev/grid/node-x24-y11 93T 69T 24T 74% +/dev/grid/node-x24-y12 89T 72T 17T 80% +/dev/grid/node-x24-y13 91T 71T 20T 78% +/dev/grid/node-x24-y14 86T 71T 15T 82% +/dev/grid/node-x24-y15 87T 67T 20T 77% +/dev/grid/node-x24-y16 92T 72T 20T 78% +/dev/grid/node-x24-y17 88T 64T 24T 72% +/dev/grid/node-x24-y18 91T 67T 24T 73% +/dev/grid/node-x24-y19 93T 69T 24T 74% +/dev/grid/node-x24-y20 91T 72T 19T 79% +/dev/grid/node-x24-y21 87T 66T 21T 75% +/dev/grid/node-x24-y22 87T 72T 15T 82% +/dev/grid/node-x24-y23 94T 67T 27T 71% +/dev/grid/node-x24-y24 504T 497T 7T 98% +/dev/grid/node-x24-y25 91T 71T 20T 78% +/dev/grid/node-x24-y26 92T 65T 27T 70% +/dev/grid/node-x24-y27 85T 67T 18T 78% +/dev/grid/node-x25-y0 89T 66T 23T 74% +/dev/grid/node-x25-y1 88T 71T 17T 80% +/dev/grid/node-x25-y2 93T 72T 21T 77% +/dev/grid/node-x25-y3 92T 65T 27T 70% +/dev/grid/node-x25-y4 88T 65T 23T 73% +/dev/grid/node-x25-y5 89T 64T 25T 71% +/dev/grid/node-x25-y6 87T 73T 14T 83% +/dev/grid/node-x25-y7 88T 67T 21T 76% +/dev/grid/node-x25-y8 92T 68T 24T 73% +/dev/grid/node-x25-y9 86T 70T 16T 81% +/dev/grid/node-x25-y10 91T 68T 23T 74% +/dev/grid/node-x25-y11 90T 65T 25T 72% +/dev/grid/node-x25-y12 92T 67T 25T 72% +/dev/grid/node-x25-y13 90T 66T 24T 73% +/dev/grid/node-x25-y14 93T 66T 27T 70% +/dev/grid/node-x25-y15 86T 68T 18T 79% +/dev/grid/node-x25-y16 92T 69T 23T 75% +/dev/grid/node-x25-y17 88T 66T 22T 75% +/dev/grid/node-x25-y18 91T 73T 18T 80% +/dev/grid/node-x25-y19 86T 71T 15T 82% +/dev/grid/node-x25-y20 88T 70T 18T 79% +/dev/grid/node-x25-y21 85T 66T 19T 77% +/dev/grid/node-x25-y22 92T 64T 28T 69% +/dev/grid/node-x25-y23 87T 72T 15T 82% +/dev/grid/node-x25-y24 506T 493T 13T 97% +/dev/grid/node-x25-y25 85T 64T 21T 75% +/dev/grid/node-x25-y26 87T 64T 23T 73% +/dev/grid/node-x25-y27 88T 72T 16T 81% +/dev/grid/node-x26-y0 87T 73T 14T 83% +/dev/grid/node-x26-y1 91T 72T 19T 79% +/dev/grid/node-x26-y2 86T 66T 20T 76% +/dev/grid/node-x26-y3 86T 72T 14T 83% +/dev/grid/node-x26-y4 90T 67T 23T 74% +/dev/grid/node-x26-y5 87T 70T 17T 80% +/dev/grid/node-x26-y6 87T 64T 23T 73% +/dev/grid/node-x26-y7 90T 64T 26T 71% +/dev/grid/node-x26-y8 85T 64T 21T 75% +/dev/grid/node-x26-y9 92T 68T 24T 73% +/dev/grid/node-x26-y10 92T 65T 27T 70% +/dev/grid/node-x26-y11 88T 65T 23T 73% +/dev/grid/node-x26-y12 85T 70T 15T 82% +/dev/grid/node-x26-y13 86T 68T 18T 79% +/dev/grid/node-x26-y14 92T 70T 22T 76% +/dev/grid/node-x26-y15 89T 68T 21T 76% +/dev/grid/node-x26-y16 89T 66T 23T 74% +/dev/grid/node-x26-y17 86T 71T 15T 82% +/dev/grid/node-x26-y18 87T 68T 19T 78% +/dev/grid/node-x26-y19 88T 69T 19T 78% +/dev/grid/node-x26-y20 92T 67T 25T 72% +/dev/grid/node-x26-y21 94T 69T 25T 73% +/dev/grid/node-x26-y22 86T 68T 18T 79% +/dev/grid/node-x26-y23 85T 73T 12T 85% +/dev/grid/node-x26-y24 508T 498T 10T 98% +/dev/grid/node-x26-y25 85T 73T 12T 85% +/dev/grid/node-x26-y26 88T 69T 19T 78% +/dev/grid/node-x26-y27 89T 68T 21T 76% +/dev/grid/node-x27-y0 86T 64T 22T 74% +/dev/grid/node-x27-y1 93T 65T 28T 69% +/dev/grid/node-x27-y2 92T 71T 21T 77% +/dev/grid/node-x27-y3 87T 68T 19T 78% +/dev/grid/node-x27-y4 92T 64T 28T 69% +/dev/grid/node-x27-y5 91T 65T 26T 71% +/dev/grid/node-x27-y6 86T 64T 22T 74% +/dev/grid/node-x27-y7 90T 73T 17T 81% +/dev/grid/node-x27-y8 91T 67T 24T 73% +/dev/grid/node-x27-y9 85T 69T 16T 81% +/dev/grid/node-x27-y10 92T 64T 28T 69% +/dev/grid/node-x27-y11 93T 69T 24T 74% +/dev/grid/node-x27-y12 90T 69T 21T 76% +/dev/grid/node-x27-y13 87T 72T 15T 82% +/dev/grid/node-x27-y14 94T 70T 24T 74% +/dev/grid/node-x27-y15 91T 72T 19T 79% +/dev/grid/node-x27-y16 86T 70T 16T 81% +/dev/grid/node-x27-y17 90T 67T 23T 74% +/dev/grid/node-x27-y18 86T 73T 13T 84% +/dev/grid/node-x27-y19 92T 66T 26T 71% +/dev/grid/node-x27-y20 94T 64T 30T 68% +/dev/grid/node-x27-y21 89T 70T 19T 78% +/dev/grid/node-x27-y22 91T 73T 18T 80% +/dev/grid/node-x27-y23 89T 67T 22T 75% +/dev/grid/node-x27-y24 503T 490T 13T 97% +/dev/grid/node-x27-y25 94T 67T 27T 71% +/dev/grid/node-x27-y26 90T 68T 22T 75% +/dev/grid/node-x27-y27 87T 72T 15T 82% +/dev/grid/node-x28-y0 90T 68T 22T 75% +/dev/grid/node-x28-y1 86T 73T 13T 84% +/dev/grid/node-x28-y2 88T 73T 15T 82% +/dev/grid/node-x28-y3 93T 70T 23T 75% +/dev/grid/node-x28-y4 86T 64T 22T 74% +/dev/grid/node-x28-y5 86T 69T 17T 80% +/dev/grid/node-x28-y6 89T 71T 18T 79% +/dev/grid/node-x28-y7 94T 72T 22T 76% +/dev/grid/node-x28-y8 85T 68T 17T 80% +/dev/grid/node-x28-y9 90T 69T 21T 76% +/dev/grid/node-x28-y10 87T 73T 14T 83% +/dev/grid/node-x28-y11 86T 64T 22T 74% +/dev/grid/node-x28-y12 88T 71T 17T 80% +/dev/grid/node-x28-y13 87T 64T 23T 73% +/dev/grid/node-x28-y14 94T 71T 23T 75% +/dev/grid/node-x28-y15 85T 73T 12T 85% +/dev/grid/node-x28-y16 86T 69T 17T 80% +/dev/grid/node-x28-y17 92T 72T 20T 78% +/dev/grid/node-x28-y18 88T 71T 17T 80% +/dev/grid/node-x28-y19 85T 68T 17T 80% +/dev/grid/node-x28-y20 94T 65T 29T 69% +/dev/grid/node-x28-y21 85T 71T 14T 83% +/dev/grid/node-x28-y22 85T 67T 18T 78% +/dev/grid/node-x28-y23 94T 65T 29T 69% +/dev/grid/node-x28-y24 509T 496T 13T 97% +/dev/grid/node-x28-y25 93T 71T 22T 76% +/dev/grid/node-x28-y26 87T 72T 15T 82% +/dev/grid/node-x28-y27 90T 72T 18T 80% +/dev/grid/node-x29-y0 91T 67T 24T 73% +/dev/grid/node-x29-y1 90T 66T 24T 73% +/dev/grid/node-x29-y2 89T 71T 18T 79% +/dev/grid/node-x29-y3 87T 68T 19T 78% +/dev/grid/node-x29-y4 86T 64T 22T 74% +/dev/grid/node-x29-y5 93T 73T 20T 78% +/dev/grid/node-x29-y6 86T 65T 21T 75% +/dev/grid/node-x29-y7 94T 70T 24T 74% +/dev/grid/node-x29-y8 88T 72T 16T 81% +/dev/grid/node-x29-y9 93T 66T 27T 70% +/dev/grid/node-x29-y10 89T 65T 24T 73% +/dev/grid/node-x29-y11 89T 72T 17T 80% +/dev/grid/node-x29-y12 88T 72T 16T 81% +/dev/grid/node-x29-y13 94T 71T 23T 75% +/dev/grid/node-x29-y14 93T 65T 28T 69% +/dev/grid/node-x29-y15 89T 72T 17T 80% +/dev/grid/node-x29-y16 85T 71T 14T 83% +/dev/grid/node-x29-y17 93T 68T 25T 73% +/dev/grid/node-x29-y18 86T 66T 20T 76% +/dev/grid/node-x29-y19 90T 65T 25T 72% +/dev/grid/node-x29-y20 94T 66T 28T 70% +/dev/grid/node-x29-y21 87T 68T 19T 78% +/dev/grid/node-x29-y22 92T 70T 22T 76% +/dev/grid/node-x29-y23 92T 72T 20T 78% +/dev/grid/node-x29-y24 508T 497T 11T 97% +/dev/grid/node-x29-y25 87T 64T 23T 73% +/dev/grid/node-x29-y26 86T 68T 18T 79% +/dev/grid/node-x29-y27 87T 71T 16T 81% +/dev/grid/node-x30-y0 89T 71T 18T 79% +/dev/grid/node-x30-y1 93T 64T 29T 68% +/dev/grid/node-x30-y2 86T 73T 13T 84% +/dev/grid/node-x30-y3 89T 71T 18T 79% +/dev/grid/node-x30-y4 86T 70T 16T 81% +/dev/grid/node-x30-y5 85T 70T 15T 82% +/dev/grid/node-x30-y6 85T 72T 13T 84% +/dev/grid/node-x30-y7 94T 64T 30T 68% +/dev/grid/node-x30-y8 94T 64T 30T 68% +/dev/grid/node-x30-y9 89T 65T 24T 73% +/dev/grid/node-x30-y10 87T 71T 16T 81% +/dev/grid/node-x30-y11 93T 64T 29T 68% +/dev/grid/node-x30-y12 91T 67T 24T 73% +/dev/grid/node-x30-y13 89T 68T 21T 76% +/dev/grid/node-x30-y14 88T 67T 21T 76% +/dev/grid/node-x30-y15 85T 71T 14T 83% +/dev/grid/node-x30-y16 85T 64T 21T 75% +/dev/grid/node-x30-y17 86T 73T 13T 84% +/dev/grid/node-x30-y18 89T 65T 24T 73% +/dev/grid/node-x30-y19 92T 72T 20T 78% +/dev/grid/node-x30-y20 88T 70T 18T 79% +/dev/grid/node-x30-y21 94T 66T 28T 70% +/dev/grid/node-x30-y22 91T 68T 23T 74% +/dev/grid/node-x30-y23 90T 66T 24T 73% +/dev/grid/node-x30-y24 509T 494T 15T 97% +/dev/grid/node-x30-y25 86T 72T 14T 83% +/dev/grid/node-x30-y26 90T 65T 25T 72% +/dev/grid/node-x30-y27 85T 69T 16T 81% +/dev/grid/node-x31-y0 88T 64T 24T 72% +/dev/grid/node-x31-y1 92T 70T 22T 76% +/dev/grid/node-x31-y2 90T 69T 21T 76% +/dev/grid/node-x31-y3 87T 70T 17T 80% +/dev/grid/node-x31-y4 92T 72T 20T 78% +/dev/grid/node-x31-y5 94T 72T 22T 76% +/dev/grid/node-x31-y6 91T 68T 23T 74% +/dev/grid/node-x31-y7 90T 69T 21T 76% +/dev/grid/node-x31-y8 91T 64T 27T 70% +/dev/grid/node-x31-y9 87T 68T 19T 78% +/dev/grid/node-x31-y10 87T 69T 18T 79% +/dev/grid/node-x31-y11 90T 68T 22T 75% +/dev/grid/node-x31-y12 92T 70T 22T 76% +/dev/grid/node-x31-y13 93T 64T 29T 68% +/dev/grid/node-x31-y14 91T 66T 25T 72% +/dev/grid/node-x31-y15 87T 64T 23T 73% +/dev/grid/node-x31-y16 94T 69T 25T 73% +/dev/grid/node-x31-y17 89T 70T 19T 78% +/dev/grid/node-x31-y18 91T 69T 22T 75% +/dev/grid/node-x31-y19 85T 69T 16T 81% +/dev/grid/node-x31-y20 86T 67T 19T 77% +/dev/grid/node-x31-y21 93T 69T 24T 74% +/dev/grid/node-x31-y22 93T 64T 29T 68% +/dev/grid/node-x31-y23 87T 73T 14T 83% +/dev/grid/node-x31-y24 510T 494T 16T 96% +/dev/grid/node-x31-y25 90T 68T 22T 75% +/dev/grid/node-x31-y26 89T 73T 16T 82% +/dev/grid/node-x31-y27 91T 65T 26T 71% +/dev/grid/node-x32-y0 93T 70T 23T 75% +/dev/grid/node-x32-y1 90T 71T 19T 78% +/dev/grid/node-x32-y2 87T 71T 16T 81% +/dev/grid/node-x32-y3 94T 64T 30T 68% +/dev/grid/node-x32-y4 90T 64T 26T 71% +/dev/grid/node-x32-y5 90T 67T 23T 74% +/dev/grid/node-x32-y6 90T 70T 20T 77% +/dev/grid/node-x32-y7 94T 64T 30T 68% +/dev/grid/node-x32-y8 91T 67T 24T 73% +/dev/grid/node-x32-y9 89T 64T 25T 71% +/dev/grid/node-x32-y10 88T 70T 18T 79% +/dev/grid/node-x32-y11 85T 68T 17T 80% +/dev/grid/node-x32-y12 85T 68T 17T 80% +/dev/grid/node-x32-y13 86T 68T 18T 79% +/dev/grid/node-x32-y14 87T 71T 16T 81% +/dev/grid/node-x32-y15 85T 70T 15T 82% +/dev/grid/node-x32-y16 92T 71T 21T 77% +/dev/grid/node-x32-y17 88T 71T 17T 80% +/dev/grid/node-x32-y18 93T 71T 22T 76% +/dev/grid/node-x32-y19 89T 67T 22T 75% +/dev/grid/node-x32-y20 85T 68T 17T 80% +/dev/grid/node-x32-y21 86T 65T 21T 75% +/dev/grid/node-x32-y22 91T 70T 21T 76% +/dev/grid/node-x32-y23 87T 72T 15T 82% +/dev/grid/node-x32-y24 506T 490T 16T 96% +/dev/grid/node-x32-y25 94T 68T 26T 72% +/dev/grid/node-x32-y26 86T 65T 21T 75% +/dev/grid/node-x32-y27 91T 70T 21T 76% +/dev/grid/node-x33-y0 90T 72T 18T 80% +/dev/grid/node-x33-y1 90T 70T 20T 77% +/dev/grid/node-x33-y2 94T 69T 25T 73% +/dev/grid/node-x33-y3 86T 67T 19T 77% +/dev/grid/node-x33-y4 88T 66T 22T 75% +/dev/grid/node-x33-y5 91T 67T 24T 73% +/dev/grid/node-x33-y6 94T 65T 29T 69% +/dev/grid/node-x33-y7 89T 67T 22T 75% +/dev/grid/node-x33-y8 87T 72T 15T 82% +/dev/grid/node-x33-y9 93T 68T 25T 73% +/dev/grid/node-x33-y10 91T 71T 20T 78% +/dev/grid/node-x33-y11 87T 69T 18T 79% +/dev/grid/node-x33-y12 88T 65T 23T 73% +/dev/grid/node-x33-y13 86T 64T 22T 74% +/dev/grid/node-x33-y14 92T 67T 25T 72% +/dev/grid/node-x33-y15 94T 67T 27T 71% +/dev/grid/node-x33-y16 85T 73T 12T 85% +/dev/grid/node-x33-y17 92T 64T 28T 69% +/dev/grid/node-x33-y18 87T 65T 22T 74% +/dev/grid/node-x33-y19 87T 68T 19T 78% +/dev/grid/node-x33-y20 89T 73T 16T 82% +/dev/grid/node-x33-y21 87T 65T 22T 74% +/dev/grid/node-x33-y22 92T 71T 21T 77% +/dev/grid/node-x33-y23 89T 67T 22T 75% +/dev/grid/node-x33-y24 505T 497T 8T 98% +/dev/grid/node-x33-y25 91T 64T 27T 70% +/dev/grid/node-x33-y26 88T 67T 21T 76% +/dev/grid/node-x33-y27 93T 68T 25T 73% +/dev/grid/node-x34-y0 88T 66T 22T 75% +/dev/grid/node-x34-y1 94T 69T 25T 73% +/dev/grid/node-x34-y2 89T 66T 23T 74% +/dev/grid/node-x34-y3 90T 64T 26T 71% +/dev/grid/node-x34-y4 86T 73T 13T 84% +/dev/grid/node-x34-y5 93T 67T 26T 72% +/dev/grid/node-x34-y6 86T 73T 13T 84% +/dev/grid/node-x34-y7 85T 70T 15T 82% +/dev/grid/node-x34-y8 92T 70T 22T 76% +/dev/grid/node-x34-y9 89T 67T 22T 75% +/dev/grid/node-x34-y10 86T 68T 18T 79% +/dev/grid/node-x34-y11 91T 65T 26T 71% +/dev/grid/node-x34-y12 94T 72T 22T 76% +/dev/grid/node-x34-y13 91T 70T 21T 76% +/dev/grid/node-x34-y14 91T 72T 19T 79% +/dev/grid/node-x34-y15 91T 64T 27T 70% +/dev/grid/node-x34-y16 89T 67T 22T 75% +/dev/grid/node-x34-y17 92T 67T 25T 72% +/dev/grid/node-x34-y18 89T 69T 20T 77% +/dev/grid/node-x34-y19 87T 66T 21T 75% +/dev/grid/node-x34-y20 94T 71T 23T 75% +/dev/grid/node-x34-y21 86T 71T 15T 82% +/dev/grid/node-x34-y22 89T 72T 17T 80% +/dev/grid/node-x34-y23 87T 73T 14T 83% +/dev/grid/node-x34-y24 509T 494T 15T 97% +/dev/grid/node-x34-y25 88T 69T 19T 78% +/dev/grid/node-x34-y26 87T 0T 87T 0% +/dev/grid/node-x34-y27 90T 67T 23T 74% +/dev/grid/node-x35-y0 94T 69T 25T 73% +/dev/grid/node-x35-y1 90T 71T 19T 78% +/dev/grid/node-x35-y2 93T 72T 21T 77% +/dev/grid/node-x35-y3 85T 64T 21T 75% +/dev/grid/node-x35-y4 91T 69T 22T 75% +/dev/grid/node-x35-y5 94T 73T 21T 77% +/dev/grid/node-x35-y6 88T 65T 23T 73% +/dev/grid/node-x35-y7 91T 67T 24T 73% +/dev/grid/node-x35-y8 90T 66T 24T 73% +/dev/grid/node-x35-y9 94T 70T 24T 74% +/dev/grid/node-x35-y10 92T 68T 24T 73% +/dev/grid/node-x35-y11 90T 64T 26T 71% +/dev/grid/node-x35-y12 92T 68T 24T 73% +/dev/grid/node-x35-y13 94T 64T 30T 68% +/dev/grid/node-x35-y14 94T 68T 26T 72% +/dev/grid/node-x35-y15 94T 68T 26T 72% +/dev/grid/node-x35-y16 94T 70T 24T 74% +/dev/grid/node-x35-y17 93T 68T 25T 73% +/dev/grid/node-x35-y18 88T 70T 18T 79% +/dev/grid/node-x35-y19 89T 66T 23T 74% +/dev/grid/node-x35-y20 85T 73T 12T 85% +/dev/grid/node-x35-y21 89T 72T 17T 80% +/dev/grid/node-x35-y22 86T 72T 14T 83% +/dev/grid/node-x35-y23 89T 71T 18T 79% +/dev/grid/node-x35-y24 510T 498T 12T 97% +/dev/grid/node-x35-y25 93T 69T 24T 74% +/dev/grid/node-x35-y26 86T 71T 15T 82% +/dev/grid/node-x35-y27 89T 64T 25T 71% +/dev/grid/node-x36-y0 87T 64T 23T 73% +/dev/grid/node-x36-y1 91T 69T 22T 75% +/dev/grid/node-x36-y2 87T 68T 19T 78% +/dev/grid/node-x36-y3 90T 65T 25T 72% +/dev/grid/node-x36-y4 90T 65T 25T 72% +/dev/grid/node-x36-y5 87T 68T 19T 78% +/dev/grid/node-x36-y6 94T 70T 24T 74% +/dev/grid/node-x36-y7 94T 68T 26T 72% +/dev/grid/node-x36-y8 90T 69T 21T 76% +/dev/grid/node-x36-y9 88T 67T 21T 76% +/dev/grid/node-x36-y10 93T 64T 29T 68% +/dev/grid/node-x36-y11 89T 71T 18T 79% +/dev/grid/node-x36-y12 88T 65T 23T 73% +/dev/grid/node-x36-y13 89T 73T 16T 82% +/dev/grid/node-x36-y14 86T 70T 16T 81% +/dev/grid/node-x36-y15 87T 64T 23T 73% +/dev/grid/node-x36-y16 86T 71T 15T 82% +/dev/grid/node-x36-y17 85T 71T 14T 83% +/dev/grid/node-x36-y18 90T 72T 18T 80% +/dev/grid/node-x36-y19 92T 68T 24T 73% +/dev/grid/node-x36-y20 91T 66T 25T 72% +/dev/grid/node-x36-y21 87T 67T 20T 77% +/dev/grid/node-x36-y22 85T 66T 19T 77% +/dev/grid/node-x36-y23 86T 67T 19T 77% +/dev/grid/node-x36-y24 502T 499T 3T 99% +/dev/grid/node-x36-y25 94T 70T 24T 74% +/dev/grid/node-x36-y26 85T 72T 13T 84% +/dev/grid/node-x36-y27 87T 68T 19T 78% +/dev/grid/node-x37-y0 93T 70T 23T 75% +/dev/grid/node-x37-y1 92T 72T 20T 78% +/dev/grid/node-x37-y2 89T 73T 16T 82% +/dev/grid/node-x37-y3 94T 70T 24T 74% +/dev/grid/node-x37-y4 92T 66T 26T 71% +/dev/grid/node-x37-y5 91T 64T 27T 70% +/dev/grid/node-x37-y6 87T 64T 23T 73% +/dev/grid/node-x37-y7 90T 72T 18T 80% +/dev/grid/node-x37-y8 91T 66T 25T 72% +/dev/grid/node-x37-y9 94T 65T 29T 69% +/dev/grid/node-x37-y10 85T 70T 15T 82% +/dev/grid/node-x37-y11 89T 69T 20T 77% +/dev/grid/node-x37-y12 93T 71T 22T 76% +/dev/grid/node-x37-y13 88T 67T 21T 76% +/dev/grid/node-x37-y14 94T 67T 27T 71% +/dev/grid/node-x37-y15 86T 73T 13T 84% +/dev/grid/node-x37-y16 85T 68T 17T 80% +/dev/grid/node-x37-y17 89T 72T 17T 80% +/dev/grid/node-x37-y18 88T 67T 21T 76% +/dev/grid/node-x37-y19 87T 66T 21T 75% +/dev/grid/node-x37-y20 88T 69T 19T 78% +/dev/grid/node-x37-y21 86T 70T 16T 81% +/dev/grid/node-x37-y22 92T 68T 24T 73% +/dev/grid/node-x37-y23 87T 70T 17T 80% +/dev/grid/node-x37-y24 502T 498T 4T 99% +/dev/grid/node-x37-y25 87T 72T 15T 82% +/dev/grid/node-x37-y26 90T 64T 26T 71% +/dev/grid/node-x37-y27 90T 70T 20T 77% diff --git a/adventofcode16/src/Lib.hs b/adventofcode16/src/Lib.hs new file mode 100644 index 0000000..d36ff27 --- /dev/null +++ b/adventofcode16/src/Lib.hs @@ -0,0 +1,6 @@ +module Lib + ( someFunc + ) where + +someFunc :: IO () +someFunc = putStrLn "someFunc" diff --git a/adventofcode16/stack.yaml b/adventofcode16/stack.yaml new file mode 100644 index 0000000..b77fb38 --- /dev/null +++ b/adventofcode16/stack.yaml @@ -0,0 +1,10 @@ +flags: {} +extra-package-dbs: [] +packages: +- '.' +system-ghc: true +extra-deps: +- astar-0.3.0.0 +- parsec-numbers-0.1.0 +- pqueue-1.3.2 +resolver: lts-6.25 diff --git a/adventofcode16/test/Spec.hs b/adventofcode16/test/Spec.hs new file mode 100644 index 0000000..cd4753f --- /dev/null +++ b/adventofcode16/test/Spec.hs @@ -0,0 +1,2 @@ +main :: IO () +main = putStrLn "Test suite not yet implemented" diff --git a/day22.html b/day22.html new file mode 100644 index 0000000..3a820ab --- /dev/null +++ b/day22.html @@ -0,0 +1,208 @@ + + + + +Day 22 - Advent of Code 2016 + + + + + + +

Advent of Code

Neil Smith (AoC++) 44*

 {'year':2016}

+ + + +
+

--- Day 22: Grid Computing ---

You gain access to a massive storage cluster arranged in a grid; each storage node is only connected to the four nodes directly adjacent to it (three if the node is on an edge, two if it's in a corner).

+

You can directly access data only on node /dev/grid/node-x0-y0, but you can perform some limited actions on the other nodes:

+
    +
  • You can get the disk usage of all nodes (via df). The result of doing this is in your puzzle input.
  • +
  • You can instruct a node to move (not copy) all of its data to an adjacent node (if the destination node has enough space to receive the data). The sending node is left empty after this operation.
  • +
+

Nodes are named by their position: the node named node-x10-y10 is adjacent to nodes node-x9-y10, node-x11-y10, node-x10-y9, and node-x10-y11.

+

Before you begin, you need to understand the arrangement of data on these nodes. Even though you can only move data between directly connected nodes, you're going to need to rearrange a lot of the data to get access to the data you need. Therefore, you need to work out how you might be able to shift data around.

+

To do this, you'd like to count the number of viable pairs of nodes. A viable pair is any two nodes (A,B), regardless of whether they are directly connected, such that:

+
    +
  • Node A is not empty (its Used is not zero).
  • +
  • Nodes A and B are not the same node.
  • +
  • The data on node A (its Used) would fit on node B (its Avail).
  • +
+

How many viable pairs of nodes are there?

+
+

Your puzzle answer was 1034.

--- Part Two ---

Now that you have a better understanding of the grid, it's time to get to work.

+

Your goal is to gain access to the data which begins in the node with y=0 and the highest x (that is, the node in the top-right corner).

+

For example, suppose you have the following grid:

+
Filesystem            Size  Used  Avail  Use%
+/dev/grid/node-x0-y0   10T    8T     2T   80%
+/dev/grid/node-x0-y1   11T    6T     5T   54%
+/dev/grid/node-x0-y2   32T   28T     4T   87%
+/dev/grid/node-x1-y0    9T    7T     2T   77%
+/dev/grid/node-x1-y1    8T    0T     8T    0%
+/dev/grid/node-x1-y2   11T    7T     4T   63%
+/dev/grid/node-x2-y0   10T    6T     4T   60%
+/dev/grid/node-x2-y1    9T    8T     1T   88%
+/dev/grid/node-x2-y2    9T    6T     3T   66%
+
+

In this example, you have a storage grid 3 nodes wide and 3 nodes tall. The node you can access directly, node-x0-y0, is almost full. The node containing the data you want to access, node-x2-y0 (because it has y=0 and the highest x value), contains 6 terabytes of data - enough to fit on your node, if only you could make enough space to move it there.

+

Fortunately, node-x1-y1 looks like it has enough free space to enable you to move some of this data around. In fact, it seems like all of the nodes have enough space to hold any node's data (except node-x0-y2, which is much larger, very full, and not moving any time soon). So, initially, the grid's capacities and connections look like this:

+
( 8T/10T) --  7T/ 9T -- [ 6T/10T]
+    |           |           |
+  6T/11T  --  0T/ 8T --   8T/ 9T
+    |           |           |
+ 28T/32T  --  7T/11T --   6T/ 9T
+
+

The node you can access directly is in parentheses; the data you want starts in the node marked by square brackets.

+

In this example, most of the nodes are interchangable: they're full enough that no other node's data would fit, but small enough that their data could be moved around. Let's draw these nodes as .. The exceptions are the empty node, which we'll draw as _, and the very large, very full node, which we'll draw as #. Let's also draw the goal data as G. Then, it looks like this:

+
(.) .  G
+ .  _  .
+ #  .  .
+
+

The goal is to move the data in the top right, G, to the node in parentheses. To do this, we can issue some commands to the grid and rearrange the data:

+
    +
  • Move data from node-y0-x1 to node-y1-x1, leaving node node-y0-x1 empty:

    (.) _  G
    + .  .  .
    + #  .  .
    +
    +
  • Move the goal data from node-y0-x2 to node-y0-x1:

    (.) G  _
    + .  .  .
    + #  .  .
    +
    +
  • At this point, we're quite close. However, we have no deletion command, so we have to move some more data around. So, next, we move the data from node-y1-x2 to node-y0-x2:

    (.) G  .
    + .  .  _
    + #  .  .
    +
    +
  • Move the data from node-y1-x1 to node-y1-x2:

    (.) G  .
    + .  _  .
    + #  .  .
    +
    +
  • Move the data from node-y1-x0 to node-y1-x1:

    (.) G  .
    + _  .  .
    + #  .  .
    +
    +
  • Next, we can free up space on our node by moving the data from node-y0-x0 to node-y1-x0:

    (_) G  .
    + .  .  .
    + #  .  .
    +
    +
  • +
  • Finally, we can access the goal data by moving the it from node-y0-x1 to node-y0-x0:

    (G) _  .
    + .  .  .
    + #  .  .
    +
    +
  • +
+

So, after 7 steps, we've accessed the data we want. Unfortunately, each of these moves takes time, and we need to be efficient:

+

What is the fewest number of steps required to move your goal data to node-x0-y0?

+
+

Your puzzle answer was 261.

Both parts of this puzzle are complete! They provide two gold stars: **

+

At this point, you should return to your advent calendar and try another puzzle.

+

If you still want to see it, you can get your puzzle input.

+

You can also this puzzle.

+
+ + + + + + \ No newline at end of file -- 2.34.1