Refactor CMake and VSCode settings; add Day 4 solution

- Updated .vscode/settings.json to enhance Clangd configuration and disable IntelliSense.
- Removed obsolete Clang-Format and Clang-Tidy tasks from .vscode/tasks.json.
- Modified CMakeLists.txt to enable compile commands export and adjusted target properties for Day 4.
- Added new CMakeLists.txt and main.cpp for Day 4 solution, implementing diagram parsing and movable paper counting logic.
- Included test_input and puzzle_input files for Day 4.
- Deleted the run-clang-tidy.sh script as it is no longer needed.
This commit is contained in:
Feiko Wielsma 2025-12-04 14:22:43 +00:00
parent e3098c6651
commit eac8571ea7
11 changed files with 605 additions and 54 deletions

View file

@ -1,3 +1,297 @@
BasedOnStyle: Google ---
IndentWidth: 4 Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionDeclarations: false
AlignFunctionPointers: false
PadOperators: true
AlignConsecutiveBitFields:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionDeclarations: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionDeclarations: true
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveMacros:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionDeclarations: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveShortCaseStatements:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCaseArrows: false
AlignCaseColons: false
AlignConsecutiveTableGenBreakingDAGArgColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionDeclarations: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveTableGenCondOperatorColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionDeclarations: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveTableGenDefinitionColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionDeclarations: false
AlignFunctionPointers: false
PadOperators: false
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowBreakBeforeNoexceptSpecifier: Never
AllowShortBlocksOnASingleLine: Never
AllowShortCaseExpressionOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortCompoundRequirementOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AllowShortNamespacesOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AttributeMacros:
- __capability
BinPackArguments: true
BinPackLongBracedList: true
BinPackParameters: BinPack
BitFieldColonSpacing: Both
BracedInitializerIndentWidth: -1
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterExternBlock: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAdjacentStringLiterals: true
BreakAfterAttributes: Leave
BreakAfterJavaFieldAnnotations: false
BreakAfterReturnType: None
BreakArrays: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Attach
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTemplateCloser: false
BreakBeforeTernaryOperators: true
BreakBinaryOperations: Never
BreakConstructorInitializers: BeforeColon
BreakFunctionDefinitionParameters: false
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
BreakTemplateDeclarations: MultiLine
ColumnLimit: 120 ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
EnumTrailingComma: Leave
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: false
IndentExportBlock: true
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: None
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: false
InsertNewlineAtEOF: false
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0
BinaryMinDigits: 0
Decimal: 0
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLines:
AtEndOfFile: false
AtStartOfBlock: true
AtStartOfFile: true
KeepFormFeed: false
LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: ''
MacroBlockEnd: ''
MainIncludeChar: Quote
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
OneLineFormatOffRegex: ''
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakBeforeMemberAccess: 150
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakScopeResolution: 500
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
PPIndentWidth: -1
QualifierAlignment: Leave
ReferenceAlignment: Pointer
ReflowComments: Always
RemoveBracesLLVM: false
RemoveEmptyLinesInUnwrappedLines: false
RemoveParentheses: Leave
RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SkipMacroDefinitionBody: false
SortIncludes:
Enabled: true
IgnoreCase: false
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterOperatorKeyword: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeJsonColon: false
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterNot: false
AfterOverloadedOperator: false
AfterPlacementOperator: true
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInContainerLiterals: true
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParens: Never
SpacesInParensOptions:
ExceptDoubleParentheses: false
InCStyleCasts: false
InConditionalStatements: false
InEmptyParentheses: false
Other: false
SpacesInSquareBrackets: false
Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TableGenBreakInsideDAGArg: DontBreak
TabWidth: 8
UseTab: Never
VerilogBreakBetweenInstancePorts: true
WhitespaceSensitiveMacros:
- BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
- NS_SWIFT_NAME
- PP_STRINGIZE
- STRINGIZE
WrapNamespaceBodyWithEmptyLines: Leave
...

View file

@ -1,4 +1,18 @@
Checks: '-*,modernize-*,readability-*,bugprone-*,performance-*' # We explicitly enable checks with '*' and disable noisy ones with '-'
Checks: >
-*,
bugprone-*,
modernize-*,
performance-*,
readability-*,
cppcoreguidelines-*,
misc-*,
# Disable these specifically if they are too annoying
-modernize-use-trailing-return-type,
-llvmlibc-*
# Treat warnings as errors (optional, good for strict discipline)
WarningsAsErrors: '' WarningsAsErrors: ''
HeaderFilterRegex: '.*'
FormatStyle: file # This ensures clang-tidy sees the same headers as your compiler
# It will read the compile_commands.json automatically

View file

@ -7,6 +7,8 @@ RUN apt-get update \
cmake \ cmake \
ninja-build \ ninja-build \
build-essential \ build-essential \
libc++-dev \
libc++abi-dev \
git \ git \
python3 \ python3 \
python3-pip \ python3-pip \

View file

@ -1,9 +1,15 @@
{ {
"C_Cpp.intelliSenseEngine": "disabled",
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd",
"editor.formatOnSave": true, "editor.formatOnSave": true,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools", "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cmake.configureOnOpen": false, "cmake.configureOnOpen": false,
"cmake.generator": "Ninja", "cmake.generator": "Ninja",
"clangd.arguments": [ "clangd.arguments": [
"--compile-commands-dir=build" "--background-index",
"--compile-commands-dir=${workspaceFolder}/build",
"--header-insertion=iwyu",
"--clang-tidy",
"--completion-style=detailed"
] ]
} }

16
.vscode/tasks.json vendored
View file

@ -12,22 +12,6 @@
"type": "shell", "type": "shell",
"command": "cmake --build build -- -j", "command": "cmake --build build -- -j",
"problemMatcher": [] "problemMatcher": []
},
{
"label": "Clang-Format: Format Workspace",
"type": "shell",
"command": "bash -lc \"find . -name \"*.cpp\" -o -name \"*.hpp\" -o -name \"*.h\" | xargs -r clang-format -i\"",
"problemMatcher": []
},
{
"label": "Clang-Tidy: Run",
"type": "shell",
"command": "./scripts/run-clang-tidy.sh",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
} }
] ]
} }

View file

@ -5,7 +5,7 @@ set(CMAKE_C_COMPILER /usr/bin/clang-21)
set(CMAKE_CXX_COMPILER /usr/bin/clang++-21) set(CMAKE_CXX_COMPILER /usr/bin/clang++-21)
project(aoc25 VERSION 0.1.0 LANGUAGES C CXX) project(aoc25 VERSION 0.1.0 LANGUAGES C CXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Helper to add AoC day targets and auto-copy any input files # Helper to add AoC day targets and auto-copy any input files
function(aoc_add_day name src_dir) function(aoc_add_day name src_dir)
# remaining args are source files # remaining args are source files
@ -13,8 +13,9 @@ function(aoc_add_day name src_dir)
add_executable(${name} ${sources}) add_executable(${name} ${sources})
set_target_properties(${name} PROPERTIES CXX_STANDARD 23 CXX_STANDARD_REQUIRED ON) set_target_properties(${name} PROPERTIES CXX_STANDARD 23 CXX_STANDARD_REQUIRED ON)
# Use GCC toolchain compatibility for clang++-21
target_compile_options(${name} PRIVATE --gcc-toolchain=/usr) target_compile_options(${name} PRIVATE -stdlib=libc++)
target_link_options(${name} PRIVATE -stdlib=libc++)
# Gather common input files in the source directory # Gather common input files in the source directory
file(GLOB INPUT_FILES file(GLOB INPUT_FILES
@ -36,4 +37,5 @@ endfunction()
add_subdirectory(day1) add_subdirectory(day1)
add_subdirectory(day2) add_subdirectory(day2)
add_subdirectory(day3) add_subdirectory(day3)
add_subdirectory(day4)

2
day4/CMakeLists.txt Normal file
View file

@ -0,0 +1,2 @@
# Use top-level helper to add the target and copy input files
aoc_add_day(day4 "${CMAKE_CURRENT_SOURCE_DIR}" main.cpp)

128
day4/main.cpp Normal file
View file

@ -0,0 +1,128 @@
#include <algorithm>
#include <array>
#include <cstddef>
#include <expected>
#include <fstream>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <mdspan>
#include <numeric>
#include <print>
#include <ranges>
#include <string>
#include <string_view>
#include <vector>
struct Diagram {
std::vector<int> data;
size_t width;
size_t height;
auto mdspan() const { return std::mdspan(data.data(), height, width); }
};
auto printMap(const Diagram &diagram) {
auto mdspan = diagram.mdspan();
for (auto row = 0UZ; row != mdspan.extent(0); row++) {
for (auto col = 0UZ; col != mdspan.extent(1); col++) {
std::print("{}", mdspan[row, col]);
}
std::println();
}
// std::println("Map: {}", diagram.data);
std::println("Width: {}", diagram.width);
std::println("Height: {}", diagram.height);
}
auto parseMap(const std::string &filename) -> std::expected<Diagram, std::string> {
std::ifstream inputF{filename};
if (!inputF) {
return std::unexpected{"Some file open error.\n"};
}
Diagram diagram{};
std::string puzzleLine{};
while (std::getline(inputF, puzzleLine)) {
// std::println("{:3}: {}", diagram.height, puzzleLine);
diagram.data.push_back(0);
diagram.data.append_range(puzzleLine | std::views::transform([](char c) -> int { return c == '.' ? 0 : 1; }) |
std::ranges::to<std::vector<int>>());
diagram.data.push_back(0);
diagram.height++;
// ugly
diagram.width = puzzleLine.length() + 2;
}
// also ugly, bound it with 0s
diagram.data.append_range(std::vector<int>(diagram.width, 0));
diagram.data.insert_range(diagram.data.begin(), std::vector<int>(diagram.width, 0));
diagram.height += 2;
printMap(diagram);
// auto ms2 = std::mdspan(diagram.data.data(), diagram.width, diagram.height);
return std::move(diagram);
}
auto countMovablePaper(const Diagram &diagram) -> long {
long nMovablePaper{};
auto mdspan = diagram.mdspan();
for (auto row = 1UZ; row != mdspan.extent(0) - 1; row++) {
for (auto col = 1UZ; col != mdspan.extent(1) - 1; col++) {
if (mdspan[row, col] == 1) {
// std::print("checking [{},{}]:", row, col);
// shitty kernal
int upLeft = mdspan[row - 1, col - 1];
int up = mdspan[row - 1, col];
int upRight = mdspan[row - 1, col + 1];
int left = mdspan[row, col - 1];
int right = mdspan[row, col + 1];
int downLeft = mdspan[row + 1, col - 1];
int down = mdspan[row + 1, col];
int downRight = mdspan[row + 1, col + 1];
// caveman shit
if ((upLeft + up + upRight + left + right + downLeft + down + downRight) < 4) {
// std::println("Found");
nMovablePaper++;
}
}
// std::println();
}
}
return nMovablePaper;
}
auto main() -> int {
auto testCase = parseMap("test_input");
if (testCase) {
auto testResult = countMovablePaper(*testCase);
std::println("P1 Testcase result: {}", testResult);
// auto testResultP2 = countMovablePaper(*testCase);
// std::println("P2 Testcase result: {}", testResultP2);
} else {
std::print("{}\n", testCase.error());
}
auto realPuzzle = parseMap("puzzle_input");
if (realPuzzle) {
auto realResult = countMovablePaper(*realPuzzle);
std::println("P1 Real result: {}", realResult);
// auto realResultP2 = countJoltagesP2(*realPuzzle);
// std::println("P2 Real result: {}", realResultP2);
} else {
std::print("{}\n", realPuzzle.error());
}
return 0;
}

137
day4/puzzle_input Normal file
View file

@ -0,0 +1,137 @@
.@@@.@@@@@.@@.@@@@.@@@@.@@@@..@@@@.@@@...@@@@.@.@@.@@@.@@@@@@@@@...@.@@@@@@..@..@@@.@@@.@@.@@@@@@.@@@@.@..@@@@@.@@@....@@@@@@..@.@@.@.@@@
@@.@@@@.@.@@.@@...@.@..@@.@.@.@....@.@@@.@@.@.......@@..@.@..@@@@@.@@.@..@@....@@@.@@@.@@@@...@.@.@@.@@@.@@@@@@@@@@..@.@@.@@.@.@@..@@@...
@..@..@@@@@@@.@@@@.@.@@.@@..@@.@@@@@@@@@@@@@@@@@@@.@.@@...@.@..@@@@.@@.@..@@@@@.@@@@..@@.@@@@@@@..@.@@@@@@@@@@@..@@@@.@@@.@@.@@@...@@.@@@
@@@.@@@@@@..@@@@.@@@@@@...@..@@@@.@..@.@@..@@@@..@@@.@@@..@.@@@@....@.@@@..@@.@.@.@@..@@@@@@.@@...@..@@@@@@@@@@.@@@@@...@..@@@.@@..@@@.@.
.@@@@@@.@@.@..@.@@.@@@@@@@@@@@@@@@@@@@@@.@@@@@@@.@@.@..@@@@@...@@@.@@@@.@..@@@...@..@@.@@@@@@..@@@@@.@...@@.@.@@......@..@@@@.@..@.@@@.@.
@@@@.@@@@.@@@.@@..@.@.@@..@@.@@@@....@.@@.@@.@@@@@.@@@.@@@@@@@.@.@..@@@@@@@@@.@@@@@@@@..@.@@@@@..@.@@.@.@.@...@@@.@@@@@..@....@@@@.@.@@@@
@@@@@@@@..@@@..@@@@@@@.@@@@..@@@.@..@@@.@...@..@..@@.@.@@@.@.@@...@@...@.@.@..@@@@...@@..@@.@@.@...@@@..@@@@.@@.@..@@@.@@@.@..@..@@.@...@
.@@.@@@@@@@@..@@@@@@.@@.@..@.@.@@@.@@@@.@@.@@...@@@.@@.@@..@@..@.@.@@@..@@.@@@@....@.@..@@@@.@@@@@.@@@..@@..@..@.@.@@.@@@@..@@...@@@.@@@@
@@@@@@.@.@@@@@@@...@@@@@@.@@.@@@@@.@..@@@@..@@@@@@.@@@@..@@.@@.@@@..@@@.@@@@@@@...@@@@@.@.@.@.@@@@@@.@@@@@@@@@.@..@@@@@@@@.@.@@.@@.@.@@@.
@...@@@@@@@@@@@@.@@@......@@@.@.@.@.@@.@@..@@@@@.@@@@@.@@.@....@@@.@.@@@@@@@@@...@@@@.@@@..@@@.@@..@@@@...@.@..@@@...@.@@..@..@.@@@@@..@.
@@.@@@....@@@.@@@@@.@@@.@@@@.@@@@.@@@@@.@@@.@@.@..@.@@@@..@...@.@@@@@...@@.@@..@..@@.@.@@.@@@@.@@.@.@.@@.@@@.@@@@@@@@@@@@@@..@..@@@..@@@.
@..@.@@.@@@@.@@.@@@@..@@@@..@@.@@.@..@.@@@@@.@..@.@..@@@.@@.@@@..@@.@.@@@@@@@@.@@@.@@@.@@@.@@@@.@@...@@@.@.@@.@@..@@..@.@.@@.@@@...@@@@@@
@@@.@@@@.@@.@@@.@@@@.@@@.@@@.@@@@.@@@@@@....@@@...@@.@.@.@.@@@.@.@@@....@.@@@@@..@@@@@@@.@..@@@.@..@@@@.@@@.@@@@@@.@.@..@@@@@@@@@@..@@@@.
.@@.@..@.@.@@@.@@@@.@@@@@.@@@.@@@@@@...@@@@..@@@.@@@.@@.@@.@@..@.@@..@@@@.@@@@.@@@@@@.@..@.@.@@@....@@..@@@@@.....@@@.@.@@.@@@.@.@@..@@..
.@@@@.@@@@....@.@@.@@..@@@.@@..@.@..@@.@@@.@.@@@..@...@.@..@@.@@@@.@.@.@@@..@@@.@@@@.@@@@.@.@@@@@@@@.@.@@..@.@@@@.@.@@.@.@.@...@.@@@@@...
@@@@..@@.@@@..@...@@..@@@@.@@.@.@..@.@.@@@@@.@.@@.@@@@..@@@..@.@@@@@@...@.@.@@@@..@@...@..@@@.@..@@@@@@@.@@@@.@@@@..@...@@@.....@@....@.@
@@.@@.@@@@@@@.@.@.@.@..@@@@.@@@@...@...@@.@..@..@@.@.@.@.@.@@@@@@@@..@@.@@@@@@@@..@@@@.@@@...@.....@@.@.@.@.@@@@.@@@@..@..@.....@@@@.@@@@
@@@@@@@@.@@@@..@@@@@@@@@.@@@..@@.@@@@@@.@@@.@@.@@@@@@@@..@@.@@.@.@@.@@@.@@.@@....@@.@.@.@@@.@@.@..@@@@.@.@@@@@..@@@.@@@@@@@@@@@...@@...@@
.@@..@@@@@.@@@@@.@@.@..@@@..@@@@@@@@..@@....@@.@.@@@@@.@@@.@@@@..@..@@...@.@@@.@@@.@@..@@@@.@.@@@@...@.@.@@.@@..@@@@@@@@@.@@..@.@@@.@@@@@
@.@@.@@.@..@.@@@@.@@@@.@@..@@.@.@...@@@@@@@@@..@@@@.@@@@@.@@.@@@@.@@@@@.@@.@.@@@.@...@@.@..@@@...@@@...@@@@@.@.@@@.@@@@..@@@@..@@@.@@@@@.
@@@..@@.@@@@@@@@@.@@@.@@@@@.@.@@@@.@.@.@@@@.@.@.@@.@.@@..@@@..@@@..@.@@.@@..@.@.@@@@..@..@.@@@@@@@@@@@...@.@@....@.@..@@..@@.@..@.@@@@@..
@.@.@@@@@@@.@.@.@@@.@@.@@@@@@@@@@@.@@@@@.@..@@@@@@@..@@@@@.@.@@@..@@@@@.@..@@..@.@@@@@@@.@@@..@.@@@.@@@@.@@.@@.@@@@@@..@@@.@@.@..@@@@.@@.
.@.@@@@@@...@@@.@@@@.@@@@@@@@@@@.@@@@.@@@@.@@.@@...@@...@@@@.@..@@@@.@@...@.@..@@@@@@.@@@@.@.@@...@@@.@.@..@.@.@@@@.@@@....@@@@.@@.@.@@..
@..@@@...@....@@@@@@@.@@.@@@@@@@.@@@@@@.@@@.@@@.@..@@.@@@.@.@@.@.@@@@@@@@@@.@@@@.@@@@@.@@.@..@@@@.@@..@..@...@@@..@.@...@..@@@@.@@@.@@@@@
.@@..@..@...@@@@..@.@.@@...@.@@@@@.@@@@@.@@@...@.@..@@@..@.@..@....@@.@@.@@@@@@@.@.@@@.@@@@@.@@@.@@@.@.@@@@.@@@@@@@.@@@@@@@..@...@@.@.@@@
@@@@@@.@@@@...@.@@@...@@@.@@.@@@..@@@.@.@@...@@@.....@@@.@@@@.@@@@.@.@@@.@@@@@...@@.@@.@@@.@@@@@@.@@@@.@@.@@@@@@@@@@@..@.@@.@@@@@.@@.@@@@
.@.@@@@.@@@@@@@.@@..@@@@@@@@....@@@...@@..@.@@@.@@.@.@.@@@@..@@...@.@@@@.@...@..@@..@@@.@@@@.@.@@@....@..@@.@@@@@@...@@@@@@@..@@@..@.@@.@
@@.@.@@@@@...@@@@@.@.@@@@@@.@@@@.@@..@@......@.@@@..@..@@@@@@.@@@@@@@.@..@@@@@@@@@@.@@@@@..@@@@...@.@@@.@@@@@.@..@@@@.@@@@@@.@@@@.@@@@...
@@.@.@..@.@@@@@@@.@.@@.@..@@@@@@...@@@@.@@@@@@@@.@@@@@@@.@@.@@@@@.@@@@.@@.@@@@...@.@.@@.@.@..@@@@@.@.@@.@@@@@@@.@..@@..@@.@@..@..@.@@@.@.
@@.@@@@@@...@@@@@@@..@.@@@.@..@...@@@.@@..@@@.@.@@.@@@@@........@@.@@.@.@.@.@@@@@@@@@@@.@.@@.@@@@@@@.@.@@@.@@@.@@@@@.@@.@@..@@..@@.@@@@.@
..@.@@.@@..@.@@..@@@@@.@@.@@@@..@.@.@@@@@@.@@@.@@@@@@..@.@@@@@@.@.@@@@@@.@.@.@@@@@@.@@..@.@.@@@@.@.@@@.@..@@@.@@@@.@@.....@.@.@.....@@@@.
.@@@@.@@@@@.@@.@@@@@@.@@@.@@@...@@.@.@@.@@@@@@....@@@@.@@.@@.@@.@@@@.@@.@@@@@...@@@@@.@@@@@..@..@@@@....@@@@..@.@@@@@.@.@@..@..@..@@@@@@.
@@@@@@.@.@@@..@..@@@.@@@.@..@.@@@@@@@@@@@.@.@@@@@..@@@.@..@@.@@....@@@.@@.@....@@@@@@@.@@.@@@@.@.@.@@..@.@@@@@...@.@@@@@@...@@..@.@@@@@..
@.@@@@@@.@.@.@.@@@..@@@@@.@@@.@@@@@..@.@.@@.@@.@@@.@@@@@@@@.@.@@@@@@.@@@@.@@.@@.@@.@.@@@@@@@@.@@.@@.@@.@@@@@@@@..@@@@..@@@......@@..@.@@@
.@@@@@.@@@@.@@@@@@.@@.@@@@.@@.@@@@.@.@@.@.@@@@@...@.@.@@@.@@@@@@.@@..@@@@@@@@@@@.@@@@.@@@..@@@@@@..@.@@@@.@@@.@.@@.@@.@@@@@@..@.@..@.@...
.@@....@.@.@.@@@.@@.@@@@@@@..@..@@..@@@....@....@@....@.@@.@.@@.@@@@@@@@@@@@..@.@@@@@.@.@@@@..@.@.@@.@@@@@..@@@@@@@@@.@.@@..@@@@..@@@..@@
@..@@@@@@.@@@@.@@@.@..@.@@@@.@@.@@@@@.@@.@.@@@@@@@..@..@.@@.@.@@..@@..@@@@@.@@@.@@@..@@@@@@@.@@@@@.@@.@@@@@@@@@@.@@@.@.@@@@@.@@@@@.@@..@@
@@.@..@.@@@@@.....@@.@@@@@@.@@@.@..@@@.@@@@.@@@..@.@@..@.@...@@@@@@@@.@@.@@..@@@@@.@@@@.@@.@..@@@.@@@@@@@@@...@@@@.@@@@@@@@@@.@@@@..@@@.@
@..@@@@.@.@@...@@@@..@@@.@@@@.@..@.@...@@@@@..@@@.@@@.@..@@..@@@@@@@.@@...@@.@@@@@.@.....@@@..@@...@.@....@@....@@@@@@@@@@@..@@@@@.@@@.@@
..@.....@@.@@@@@.@.@@@@@@.@@..@..@@..@@.@@@.@@.@.@@.@@@@@@.@@.@@@.@@@@...@.@.@.@@.@.@@..@@.@@@@..@@@@@.@.@.@@@@@.@@@@@@@.@@@@@@.@@@@.@@..
.@..@@@@@@@@@@.@.@.@.@@@.@@.@@@@@@@@@@.@@@.@.@...@.@@.@@@.@...@@.@@@@@@@.@@@.@@@...@@@.@@.@@@.@@@@@@@..@@....@.@.@@.@@@@.@.@.@@@.@@@@..@@
@.@....@@@@.@@.@.@@@@..@@@.@@.@@@@..@@@@@@..@@.@...@...@@@@@.@@@@@.@.@.@.@.@@.@@.@.@.@@..@.@@@.@@@.@...@@@.@.@@..@@@..@@...@@@@@@@@@@@.@.
@@@@.@.@@..@@.@..@@@@@@..@@....@..@@@@@@.@@...@@@@.@@@@.....@.@@.@.@@@@@@..@@.@...@..@@.@@@@@@.@@.@@@..@@@@@.@@@@@..@@.@@@.@@@@@@@..@@@@@
..@.@@@@@@.@.@.@@@.@@.@@@@@@..@.@.@.@@.@@@.@@@@...@@.@@.@.@@@..@@.@.@.@@@.@@@..@@@@@@@@@@@@.@@@@@@@@@@..@.@.@.@@@@@@@@@@@@.@@.@@.@.@.@@@@
.@..@@@@@.@..@@@.@@@@@@@..@@.@@...@@.@@@@@@@@@@..@.@@.@@.@@@@@@@...@@@.@.@@@.@@@@.@@@@@.@.@@.@.@@@@..@@@..@..@@@.@@@.@@.@.@@@@@@.@@@@@.@.
...@@.@@@..@@@@.@@@.@..@@@@@.@@@.@.@@.@@.@.@@@@....@@.@@..@@@.@@@..@.@@....@@.@@@@@@@@@@.@@@@.@@..@..@@@..@.....@..@..@@@@@@@.@@@@@@@.@@@
@@@@.@..@@@.@..@.@.@...@@@..@@@.@.@..@@.@@@..@@@@@@..@.@.....@.@@@@@.@@.@@@@.@@@@@@@@.@@@@@@@@@@...@.@@@.@.@@@@.@..@@.@@.@@@@.@@@@..@@.@.
@..@....@@@..@@@@@@@@@..@@@@@@@@.@.@@@@@@@@@@.@.@@@@...@@.@@@@@@...@.@.@@@....@@...@@@@@.@..@@.@.@@.@@.@.@.@@@.@@@@@@@.@@.@@@.@@@.@.@@@@.
@.@.@@@@.@...@@.@@@@.@@@..@@@.@@.@.@.@@.@@@.@@.@@....@@@@.@@@@.@.@.@.@@@@..@@.@@....@@@@@.@@@@@.@..@@@@.@.@@..@.@@@@.....@.@.@@@@@@.@@@@@
.@.@@@@.@...@@@.@@@.@@.@..@@@@.@@.@@@..@@@@..@.@@@@.@@..@@@@.@.@@.@@@.@@@..@@@@@.@@@@@@@@@.@@@.@@@..@.@.@.@@@.@..@@@..@...@..@...@.@...@@
@@@@@@@.@@.@.@.@@@.@@.@@@.@....@@.@@.@.@@@.@.@@.@.@@.@@@.@@@@@@@@@...@@.@.@@.@@..@.@@@..@..@.@..@@@@@@..@.@.@@@@@@.@@@...@@@@.@@.@@@@.@@.
@.@@@@..@.@.@.@.@@.@.@@@.@@@@..@@.@.@@@.@@@.@@@@@@@@.@.@@@@..@....@@..@@.@@..@@@@.@@.@@@@..@@@@...@@.@@@@@.@.@@@@.@@..@@@@@.@@@..@@@@.@@@
@@..@@.@@@.@..@..@@@.@@...@@@@@@@@@@.@..@.@.@@@@@.@@@@.@@@@@@.@@...@.....@@@@.@@@@@@@@@.......@@@.@@.@@..@@@@.@@@@..@@@@@@..@@..@@@@@@.@@
..@@@@@.@.@@@@@@@@@....@@.@.@.@.@@@....@@.....@.@@@@@@@@.@.@.@@@..@@@.@@.@@.@@@...@@@..@@..@@@.@@@@@@@.@@@@.@@....@@@@@..@..@@@.@.@...@@@
@@@@@@..@...@.@..@@@....@.@@@@@@@@.@.@@@.@@@@@@@@@.@@@.@@.@@..@.@@.@...@.@@@@.@@@@@@.@@@@@.@.@@.@@.@@@.@.@@@@.@@@@.@@.@@.@.@@.@..@@.@@@@@
@..@@.@.@@@@@.@....@@..@@@@@@@@.@@@@@@..@@@..@...@.@@@..@.@.@@.@@.....@.@...@@@@.@@.@.@@.@.@@@@.@@.@@.@@@.@@.@..@@@.@.@@@@..@@..@@.@@....
.@@.@.@@@@@@@@@..@.@@@.@@@@@.@@@.@.@@@@@..@@@@.@@@@@.@@@@@@@@@@.@.@@@@.@@.@.@@@@.@@@@@@@@..@@@..@@.@@.@@@.@.@.@@..@@@.@.@@@@.@@@.@@@.@@@.
@@@..@.@@.@@@..@@...@..@@@@@@@@@@@.....@.@@..@@.@.@..@@@@.@@.@...@@@.@@@@..@@@@..@.@@@.@@@@@@@.@.@@..@@@@@@@@@@@@.@.@@...@@@@@.@@@......@
@@@@.@@@@@@.@@.@...@@@...@@@@...@.@.@@.@.@@..@@..@@@.@@.@@.@@@.....@@@@@.@..@@@...@.....@@@@@.@@.@@.@@.@.@.@@@@@@@@.@.@.@.@@@@@@@.@@..@@.
@@.@@@..@@..@@..@@@@@@@@@@@..@.@@...@..@@@@@.@@.@...@@@@..@@@.@@@@.@@@..@@.@@....@@..@@@@.@@@@.@@..@@@@.@@@.@..@@@@..@....@@...@@@@@@@@..
.@.@.@@@..@..@@.@.@@@@@@..@@@@.@@@@....@@@@@@.@@.@@@.@.@@....@.@@.@@@.@.@@.@@.@@.@..@@@.@@@.@.@.@@@.@@@@@@.@..@@@..@.@..@@@@@@@@@@@@@@@@@
..@@.@.@@.@@@@@.@@@@@@..@@@@@@.@.@.@@@..@@@@@@.@@@@@@@@...@@..@@@@@@@@@@..@@.@.@@.@@@@@..@.@@@@.@@@.@@@@@@@@.@@.@@@@.@..@@..@.@@..@@@@@@.
@..@.@@@@@@.@@@..@@..@@..@@..@@@@.@.@@.@@@@@.@..@@@@..@..@@.@@@@.@@@...@...@.@.@@.@@..@@.@@@@.@.@.@@@@.@.@..@@@.@@.@.@@.@@..@@@@@@@..@@@@
@@.@@@@@.@@@.@@@..@@.@@..@.@@..@@@@.@@@..@..@@@@@@.@@@@.@.@@@@@@@.@..@@.@...@@...@@@@@...@@@@@@@.@@@@.@@.@@@@@@.@@@@@@@.@@.@..@@.@@@@@.@@
@@@@@.@@....@@@.@@@.@.@.@.@@@@@@@@@@@@@.@@@@@@.@..@@@@@.@.@@.@.@@@@..@@@@.@@..@@..@.@@...@@.@.@@.@@@@@.@@.@@@@@@.@@.@.@...@..@..@@@@@@@@.
.@@@..@.@..@@@@@@.@@..@.@@@.@@@..@.@.@.@@@.@.@..@@@@@@.@@@@@.@@@.@@@@..@.@@.@@@@@@@...@@@.@@....@@.@@@..@.@.@@@@.@@@..@@@.@.@@..@..@@.@@@
@@@.@@@@@@.@@@.@@@.@.@@@@.@@.@.@...@@.@.@.@@@...@@@.@..@@@@@@.@.@.@@@@@@@@@@@@..@@@@@.@@.@.@.@@@@..@@@@.@@..@..@....@.@@@.@..@@@@@..@@@@@
@@.@..@@@..@@.@@@@@@@.@@.@..@@@.....@@@@.@@@.@.@@.@@..@@.@@@.@@.@@..@@@.@@@@.@@@@..@.@@.@.@@@@@@@.@@@..@.@.@@@@..@@..@@@@@@.@@.@@@@.@@@@.
@..@@@.@..@@.@@.@@.@.@.@@@.@..@@@@@.@@.@@......@@@.@@.@...@@@.......@@..@@...@@@@@.@@@@@@@...@@@@..@@..@.@@.@@@@@.@.@..@@@@@.@@@@@.@..@.@
@@@.@.@.@@@@@.@.@@...@@@.@.@@@.@@@@@@.@@.@@.@@.@@@.@.@@.@@...@@@@@@@@@....@@@.@.@@.@..@@.@@@.@.@.@.@@@@@..@@@..@.@@.@.@@@@@.@.@@..@.@.@@@
@.@@@@.@.@@@@@@.@.@.@@@@@@...@@@@..@@@.@..@.@@@@@@.@@@....@@@@.@.@@@@@.@@@.@@@@.@@@@@..@.@..@..@.@@@..@@..@..@.@@..@@..@..@@.@@@@......@@
@.@@.@@@.@@@@@.@@@@@@.@@@@.@@@@@.@.@@.@.@@@.@.@....@.@@..@@@@@@.@.@..@..@@.@@@.@@@@....@@@.@@.@...@.@@@@.@@@@..@@@.@.@@@..@.@....@.@@@..@
@...@..@..@@.@.@@@....@@@.@@@@@@@@@.@@.@@@@..@@.@.@@..@@..@@@@@...@@...@@@.@..@@.@@@@.@.....@.@.@@.@@@@@@.@.@@@@@@..@@.@.@@@..@.@...@@@@@
.@@@@@...@.@@..@..@.@@@@@@....@@@@@@@@@@@@@@@@.@@@...@..@@.@..@@@@...@.@.@@@@..@.@@.@@.@.@@.@.@@.@.@.@@@@@@.@@@.@@..@.@@@@@..@@@@..@@@@..
.@@@@@@@@.@.@@@@@@.@.@.@@@@.@@.@@.@.@@@.@@@..@.@@..@....@..@.@@...@@@@@@@@@@.@.@.@@@..@@@@@@.@@@@@.@@....@@@@@@@@@@.@.@..@@....@@@@@@@@.@
@.@@@..@@@@.@.@@.@...@.@@..@.@@@@@@@.@@@.@@.@@.@..@@.@@@.@....@@@@..@.@.@..@@@@@@..@@@@@@@.@.@@@@@.@.@.@.@@.@....@@@..@@..@@@@.@@@.@@....
.@.@.@@@.@@@@@@@@.@@@.@@.@@@.@@@@@@.@@..@.@@@@@@@@@@.....@@.@@@.@@@@@..@@@@.@@.@@.@@@@@@@.@@.....@..@@@@@@@@@@@@.@.@@@@@@.@@.@.@@@.@.@@.@
@....@..@.@..@....@@.@@@.@@..@@.@@@@@.@@@@@@..@@@..@@.@...@....@.@..@.@@@@@@@...@@@@.@@@@@@@@@.@.@@..@@@@@@@@@.@..@.@@.@@@@@@@.@@@@..@@@.
@@@@@@.@.@@@@@@.@@..@@..@.@.@@.@.@.@@..@.@@..@@@.@@@@@@@@...@....@.@.@@@.@..@.@.@.@@.@...@@..@....@@.@.@@@@.@..@..@.@@.@@@@@@...@@@@@@@@.
@@..@@@.@@@@@@.@@@@.@@@@@...@@...@@..@@@@@..@@@.@@@.@.@@..@@..@@@@.@.@.@@@.@@@@.@@.@..@@...@.@@..@@.@.@@@@...@.@@@@@@@@..@@@@.@.@@@...@.@
.@@@@..@.@@...@.@.@@@@@@@@..@@@.@@@@.@@..@..@..@.@@@.@.@.@@.@....@@.@..@@.@.@@..@.@@.@@@@.@@@@..@...@@@@.@@@@@.@@@.@@..@@@.@@@.@@@@@@@@@.
@@@@@@..@.@.@@@@@.@@@@@@..@@@@@.@@@@.@..@@@.@@@..@@....@.@@.@@@@@..@@.@.@@@@@.@.....@@@.@@@@.@..@@@.@@@@.@.@@.@@@@.@@@@..@@.@@.@@..@@@@@@
@@@..@@.@....@@.@@....@@...@.@..@..@@@@@.@...@@...@.@@@@.@@..@@.@@@@@@@.@@@@@@.@@@@@..@@@@@@..@..@....@...@.@.@...@@@.@@@@.@@....@@..@@..
@.@..@@.@@.@@@..@@@.@..@@..@..@@.@.@@@.@@@@@@@@.@..@.@@@...@@@@.@@@@@@...@.@@@@@@.@@@@@.@@@@@@@..@@@.@.@@@@@@@@@.@@@@...@.@@@@@.@@@@.@@.@
@@.@@@..@.@@@@@@@@.@..@.@.@.@@@.@@.@@.@@@@...@@.@@@@@.@@@...@..@@..@@@.@@..@@@@@.@..@@@@@@@...@@.@.@@@@@@.@@@@@.@@@@.@.@@@@@@.@.@@@.@..@@
.@.@.@@@..@.@.@.@@..@@@@@.@@@@@@@...@@@.@@@@@@.@@.@@.@@@@@.@.@@@.@...@.@@.@.@...@......@@@@@@@@@..@@...@@@@@.@@.@@@@..@@@@@@.@..@@@@@@@@@
.@@@.@.@..@@@@.@@@@@.@@@.@@...@@@@..@@@@@.@@.@@@.@@@..@@@.@@@@..@.@.@@@@@@.@@@.@.@@@@@@.@@@.@@@.@@@.@@@..@..@.@@@@@@@@@..@@.@@@@.@@.@@@..
.@..@..@.@@.@@.@@@@@@.@.@@@@.@..@.@..@.@..@@.@@..@@@.@.@.@.@..@..@.@@....@.@.@@@.@@@@@..@@@.@@.@@@@@@@@@@@@.@@@.@.@.@..@@@@@.@@@@@@@@@@@.
.@@.@@@@@@@.@...@@.@@@@....@....@@@.@.@.@@..@@....@.@@@.@...@.@@...@@..@@@.@..@@..@.@@.@@.@@.@@.@..@@@..@@.@.@@@@.@.@@@@@@.@@@@@@@@@@@.@@
@@@.@@.@@@.@.@@@@@@@..@@@@@@@@..@@@.@@@@@.@@@@.@@@.@@@...@.@.@@@.@.@.@@@@@.@.@@.@@..@@@@.@@@@@@.@@..@@@@@@@@@@.@@@.@..@.@@@@@@@.@@@@@@@@.
@.@.@@@.@@@@@......@@@.@@.@.@@@@@.@@.@@..@.@@.@@....@@@@@@.@.@@.@...@@.@@@@.@@@@@@@@@@@@@@@@@.@...@@@@.@@@@@@@.@.@@@.@@.@@@...@.@@..@.@@@
@..@@@@@@@@.@.@.@@@..@@@@@.@@..@.@@.@@@@@@@@@@.@@..@.@@..@.@@@@.@@.@@@.@@.@@@@@@.@@@..@.@@@@@@@@@..@.@@@.@@..@@@@@@@@.@@@@.@@@@@@.@..@@@@
.@@@@.....@.@..@@@..@@.@@@@...@.@@@@@.@....@@@@@.@...@.@..@....@.@@@@.@@@@@@@..@@..@.@@@@@@.@.@@@@@..@.....@.@.@@@@@@@@@.@..@@.@..@..@.@@
@@@.@@@.@..@@@@.@@..@@@@@.@@..@...@.@...@@@@....@@@.@@.@@@@..@@@@@.@@@@@@..@@@.@@@.@.@@@@@@@@.@@.@@.@.@.@@@.@.@@..@@@@..@@@@.@@.@@@.@@.@@
..@@.@.@.@@@@@.@@@@.@.@.@....@@.@@.@@@.@@.@@.@@.@.@..@@@@...@..@.@@@.@.@..@@.@@@@.@@@.@@.@@@.@@.@@..@...@@..@..@@@..@.@@.@...@@@@@.@.@@..
@@@@@.@@@@@@@@@@..@@.@@@....@@.@@@.@..@..@.@...@@@@@.@@.@@@.@.@.@@.@@.@..@@..@@@@@@@@.@..@@@.@.@@..@@@@@@@@.....@@.@@@.@@@@@..@......@@@@
@@.....@....@@@@.@..@@@@.@@@.@@@@@@@@@...@@.@@..@..@.@.@@..@@@..@@@@@@@.@.@@@.@.@@@@.@.@.@@@.@@@@@.@@@.@..@..@@.@@@@@@@@@...@@@@.@.@.@@@@
.@@@@..@.@@@.@.@.@@@@.@.@..@@.@@@@.@@@@@@@@@@@@@@@@.@.@@..@....@..@@@.@@@@@@@@.@@@@@.@@@@@.@.@@....@..@@@.@@..@....@@@@@@.@@@@....@@..@@@
@@@.@.@@@@......@@...@.@.@@.@@@..@@@.@.@.@.@@@@@@.@@@.@@..@@@.@@@@....@@@@.@@@@..@@.@@@.@@@@.@@@@@@@.@@@..@@.@.@@.@.@@@@@..@@..@@..@.@@.@
@..@@@@..@..@.@@@.@@@..@@@@@..@@.@@@.@.@..@..@@.@.@@@@@@@@@@.@@.@@..@..@@@.@@@.@@@@@....@@@..@@.@.@@@.@@.@@@.@@...@@..@.......@.@@@@@@.@.
@@.@@@@.@..@..@.@@@..@.@@@@@@.@.@..@..@.....@@@..@@@..@..@.@@.@@@.@.@@.@.@@.@....@@..@@@@@@@@@@@@...@@.@@@..@@.@@@@.@.@@..@@@@@@@.@@@.@@@
@@@@@..@.@@@@@@...@.@@@@@.@@@.@@.@.@@@.@.@@.@@@@.@...@@@.@..@@.@@.@..@@@@.@.@@.@@@@..@@@@@@@.@@@@.@.@@@@...@.@@@@@@...@..@.@@@.@@....@.@@
.@@.....@@@@@.@.....@@.@.@.@..@@.@..@@.@..@@.@.@.@@@@.@.@@@@@.@@@@@@.@..@.@.@@@@@@@@...@@@@.@@.@@@@@@@@@@@@.@@...@...@@.@@...@@.@.@@.@@@.
@....@@@@@.@..@..@..@@.....@@@@..@@.@..@@@@@@.@.@@@@@.@@@.@@..@@@.@...@@..@.@@@.@.@@..@....@.@@@..@@@@.@@@..@@..@@@@...@@@@.@...@@@.@@@@@
@@.@..@..@.@..@@@..@@@@.@@@@..@@......@@@.@.@@@...@@.@@@@@@@@@@.@.@@..@@..@@..@@@@@@@@@@@@@.@...@.@.@@@@.@@.@.@@...@..@.@.@...@@@@@.@@@@@
@@@@...@@@@..@@@..@...@@.@@@.@@@@@..@@@@.@..@.@@@@@......@@.@@...@@.@@@@.@@.@..@.@@@.@@@@@.@@@.@@..@@@..@@@@..@.@.@@.@@@@@...@.@...@...@.
@.@@@..@@.@.@@@@@..@..@.@@.@@@@.@@.@.@@..@@@@@@@@..@.@@..@..@.@@..@..@@..@@..@@@@.@.@.@.@.@@.@@@..@.@@@.@....@.@@@@@...@.@@.@...@@...@@..
.@@.@@@...@@@..@@.@@..@@.@.@@..@@@......@@.@@@....@@@@@.@@@@..@@.@....@@@..@@@@@.@@@...@@@.@@.@@@.@.@@@@@.@.@.@@@@@@.@.@@@@@..@@..@@...@@
@@@@@@@@...@@...@@@@@@@.@.@@.@@@.@.@.@@..@.@@..@.@.@.@@@@@@..@@@@.@@@@@...@@....@@@@.@@.@@.@..@.@@.@@..@@@@.@@@@.@@.@.@@...@@@.@@@..@@@..
@...@..@@@@@..@@...@.@@@@.@.@.@@@@@@.@@.@.@@...@.@..@@@@@.@.@.@@.@.@.@@@.@@.@@@@@@@@.@@@.@..@.@@@.@@@@@@.@@.@@.@@..@@.@@.@@@..@.@@.@@@@@.
.@@@.@@....@@@@@@.@@@@@@@@@@@.@.@.@@@.@@@@@@@@..@@@@@.@@@@@.@@.@@@.@@@.@..@.@@...@@...@@.....@.@@@@.@@.@@.@@@.@.@..@.@@@..@..@@@.@.@@.@.@
@.@@.@@@@.@.@.@@..@..@@@@..@@.@@@@@.@@@..@..@@@@.@@.@@@...@@@@@@@@@.@@@@@@...@@@.@..@@@@.....@.@@@@@..@.@..@@@..@.@@@.@@@.@@@@@..@.@@@...
.@.@@@.@.@...@.@@@.@.@@@@@@@@@@.@@...@..@@@.@.@@@.@.@@@@@..@@@@@@@@@@@.@@@@..@.@@@@@@@@..@@..@@@@@@@@..@@...@@@@@@@@.@.@@@@@..@@@.@.@@@@@
..@@.@..@@.@@@.@@@@.@.@.@@..@@.@@...@.@.@@@@@.@...@@@@...@@@..@...@@@....@@@@@.@@@@.@@@@@@.@.@@@@.@.@@@.@@@.@@.@.@@.@@.....@@@...@.@@@@@@
@@@@.@@@@@.@@.@.@.@@@@@@@@@..@@@@@@@@@..@.@@@.@@@.@@@@@.@@@@@.@.@@@@.....@.@.@@@@@@.....@@.@.@@.@..@@@@@.@..@.@..@...@@@.@..@.@@@@.@.@@@@
@@@@.@@@..@@@.@@@@@@@@@.@@@@@@@..@.@@.@@@@.@@@..@.@..@@.@@...@@@@@.@.@@...@..@@@..@@.@.@@@@.@@@@@@@@@@@....@@.@@.@@@...@.@.@@@@.@@@.@@@.@
@@@.@..@@@@@.@@.@@..@.@@@..@@@@@@@.@@@.@@@@@@.@@.@...@@@.@@..@@@@@.@@..@@@@@@@@.@@....@@....@@@@@@@@.@.@.@@@.@@.@.@@@@@.@.@@.@@@.@@@@.@.@
.@@.@@@@..@@@.@.@.@@@@@@@@@@@..@..@@@@@@@@@@@..@@@.....@@@@.@@@@@@@..@@..@@@..@@@@@@..@@.@@@@@..@@@@.@.@@@@..@@@@@...@.@@@.@@@@@@.@@@.@@@
@@..@.@.@@@@@.@@@.@@@@@@.@...@.@@.@@@..@..@.@@@@.@@.@@@@@@@..@.@@@@@@@@.@..@.@@@...@@@.@@.@@@@@@.@@@@@@..@...@@@@.@@.@@.@.@.@@.@@.@@.@.@@
@.@@..@@...@@@@@.@@.@..@@@@@@.@@@.@.@@.@@@@@@@..@@@@@@.@@@@.....@@.@@@@..@@@...@@..@..@@@@.@@@@@@@@@..@.@@@@@..@@@.@@.@@@.@..@@@@@@.@@@@@
@@@@@@@@@@..@.@.@@@@@..@@@@..@@.@@@@@..@@@@.@.@@@@@@@.@@@@@.@@@@.@.@@@@@@@@@@@@@@@..@@@@@@.@@@@@.@@@@@....@.@@.@@.@...@@@@@@@@.@.@@.@..@@
..@..@@@@@.@@@@@.@@@@@@@.@@..@.@@.@@@@.@@@@@..@.@.@.@@.@@...@@@@@@@@...@..@..@..@.@@@...@@...@@.@@..@@@@.@....@@@@@.@@@@.@@@@@.@@.@@@@@.@
@@@.@.@@...@@......@.@..@@@.@@@.@.@@.@@@..@@@@.@.@@@@.@@.@.@.@@@@.@@@@@@.@@@@@@.@@@..@@......@@@@@@@.@@@@@@@@.@@@@@@@..@.@@@..@.@..@@@.@@
@@@@.@@...@@..@@@@@@@.@@@...@.@@.@.@@@@@@@@@@@@@@@.@@.@@.@@@..@..@..@@.@.@.@@@@@@@....@@.@@@@.@.@@@.@@@@@@..@.@@.@@@...@.@@@.@@@..@@@@..@
.@@.@.@@@.@....@@.@@@@..@@@@..@@@.@@@...@@..@@@@..@.@.@@@@@@@.@@@@.@.@@.@@....@@.@@@@.@@@@.@.@.@@....@.@@@...@.@...@...@..@.@@@@@..@@@.@.
..@@@@@@@.@@.@..@@@..@.@....@@..@@@@@.@@@..@@@.@@@..@@.@@@.@@@@@@@.@.@@..@@@@.@.@@@......@@..@@@.@@@@...@@..@@@@@.@.@@@@@..@.@@..@..@@@@@
.@@@.@.@.@.@.@@@@.@.@.@@..@@.@@@.@.@@@@@.@.@..@@@@@.@.@@.@@@@@@@@..@@..@@@@@@.@.@@@@.@@...@@@.@@...@@@@@@@@@.@@.@@@.@@.@@.@@...@@.@@.@.@.
@.@@@@.@@@.@@@..@..@..@@@@@.@.@.@@@@@@@.@..@@@.@.@.@@.@@@@...@@@.@.@@@@..@.@@....@@@@.@@@@.@.@.@@@@@@@.@@.@@@@..@.@@@.@@@@@@.@@@@@@@@.@.@
.@@@@@.@@@@..@@.@.@@@.@.@@@@@@@..@@.@@.@@.@.@.@.@@@@@@@@@...@.@@@@@@@..@@@.@.@.@.@@@@.@@@.@.@@@@@@@@@@@@@@@@.@@.@@@@@.@.@..@@..@@.@@@@.@.
.@@.@@@@@@..@@.@.@@@......@@@@..@@@.@@@.@@..@@@@@.@@..@.@@@.@@.@@@@@..@@@@.@.@@..@.@.@@.@@@.@@@@@@@..@@.@.@...@@@.@..@.@@.@@@@.@..@@@@@..
@.@@@@..@.@.@@@@@@@@@...@@@@..@.@@@..@@@@@..@..@.@@.@@.@@.@@@@.@@.@.@@@@@.@@@...@.@@..@.@@.@@@@@@@@@@@@@.@@@@@.@@.@@@..@@@@.@@@@..@@@@@@@
@@@@@@...@..@.@@@..@@.@@@@.@@..@@@.@.@@@.@@@@@@@.@@@@..@@@@@.@.@.@@@@@@.@@.@@@..@.@.@.@...@@@..@@@@@....@@@@@@@@@@...@@@.@.@.@@@.@.@@@..@
@.@.@@@.@@@.@.@.@@@@.@..@.@....@@..@@@@.@..@..@@@@@@@.@@@@@.@@@@@..@@.@...@@..@@.@@@@@@@@@.@.@@@@@@@.....@@@@@@@.@@@.@..@@.@@.@.@@.@@.@..
..@@..@.@@@.@@@@.@@.@@..@@.@.@@.@....@@@@@@...@.@..@@@@@@@...@...@..@....@@@.@..@@@@@@.....@@@@@.@@@..@.@@@@@@.@@@@.@@@.@@.@@@..@@@@@..@@
@..@.@@.@@@.@@@..@@@...@..@.@@@@@@.@.@@...@.@@..@..@@.@@....@....@@@.@@@@@.@.@@@.@.@.@@@@.@.@.@...@@@@@@@@...@@@@@@..@@@@@@@.@@@.@.@@@.@.
@@.@.@.@.@@.@.@@@@..@@@@@@@.@@..@@.@@@@@@@@.@.@@.@.@.@...@@.@.@@.@.@@@@@@@@@@@@@@.@..@.@.@@.@.@@@@.@@@@@@@@..@..@...@.@@@..@@@@.@.@@@@@@.
.@.@@@@@@.@..@@...@@@.@@@.@@@@@@.@@@.@@@@@..@@.@.@.@@@..@@@.@@..@.@.@@@@@.@..@@.@@..@@@@@@@.@..@@@@@@.@@.@@@@@.@.@@.@.@.@.@@@@@@@...@.@@.

10
day4/test_input Normal file
View file

@ -0,0 +1,10 @@
..@@.@@@@.
@@@.@.@.@@
@@@@@.@.@@
@.@@@@..@.
@@.@@@@.@@
.@@@@@@@.@
.@.@.@.@@@
@.@@@.@@@@
.@@@@@@@@.
@.@.@@@.@.

View file

@ -1,28 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
BUILD_DIR=build
if [ ! -f "${BUILD_DIR}/compile_commands.json" ]; then
echo "compile_commands.json not found; running cmake configure..."
cmake -S . -B "${BUILD_DIR}" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
fi
if ! command -v clang-tidy >/dev/null 2>&1; then
echo "clang-tidy not found in PATH"
exit 1
fi
# Prefer files tracked by git; fallback to find
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
FILES=$(git ls-files '*.cpp' '*.cxx' '*.cc' '*.h' '*.hpp' || true)
else
FILES=$(find . -iname "*.cpp" -o -iname "*.cc" -o -iname "*.cxx" -o -iname "*.h" -o -iname "*.hpp")
fi
if [ -z "${FILES}" ]; then
echo "No source files found for clang-tidy"
exit 0
fi
for f in ${FILES}; do
echo "Running clang-tidy on ${f}"
clang-tidy "${f}" -p "${BUILD_DIR}" || true
done