diff --git a/day16p1/Makefile b/day16p1/Makefile new file mode 100644 index 0000000..c711967 --- /dev/null +++ b/day16p1/Makefile @@ -0,0 +1,12 @@ +CFLAGS := -Wall -Wextra -std=c17 -D_GNU_SOURCE + +LIBS := glib-2.0 +CFLAGS += $(shell pkg-config --cflags $(LIBS)) +LDLIBS := $(shell pkg-config --libs $(LIBS)) + +.PHONY: all +all: main + +.PHONY: clean +clean: + rm -f main diff --git a/day16p1/input b/day16p1/input new file mode 100644 index 0000000..88aab0a --- /dev/null +++ b/day16p1/input @@ -0,0 +1,4148 @@ +Before: [1, 1, 0, 1] +0 1 0 1 +After: [1, 1, 0, 1] + +Before: [2, 2, 2, 1] +2 1 2 2 +After: [2, 2, 1, 1] + +Before: [1, 3, 2, 2] +1 2 2 0 +After: [4, 3, 2, 2] + +Before: [2, 2, 1, 1] +8 0 2 1 +After: [2, 3, 1, 1] + +Before: [0, 1, 2, 2] +7 3 1 1 +After: [0, 3, 2, 2] + +Before: [1, 2, 2, 0] +8 2 0 1 +After: [1, 3, 2, 0] + +Before: [2, 2, 2, 0] +2 1 2 0 +After: [1, 2, 2, 0] + +Before: [0, 1, 1, 1] +3 1 0 1 +After: [0, 1, 1, 1] + +Before: [2, 3, 2, 2] +15 1 2 2 +After: [2, 3, 6, 2] + +Before: [0, 3, 1, 1] +9 0 0 3 +After: [0, 3, 1, 0] + +Before: [2, 0, 1, 1] +4 2 3 2 +After: [2, 0, 0, 1] + +Before: [1, 1, 3, 3] +6 0 3 3 +After: [1, 1, 3, 0] + +Before: [3, 2, 3, 2] +11 1 3 3 +After: [3, 2, 3, 1] + +Before: [3, 2, 1, 2] +14 3 3 1 +After: [3, 6, 1, 2] + +Before: [1, 0, 1, 2] +10 1 0 1 +After: [1, 1, 1, 2] + +Before: [1, 2, 0, 2] +11 1 3 2 +After: [1, 2, 1, 2] + +Before: [3, 3, 0, 0] +14 0 3 2 +After: [3, 3, 9, 0] + +Before: [2, 0, 2, 3] +6 0 3 1 +After: [2, 0, 2, 3] + +Before: [3, 2, 2, 2] +11 1 3 1 +After: [3, 1, 2, 2] + +Before: [2, 2, 0, 2] +13 1 2 1 +After: [2, 4, 0, 2] + +Before: [2, 2, 2, 0] +8 3 1 3 +After: [2, 2, 2, 2] + +Before: [2, 3, 1, 3] +6 0 3 2 +After: [2, 3, 0, 3] + +Before: [3, 3, 1, 1] +14 1 3 1 +After: [3, 9, 1, 1] + +Before: [2, 2, 1, 3] +6 0 3 2 +After: [2, 2, 0, 3] + +Before: [2, 3, 2, 3] +15 3 3 0 +After: [9, 3, 2, 3] + +Before: [1, 0, 0, 3] +10 1 0 1 +After: [1, 1, 0, 3] + +Before: [1, 3, 1, 3] +15 1 3 3 +After: [1, 3, 1, 9] + +Before: [1, 1, 2, 3] +15 1 2 3 +After: [1, 1, 2, 2] + +Before: [1, 1, 3, 0] +0 1 0 0 +After: [1, 1, 3, 0] + +Before: [1, 2, 3, 2] +13 3 2 2 +After: [1, 2, 4, 2] + +Before: [0, 1, 1, 2] +9 0 0 0 +After: [0, 1, 1, 2] + +Before: [2, 2, 0, 0] +12 1 1 3 +After: [2, 2, 0, 1] + +Before: [1, 0, 2, 3] +6 0 3 2 +After: [1, 0, 0, 3] + +Before: [1, 1, 0, 3] +6 0 3 3 +After: [1, 1, 0, 0] + +Before: [0, 2, 0, 0] +9 0 0 2 +After: [0, 2, 0, 0] + +Before: [0, 2, 2, 3] +5 0 3 0 +After: [3, 2, 2, 3] + +Before: [1, 0, 2, 1] +5 1 2 3 +After: [1, 0, 2, 2] + +Before: [1, 1, 3, 3] +0 1 0 2 +After: [1, 1, 1, 3] + +Before: [2, 0, 3, 1] +12 2 3 0 +After: [0, 0, 3, 1] + +Before: [0, 3, 2, 0] +5 0 2 0 +After: [2, 3, 2, 0] + +Before: [2, 1, 2, 2] +1 2 2 0 +After: [4, 1, 2, 2] + +Before: [1, 2, 1, 3] +6 0 3 2 +After: [1, 2, 0, 3] + +Before: [0, 2, 3, 1] +14 1 3 2 +After: [0, 2, 6, 1] + +Before: [1, 3, 3, 3] +5 0 3 2 +After: [1, 3, 3, 3] + +Before: [3, 1, 0, 3] +14 3 2 3 +After: [3, 1, 0, 6] + +Before: [2, 0, 3, 3] +12 3 2 0 +After: [1, 0, 3, 3] + +Before: [1, 2, 1, 2] +11 1 3 3 +After: [1, 2, 1, 1] + +Before: [2, 1, 2, 1] +1 0 2 1 +After: [2, 4, 2, 1] + +Before: [0, 1, 1, 0] +3 1 0 1 +After: [0, 1, 1, 0] + +Before: [0, 2, 3, 0] +9 0 0 2 +After: [0, 2, 0, 0] + +Before: [3, 1, 2, 3] +15 2 3 3 +After: [3, 1, 2, 6] + +Before: [0, 1, 0, 0] +3 1 0 0 +After: [1, 1, 0, 0] + +Before: [0, 0, 1, 2] +5 2 3 2 +After: [0, 0, 3, 2] + +Before: [0, 2, 2, 2] +8 0 3 1 +After: [0, 2, 2, 2] + +Before: [1, 2, 0, 3] +15 0 1 0 +After: [2, 2, 0, 3] + +Before: [2, 1, 0, 3] +6 0 3 2 +After: [2, 1, 0, 3] + +Before: [0, 2, 3, 2] +11 1 3 1 +After: [0, 1, 3, 2] + +Before: [1, 1, 2, 1] +0 1 0 1 +After: [1, 1, 2, 1] + +Before: [2, 2, 2, 0] +12 1 1 1 +After: [2, 1, 2, 0] + +Before: [3, 1, 2, 2] +1 2 2 2 +After: [3, 1, 4, 2] + +Before: [0, 1, 3, 0] +3 1 0 3 +After: [0, 1, 3, 1] + +Before: [3, 0, 2, 0] +1 2 2 2 +After: [3, 0, 4, 0] + +Before: [2, 3, 3, 2] +15 1 3 2 +After: [2, 3, 6, 2] + +Before: [3, 0, 2, 0] +1 2 2 0 +After: [4, 0, 2, 0] + +Before: [3, 2, 3, 2] +12 1 1 0 +After: [1, 2, 3, 2] + +Before: [2, 3, 3, 2] +13 0 2 0 +After: [4, 3, 3, 2] + +Before: [1, 0, 2, 2] +10 1 0 0 +After: [1, 0, 2, 2] + +Before: [2, 0, 0, 0] +8 1 0 1 +After: [2, 2, 0, 0] + +Before: [0, 2, 2, 1] +12 2 1 0 +After: [1, 2, 2, 1] + +Before: [0, 3, 2, 1] +9 0 0 3 +After: [0, 3, 2, 0] + +Before: [2, 2, 2, 1] +1 0 2 1 +After: [2, 4, 2, 1] + +Before: [0, 1, 2, 3] +3 1 0 2 +After: [0, 1, 1, 3] + +Before: [1, 1, 0, 2] +0 1 0 0 +After: [1, 1, 0, 2] + +Before: [3, 2, 1, 2] +11 1 3 0 +After: [1, 2, 1, 2] + +Before: [3, 1, 3, 3] +8 1 0 0 +After: [3, 1, 3, 3] + +Before: [3, 1, 2, 3] +15 0 2 2 +After: [3, 1, 6, 3] + +Before: [0, 2, 2, 1] +2 1 2 3 +After: [0, 2, 2, 1] + +Before: [1, 1, 0, 2] +0 1 0 3 +After: [1, 1, 0, 1] + +Before: [2, 2, 3, 2] +11 1 3 0 +After: [1, 2, 3, 2] + +Before: [1, 1, 3, 1] +0 1 0 2 +After: [1, 1, 1, 1] + +Before: [1, 2, 3, 0] +8 3 1 0 +After: [2, 2, 3, 0] + +Before: [1, 0, 2, 3] +10 1 0 0 +After: [1, 0, 2, 3] + +Before: [1, 3, 3, 1] +12 1 2 1 +After: [1, 1, 3, 1] + +Before: [0, 1, 2, 2] +3 1 0 0 +After: [1, 1, 2, 2] + +Before: [2, 2, 2, 3] +6 0 3 2 +After: [2, 2, 0, 3] + +Before: [3, 2, 3, 0] +13 1 2 0 +After: [4, 2, 3, 0] + +Before: [0, 1, 0, 1] +9 0 0 2 +After: [0, 1, 0, 1] + +Before: [2, 3, 3, 2] +13 3 2 1 +After: [2, 4, 3, 2] + +Before: [2, 2, 1, 3] +4 1 2 2 +After: [2, 2, 1, 3] + +Before: [1, 3, 0, 1] +8 0 1 2 +After: [1, 3, 3, 1] + +Before: [0, 1, 2, 0] +3 1 0 1 +After: [0, 1, 2, 0] + +Before: [0, 2, 0, 2] +11 1 3 1 +After: [0, 1, 0, 2] + +Before: [3, 2, 3, 1] +14 2 3 3 +After: [3, 2, 3, 9] + +Before: [0, 1, 1, 3] +3 1 0 0 +After: [1, 1, 1, 3] + +Before: [2, 2, 2, 1] +2 1 2 0 +After: [1, 2, 2, 1] + +Before: [0, 2, 1, 2] +4 3 3 3 +After: [0, 2, 1, 0] + +Before: [0, 1, 1, 2] +7 3 1 3 +After: [0, 1, 1, 3] + +Before: [1, 0, 1, 0] +10 1 0 0 +After: [1, 0, 1, 0] + +Before: [3, 2, 2, 1] +12 1 1 3 +After: [3, 2, 2, 1] + +Before: [0, 1, 0, 0] +9 0 0 2 +After: [0, 1, 0, 0] + +Before: [2, 2, 2, 1] +2 1 2 1 +After: [2, 1, 2, 1] + +Before: [1, 3, 0, 3] +2 1 3 0 +After: [1, 3, 0, 3] + +Before: [1, 1, 2, 2] +0 1 0 2 +After: [1, 1, 1, 2] + +Before: [0, 2, 0, 2] +11 1 3 3 +After: [0, 2, 0, 1] + +Before: [0, 2, 3, 2] +11 1 3 0 +After: [1, 2, 3, 2] + +Before: [2, 3, 2, 1] +7 3 2 0 +After: [3, 3, 2, 1] + +Before: [2, 1, 1, 3] +14 3 2 0 +After: [6, 1, 1, 3] + +Before: [1, 1, 3, 2] +0 1 0 0 +After: [1, 1, 3, 2] + +Before: [2, 2, 2, 3] +1 0 2 2 +After: [2, 2, 4, 3] + +Before: [1, 1, 0, 3] +0 1 0 3 +After: [1, 1, 0, 1] + +Before: [1, 0, 3, 0] +10 1 0 2 +After: [1, 0, 1, 0] + +Before: [0, 2, 0, 2] +11 1 3 2 +After: [0, 2, 1, 2] + +Before: [1, 3, 2, 1] +7 3 2 0 +After: [3, 3, 2, 1] + +Before: [2, 2, 1, 0] +14 0 3 2 +After: [2, 2, 6, 0] + +Before: [0, 1, 0, 0] +5 0 1 3 +After: [0, 1, 0, 1] + +Before: [0, 2, 2, 3] +15 2 3 0 +After: [6, 2, 2, 3] + +Before: [3, 3, 0, 3] +15 0 3 0 +After: [9, 3, 0, 3] + +Before: [0, 3, 3, 0] +14 2 3 0 +After: [9, 3, 3, 0] + +Before: [0, 1, 1, 2] +7 3 1 2 +After: [0, 1, 3, 2] + +Before: [1, 3, 1, 3] +2 1 3 0 +After: [1, 3, 1, 3] + +Before: [1, 0, 3, 3] +10 1 0 2 +After: [1, 0, 1, 3] + +Before: [0, 1, 3, 2] +3 1 0 3 +After: [0, 1, 3, 1] + +Before: [0, 1, 3, 1] +3 1 0 2 +After: [0, 1, 1, 1] + +Before: [1, 1, 2, 0] +0 1 0 1 +After: [1, 1, 2, 0] + +Before: [0, 3, 0, 2] +15 1 3 3 +After: [0, 3, 0, 6] + +Before: [0, 2, 1, 1] +4 1 2 2 +After: [0, 2, 1, 1] + +Before: [0, 2, 2, 1] +4 3 3 0 +After: [0, 2, 2, 1] + +Before: [1, 2, 1, 2] +8 1 0 1 +After: [1, 3, 1, 2] + +Before: [1, 2, 2, 0] +15 0 2 1 +After: [1, 2, 2, 0] + +Before: [2, 2, 3, 1] +4 3 3 1 +After: [2, 0, 3, 1] + +Before: [1, 2, 1, 0] +8 3 1 3 +After: [1, 2, 1, 2] + +Before: [3, 0, 2, 2] +8 1 0 2 +After: [3, 0, 3, 2] + +Before: [0, 0, 2, 0] +9 0 0 2 +After: [0, 0, 0, 0] + +Before: [1, 2, 2, 3] +4 1 0 2 +After: [1, 2, 1, 3] + +Before: [2, 1, 2, 2] +1 3 2 1 +After: [2, 4, 2, 2] + +Before: [2, 3, 0, 3] +2 1 3 1 +After: [2, 1, 0, 3] + +Before: [1, 2, 0, 2] +11 1 3 1 +After: [1, 1, 0, 2] + +Before: [3, 1, 0, 2] +7 3 1 1 +After: [3, 3, 0, 2] + +Before: [0, 2, 2, 3] +1 1 2 3 +After: [0, 2, 2, 4] + +Before: [1, 2, 3, 3] +6 0 3 0 +After: [0, 2, 3, 3] + +Before: [2, 0, 2, 1] +7 3 2 0 +After: [3, 0, 2, 1] + +Before: [0, 2, 2, 2] +8 0 3 2 +After: [0, 2, 2, 2] + +Before: [1, 0, 3, 1] +10 1 0 2 +After: [1, 0, 1, 1] + +Before: [0, 1, 2, 1] +4 3 3 2 +After: [0, 1, 0, 1] + +Before: [0, 2, 2, 0] +2 1 2 3 +After: [0, 2, 2, 1] + +Before: [0, 0, 2, 2] +5 1 2 0 +After: [2, 0, 2, 2] + +Before: [1, 0, 0, 3] +10 1 0 3 +After: [1, 0, 0, 1] + +Before: [1, 0, 3, 1] +10 1 0 3 +After: [1, 0, 3, 1] + +Before: [0, 0, 3, 2] +9 0 0 3 +After: [0, 0, 3, 0] + +Before: [1, 0, 1, 3] +10 1 0 2 +After: [1, 0, 1, 3] + +Before: [3, 2, 3, 2] +4 3 3 2 +After: [3, 2, 0, 2] + +Before: [0, 1, 1, 3] +3 1 0 2 +After: [0, 1, 1, 3] + +Before: [1, 2, 3, 3] +4 1 0 1 +After: [1, 1, 3, 3] + +Before: [0, 0, 0, 2] +9 0 0 1 +After: [0, 0, 0, 2] + +Before: [1, 0, 2, 1] +10 1 0 1 +After: [1, 1, 2, 1] + +Before: [1, 2, 3, 2] +5 0 3 2 +After: [1, 2, 3, 2] + +Before: [2, 2, 3, 2] +12 1 1 0 +After: [1, 2, 3, 2] + +Before: [2, 2, 2, 2] +12 2 1 2 +After: [2, 2, 1, 2] + +Before: [2, 2, 2, 3] +1 2 2 1 +After: [2, 4, 2, 3] + +Before: [3, 1, 3, 2] +7 3 1 2 +After: [3, 1, 3, 2] + +Before: [2, 2, 0, 0] +13 0 2 1 +After: [2, 4, 0, 0] + +Before: [0, 2, 1, 3] +15 1 3 1 +After: [0, 6, 1, 3] + +Before: [0, 1, 1, 2] +3 1 0 0 +After: [1, 1, 1, 2] + +Before: [2, 1, 0, 0] +8 3 0 1 +After: [2, 2, 0, 0] + +Before: [0, 1, 3, 3] +15 2 3 0 +After: [9, 1, 3, 3] + +Before: [0, 1, 1, 2] +3 1 0 1 +After: [0, 1, 1, 2] + +Before: [0, 1, 1, 1] +8 0 2 0 +After: [1, 1, 1, 1] + +Before: [1, 2, 2, 3] +12 1 1 3 +After: [1, 2, 2, 1] + +Before: [3, 3, 1, 2] +12 1 0 1 +After: [3, 1, 1, 2] + +Before: [3, 0, 0, 3] +14 3 2 2 +After: [3, 0, 6, 3] + +Before: [3, 3, 3, 1] +12 2 3 3 +After: [3, 3, 3, 0] + +Before: [2, 3, 2, 0] +14 2 3 1 +After: [2, 6, 2, 0] + +Before: [2, 3, 0, 2] +15 1 3 2 +After: [2, 3, 6, 2] + +Before: [3, 2, 3, 2] +11 1 3 1 +After: [3, 1, 3, 2] + +Before: [1, 2, 2, 1] +15 3 2 1 +After: [1, 2, 2, 1] + +Before: [1, 2, 2, 1] +5 0 2 1 +After: [1, 3, 2, 1] + +Before: [1, 2, 3, 3] +6 0 3 2 +After: [1, 2, 0, 3] + +Before: [1, 2, 2, 0] +5 0 2 2 +After: [1, 2, 3, 0] + +Before: [3, 0, 0, 2] +4 3 3 1 +After: [3, 0, 0, 2] + +Before: [1, 2, 1, 3] +8 1 0 2 +After: [1, 2, 3, 3] + +Before: [2, 0, 2, 1] +1 2 2 1 +After: [2, 4, 2, 1] + +Before: [2, 1, 2, 3] +1 2 2 3 +After: [2, 1, 2, 4] + +Before: [1, 1, 0, 1] +14 3 2 1 +After: [1, 2, 0, 1] + +Before: [1, 0, 2, 1] +1 2 2 1 +After: [1, 4, 2, 1] + +Before: [2, 2, 0, 3] +15 0 3 3 +After: [2, 2, 0, 6] + +Before: [3, 0, 2, 2] +1 3 2 0 +After: [4, 0, 2, 2] + +Before: [2, 2, 3, 2] +13 3 2 1 +After: [2, 4, 3, 2] + +Before: [1, 1, 2, 1] +0 1 0 2 +After: [1, 1, 1, 1] + +Before: [0, 2, 3, 2] +11 1 3 2 +After: [0, 2, 1, 2] + +Before: [2, 1, 1, 2] +7 3 1 0 +After: [3, 1, 1, 2] + +Before: [3, 0, 2, 0] +14 2 3 3 +After: [3, 0, 2, 6] + +Before: [2, 2, 0, 2] +14 0 3 3 +After: [2, 2, 0, 6] + +Before: [0, 0, 3, 2] +9 0 0 0 +After: [0, 0, 3, 2] + +Before: [1, 1, 3, 1] +0 1 0 1 +After: [1, 1, 3, 1] + +Before: [1, 1, 1, 1] +0 1 0 1 +After: [1, 1, 1, 1] + +Before: [1, 0, 2, 0] +10 1 0 1 +After: [1, 1, 2, 0] + +Before: [1, 1, 0, 3] +0 1 0 0 +After: [1, 1, 0, 3] + +Before: [0, 1, 0, 2] +13 3 2 1 +After: [0, 4, 0, 2] + +Before: [2, 1, 0, 0] +14 1 2 3 +After: [2, 1, 0, 2] + +Before: [3, 3, 2, 2] +4 3 3 1 +After: [3, 0, 2, 2] + +Before: [0, 2, 0, 0] +12 1 1 3 +After: [0, 2, 0, 1] + +Before: [1, 0, 2, 1] +1 2 2 2 +After: [1, 0, 4, 1] + +Before: [0, 1, 2, 1] +9 0 0 2 +After: [0, 1, 0, 1] + +Before: [1, 1, 3, 2] +0 1 0 2 +After: [1, 1, 1, 2] + +Before: [3, 0, 3, 2] +15 0 3 0 +After: [6, 0, 3, 2] + +Before: [2, 1, 2, 0] +5 3 2 0 +After: [2, 1, 2, 0] + +Before: [3, 2, 2, 2] +1 2 2 2 +After: [3, 2, 4, 2] + +Before: [1, 1, 0, 0] +0 1 0 3 +After: [1, 1, 0, 1] + +Before: [1, 2, 0, 3] +12 1 1 2 +After: [1, 2, 1, 3] + +Before: [2, 2, 2, 0] +1 0 2 1 +After: [2, 4, 2, 0] + +Before: [0, 2, 1, 3] +8 0 2 2 +After: [0, 2, 1, 3] + +Before: [3, 2, 0, 0] +14 1 3 1 +After: [3, 6, 0, 0] + +Before: [0, 2, 2, 3] +15 3 3 3 +After: [0, 2, 2, 9] + +Before: [1, 0, 3, 2] +10 1 0 0 +After: [1, 0, 3, 2] + +Before: [1, 2, 2, 0] +2 1 2 2 +After: [1, 2, 1, 0] + +Before: [0, 0, 3, 3] +9 0 0 1 +After: [0, 0, 3, 3] + +Before: [0, 1, 2, 3] +3 1 0 1 +After: [0, 1, 2, 3] + +Before: [1, 0, 1, 1] +10 1 0 3 +After: [1, 0, 1, 1] + +Before: [2, 0, 2, 3] +6 0 3 0 +After: [0, 0, 2, 3] + +Before: [0, 2, 3, 0] +13 1 2 1 +After: [0, 4, 3, 0] + +Before: [0, 1, 3, 2] +3 1 0 1 +After: [0, 1, 3, 2] + +Before: [1, 1, 0, 3] +6 0 3 0 +After: [0, 1, 0, 3] + +Before: [3, 2, 0, 1] +13 1 2 0 +After: [4, 2, 0, 1] + +Before: [2, 1, 3, 1] +5 0 1 2 +After: [2, 1, 3, 1] + +Before: [1, 1, 3, 2] +0 1 0 1 +After: [1, 1, 3, 2] + +Before: [2, 0, 0, 3] +6 0 3 0 +After: [0, 0, 0, 3] + +Before: [1, 2, 1, 0] +13 1 2 1 +After: [1, 4, 1, 0] + +Before: [2, 2, 1, 2] +11 1 3 3 +After: [2, 2, 1, 1] + +Before: [0, 1, 2, 3] +5 1 3 3 +After: [0, 1, 2, 3] + +Before: [2, 0, 3, 3] +6 0 3 2 +After: [2, 0, 0, 3] + +Before: [2, 2, 1, 0] +12 1 0 0 +After: [1, 2, 1, 0] + +Before: [2, 2, 2, 2] +11 1 3 0 +After: [1, 2, 2, 2] + +Before: [1, 1, 0, 1] +0 1 0 0 +After: [1, 1, 0, 1] + +Before: [0, 2, 2, 2] +11 1 3 0 +After: [1, 2, 2, 2] + +Before: [2, 2, 0, 2] +11 1 3 3 +After: [2, 2, 0, 1] + +Before: [2, 2, 2, 0] +2 1 2 2 +After: [2, 2, 1, 0] + +Before: [3, 1, 1, 2] +7 3 1 3 +After: [3, 1, 1, 3] + +Before: [0, 2, 1, 3] +9 0 0 0 +After: [0, 2, 1, 3] + +Before: [0, 2, 2, 2] +11 1 3 3 +After: [0, 2, 2, 1] + +Before: [3, 3, 3, 1] +7 3 2 2 +After: [3, 3, 3, 1] + +Before: [2, 0, 3, 3] +6 0 3 1 +After: [2, 0, 3, 3] + +Before: [0, 0, 2, 3] +5 1 3 1 +After: [0, 3, 2, 3] + +Before: [3, 3, 2, 0] +5 3 2 2 +After: [3, 3, 2, 0] + +Before: [3, 1, 2, 0] +14 2 3 3 +After: [3, 1, 2, 6] + +Before: [1, 1, 2, 0] +1 2 2 2 +After: [1, 1, 4, 0] + +Before: [1, 3, 1, 1] +4 2 3 1 +After: [1, 0, 1, 1] + +Before: [1, 1, 2, 3] +0 1 0 1 +After: [1, 1, 2, 3] + +Before: [3, 3, 3, 2] +15 2 3 0 +After: [6, 3, 3, 2] + +Before: [1, 1, 0, 1] +0 1 0 3 +After: [1, 1, 0, 1] + +Before: [2, 1, 1, 1] +13 0 2 1 +After: [2, 4, 1, 1] + +Before: [3, 3, 2, 1] +1 2 2 1 +After: [3, 4, 2, 1] + +Before: [0, 2, 2, 3] +2 1 2 3 +After: [0, 2, 2, 1] + +Before: [2, 0, 1, 3] +6 0 3 2 +After: [2, 0, 0, 3] + +Before: [1, 3, 3, 3] +6 0 3 2 +After: [1, 3, 0, 3] + +Before: [0, 1, 0, 2] +7 3 1 3 +After: [0, 1, 0, 3] + +Before: [0, 2, 2, 1] +12 2 1 2 +After: [0, 2, 1, 1] + +Before: [1, 3, 2, 3] +6 0 3 1 +After: [1, 0, 2, 3] + +Before: [1, 3, 1, 3] +15 1 3 2 +After: [1, 3, 9, 3] + +Before: [0, 3, 2, 2] +1 2 2 1 +After: [0, 4, 2, 2] + +Before: [3, 3, 2, 3] +2 1 3 2 +After: [3, 3, 1, 3] + +Before: [0, 0, 2, 3] +5 0 2 0 +After: [2, 0, 2, 3] + +Before: [3, 0, 2, 3] +15 2 3 0 +After: [6, 0, 2, 3] + +Before: [2, 3, 0, 3] +14 3 2 1 +After: [2, 6, 0, 3] + +Before: [2, 0, 2, 1] +1 0 2 2 +After: [2, 0, 4, 1] + +Before: [0, 1, 3, 1] +9 0 0 2 +After: [0, 1, 0, 1] + +Before: [1, 2, 2, 2] +2 1 2 3 +After: [1, 2, 2, 1] + +Before: [0, 0, 3, 1] +9 0 0 0 +After: [0, 0, 3, 1] + +Before: [0, 1, 3, 3] +3 1 0 2 +After: [0, 1, 1, 3] + +Before: [2, 1, 2, 3] +12 2 0 0 +After: [1, 1, 2, 3] + +Before: [1, 2, 3, 2] +11 1 3 2 +After: [1, 2, 1, 2] + +Before: [3, 2, 0, 2] +11 1 3 3 +After: [3, 2, 0, 1] + +Before: [2, 1, 2, 2] +12 2 0 1 +After: [2, 1, 2, 2] + +Before: [0, 1, 0, 2] +13 3 2 2 +After: [0, 1, 4, 2] + +Before: [0, 1, 1, 0] +9 0 0 3 +After: [0, 1, 1, 0] + +Before: [2, 1, 1, 3] +5 1 3 1 +After: [2, 3, 1, 3] + +Before: [0, 2, 2, 2] +1 2 2 1 +After: [0, 4, 2, 2] + +Before: [0, 1, 1, 2] +5 0 1 2 +After: [0, 1, 1, 2] + +Before: [1, 1, 1, 2] +0 1 0 1 +After: [1, 1, 1, 2] + +Before: [3, 3, 1, 2] +12 1 0 0 +After: [1, 3, 1, 2] + +Before: [3, 2, 1, 0] +14 0 3 0 +After: [9, 2, 1, 0] + +Before: [2, 2, 1, 1] +15 3 1 0 +After: [2, 2, 1, 1] + +Before: [1, 3, 2, 1] +7 3 2 2 +After: [1, 3, 3, 1] + +Before: [0, 2, 0, 0] +9 0 0 3 +After: [0, 2, 0, 0] + +Before: [1, 2, 1, 3] +4 1 0 1 +After: [1, 1, 1, 3] + +Before: [1, 1, 3, 2] +15 2 3 1 +After: [1, 6, 3, 2] + +Before: [2, 3, 3, 1] +7 3 2 0 +After: [3, 3, 3, 1] + +Before: [0, 1, 2, 2] +5 0 1 0 +After: [1, 1, 2, 2] + +Before: [3, 1, 0, 2] +7 3 1 0 +After: [3, 1, 0, 2] + +Before: [1, 3, 3, 3] +15 2 3 3 +After: [1, 3, 3, 9] + +Before: [3, 2, 2, 3] +15 3 3 1 +After: [3, 9, 2, 3] + +Before: [0, 0, 0, 2] +9 0 0 2 +After: [0, 0, 0, 2] + +Before: [2, 1, 3, 0] +5 1 2 3 +After: [2, 1, 3, 3] + +Before: [3, 0, 2, 1] +1 2 2 0 +After: [4, 0, 2, 1] + +Before: [1, 0, 2, 3] +10 1 0 3 +After: [1, 0, 2, 1] + +Before: [0, 3, 1, 2] +14 3 3 2 +After: [0, 3, 6, 2] + +Before: [0, 3, 3, 3] +2 1 3 2 +After: [0, 3, 1, 3] + +Before: [0, 2, 2, 0] +5 3 2 3 +After: [0, 2, 2, 2] + +Before: [1, 1, 2, 1] +5 2 1 0 +After: [3, 1, 2, 1] + +Before: [1, 2, 0, 2] +11 1 3 3 +After: [1, 2, 0, 1] + +Before: [3, 0, 2, 1] +7 3 2 3 +After: [3, 0, 2, 3] + +Before: [0, 2, 1, 3] +9 0 0 2 +After: [0, 2, 0, 3] + +Before: [2, 2, 2, 2] +11 1 3 3 +After: [2, 2, 2, 1] + +Before: [1, 3, 2, 3] +1 2 2 0 +After: [4, 3, 2, 3] + +Before: [1, 3, 1, 3] +2 1 3 2 +After: [1, 3, 1, 3] + +Before: [0, 1, 2, 3] +5 0 3 1 +After: [0, 3, 2, 3] + +Before: [2, 2, 1, 2] +11 1 3 1 +After: [2, 1, 1, 2] + +Before: [1, 0, 3, 1] +7 3 2 0 +After: [3, 0, 3, 1] + +Before: [1, 2, 1, 3] +6 0 3 0 +After: [0, 2, 1, 3] + +Before: [3, 2, 2, 2] +2 1 2 0 +After: [1, 2, 2, 2] + +Before: [3, 0, 0, 3] +5 1 3 0 +After: [3, 0, 0, 3] + +Before: [2, 3, 3, 3] +6 0 3 2 +After: [2, 3, 0, 3] + +Before: [1, 2, 3, 2] +11 1 3 0 +After: [1, 2, 3, 2] + +Before: [2, 3, 3, 3] +6 0 3 1 +After: [2, 0, 3, 3] + +Before: [2, 1, 0, 3] +6 0 3 0 +After: [0, 1, 0, 3] + +Before: [3, 2, 3, 1] +4 3 3 1 +After: [3, 0, 3, 1] + +Before: [1, 2, 2, 3] +1 2 2 1 +After: [1, 4, 2, 3] + +Before: [0, 2, 0, 2] +12 1 1 2 +After: [0, 2, 1, 2] + +Before: [3, 3, 1, 3] +2 1 3 3 +After: [3, 3, 1, 1] + +Before: [1, 1, 2, 2] +5 1 2 2 +After: [1, 1, 3, 2] + +Before: [0, 0, 2, 2] +5 0 2 3 +After: [0, 0, 2, 2] + +Before: [0, 1, 3, 1] +9 0 0 0 +After: [0, 1, 3, 1] + +Before: [0, 1, 0, 0] +3 1 0 1 +After: [0, 1, 0, 0] + +Before: [1, 0, 0, 1] +10 1 0 1 +After: [1, 1, 0, 1] + +Before: [1, 1, 1, 3] +0 1 0 0 +After: [1, 1, 1, 3] + +Before: [0, 2, 2, 2] +4 3 3 1 +After: [0, 0, 2, 2] + +Before: [1, 2, 1, 0] +8 2 1 0 +After: [3, 2, 1, 0] + +Before: [0, 1, 2, 1] +3 1 0 3 +After: [0, 1, 2, 1] + +Before: [1, 0, 2, 1] +10 1 0 3 +After: [1, 0, 2, 1] + +Before: [1, 1, 3, 1] +5 0 2 1 +After: [1, 3, 3, 1] + +Before: [2, 3, 2, 1] +4 3 3 2 +After: [2, 3, 0, 1] + +Before: [3, 3, 0, 3] +12 1 0 1 +After: [3, 1, 0, 3] + +Before: [3, 3, 1, 3] +8 2 0 3 +After: [3, 3, 1, 3] + +Before: [1, 3, 3, 1] +7 3 2 2 +After: [1, 3, 3, 1] + +Before: [3, 0, 3, 1] +4 3 3 0 +After: [0, 0, 3, 1] + +Before: [1, 3, 2, 3] +15 3 2 3 +After: [1, 3, 2, 6] + +Before: [3, 2, 2, 0] +2 1 2 2 +After: [3, 2, 1, 0] + +Before: [3, 1, 2, 1] +4 3 3 1 +After: [3, 0, 2, 1] + +Before: [2, 3, 1, 3] +2 1 3 3 +After: [2, 3, 1, 1] + +Before: [2, 2, 0, 3] +6 0 3 1 +After: [2, 0, 0, 3] + +Before: [2, 3, 2, 2] +1 0 2 0 +After: [4, 3, 2, 2] + +Before: [0, 1, 3, 3] +5 0 3 3 +After: [0, 1, 3, 3] + +Before: [2, 0, 3, 3] +12 3 2 2 +After: [2, 0, 1, 3] + +Before: [1, 1, 3, 2] +13 3 2 2 +After: [1, 1, 4, 2] + +Before: [1, 3, 3, 3] +2 1 3 2 +After: [1, 3, 1, 3] + +Before: [3, 2, 2, 2] +14 0 3 1 +After: [3, 9, 2, 2] + +Before: [1, 0, 3, 2] +8 1 3 2 +After: [1, 0, 2, 2] + +Before: [0, 3, 3, 3] +9 0 0 2 +After: [0, 3, 0, 3] + +Before: [3, 2, 0, 1] +4 3 3 0 +After: [0, 2, 0, 1] + +Before: [3, 0, 3, 2] +4 3 3 0 +After: [0, 0, 3, 2] + +Before: [3, 0, 3, 2] +8 1 2 1 +After: [3, 3, 3, 2] + +Before: [0, 2, 1, 1] +8 0 3 0 +After: [1, 2, 1, 1] + +Before: [2, 2, 2, 0] +1 1 2 1 +After: [2, 4, 2, 0] + +Before: [2, 2, 1, 3] +13 0 2 1 +After: [2, 4, 1, 3] + +Before: [0, 1, 3, 1] +3 1 0 0 +After: [1, 1, 3, 1] + +Before: [0, 1, 2, 2] +3 1 0 3 +After: [0, 1, 2, 1] + +Before: [1, 2, 2, 3] +6 0 3 1 +After: [1, 0, 2, 3] + +Before: [3, 2, 0, 3] +12 1 1 2 +After: [3, 2, 1, 3] + +Before: [2, 3, 1, 1] +13 0 2 0 +After: [4, 3, 1, 1] + +Before: [2, 1, 1, 0] +5 0 1 1 +After: [2, 3, 1, 0] + +Before: [3, 3, 2, 3] +15 3 2 3 +After: [3, 3, 2, 6] + +Before: [0, 1, 0, 3] +3 1 0 3 +After: [0, 1, 0, 1] + +Before: [1, 0, 3, 2] +14 2 3 1 +After: [1, 9, 3, 2] + +Before: [0, 2, 3, 1] +7 3 2 0 +After: [3, 2, 3, 1] + +Before: [2, 3, 0, 2] +14 1 2 2 +After: [2, 3, 6, 2] + +Before: [2, 2, 3, 1] +7 3 2 0 +After: [3, 2, 3, 1] + +Before: [0, 3, 3, 3] +12 3 2 2 +After: [0, 3, 1, 3] + +Before: [0, 2, 2, 2] +9 0 0 2 +After: [0, 2, 0, 2] + +Before: [0, 3, 1, 0] +8 0 1 2 +After: [0, 3, 3, 0] + +Before: [0, 3, 3, 0] +9 0 0 0 +After: [0, 3, 3, 0] + +Before: [0, 3, 0, 3] +15 3 3 1 +After: [0, 9, 0, 3] + +Before: [2, 1, 1, 3] +6 0 3 2 +After: [2, 1, 0, 3] + +Before: [2, 0, 0, 3] +15 3 3 1 +After: [2, 9, 0, 3] + +Before: [0, 1, 0, 3] +5 0 3 2 +After: [0, 1, 3, 3] + +Before: [1, 2, 2, 1] +4 1 0 0 +After: [1, 2, 2, 1] + +Before: [0, 2, 3, 2] +15 2 3 0 +After: [6, 2, 3, 2] + +Before: [0, 2, 2, 3] +9 0 0 1 +After: [0, 0, 2, 3] + +Before: [3, 3, 3, 3] +2 1 3 1 +After: [3, 1, 3, 3] + +Before: [1, 0, 2, 3] +10 1 0 1 +After: [1, 1, 2, 3] + +Before: [2, 1, 1, 3] +6 0 3 1 +After: [2, 0, 1, 3] + +Before: [0, 2, 2, 3] +1 2 2 1 +After: [0, 4, 2, 3] + +Before: [1, 1, 1, 1] +0 1 0 2 +After: [1, 1, 1, 1] + +Before: [0, 0, 2, 0] +1 2 2 1 +After: [0, 4, 2, 0] + +Before: [1, 3, 0, 2] +13 3 2 3 +After: [1, 3, 0, 4] + +Before: [1, 1, 0, 0] +0 1 0 2 +After: [1, 1, 1, 0] + +Before: [1, 1, 1, 3] +0 1 0 2 +After: [1, 1, 1, 3] + +Before: [1, 0, 3, 1] +10 1 0 0 +After: [1, 0, 3, 1] + +Before: [2, 2, 1, 2] +11 1 3 0 +After: [1, 2, 1, 2] + +Before: [0, 1, 0, 1] +9 0 0 3 +After: [0, 1, 0, 0] + +Before: [0, 2, 1, 3] +5 2 3 2 +After: [0, 2, 3, 3] + +Before: [1, 2, 2, 0] +1 1 2 3 +After: [1, 2, 2, 4] + +Before: [1, 1, 0, 1] +0 1 0 2 +After: [1, 1, 1, 1] + +Before: [0, 1, 2, 3] +3 1 0 0 +After: [1, 1, 2, 3] + +Before: [0, 0, 2, 1] +14 2 3 1 +After: [0, 6, 2, 1] + +Before: [2, 1, 2, 2] +7 3 1 3 +After: [2, 1, 2, 3] + +Before: [1, 3, 3, 2] +12 1 2 0 +After: [1, 3, 3, 2] + +Before: [3, 2, 2, 3] +1 2 2 2 +After: [3, 2, 4, 3] + +Before: [0, 3, 2, 1] +8 0 3 2 +After: [0, 3, 1, 1] + +Before: [1, 1, 0, 3] +0 1 0 2 +After: [1, 1, 1, 3] + +Before: [3, 2, 1, 2] +11 1 3 2 +After: [3, 2, 1, 2] + +Before: [0, 2, 1, 2] +11 1 3 1 +After: [0, 1, 1, 2] + +Before: [1, 2, 1, 3] +6 0 3 1 +After: [1, 0, 1, 3] + +Before: [2, 2, 2, 3] +2 1 2 2 +After: [2, 2, 1, 3] + +Before: [3, 2, 2, 1] +1 1 2 1 +After: [3, 4, 2, 1] + +Before: [1, 0, 0, 1] +10 1 0 3 +After: [1, 0, 0, 1] + +Before: [0, 1, 0, 1] +3 1 0 3 +After: [0, 1, 0, 1] + +Before: [1, 1, 1, 0] +0 1 0 3 +After: [1, 1, 1, 1] + +Before: [1, 1, 1, 2] +7 3 1 3 +After: [1, 1, 1, 3] + +Before: [3, 3, 1, 3] +2 1 3 0 +After: [1, 3, 1, 3] + +Before: [1, 0, 0, 2] +10 1 0 0 +After: [1, 0, 0, 2] + +Before: [0, 2, 1, 3] +13 1 2 3 +After: [0, 2, 1, 4] + +Before: [1, 0, 2, 0] +10 1 0 3 +After: [1, 0, 2, 1] + +Before: [2, 3, 3, 0] +13 0 2 3 +After: [2, 3, 3, 4] + +Before: [3, 1, 2, 3] +5 1 3 3 +After: [3, 1, 2, 3] + +Before: [1, 1, 1, 3] +0 1 0 1 +After: [1, 1, 1, 3] + +Before: [2, 1, 2, 1] +7 3 2 3 +After: [2, 1, 2, 3] + +Before: [1, 0, 0, 0] +10 1 0 0 +After: [1, 0, 0, 0] + +Before: [1, 1, 0, 2] +0 1 0 1 +After: [1, 1, 0, 2] + +Before: [3, 1, 2, 2] +1 2 2 0 +After: [4, 1, 2, 2] + +Before: [1, 1, 1, 2] +0 1 0 3 +After: [1, 1, 1, 1] + +Before: [1, 2, 3, 2] +11 1 3 1 +After: [1, 1, 3, 2] + +Before: [3, 0, 2, 1] +1 2 2 3 +After: [3, 0, 2, 4] + +Before: [0, 1, 0, 2] +3 1 0 1 +After: [0, 1, 0, 2] + +Before: [1, 0, 3, 3] +10 1 0 3 +After: [1, 0, 3, 1] + +Before: [1, 3, 1, 2] +5 0 3 2 +After: [1, 3, 3, 2] + +Before: [1, 0, 0, 2] +10 1 0 2 +After: [1, 0, 1, 2] + +Before: [1, 1, 1, 3] +6 0 3 3 +After: [1, 1, 1, 0] + +Before: [1, 2, 0, 2] +11 1 3 0 +After: [1, 2, 0, 2] + +Before: [1, 2, 1, 2] +11 1 3 1 +After: [1, 1, 1, 2] + +Before: [0, 0, 2, 0] +9 0 0 3 +After: [0, 0, 2, 0] + +Before: [3, 2, 2, 2] +1 3 2 2 +After: [3, 2, 4, 2] + +Before: [0, 1, 3, 2] +3 1 0 2 +After: [0, 1, 1, 2] + +Before: [2, 2, 1, 2] +11 1 3 2 +After: [2, 2, 1, 2] + +Before: [1, 3, 0, 2] +13 3 2 0 +After: [4, 3, 0, 2] + +Before: [2, 1, 2, 3] +6 0 3 2 +After: [2, 1, 0, 3] + +Before: [0, 2, 1, 2] +11 1 3 2 +After: [0, 2, 1, 2] + +Before: [2, 2, 2, 2] +2 1 2 1 +After: [2, 1, 2, 2] + +Before: [3, 0, 2, 2] +1 2 2 3 +After: [3, 0, 2, 4] + +Before: [0, 0, 3, 2] +13 3 2 0 +After: [4, 0, 3, 2] + +Before: [1, 2, 1, 1] +4 1 0 1 +After: [1, 1, 1, 1] + +Before: [1, 0, 2, 1] +10 1 0 0 +After: [1, 0, 2, 1] + +Before: [2, 0, 2, 3] +6 0 3 3 +After: [2, 0, 2, 0] + +Before: [1, 2, 3, 1] +4 3 3 3 +After: [1, 2, 3, 0] + +Before: [1, 1, 1, 2] +5 2 3 2 +After: [1, 1, 3, 2] + +Before: [1, 2, 3, 0] +14 1 3 1 +After: [1, 6, 3, 0] + +Before: [0, 0, 1, 3] +5 2 3 0 +After: [3, 0, 1, 3] + +Before: [0, 0, 0, 1] +9 0 0 0 +After: [0, 0, 0, 1] + +Before: [2, 1, 3, 1] +5 0 1 3 +After: [2, 1, 3, 3] + +Before: [2, 1, 2, 3] +6 0 3 3 +After: [2, 1, 2, 0] + +Before: [2, 3, 1, 3] +2 1 3 1 +After: [2, 1, 1, 3] + +Before: [1, 2, 1, 2] +4 3 3 3 +After: [1, 2, 1, 0] + +Before: [2, 2, 3, 2] +11 1 3 1 +After: [2, 1, 3, 2] + +Before: [2, 3, 3, 3] +13 0 2 1 +After: [2, 4, 3, 3] + +Before: [1, 3, 2, 3] +6 0 3 2 +After: [1, 3, 0, 3] + +Before: [2, 2, 1, 1] +4 1 2 0 +After: [1, 2, 1, 1] + +Before: [1, 0, 3, 3] +5 1 3 2 +After: [1, 0, 3, 3] + +Before: [3, 3, 2, 1] +7 3 2 1 +After: [3, 3, 2, 1] + +Before: [1, 0, 2, 2] +10 1 0 1 +After: [1, 1, 2, 2] + +Before: [2, 1, 1, 3] +13 0 2 0 +After: [4, 1, 1, 3] + +Before: [1, 1, 0, 0] +0 1 0 0 +After: [1, 1, 0, 0] + +Before: [2, 2, 2, 0] +2 1 2 1 +After: [2, 1, 2, 0] + +Before: [0, 1, 1, 0] +3 1 0 2 +After: [0, 1, 1, 0] + +Before: [1, 1, 2, 2] +1 3 2 3 +After: [1, 1, 2, 4] + +Before: [2, 2, 1, 2] +13 3 2 0 +After: [4, 2, 1, 2] + +Before: [0, 1, 0, 0] +9 0 0 1 +After: [0, 0, 0, 0] + +Before: [1, 3, 1, 1] +14 1 2 2 +After: [1, 3, 6, 1] + +Before: [1, 3, 0, 3] +6 0 3 1 +After: [1, 0, 0, 3] + +Before: [1, 2, 2, 2] +11 1 3 1 +After: [1, 1, 2, 2] + +Before: [1, 2, 0, 1] +12 1 1 2 +After: [1, 2, 1, 1] + +Before: [3, 3, 2, 2] +4 3 3 0 +After: [0, 3, 2, 2] + +Before: [0, 0, 0, 2] +4 3 3 3 +After: [0, 0, 0, 0] + +Before: [1, 1, 2, 0] +0 1 0 2 +After: [1, 1, 1, 0] + +Before: [3, 0, 2, 1] +7 3 2 2 +After: [3, 0, 3, 1] + +Before: [3, 1, 2, 1] +7 3 2 1 +After: [3, 3, 2, 1] + +Before: [0, 0, 2, 2] +1 3 2 2 +After: [0, 0, 4, 2] + +Before: [0, 1, 3, 1] +3 1 0 3 +After: [0, 1, 3, 1] + +Before: [1, 3, 2, 2] +14 3 3 3 +After: [1, 3, 2, 6] + +Before: [1, 3, 3, 0] +8 0 1 0 +After: [3, 3, 3, 0] + +Before: [1, 3, 2, 3] +1 2 2 1 +After: [1, 4, 2, 3] + +Before: [0, 1, 3, 2] +7 3 1 3 +After: [0, 1, 3, 3] + +Before: [3, 3, 2, 2] +15 1 2 2 +After: [3, 3, 6, 2] + +Before: [0, 3, 3, 1] +7 3 2 3 +After: [0, 3, 3, 3] + +Before: [2, 3, 3, 3] +2 1 3 1 +After: [2, 1, 3, 3] + +Before: [1, 1, 3, 1] +14 0 2 2 +After: [1, 1, 2, 1] + +Before: [2, 1, 0, 3] +8 1 0 2 +After: [2, 1, 3, 3] + +Before: [1, 2, 2, 0] +2 1 2 0 +After: [1, 2, 2, 0] + +Before: [1, 0, 0, 0] +10 1 0 2 +After: [1, 0, 1, 0] + +Before: [1, 3, 3, 3] +2 1 3 3 +After: [1, 3, 3, 1] + +Before: [0, 2, 2, 1] +1 1 2 3 +After: [0, 2, 2, 4] + +Before: [1, 2, 2, 3] +6 0 3 3 +After: [1, 2, 2, 0] + +Before: [3, 2, 0, 2] +11 1 3 2 +After: [3, 2, 1, 2] + +Before: [2, 2, 2, 2] +1 2 2 0 +After: [4, 2, 2, 2] + +Before: [1, 0, 0, 1] +4 3 3 1 +After: [1, 0, 0, 1] + +Before: [3, 1, 1, 2] +4 3 3 1 +After: [3, 0, 1, 2] + +Before: [1, 1, 2, 3] +6 0 3 3 +After: [1, 1, 2, 0] + +Before: [0, 3, 1, 3] +9 0 0 2 +After: [0, 3, 0, 3] + +Before: [1, 3, 0, 0] +8 2 1 0 +After: [3, 3, 0, 0] + +Before: [3, 2, 0, 2] +13 1 2 3 +After: [3, 2, 0, 4] + +Before: [0, 0, 1, 2] +13 3 2 2 +After: [0, 0, 4, 2] + +Before: [0, 2, 0, 2] +11 1 3 0 +After: [1, 2, 0, 2] + +Before: [0, 3, 1, 3] +9 0 0 3 +After: [0, 3, 1, 0] + +Before: [2, 2, 0, 2] +11 1 3 0 +After: [1, 2, 0, 2] + +Before: [0, 3, 1, 2] +8 2 1 0 +After: [3, 3, 1, 2] + +Before: [0, 3, 2, 2] +9 0 0 2 +After: [0, 3, 0, 2] + +Before: [3, 2, 0, 2] +13 1 2 2 +After: [3, 2, 4, 2] + +Before: [0, 3, 1, 1] +14 1 3 2 +After: [0, 3, 9, 1] + +Before: [2, 0, 2, 0] +1 0 2 1 +After: [2, 4, 2, 0] + +Before: [3, 2, 3, 2] +11 1 3 0 +After: [1, 2, 3, 2] + +Before: [0, 0, 3, 1] +7 3 2 0 +After: [3, 0, 3, 1] + +Before: [2, 2, 0, 2] +12 1 1 2 +After: [2, 2, 1, 2] + +Before: [0, 3, 2, 1] +8 0 1 0 +After: [3, 3, 2, 1] + +Before: [2, 0, 3, 1] +7 3 2 0 +After: [3, 0, 3, 1] + +Before: [0, 0, 1, 2] +8 0 3 2 +After: [0, 0, 2, 2] + +Before: [1, 1, 3, 0] +0 1 0 3 +After: [1, 1, 3, 1] + +Before: [1, 2, 0, 3] +4 1 0 1 +After: [1, 1, 0, 3] + +Before: [1, 1, 2, 1] +0 1 0 0 +After: [1, 1, 2, 1] + +Before: [2, 3, 2, 3] +6 0 3 3 +After: [2, 3, 2, 0] + +Before: [2, 1, 3, 2] +7 3 1 3 +After: [2, 1, 3, 3] + +Before: [1, 0, 0, 2] +4 3 3 2 +After: [1, 0, 0, 2] + +Before: [0, 0, 1, 1] +4 2 3 2 +After: [0, 0, 0, 1] + +Before: [1, 1, 0, 2] +0 1 0 2 +After: [1, 1, 1, 2] + +Before: [0, 1, 0, 2] +3 1 0 2 +After: [0, 1, 1, 2] + +Before: [2, 2, 0, 1] +13 0 2 0 +After: [4, 2, 0, 1] + +Before: [2, 2, 0, 3] +6 0 3 3 +After: [2, 2, 0, 0] + +Before: [0, 2, 0, 2] +13 3 2 0 +After: [4, 2, 0, 2] + +Before: [2, 2, 2, 2] +1 0 2 3 +After: [2, 2, 2, 4] + +Before: [1, 2, 2, 3] +2 1 2 3 +After: [1, 2, 2, 1] + +Before: [1, 2, 0, 0] +15 0 1 3 +After: [1, 2, 0, 2] + +Before: [2, 2, 0, 2] +11 1 3 1 +After: [2, 1, 0, 2] + +Before: [1, 0, 2, 3] +5 0 2 0 +After: [3, 0, 2, 3] + +Before: [1, 0, 0, 1] +10 1 0 2 +After: [1, 0, 1, 1] + +Before: [3, 1, 1, 1] +14 0 3 2 +After: [3, 1, 9, 1] + +Before: [0, 1, 3, 3] +3 1 0 3 +After: [0, 1, 3, 1] + +Before: [2, 1, 2, 2] +1 0 2 2 +After: [2, 1, 4, 2] + +Before: [0, 2, 2, 1] +12 1 1 0 +After: [1, 2, 2, 1] + +Before: [1, 2, 1, 2] +11 1 3 2 +After: [1, 2, 1, 2] + +Before: [0, 1, 2, 2] +3 1 0 1 +After: [0, 1, 2, 2] + +Before: [2, 2, 3, 2] +11 1 3 3 +After: [2, 2, 3, 1] + +Before: [0, 2, 1, 2] +12 1 1 1 +After: [0, 1, 1, 2] + +Before: [2, 1, 1, 3] +6 0 3 0 +After: [0, 1, 1, 3] + +Before: [1, 2, 1, 3] +8 0 1 3 +After: [1, 2, 1, 3] + +Before: [0, 3, 0, 2] +9 0 0 3 +After: [0, 3, 0, 0] + +Before: [0, 2, 2, 2] +11 1 3 1 +After: [0, 1, 2, 2] + +Before: [0, 1, 0, 2] +3 1 0 0 +After: [1, 1, 0, 2] + +Before: [2, 0, 1, 2] +13 0 2 2 +After: [2, 0, 4, 2] + +Before: [1, 0, 0, 2] +10 1 0 3 +After: [1, 0, 0, 1] + +Before: [3, 1, 3, 2] +14 0 3 3 +After: [3, 1, 3, 9] + +Before: [2, 2, 2, 3] +15 2 3 0 +After: [6, 2, 2, 3] + +Before: [1, 0, 1, 0] +10 1 0 2 +After: [1, 0, 1, 0] + +Before: [0, 2, 1, 0] +9 0 0 3 +After: [0, 2, 1, 0] + +Before: [1, 2, 2, 2] +11 1 3 0 +After: [1, 2, 2, 2] + +Before: [1, 2, 3, 1] +15 3 1 0 +After: [2, 2, 3, 1] + +Before: [0, 0, 3, 1] +8 0 2 2 +After: [0, 0, 3, 1] + +Before: [2, 0, 2, 1] +14 0 3 1 +After: [2, 6, 2, 1] + +Before: [0, 0, 2, 3] +15 2 3 1 +After: [0, 6, 2, 3] + +Before: [1, 2, 2, 0] +12 1 1 2 +After: [1, 2, 1, 0] + +Before: [2, 2, 3, 0] +12 1 0 2 +After: [2, 2, 1, 0] + +Before: [3, 2, 0, 2] +11 1 3 1 +After: [3, 1, 0, 2] + +Before: [2, 2, 2, 3] +6 0 3 3 +After: [2, 2, 2, 0] + +Before: [0, 1, 0, 0] +3 1 0 2 +After: [0, 1, 1, 0] + +Before: [0, 1, 1, 3] +3 1 0 3 +After: [0, 1, 1, 1] + +Before: [2, 0, 0, 3] +6 0 3 1 +After: [2, 0, 0, 3] + +Before: [3, 1, 0, 0] +8 1 0 0 +After: [3, 1, 0, 0] + +Before: [0, 1, 2, 1] +3 1 0 1 +After: [0, 1, 2, 1] + +Before: [1, 0, 1, 0] +10 1 0 3 +After: [1, 0, 1, 1] + +Before: [0, 0, 3, 1] +12 2 3 3 +After: [0, 0, 3, 0] + +Before: [0, 1, 0, 1] +4 3 3 2 +After: [0, 1, 0, 1] + +Before: [1, 0, 2, 1] +7 3 2 2 +After: [1, 0, 3, 1] + +Before: [1, 1, 2, 2] +15 0 2 0 +After: [2, 1, 2, 2] + +Before: [3, 3, 0, 3] +2 1 3 2 +After: [3, 3, 1, 3] + +Before: [1, 0, 3, 3] +10 1 0 0 +After: [1, 0, 3, 3] + +Before: [1, 3, 2, 1] +14 2 3 2 +After: [1, 3, 6, 1] + +Before: [0, 1, 1, 1] +3 1 0 0 +After: [1, 1, 1, 1] + +Before: [3, 3, 0, 1] +4 3 3 3 +After: [3, 3, 0, 0] + +Before: [3, 3, 2, 1] +7 3 2 2 +After: [3, 3, 3, 1] + +Before: [3, 2, 2, 1] +2 1 2 3 +After: [3, 2, 2, 1] + +Before: [1, 1, 1, 3] +6 0 3 0 +After: [0, 1, 1, 3] + +Before: [3, 0, 2, 3] +5 1 3 3 +After: [3, 0, 2, 3] + +Before: [2, 2, 3, 3] +15 1 3 2 +After: [2, 2, 6, 3] + +Before: [1, 2, 1, 2] +8 2 1 3 +After: [1, 2, 1, 3] + +Before: [0, 2, 3, 1] +15 3 1 0 +After: [2, 2, 3, 1] + +Before: [3, 3, 0, 3] +12 3 0 2 +After: [3, 3, 1, 3] + +Before: [2, 2, 2, 2] +11 1 3 2 +After: [2, 2, 1, 2] + +Before: [3, 0, 3, 0] +8 1 2 1 +After: [3, 3, 3, 0] + +Before: [1, 1, 1, 2] +5 0 3 2 +After: [1, 1, 3, 2] + +Before: [0, 3, 3, 2] +9 0 0 2 +After: [0, 3, 0, 2] + +Before: [0, 3, 2, 1] +9 0 0 0 +After: [0, 3, 2, 1] + +Before: [1, 3, 1, 3] +5 2 3 3 +After: [1, 3, 1, 3] + +Before: [2, 1, 3, 3] +6 0 3 3 +After: [2, 1, 3, 0] + +Before: [0, 1, 1, 0] +9 0 0 0 +After: [0, 1, 1, 0] + +Before: [1, 0, 2, 3] +6 0 3 0 +After: [0, 0, 2, 3] + +Before: [3, 3, 3, 1] +7 3 2 0 +After: [3, 3, 3, 1] + +Before: [0, 1, 3, 0] +3 1 0 2 +After: [0, 1, 1, 0] + +Before: [1, 2, 2, 2] +4 3 3 1 +After: [1, 0, 2, 2] + +Before: [3, 2, 2, 2] +11 1 3 3 +After: [3, 2, 2, 1] + +Before: [0, 1, 0, 2] +9 0 0 0 +After: [0, 1, 0, 2] + +Before: [1, 0, 1, 3] +10 1 0 0 +After: [1, 0, 1, 3] + +Before: [3, 3, 2, 3] +2 1 3 1 +After: [3, 1, 2, 3] + +Before: [2, 3, 1, 0] +8 3 0 1 +After: [2, 2, 1, 0] + +Before: [1, 1, 2, 1] +0 1 0 3 +After: [1, 1, 2, 1] + +Before: [3, 3, 2, 3] +15 3 2 1 +After: [3, 6, 2, 3] + +Before: [0, 2, 1, 2] +4 1 2 3 +After: [0, 2, 1, 1] + +Before: [2, 2, 1, 0] +13 1 2 1 +After: [2, 4, 1, 0] + +Before: [1, 0, 3, 3] +10 1 0 1 +After: [1, 1, 3, 3] + +Before: [3, 3, 2, 0] +1 2 2 2 +After: [3, 3, 4, 0] + +Before: [1, 2, 1, 2] +11 1 3 0 +After: [1, 2, 1, 2] + +Before: [1, 3, 1, 3] +6 0 3 3 +After: [1, 3, 1, 0] + +Before: [3, 3, 1, 3] +8 2 1 1 +After: [3, 3, 1, 3] + +Before: [1, 0, 0, 1] +4 3 3 0 +After: [0, 0, 0, 1] + +Before: [1, 2, 2, 2] +11 1 3 3 +After: [1, 2, 2, 1] + +Before: [3, 1, 2, 1] +8 1 0 0 +After: [3, 1, 2, 1] + +Before: [3, 0, 1, 2] +8 1 3 3 +After: [3, 0, 1, 2] + +Before: [1, 1, 3, 3] +0 1 0 3 +After: [1, 1, 3, 1] + +Before: [0, 0, 1, 2] +13 3 2 1 +After: [0, 4, 1, 2] + +Before: [2, 3, 0, 1] +13 0 2 0 +After: [4, 3, 0, 1] + +Before: [1, 2, 2, 0] +2 1 2 1 +After: [1, 1, 2, 0] + +Before: [2, 3, 1, 0] +13 0 2 2 +After: [2, 3, 4, 0] + +Before: [0, 1, 2, 3] +3 1 0 3 +After: [0, 1, 2, 1] + +Before: [2, 3, 2, 2] +15 1 3 1 +After: [2, 6, 2, 2] + +Before: [0, 1, 2, 0] +3 1 0 3 +After: [0, 1, 2, 1] + +Before: [1, 2, 2, 2] +15 0 2 2 +After: [1, 2, 2, 2] + +Before: [1, 2, 2, 1] +12 1 1 2 +After: [1, 2, 1, 1] + +Before: [0, 1, 1, 0] +3 1 0 0 +After: [1, 1, 1, 0] + +Before: [3, 3, 0, 1] +14 0 3 1 +After: [3, 9, 0, 1] + +Before: [1, 0, 2, 1] +10 1 0 2 +After: [1, 0, 1, 1] + +Before: [0, 3, 2, 3] +9 0 0 2 +After: [0, 3, 0, 3] + +Before: [0, 2, 1, 2] +11 1 3 3 +After: [0, 2, 1, 1] + +Before: [2, 0, 1, 3] +6 0 3 1 +After: [2, 0, 1, 3] + +Before: [1, 1, 2, 3] +0 1 0 3 +After: [1, 1, 2, 1] + +Before: [3, 0, 2, 2] +1 2 2 1 +After: [3, 4, 2, 2] + +Before: [1, 3, 2, 0] +5 3 2 3 +After: [1, 3, 2, 2] + +Before: [3, 3, 0, 3] +8 2 0 1 +After: [3, 3, 0, 3] + +Before: [0, 0, 3, 3] +9 0 0 3 +After: [0, 0, 3, 0] + +Before: [0, 3, 1, 3] +8 2 1 3 +After: [0, 3, 1, 3] + +Before: [1, 1, 3, 2] +0 1 0 3 +After: [1, 1, 3, 1] + +Before: [1, 0, 0, 3] +10 1 0 2 +After: [1, 0, 1, 3] + +Before: [2, 0, 1, 2] +13 3 2 3 +After: [2, 0, 1, 4] + +Before: [3, 2, 3, 2] +13 1 2 0 +After: [4, 2, 3, 2] + +Before: [0, 1, 0, 2] +3 1 0 3 +After: [0, 1, 0, 1] + +Before: [1, 1, 3, 1] +0 1 0 0 +After: [1, 1, 3, 1] + +Before: [0, 1, 3, 0] +3 1 0 0 +After: [1, 1, 3, 0] + +Before: [0, 1, 0, 1] +3 1 0 1 +After: [0, 1, 0, 1] + +Before: [3, 2, 1, 2] +4 1 2 2 +After: [3, 2, 1, 2] + +Before: [1, 1, 2, 3] +0 1 0 0 +After: [1, 1, 2, 3] + +Before: [3, 2, 3, 2] +11 1 3 2 +After: [3, 2, 1, 2] + +Before: [0, 1, 3, 1] +3 1 0 1 +After: [0, 1, 3, 1] + +Before: [1, 1, 2, 0] +0 1 0 3 +After: [1, 1, 2, 1] + +Before: [0, 1, 3, 0] +9 0 0 3 +After: [0, 1, 3, 0] + +Before: [2, 2, 3, 1] +14 2 3 2 +After: [2, 2, 9, 1] + +Before: [0, 1, 0, 1] +3 1 0 2 +After: [0, 1, 1, 1] + +Before: [3, 3, 3, 3] +15 0 3 3 +After: [3, 3, 3, 9] + +Before: [2, 1, 2, 3] +6 0 3 0 +After: [0, 1, 2, 3] + +Before: [0, 2, 1, 2] +8 0 3 1 +After: [0, 2, 1, 2] + +Before: [0, 2, 2, 1] +2 1 2 1 +After: [0, 1, 2, 1] + +Before: [1, 0, 1, 2] +10 1 0 0 +After: [1, 0, 1, 2] + +Before: [1, 2, 3, 3] +15 1 3 3 +After: [1, 2, 3, 6] + +Before: [2, 1, 2, 3] +15 1 2 3 +After: [2, 1, 2, 2] + +Before: [1, 2, 2, 1] +14 1 3 3 +After: [1, 2, 2, 6] + +Before: [1, 1, 1, 0] +0 1 0 1 +After: [1, 1, 1, 0] + +Before: [3, 2, 3, 1] +4 3 3 0 +After: [0, 2, 3, 1] + +Before: [0, 2, 2, 2] +11 1 3 2 +After: [0, 2, 1, 2] + +Before: [2, 1, 3, 1] +14 3 2 3 +After: [2, 1, 3, 2] + +Before: [0, 2, 2, 3] +2 1 2 0 +After: [1, 2, 2, 3] + +Before: [0, 1, 3, 3] +5 0 3 2 +After: [0, 1, 3, 3] + +Before: [0, 3, 2, 2] +15 1 2 0 +After: [6, 3, 2, 2] + +Before: [2, 2, 1, 2] +14 3 3 1 +After: [2, 6, 1, 2] + +Before: [2, 2, 2, 2] +11 1 3 1 +After: [2, 1, 2, 2] + +Before: [3, 2, 2, 2] +11 1 3 0 +After: [1, 2, 2, 2] + +Before: [1, 3, 2, 1] +15 0 2 0 +After: [2, 3, 2, 1] + +Before: [1, 2, 0, 0] +15 0 1 2 +After: [1, 2, 2, 0] + +Before: [1, 2, 2, 3] +1 1 2 1 +After: [1, 4, 2, 3] + +Before: [3, 2, 2, 1] +7 3 2 0 +After: [3, 2, 2, 1] + +Before: [3, 2, 2, 0] +12 1 1 2 +After: [3, 2, 1, 0] + +Before: [1, 0, 3, 3] +6 0 3 1 +After: [1, 0, 3, 3] + +Before: [2, 0, 2, 1] +1 0 2 3 +After: [2, 0, 2, 4] + +Before: [2, 0, 1, 2] +13 0 2 0 +After: [4, 0, 1, 2] + +Before: [2, 2, 2, 2] +12 2 1 0 +After: [1, 2, 2, 2] + +Before: [2, 2, 0, 2] +13 3 2 1 +After: [2, 4, 0, 2] + +Before: [3, 3, 3, 0] +14 2 3 1 +After: [3, 9, 3, 0] + +Before: [3, 1, 0, 2] +4 3 3 3 +After: [3, 1, 0, 0] + +Before: [0, 2, 2, 3] +1 1 2 0 +After: [4, 2, 2, 3] + +Before: [0, 1, 1, 2] +9 0 0 1 +After: [0, 0, 1, 2] + +Before: [3, 3, 1, 0] +14 1 3 2 +After: [3, 3, 9, 0] + +Before: [2, 0, 2, 3] +5 1 2 2 +After: [2, 0, 2, 3] + +Before: [1, 1, 1, 2] +0 1 0 0 +After: [1, 1, 1, 2] + +Before: [3, 2, 3, 3] +15 1 3 0 +After: [6, 2, 3, 3] + +Before: [1, 3, 2, 1] +14 1 3 0 +After: [9, 3, 2, 1] + +Before: [2, 0, 2, 2] +1 2 2 0 +After: [4, 0, 2, 2] + +Before: [0, 2, 1, 2] +11 1 3 0 +After: [1, 2, 1, 2] + +Before: [0, 1, 1, 1] +3 1 0 3 +After: [0, 1, 1, 1] + +Before: [1, 0, 1, 0] +10 1 0 1 +After: [1, 1, 1, 0] + +Before: [1, 1, 1, 1] +4 3 3 3 +After: [1, 1, 1, 0] + +Before: [3, 2, 2, 2] +14 0 3 3 +After: [3, 2, 2, 9] + +Before: [0, 1, 2, 1] +9 0 0 0 +After: [0, 1, 2, 1] + +Before: [2, 0, 2, 3] +1 2 2 0 +After: [4, 0, 2, 3] + +Before: [1, 1, 1, 3] +0 1 0 3 +After: [1, 1, 1, 1] + +Before: [0, 1, 0, 3] +3 1 0 1 +After: [0, 1, 0, 3] + +Before: [2, 0, 2, 1] +5 1 2 0 +After: [2, 0, 2, 1] + +Before: [1, 3, 3, 1] +14 0 2 0 +After: [2, 3, 3, 1] + +Before: [1, 0, 0, 3] +6 0 3 1 +After: [1, 0, 0, 3] + +Before: [2, 3, 0, 3] +6 0 3 3 +After: [2, 3, 0, 0] + +Before: [0, 1, 2, 2] +1 3 2 3 +After: [0, 1, 2, 4] + +Before: [3, 1, 2, 3] +1 2 2 2 +After: [3, 1, 4, 3] + +Before: [3, 1, 0, 3] +8 2 0 3 +After: [3, 1, 0, 3] + +Before: [3, 3, 1, 2] +14 0 3 3 +After: [3, 3, 1, 9] + +Before: [3, 0, 3, 2] +4 3 3 3 +After: [3, 0, 3, 0] + +Before: [2, 3, 1, 0] +8 2 1 0 +After: [3, 3, 1, 0] + +Before: [0, 1, 2, 1] +3 1 0 2 +After: [0, 1, 1, 1] + +Before: [0, 1, 3, 2] +3 1 0 0 +After: [1, 1, 3, 2] + +Before: [1, 1, 2, 0] +15 0 2 1 +After: [1, 2, 2, 0] + +Before: [0, 3, 2, 2] +1 3 2 0 +After: [4, 3, 2, 2] + +Before: [1, 0, 1, 2] +10 1 0 3 +After: [1, 0, 1, 1] + +Before: [0, 2, 2, 0] +12 1 1 0 +After: [1, 2, 2, 0] + +Before: [1, 1, 3, 3] +0 1 0 1 +After: [1, 1, 3, 3] + +Before: [1, 0, 2, 0] +10 1 0 2 +After: [1, 0, 1, 0] + +Before: [2, 3, 2, 1] +15 1 2 1 +After: [2, 6, 2, 1] + +Before: [1, 2, 0, 0] +8 1 0 1 +After: [1, 3, 0, 0] + +Before: [3, 2, 1, 2] +11 1 3 3 +After: [3, 2, 1, 1] + +Before: [1, 1, 1, 1] +0 1 0 3 +After: [1, 1, 1, 1] + +Before: [2, 3, 1, 3] +6 0 3 3 +After: [2, 3, 1, 0] + +Before: [0, 2, 1, 3] +13 1 2 2 +After: [0, 2, 4, 3] + +Before: [1, 0, 3, 1] +7 3 2 3 +After: [1, 0, 3, 3] + +Before: [2, 1, 0, 0] +8 3 0 3 +After: [2, 1, 0, 2] + +Before: [1, 1, 1, 2] +0 1 0 2 +After: [1, 1, 1, 2] + +Before: [3, 2, 2, 2] +1 3 2 3 +After: [3, 2, 2, 4] + +Before: [3, 1, 1, 1] +14 0 3 3 +After: [3, 1, 1, 9] + +Before: [2, 2, 3, 3] +6 0 3 0 +After: [0, 2, 3, 3] + +Before: [0, 1, 1, 2] +3 1 0 2 +After: [0, 1, 1, 2] + +Before: [3, 2, 1, 2] +14 0 3 0 +After: [9, 2, 1, 2] + +Before: [2, 0, 3, 1] +7 3 2 3 +After: [2, 0, 3, 3] + +Before: [1, 2, 2, 1] +2 1 2 0 +After: [1, 2, 2, 1] + +Before: [0, 0, 2, 1] +4 3 3 3 +After: [0, 0, 2, 0] + +Before: [3, 2, 3, 3] +12 3 0 3 +After: [3, 2, 3, 1] + +Before: [1, 1, 2, 2] +0 1 0 3 +After: [1, 1, 2, 1] + +Before: [2, 3, 1, 1] +14 1 3 2 +After: [2, 3, 9, 1] + +Before: [1, 0, 2, 1] +15 0 2 1 +After: [1, 2, 2, 1] + +Before: [0, 1, 2, 3] +9 0 0 3 +After: [0, 1, 2, 0] + +Before: [3, 0, 0, 2] +4 3 3 0 +After: [0, 0, 0, 2] + +Before: [3, 0, 3, 1] +7 3 2 3 +After: [3, 0, 3, 3] + +Before: [3, 2, 2, 3] +12 2 1 1 +After: [3, 1, 2, 3] + +Before: [0, 3, 3, 3] +2 1 3 1 +After: [0, 1, 3, 3] + +Before: [1, 0, 0, 0] +10 1 0 1 +After: [1, 1, 0, 0] + +Before: [1, 3, 0, 3] +2 1 3 3 +After: [1, 3, 0, 1] + +Before: [3, 2, 2, 3] +12 3 0 2 +After: [3, 2, 1, 3] + +Before: [1, 1, 2, 0] +0 1 0 0 +After: [1, 1, 2, 0] + +Before: [0, 2, 2, 1] +2 1 2 2 +After: [0, 2, 1, 1] + +Before: [1, 0, 1, 2] +10 1 0 2 +After: [1, 0, 1, 2] + +Before: [1, 0, 3, 0] +14 0 2 2 +After: [1, 0, 2, 0] + +Before: [0, 2, 3, 2] +11 1 3 3 +After: [0, 2, 3, 1] + +Before: [0, 1, 0, 3] +3 1 0 2 +After: [0, 1, 1, 3] + +Before: [3, 3, 2, 1] +12 1 0 0 +After: [1, 3, 2, 1] + +Before: [0, 2, 3, 3] +13 1 2 0 +After: [4, 2, 3, 3] + +Before: [1, 1, 3, 0] +0 1 0 1 +After: [1, 1, 3, 0] + +Before: [1, 2, 2, 2] +2 1 2 2 +After: [1, 2, 1, 2] + +Before: [2, 1, 3, 3] +13 0 2 2 +After: [2, 1, 4, 3] + +Before: [1, 0, 1, 3] +10 1 0 3 +After: [1, 0, 1, 1] + +Before: [2, 1, 3, 2] +7 3 1 1 +After: [2, 3, 3, 2] + +Before: [1, 1, 1, 0] +0 1 0 0 +After: [1, 1, 1, 0] + +Before: [0, 2, 3, 2] +13 3 2 3 +After: [0, 2, 3, 4] + +Before: [3, 2, 2, 3] +12 3 0 3 +After: [3, 2, 2, 1] + +Before: [2, 3, 2, 3] +2 1 3 1 +After: [2, 1, 2, 3] + +Before: [2, 3, 0, 3] +6 0 3 1 +After: [2, 0, 0, 3] + +Before: [2, 2, 2, 3] +1 2 2 0 +After: [4, 2, 2, 3] + +Before: [3, 2, 3, 2] +4 3 3 1 +After: [3, 0, 3, 2] + +Before: [0, 2, 2, 0] +12 1 1 1 +After: [0, 1, 2, 0] + +Before: [2, 2, 3, 2] +11 1 3 2 +After: [2, 2, 1, 2] + +Before: [3, 0, 2, 3] +1 2 2 2 +After: [3, 0, 4, 3] + +Before: [0, 3, 2, 0] +9 0 0 0 +After: [0, 3, 2, 0] + +Before: [0, 2, 3, 1] +9 0 0 2 +After: [0, 2, 0, 1] + +Before: [0, 1, 1, 1] +3 1 0 2 +After: [0, 1, 1, 1] + +Before: [2, 2, 2, 3] +2 1 2 0 +After: [1, 2, 2, 3] + +Before: [0, 1, 2, 3] +15 3 2 0 +After: [6, 1, 2, 3] + +Before: [1, 1, 0, 2] +7 3 1 3 +After: [1, 1, 0, 3] + +Before: [1, 1, 1, 1] +0 1 0 0 +After: [1, 1, 1, 1] + +Before: [1, 2, 3, 3] +15 0 1 3 +After: [1, 2, 3, 2] + +Before: [0, 3, 2, 3] +2 1 3 1 +After: [0, 1, 2, 3] + +Before: [0, 3, 0, 0] +8 2 1 3 +After: [0, 3, 0, 3] + +Before: [2, 0, 2, 3] +1 0 2 0 +After: [4, 0, 2, 3] + +Before: [0, 3, 0, 3] +5 0 3 3 +After: [0, 3, 0, 3] + +Before: [0, 1, 2, 0] +3 1 0 0 +After: [1, 1, 2, 0] + + + +7 3 2 0 +7 2 1 1 +7 1 0 3 +8 1 0 1 +14 1 2 1 +1 2 1 2 +7 3 3 1 +7 2 0 0 +14 3 0 3 +13 3 2 3 +0 1 0 1 +14 1 1 1 +1 1 2 2 +7 2 2 1 +7 3 1 0 +7 1 0 3 +1 3 3 3 +14 3 3 3 +1 2 3 2 +3 2 1 0 +14 3 0 3 +13 3 0 3 +7 2 3 2 +14 2 0 1 +13 1 0 1 +6 3 2 2 +14 2 2 2 +1 0 2 0 +7 3 1 1 +7 2 2 3 +14 3 0 2 +13 2 0 2 +7 2 1 3 +14 3 3 3 +1 0 3 0 +7 0 0 3 +14 0 0 2 +13 2 3 2 +14 0 0 1 +13 1 1 1 +10 3 2 3 +14 3 2 3 +1 0 3 0 +3 0 1 1 +7 0 1 0 +7 1 1 2 +7 3 1 3 +9 3 2 0 +14 0 1 0 +1 1 0 1 +3 1 0 3 +14 0 0 2 +13 2 2 2 +7 3 2 1 +14 2 0 0 +13 0 1 0 +3 0 2 0 +14 0 2 0 +1 0 3 3 +3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 3 3 +14 3 2 3 +1 1 3 1 +3 1 1 2 +7 3 3 1 +7 1 2 3 +4 0 3 3 +14 3 3 3 +14 3 2 3 +1 2 3 2 +3 2 0 0 +7 0 2 2 +14 2 0 3 +13 3 1 3 +1 3 3 1 +14 1 2 1 +14 1 2 1 +1 1 0 0 +3 0 2 2 +7 2 1 0 +7 1 0 1 +15 1 0 1 +14 1 2 1 +14 1 2 1 +1 2 1 2 +3 2 2 1 +7 3 3 3 +7 3 2 2 +8 0 2 0 +14 0 3 0 +1 0 1 1 +7 0 2 2 +7 2 1 3 +14 1 0 0 +13 0 3 0 +2 2 0 0 +14 0 3 0 +14 0 3 0 +1 0 1 1 +3 1 0 2 +7 2 2 0 +7 2 3 1 +11 0 3 0 +14 0 3 0 +14 0 1 0 +1 0 2 2 +3 2 2 3 +7 2 2 0 +7 1 3 2 +14 3 0 1 +13 1 3 1 +12 0 1 0 +14 0 2 0 +14 0 3 0 +1 3 0 3 +3 3 2 0 +7 2 2 2 +7 0 1 3 +6 3 2 3 +14 3 1 3 +1 3 0 0 diff --git a/day16p1/main.c b/day16p1/main.c new file mode 100644 index 0000000..bb2aa99 --- /dev/null +++ b/day16p1/main.c @@ -0,0 +1,175 @@ +#include +#include + +#include + +#define REGS 4 + +enum instr_id { + INSTR_ADDR, + INSTR_ADDI, + INSTR_MULR, + INSTR_MULI, + INSTR_BANR, + INSTR_BANI, + INSTR_BORR, + INSTR_BORI, + INSTR_SETR, + INSTR_SETI, + INSTR_GTIR, + INSTR_GTRI, + INSTR_GTRR, + INSTR_EQIR, + INSTR_EQRI, + INSTR_EQRR, + INSTR_ID_COUNT +}; + +struct instr { + enum instr_id i; + int a; + int b; + int c; +}; + +struct sample { + int before[REGS]; + int after[REGS]; + struct instr instr; +}; + +const char *instr_str[] = { + "addr", + "addi", + "mulr", + "muli", + "banr", + "bani", + "borr", + "bori", + "setr", + "seti", + "gtir", + "gtri", + "gtrr", + "eqir", + "eqri", + "eqrr" +}; + +void instr_interpret(int *r, struct instr *i) +{ + switch (i->i) { + case INSTR_ADDR: + case INSTR_MULR: + case INSTR_BANR: + case INSTR_BORR: + case INSTR_GTRR: + case INSTR_EQRR: + if (i->b >= REGS) return; + // fallthrough + case INSTR_ADDI: + case INSTR_MULI: + case INSTR_BANI: + case INSTR_BORI: + case INSTR_SETR: + case INSTR_GTRI: + case INSTR_EQRI: + if (i->a >= REGS) return; + // fallthrough + case INSTR_SETI: + if (i->c >= REGS) return; + break; + + case INSTR_GTIR: + case INSTR_EQIR: + if (i->b >= REGS) return; + if (i->c >= REGS) return; + break; + + default: + break; + } + + switch (i->i) { + case INSTR_ADDR: r[i->c] = r[i->a] + r[i->b]; break; + case INSTR_ADDI: r[i->c] = r[i->a] + i->b; break; + case INSTR_MULR: r[i->c] = r[i->a] * r[i->b]; break; + case INSTR_MULI: r[i->c] = r[i->a] * i->b; break; + case INSTR_BANR: r[i->c] = r[i->a] & r[i->b]; break; + case INSTR_BANI: r[i->c] = r[i->a] & i->b; break; + case INSTR_BORR: r[i->c] = r[i->a] | r[i->b]; break; + case INSTR_BORI: r[i->c] = r[i->a] | i->b; break; + case INSTR_SETR: r[i->c] = r[i->a]; break; + case INSTR_SETI: r[i->c] = i->a; break; + case INSTR_GTIR: r[i->c] = (i->a > r[i->b]) ? 1 : 0; break; + case INSTR_GTRI: r[i->c] = (r[i->a] > i->b) ? 1 : 0; break; + case INSTR_GTRR: r[i->c] = (r[i->a] > r[i->b]) ? 1 : 0; break; + case INSTR_EQIR: r[i->c] = (i->a == r[i->b]) ? 1 : 0; break; + case INSTR_EQRI: r[i->c] = (r[i->a] == i->b) ? 1 : 0; break; + case INSTR_EQRR: r[i->c] = (r[i->a] == r[i->b]) ? 1 : 0; break; + default: break; + } +} + +struct sample *parse_samples(const char *fname, int *len) +{ + FILE *f = fopen(fname, "r"); + if (!f) { + perror(fname); + return NULL; + } + + GArray *array = g_array_new(FALSE, FALSE, sizeof(struct sample)); + + // Haha what is proper parsing + struct sample sample; + while (fscanf(f, + "Before: [%d, %d, %d, %d]\n" + "%d %d %d %d\n" + "After: [%d, %d, %d, %d]\n\n", + &sample.before[0], &sample.before[1], + &sample.before[2], &sample.before[3], + (int *)&sample.instr.i, &sample.instr.a, + &sample.instr.b, &sample.instr.c, + &sample.after[0], &sample.after[1], + &sample.after[2], &sample.after[3] + ) == 12) { + g_array_append_val(array, sample); + } + + fclose(f); + + *len = array->len; + return (struct sample *)g_array_free(array, FALSE); +} + +int main() +{ + int samples_len = 0; + struct sample *samples = parse_samples("input", &samples_len); + if (!samples) return 1; + + int *regs = g_new0(int, REGS); + int result = 0; + for (struct sample *sample = samples; + sample < samples + samples_len; sample++) { + int pass = 0; + struct instr instr; + memcpy(&instr, &sample->instr, sizeof(struct instr)); + for (enum instr_id i = 0; i < INSTR_ID_COUNT; i++) { + instr.i = i; + memcpy(regs, sample->before, sizeof(int) * REGS); + instr_interpret(regs, &instr); + if (memcmp(regs, sample->after, sizeof(int) * REGS) == 0) pass++; + } + + if (pass >= 3) result++; + } + + printf("%d/%d\n", result, samples_len); + + g_free(regs); + g_free(samples); + return 0; +}