├── .dockerignore ├── .gitignore ├── .gitattributes ├── map.bin.gz ├── LICENSE ├── .devcontainer ├── devcontainer.json └── post-create.sh ├── tsumonya ├── core.hpp ├── hule_indexer.hpp ├── calculator.hpp └── table.hpp ├── .vscode └── settings.json ├── Dockerfile ├── test ├── Dockerfile └── calculator.cpp ├── CMakeLists.txt └── README.md /.dockerignore: -------------------------------------------------------------------------------- 1 | /build 2 | /map.bin 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /map.bin 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | map.bin.gz filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /map.bin.gz: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:261e0fe7bc6a7822dec6d4e0724018fe14372bbb61049a4de64cb0c87bfbf7a4 3 | size 305579390 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Cryolite 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu 3 | { 4 | "name": "Ubuntu", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "mcr.microsoft.com/devcontainers/base:jammy", 7 | "features": { 8 | "ghcr.io/devcontainers/features/python:1": {}, 9 | "ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {}, 10 | "ghcr.io/devcontainers-contrib/features/pylint:2": {}, 11 | "ghcr.io/devcontainers-contrib/features/wget-apt-get:1": {}, 12 | "ghcr.io/jungaretti/features/make:1": {} 13 | }, 14 | 15 | // Features to add to the dev container. More info: https://containers.dev/features. 16 | // "features": {}, 17 | 18 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 19 | // "forwardPorts": [], 20 | 21 | // Use 'postCreateCommand' to run commands after the container is created. 22 | "postCreateCommand": "bash /workspaces/tsumonya/.devcontainer/post-create.sh", 23 | 24 | // Configure tool-specific properties. 25 | // "customizations": {}, 26 | 27 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. 28 | // "remoteUser": "root" 29 | 30 | "remoteEnv": { 31 | "C_INCLUDE_PATH": "/home/vscode/.local/include", 32 | "CPLUS_INCLUDE_PATH": "/home/vscode/.local/include", 33 | "LIBRARY_PATH": "/home/vscode/.local/lib64:/home/vscode/.local/lib", 34 | "LD_LIBRARY_PATH": "/home/vscode/.local/lib64:/home/vscode/.local/lib", 35 | "PATH": "/home/vscode/.local/bin:${containerEnv:PATH}" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tsumonya/core.hpp: -------------------------------------------------------------------------------- 1 | #if !defined(TSUMONYA_CORE_HPP_INCLUDE_GUARD) 2 | #define TSUMONYA_CORE_HPP_INCLUDE_GUARD 3 | 4 | #include 5 | #include 6 | 7 | 8 | namespace Tsumonya{ 9 | 10 | using Table = std::array, 5u>, 2u>, 6u>, 34u>; 11 | 12 | inline constexpr std::array, 26u> stable = {{ 13 | {{ 1u, 0u, 2u, 0u, 0u, 0u, 0u }}, 14 | {{ 1u, 0u, 1u, 1u, 0u, 0u, 0u }}, 15 | {{ 1u, 0u, 1u, 0u, 0u, 0u, 0u }}, 16 | {{ 1u, 0u, 0u, 2u, 0u, 0u, 0u }}, 17 | {{ 1u, 0u, 0u, 1u, 0u, 0u, 0u }}, 18 | {{ 1u, 0u, 0u, 0u, 0u, 0u, 0u }}, 19 | {{ 0u, 1u, 1u, 0u, 0u, 0u, 0u }}, 20 | {{ 0u, 1u, 0u, 1u, 0u, 0u, 0u }}, 21 | {{ 0u, 1u, 0u, 0u, 0u, 0u, 0u }}, 22 | {{ 0u, 0u, 2u, 2u, 0u, 0u, 0u }}, 23 | {{ 0u, 0u, 2u, 1u, 0u, 0u, 0u }}, 24 | {{ 0u, 0u, 2u, 0u, 0u, 0u, 0u }}, 25 | {{ 0u, 0u, 1u, 3u, 0u, 0u, 0u }}, 26 | {{ 0u, 0u, 1u, 2u, 0u, 0u, 0u }}, 27 | {{ 0u, 0u, 1u, 1u, 0u, 0u, 0u }}, 28 | {{ 0u, 0u, 1u, 0u, 1u, 0u, 0u }}, 29 | {{ 0u, 0u, 1u, 0u, 0u, 0u, 0u }}, 30 | {{ 0u, 0u, 0u, 4u, 0u, 0u, 0u }}, 31 | {{ 0u, 0u, 0u, 3u, 0u, 0u, 0u }}, 32 | {{ 0u, 0u, 0u, 2u, 0u, 0u, 0u }}, 33 | {{ 0u, 0u, 0u, 1u, 1u, 0u, 0u }}, 34 | {{ 0u, 0u, 0u, 1u, 0u, 0u, 0u }}, 35 | {{ 0u, 0u, 0u, 0u, 1u, 0u, 0u }}, 36 | {{ 0u, 0u, 0u, 0u, 0u, 1u, 0u }}, 37 | {{ 0u, 0u, 0u, 0u, 0u, 0u, 1u }}, 38 | {{ 0u, 0u, 0u, 0u, 0u, 0u, 0u }} 39 | }}; 40 | inline constexpr std::array mtable = { 3u, 3u, 2u, 3u, 2u, 1u, 2u, 2u, 1u, 4u, 3u, 2u, 4u, 3u, 2u, 2u, 1u, 4u, 3u, 2u, 2u, 1u, 1u, 1u, 1u, 0u }; 41 | inline constexpr std::array ntable = { 4u, 4u, 3u, 4u, 3u, 2u, 4u, 4u, 3u, 4u, 3u, 2u, 4u, 3u, 2u, 4u, 1u, 4u, 3u, 2u, 4u, 1u, 3u, 4u, 4u, 0u }; 42 | inline constexpr std::array xytable = { 2u, 2u, 1u, 2u, 1u, 0u, 1u, 1u, 0u, 4u, 3u, 2u, 4u, 3u, 2u, 1u, 1u, 4u, 3u, 2u, 1u, 1u, 0u, 0u, 0u, 0u }; 43 | 44 | } // namespace Tsumonya 45 | 46 | #endif // !defined(TSUMONYA_CORE_HPP_INCLUDE_GUARD) 47 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "C_Cpp.default.cppStandard": "c++23", 3 | "C_Cpp.default.cStandard": "c23", 4 | "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools", 5 | "files.associations": { 6 | "cctype": "cpp", 7 | "clocale": "cpp", 8 | "cmath": "cpp", 9 | "csignal": "cpp", 10 | "cstdarg": "cpp", 11 | "cstddef": "cpp", 12 | "cstdio": "cpp", 13 | "cstdlib": "cpp", 14 | "cstring": "cpp", 15 | "ctime": "cpp", 16 | "cwchar": "cpp", 17 | "cwctype": "cpp", 18 | "any": "cpp", 19 | "array": "cpp", 20 | "atomic": "cpp", 21 | "strstream": "cpp", 22 | "bit": "cpp", 23 | "*.tcc": "cpp", 24 | "chrono": "cpp", 25 | "codecvt": "cpp", 26 | "compare": "cpp", 27 | "complex": "cpp", 28 | "concepts": "cpp", 29 | "condition_variable": "cpp", 30 | "cstdint": "cpp", 31 | "deque": "cpp", 32 | "list": "cpp", 33 | "map": "cpp", 34 | "set": "cpp", 35 | "string": "cpp", 36 | "unordered_map": "cpp", 37 | "unordered_set": "cpp", 38 | "vector": "cpp", 39 | "exception": "cpp", 40 | "algorithm": "cpp", 41 | "functional": "cpp", 42 | "iterator": "cpp", 43 | "memory": "cpp", 44 | "memory_resource": "cpp", 45 | "numeric": "cpp", 46 | "optional": "cpp", 47 | "random": "cpp", 48 | "ratio": "cpp", 49 | "source_location": "cpp", 50 | "string_view": "cpp", 51 | "system_error": "cpp", 52 | "tuple": "cpp", 53 | "type_traits": "cpp", 54 | "utility": "cpp", 55 | "fstream": "cpp", 56 | "future": "cpp", 57 | "initializer_list": "cpp", 58 | "iomanip": "cpp", 59 | "iosfwd": "cpp", 60 | "iostream": "cpp", 61 | "istream": "cpp", 62 | "limits": "cpp", 63 | "mutex": "cpp", 64 | "new": "cpp", 65 | "numbers": "cpp", 66 | "ostream": "cpp", 67 | "semaphore": "cpp", 68 | "shared_mutex": "cpp", 69 | "sstream": "cpp", 70 | "stdexcept": "cpp", 71 | "stop_token": "cpp", 72 | "streambuf": "cpp", 73 | "thread": "cpp", 74 | "cinttypes": "cpp", 75 | "typeindex": "cpp", 76 | "typeinfo": "cpp", 77 | "valarray": "cpp", 78 | "variant": "cpp" 79 | } 80 | } -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest 2 | 3 | SHELL ["/bin/bash", "-c"] 4 | 5 | RUN set -euxo pipefail; \ 6 | apt-get -y update; \ 7 | apt-get -y dist-upgrade; \ 8 | apt-get -y install \ 9 | bzip2 \ 10 | curl \ 11 | g++ \ 12 | git-core \ 13 | gpg \ 14 | libssl-dev \ 15 | make \ 16 | python3 \ 17 | python3-dev \ 18 | python3-pip \ 19 | xz-utils; \ 20 | apt-get clean && rm -rf /var/lib/apt/lists/*; \ 21 | python3 -m pip install -U pip; \ 22 | python3 -m pip install -U \ 23 | mahjong==1.1.11 \ 24 | setuptools \ 25 | wheel; \ 26 | useradd -ms /bin/bash ubuntu; \ 27 | mkdir /workspace; \ 28 | chown ubuntu:ubuntu /workspace 29 | 30 | USER ubuntu 31 | 32 | RUN set -euxo pipefail; \ 33 | pushd /workspace; \ 34 | git clone 'https://github.com/Cryolite/prerequisites'; \ 35 | popd; \ 36 | /workspace/prerequisites/gcc/install --debug --prefix /home/ubuntu/.local 37 | ENV C_INCLUDE_PATH="/home/ubuntu/.local/include" 38 | ENV CPLUS_INCLUDE_PATH="/home/ubuntu/.local/include" 39 | ENV LIBRARY_PATH="/home/ubuntu/.local/lib64:/home/ubuntu/.local/lib" 40 | ENV LD_LIBRARY_PATH="/home/ubuntu/.local/lib64:/home/ubuntu/.local/lib" 41 | ENV PATH="/home/ubuntu/.local/bin${PATH:+:$PATH}" 42 | 43 | RUN set -euxo pipefail; \ 44 | /workspace/prerequisites/cmake/install --debug --prefix /home/ubuntu/.local; \ 45 | echo 'import toolset : using ; using python : : /usr/bin/python3 ;' > /home/ubuntu/user-config.jam; \ 46 | /workspace/prerequisites/boost/download --debug --source-dir /workspace/boost; \ 47 | /workspace/prerequisites/boost/build --debug --source-dir /workspace/boost --prefix /home/ubuntu/.local -- \ 48 | -d+2 --with-headers --with-timer --with-python --build-type=complete --layout=tagged \ 49 | toolset=gcc variant=debug threading=multi link=shared runtime-link=shared \ 50 | cxxflags=-D_GLIBCXX_DEBUG cxxflags=-D_GLIBCXX_DEBUG_PEDANTIC \ 51 | cflags=-fsanitize=address cxxflags=-fsanitize=address linkflags=-fsanitize=address \ 52 | cflags=-fsanitize=undefined cxxflags=-fsanitize=undefined linkflags=-fsanitize=undefined; \ 53 | /workspace/prerequisites/boost/build --debug --source-dir /workspace/boost --prefix /home/ubuntu/.local -- \ 54 | -d+2 --with-headers --with-timer --with-python --build-type=complete --layout=tagged \ 55 | toolset=gcc variant=release threading=multi link=shared runtime-link=shared; \ 56 | rm -rf /workspace/boost 57 | 58 | WORKDIR /workspace/tsumonya 59 | 60 | ENTRYPOINT ["./build.sh"] 61 | -------------------------------------------------------------------------------- /test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest 2 | 3 | SHELL ["/bin/bash", "-c"] 4 | 5 | RUN set -euxo pipefail; \ 6 | apt-get -y update; \ 7 | apt-get -y dist-upgrade; \ 8 | apt-get -y install \ 9 | bzip2 \ 10 | curl \ 11 | g++ \ 12 | git-core \ 13 | gpg \ 14 | libssl-dev \ 15 | make \ 16 | python3 \ 17 | python3-dev \ 18 | python3-pip \ 19 | xz-utils; \ 20 | apt-get clean && rm -rf /var/lib/apt/lists/*; \ 21 | python3 -m pip install -U pip; \ 22 | python3 -m pip install -U \ 23 | mahjong==1.1.11 \ 24 | setuptools \ 25 | wheel; \ 26 | useradd -ms /bin/bash ubuntu; \ 27 | mkdir /workspace; \ 28 | chown ubuntu:ubuntu /workspace 29 | 30 | USER ubuntu 31 | 32 | RUN set -euxo pipefail; \ 33 | pushd /workspace; \ 34 | git clone 'https://github.com/Cryolite/prerequisites'; \ 35 | popd; \ 36 | /workspace/prerequisites/gcc/install --debug --prefix /home/ubuntu/.local 37 | ENV C_INCLUDE_PATH="/home/ubuntu/.local/include" 38 | ENV CPLUS_INCLUDE_PATH="/home/ubuntu/.local/include" 39 | ENV LIBRARY_PATH="/home/ubuntu/.local/lib64:/home/ubuntu/.local/lib" 40 | ENV LD_LIBRARY_PATH="/home/ubuntu/.local/lib64:/home/ubuntu/.local/lib" 41 | ENV PATH="/home/ubuntu/.local/bin${PATH:+:$PATH}" 42 | 43 | RUN set -euxo pipefail; \ 44 | /workspace/prerequisites/cmake/install --debug --prefix /home/ubuntu/.local; \ 45 | echo 'import toolset : using ; using python : : /usr/bin/python3 ;' > /home/ubuntu/user-config.jam; \ 46 | /workspace/prerequisites/boost/download --debug --source-dir /workspace/boost; \ 47 | /workspace/prerequisites/boost/build --debug --source-dir /workspace/boost --prefix /home/ubuntu/.local -- \ 48 | -d+2 --with-headers --with-timer --with-python --build-type=complete --layout=tagged \ 49 | toolset=gcc variant=debug threading=multi link=shared runtime-link=shared \ 50 | cxxflags=-D_GLIBCXX_DEBUG cxxflags=-D_GLIBCXX_DEBUG_PEDANTIC \ 51 | cflags=-fsanitize=address cxxflags=-fsanitize=address linkflags=-fsanitize=address \ 52 | cflags=-fsanitize=undefined cxxflags=-fsanitize=undefined linkflags=-fsanitize=undefined; \ 53 | /workspace/prerequisites/boost/build --debug --source-dir /workspace/boost --prefix /home/ubuntu/.local -- \ 54 | -d+2 --with-headers --with-timer --with-python --build-type=complete --layout=tagged \ 55 | toolset=gcc variant=release threading=multi link=shared runtime-link=shared; \ 56 | rm -rf /workspace/boost 57 | 58 | COPY --chown=ubuntu:ubuntu . /workspace/tsumonya 59 | WORKDIR /workspace/tsumonya 60 | 61 | RUN set -euxo pipefail; \ 62 | gunzip -k map.bin.gz; \ 63 | mkdir build; \ 64 | pushd build; \ 65 | cmake -DCMAKE_BUILD_TYPE=Release ..; \ 66 | make -j$(nproc) verbose=1; \ 67 | popd 68 | 69 | ENTRYPOINT ["bash", "-c", "time build/test_calculator"] 70 | -------------------------------------------------------------------------------- /.devcontainer/post-create.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euxo pipefail 4 | 5 | PS4='+${BASH_SOURCE[0]}:$LINENO: ' 6 | if [[ -t 1 ]] && type -t tput >/dev/null; then 7 | if (( "$(tput colors)" == 256 )); then 8 | PS4='$(tput setaf 10)'$PS4'$(tput sgr0)' 9 | else 10 | PS4='$(tput setaf 2)'$PS4'$(tput sgr0)' 11 | fi 12 | fi 13 | 14 | # Install prerequisite packages. 15 | sudo apt-get -y update 16 | sudo apt-get -y dist-upgrade 17 | sudo apt-get -y install \ 18 | g++ \ 19 | python3-dev 20 | 21 | sudo chown vscode:vscode /workspaces 22 | 23 | # Install prerequisite Python packages. 24 | python3 -m pip install -U pip 25 | python3 -m pip install -U \ 26 | mahjong==1.1.11 \ 27 | setuptools \ 28 | wheel 29 | 30 | # Clone `prerequisites`. 31 | pushd /workspaces 32 | git clone 'https://github.com/Cryolite/prerequisites' 33 | popd 34 | 35 | # Install GCC. 36 | /workspaces/prerequisites/gcc/install --debug --prefix "$HOME/.local" 37 | 38 | if [[ -v C_INCLUDE_PATH ]]; then 39 | OLD_C_INCLUDE_PATH="$C_INCLUDE_PATH" 40 | fi 41 | export C_INCLUDE_PATH="$HOME/.local/include${C_INCLUDE_PATH:+:$C_INCLUDE_PATH}" 42 | 43 | if [[ -v CPLUS_INCLUDE_PATH ]]; then 44 | OLD_CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH" 45 | fi 46 | export CPLUS_INCLUDE_PATH="$HOME/.local/include${CPLUS_INCLUDE_PATH:+:$CPLUS_INCLUDE_PATH}" 47 | 48 | if [[ -v LIBRARY_PATH ]]; then 49 | OLD_LIBRARY_PATH="$LIBRARY_PATH" 50 | fi 51 | export LIBRARY_PATH="$HOME/.local/lib64:$HOME/.local/lib${LIBRARY_PATH:+:$LIBRARY_PATH}" 52 | 53 | if [[ -v LD_LIBRARY_PATH ]]; then 54 | OLD_LD_LIBRARY_PATH="$LD_LIBRARY_PATH" 55 | fi 56 | export LD_LIBRARY_PATH="$HOME/.local/lib64:$HOME/.local/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" 57 | 58 | if [[ -v PATH ]]; then 59 | OLD_PATH="$PATH" 60 | fi 61 | export PATH="$HOME/.local/bin${PATH:+:$PATH}" 62 | 63 | # Install CMake. 64 | /workspaces/prerequisites/cmake/install --debug --prefix "$HOME/.local" 65 | 66 | # Install Boost.Stacktrace and Boost.Python. 67 | echo 'import toolset : using ; using python : : /usr/local/python/current/bin/python3 ;' > "$HOME/user-config.jam" 68 | /workspaces/prerequisites/boost/download --debug --source-dir /workspaces/boost 69 | /workspaces/prerequisites/boost/build --debug --source-dir /workspaces/boost --prefix "$HOME/.local" -- \ 70 | -d+2 --with-headers --with-timer --with-python --build-type=complete --layout=tagged \ 71 | toolset=gcc variant=debug threading=multi link=shared runtime-link=shared \ 72 | cxxflags=-D_GLIBCXX_DEBUG cxxflags=-D_GLIBCXX_DEBUG_PEDANTIC \ 73 | cflags=-fsanitize=address cxxflags=-fsanitize=address linkflags=-fsanitize=address \ 74 | cflags=-fsanitize=undefined cxxflags=-fsanitize=undefined linkflags=-fsanitize=undefined 75 | /workspaces/prerequisites/boost/build --debug --source-dir /workspaces/boost --prefix "$HOME/.local" -- \ 76 | -d+2 --with-headers --with-timer --with-python --build-type=complete --layout=tagged \ 77 | toolset=gcc variant=release threading=multi link=shared runtime-link=shared 78 | rm -rf /workspaces/boost 79 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.25.0) 2 | project(tsumonya) 3 | 4 | enable_testing() 5 | 6 | if (NOT DEFINED PYTHON_VERSION) 7 | execute_process( 8 | COMMAND bash "-c" "python3 --version | grep -Eo '^Python [[:digit:]]+\\.[[:digit:]]+' | grep -Eo '[[:digit:]]+\\.[[:digit:]]+'" 9 | OUTPUT_VARIABLE PYTHON_VERSION 10 | OUTPUT_STRIP_TRAILING_WHITESPACE) 11 | endif() 12 | 13 | if (NOT DEFINED PYTHON_INCLUDE_PATH) 14 | set(PYTHON_INCLUDE_PATH /usr/include/python${PYTHON_VERSION}) 15 | endif() 16 | 17 | message("PYTHON_VERSION=${PYTHON_VERSION}") 18 | message("PYTHON_INCLUDE_PATH=${PYTHON_INCLUDE_PATH}") 19 | 20 | message("CMAKE_C_COMPILER=${CMAKE_C_COMPILER}") 21 | message("CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}") 22 | 23 | set(CMAKE_CXX_STANDARD 20) 24 | 25 | include_directories( 26 | "${PYTHON_INCLUDE_PATH}" 27 | .) 28 | 29 | if (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) 30 | add_compile_options(-Werror) 31 | endif() 32 | 33 | message("CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") 34 | 35 | if (CMAKE_BUILD_TYPE STREQUAL "Debug") 36 | set(KANACHAN_ENABLE_ASSERT ON) 37 | endif() 38 | if (KANACHAN_ENABLE_ASSERT) 39 | add_compile_definitions(KANACHAN_ENABLE_ASSERT) 40 | endif() 41 | message("KANACHAN_ENABLE_ASSERT=${KANACHAN_ENABLE_ASSERT}") 42 | 43 | if (CMAKE_BUILD_TYPE STREQUAL "Debug") 44 | if (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) 45 | add_compile_definitions(_GLIBCXX_DEBUG _GLIBCXX_DEBUG_PEDANTIC) 46 | endif() 47 | endif() 48 | 49 | if (KANACHAN_WITH_COVERAGE) 50 | add_compile_definitions(KANACHAN_WITH_COVERAGE) 51 | add_compile_options("-coverage") 52 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -coverage") 53 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -coverage") 54 | endif() 55 | message("KANACHAN_WITH_COVERAGE=${KANACHAN_WITH_COVERAGE}") 56 | 57 | if (CMAKE_BUILD_TYPE STREQUAL "Debug") 58 | if (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) 59 | set(KANACHAN_WITH_ASAN ON) 60 | endif() 61 | endif() 62 | if (KANACHAN_WITH_ASAN) 63 | add_compile_options(-fsanitize=address) 64 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address") 65 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") 66 | endif() 67 | message("KANACHAN_WITH_ASAN=${KANACHAN_WITH_ASAN}") 68 | 69 | if (CMAKE_BUILD_TYPE STREQUAL "Debug") 70 | if (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) 71 | set(KANACHAN_WITH_UBSAN ON) 72 | endif() 73 | endif() 74 | if (KANACHAN_WITH_UBSAN) 75 | add_compile_options(-fsanitize=undefined) 76 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=undefined") 77 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined") 78 | endif() 79 | message("KANACHAN_WITH_UBSAN=${KANACHAN_WITH_UBSAN}") 80 | 81 | if (KANACHAN_WITH_TSAN) 82 | add_compile_options(-fsanitize=thread) 83 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=thread") 84 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=thread") 85 | endif() 86 | message("KANACHAN_WITH_TSAN=${KANACHAN_WITH_TSAN}") 87 | 88 | if (CMAKE_BUILD_TYPE STREQUAL "Release") 89 | set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) 90 | endif() 91 | 92 | add_compile_options(-pthread) 93 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread") 94 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread") 95 | 96 | message("CMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS}") 97 | message("CMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}") 98 | 99 | if (CMAKE_BUILD_TYPE STREQUAL "Debug") 100 | set(Boost_USE_DEBUG_LIBS ON) 101 | set(Boost_USE_RELEASE_LIBS OFF) 102 | else() 103 | set(Boost_USE_DEBUG_LIBS OFF) 104 | set(Boost_USE_RELEASE_LIBS ON) 105 | endif() 106 | 107 | set(BOOST_ROOT "$ENV{HOME}/.local") 108 | find_package(Boost 109 | REQUIRED 110 | COMPONENTS timer python) 111 | 112 | add_compile_definitions(BOOST_STACKTRACE_USE_BACKTRACE) 113 | 114 | add_executable(build_table 115 | build_table.cpp) 116 | target_link_libraries(build_table 117 | PRIVATE Boost::headers) 118 | 119 | add_executable(build_map 120 | build_map.cpp) 121 | target_link_libraries(build_map 122 | PRIVATE Boost::python 123 | PRIVATE Boost::timer 124 | PRIVATE Boost::headers 125 | PRIVATE python"${PYTHON_VERSION}") 126 | 127 | add_executable(test_calculator 128 | test/calculator.cpp) 129 | -------------------------------------------------------------------------------- /test/calculator.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | namespace{ 8 | 9 | using Tsumonya::stable; 10 | using Tsumonya::mtable; 11 | using Tsumonya::ntable; 12 | using Tsumonya::xytable; 13 | 14 | using Tsumonya::Hand; 15 | using Tsumonya::ChiList; 16 | using Tsumonya::PengList; 17 | using Tsumonya::GangList; 18 | using Tsumonya::zimo; 19 | using Tsumonya::rong; 20 | using Tsumonya::Calculator; 21 | 22 | void dump( 23 | Hand const &hand, ChiList const &chi_list, PengList const &peng_list, 24 | GangList const &angang_list, GangList const &minggang_list, std::uint_fast8_t const hupai, 25 | std::uint_fast8_t const fu, std::uint_fast8_t const fan) 26 | { 27 | std::cerr << "hand = "; 28 | for (unsigned h : hand) { 29 | std::cerr << h << ','; 30 | } 31 | std::cerr << '\n'; 32 | 33 | std::cerr << "chi = "; 34 | for (unsigned c : chi_list) { 35 | std::cerr << c << ','; 36 | } 37 | std::cerr << '\n'; 38 | 39 | std::cerr << "peng = "; 40 | for (unsigned p : peng_list) { 41 | std::cerr << p << ','; 42 | } 43 | std::cerr << '\n'; 44 | 45 | std::cerr << "angang = "; 46 | for (unsigned ag : angang_list) { 47 | std::cerr << ag << ','; 48 | } 49 | std::cerr << '\n'; 50 | 51 | std::cerr << "minggang = "; 52 | for (unsigned mg : minggang_list) { 53 | std::cerr << mg << ','; 54 | } 55 | std::cerr << '\n'; 56 | 57 | std::cerr << "hupai = " << static_cast(hupai) << '\n'; 58 | 59 | std::cerr << "fu = " << static_cast(fu) 60 | << ", fan = " << static_cast(fan) << '\n'; 61 | 62 | std::cerr << "========================================" << std::endl; 63 | } 64 | 65 | void calculate( 66 | Hand const &hand, ChiList const &chi_list, PengList const &peng_list, 67 | GangList const &angang_list, GangList const &minggang_list, Calculator const &calculator) 68 | { 69 | constexpr bool debugging = false; 70 | 71 | for (std::uint_fast8_t i = 0u, hupai_index = 0u;; ++i, ++hupai_index) { 72 | while (i < hand.size() && hand[i] == 0u) { 73 | ++i; 74 | } 75 | if (i >= hand.size()) { 76 | break; 77 | } 78 | 79 | if (hupai_index >= 13u) { 80 | throw std::logic_error("A logic error."); 81 | } 82 | 83 | Hand new_hand(hand); 84 | --new_hand[i]; 85 | 86 | { 87 | auto const [fu, fan] = calculator( 88 | new_hand, chi_list, peng_list, angang_list, minggang_list, i, 0u, zimo); 89 | if constexpr (debugging) { 90 | dump(hand, chi_list, peng_list, angang_list, minggang_list, i, fu, fan); 91 | } 92 | if (fu == 0u && fan == 0u) { 93 | if constexpr (!debugging) { 94 | dump(hand, chi_list, peng_list, angang_list, minggang_list, i, fu, fan); 95 | } 96 | throw std::logic_error("A logic error."); 97 | } 98 | } 99 | 100 | { 101 | auto const [fu, fan] = calculator( 102 | new_hand, chi_list, peng_list, angang_list, minggang_list, i, 0u, rong); 103 | if constexpr (debugging) { 104 | dump(hand, chi_list, peng_list, angang_list, minggang_list, i, fu, fan); 105 | } 106 | if (fu == 0u && fan == 0u) { 107 | if constexpr (!debugging) { 108 | dump(hand, chi_list, peng_list, angang_list, minggang_list, i, fu, fan); 109 | } 110 | throw std::logic_error("A logic error."); 111 | } 112 | } 113 | } 114 | } 115 | 116 | void enumerateNormalHule( 117 | std::uint_fast8_t const i, std::uint_fast8_t const m, std::uint_fast8_t const h, 118 | std::uint_fast8_t const x, std::uint_fast8_t const y, Hand &hand, ChiList &chi_list, 119 | PengList &peng_list, GangList &angang_list, GangList &minggang_list, 120 | Calculator const &calculator) 121 | { 122 | assert((i <= 34u)); 123 | assert((m <= 5u)); 124 | assert((h <= 1u)); 125 | for (std::uint_fast8_t const x : hand) { 126 | assert((x <= 4u)); 127 | } 128 | for (std::uint_fast8_t const c : chi_list) { 129 | assert((c <= 4u)); 130 | } 131 | for (std::uint_fast8_t const p : peng_list) { 132 | assert((p <= 1u)); 133 | } 134 | for (std::uint_fast8_t const ag : angang_list) { 135 | assert((ag <= 1u)); 136 | } 137 | for (std::uint_fast8_t const mg : minggang_list) { 138 | assert((mg <= 1u)); 139 | } 140 | 141 | if (i == 34u) { 142 | assert((x == 0u)); 143 | assert((y == 0u)); 144 | // Termination of recursion 145 | if (m == 5u && h == 1u) { 146 | calculate(hand, chi_list, peng_list, angang_list, minggang_list, calculator); 147 | } 148 | return; 149 | } 150 | 151 | std::uint_fast8_t const color = i / 9u; 152 | std::uint_fast8_t const number = i % 9u; 153 | std::uint_fast8_t const cindex = color * 7u + number; 154 | bool const shunzi_prohibited = color <= 2u && number >= 7u || color == 3u; 155 | 156 | for (std::uint_fast8_t s = 0u; s < stable.size(); ++s) { 157 | if (m + mtable[s] > 5u) { 158 | continue; 159 | } 160 | if (h + stable[s][0u] > 1u) { 161 | continue; 162 | } 163 | if (shunzi_prohibited && xytable[s] > 0u) { 164 | continue; 165 | } 166 | if (ntable[s] + x > 4u) { 167 | continue; 168 | } 169 | if (xytable[s] + y > 4u) { 170 | continue; 171 | } 172 | 173 | hand[i] += 2u * stable[s][0u] + 3u * stable[s][1u] + stable[s][2u]; 174 | if (!shunzi_prohibited) { 175 | hand[i + 1u] += stable[s][2u]; 176 | hand[i + 2u] += stable[s][2u]; 177 | assert((cindex < 21u)); 178 | chi_list[cindex] += stable[s][3u]; 179 | } 180 | peng_list[i] += stable[s][4u]; 181 | angang_list[i] += stable[s][5u]; 182 | minggang_list[i] += stable[s][6u]; 183 | 184 | enumerateNormalHule( 185 | i + 1u, m + mtable[s], h + stable[s][0u], xytable[s] + y, xytable[s], 186 | hand, chi_list, peng_list, angang_list, minggang_list, calculator); 187 | 188 | angang_list[i] -= stable[s][5u]; 189 | minggang_list[i] -= stable[s][6u]; 190 | peng_list[i] -= stable[s][4u]; 191 | if (!shunzi_prohibited) { 192 | assert((cindex < 21u)); 193 | chi_list[cindex] -= stable[s][3u]; 194 | hand[i + 2u] -= stable[s][2u]; 195 | hand[i + 1u] -= stable[s][2u]; 196 | } 197 | hand[i] -= 2u * stable[s][0u] + 3u * stable[s][1u] + stable[s][2u]; 198 | } 199 | } 200 | 201 | } 202 | 203 | int main() 204 | { 205 | Tsumonya::Calculator calculator("map.bin", true); 206 | 207 | Tsumonya::Hand hand{ 208 | 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 209 | 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 210 | 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 211 | 0u, 0u, 0u, 0u, 0u, 0u, 0u 212 | }; 213 | Tsumonya::ChiList chi_list{ 214 | 0u, 0u, 0u, 0u, 0u, 0u, 0u, 215 | 0u, 0u, 0u, 0u, 0u, 0u, 0u, 216 | 0u, 0u, 0u, 0u, 0u, 0u, 0u 217 | }; 218 | Tsumonya::PengList peng_list{ 219 | 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 220 | 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 221 | 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 222 | 0u, 0u, 0u, 0u, 0u, 0u, 0u 223 | }; 224 | Tsumonya::GangList angang_list{ 225 | 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 226 | 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 227 | 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 228 | 0u, 0u, 0u, 0u, 0u, 0u, 0u 229 | }; 230 | Tsumonya::GangList minggang_list{ 231 | 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 232 | 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 233 | 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 234 | 0u, 0u, 0u, 0u, 0u, 0u, 0u 235 | }; 236 | 237 | enumerateNormalHule( 238 | 0u, 0u, 0u, 0u, 0u, hand, chi_list, peng_list, angang_list, minggang_list, calculator); 239 | } 240 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tsumonya - ultra-high throughput mahjong hand calculator 2 | 3 | *Tsumonya* is a mahjong-related C++ library that calculates the score for a given winning hand (和了形). The main feature of this library is its ultra-high throughput, i.e., it focuses on dramatically reducing the average computation time for a single score calculation when calling many consecutive score calculation routines. On the other hand, the library sacrifices a significant amount of reaction time, or latency, for a single computation routine call. In addition, this library consumes an ridicuously large amount of storage (~26GB). Therefore, users are requested to carefully determine whether this library is suitable to their individual use cases. 4 | 5 | Ultra-high throughput is not likely to be required for ordinary mahjong score calculations. However, ultra-high throughput may be required when running large-scale simulations for the development, training, and evaluation of mahjong AIs. In these cases, the score calculation is called not only once at the end of each round in simulations, but also many times to determine whether a zimo (自摸) or rong (ロン) is possible when one of the players has a ready hand and every time they draws a tile or another player discards a tile. Therefore, an ultra-high throughput implementation in calling a large number of scoring routines would contribute significantly to simulation speed-up. 6 | 7 | The implementation is based on an idea of computing mahjong scores only by simple array indexing. In other words, this library pre-computes the fu (符) and fan (飜) for **ALL POSSIBLE MAHJONG WINNING HANDS** and stores them in a huge array. In this way, it completely omits the computationally expensive processes normally required for mahjong score calculation, such as member (面子, menzi) decomposition, calculation of fu, determination of hand types (Yaku, 役), calculation of fan, logic to resolve ambiguities in member decomposition for an winning hand based on the highest point principle (高点法), and others. 8 | 9 | # How to use 10 | 11 | First, set up [git large file storage](https://git-lfs.com/). 12 | 13 | ```sh 14 | $ git lfs install 15 | ``` 16 | 17 | Next, clone this repository. 18 | 19 | ```sh 20 | $ git clone https://github.com/Cryolite/tsumonya 21 | $ cd tsumonya 22 | ``` 23 | 24 | Then, decompress `map.bin.gz`. 25 | 26 | ```sh 27 | tsumonya$ gunzip -k map.bin.gz 28 | ``` 29 | 30 | Finally, add the path to the top directory of this repository to the set of the include paths, and include the `` header file. 31 | 32 | # Reference 33 | 34 | ```c++ 35 | namespace Tsumonya{ 36 | 37 | using Hand = std::array; 38 | using ChiList = std::array; 39 | using PengList = std::array; 40 | using GangList = std::array; 41 | 42 | enum Situation 43 | : std::uint_fast16_t; 44 | 45 | inline constexpr Situation zimo; 46 | inline constexpr Situation rong; 47 | inline constexpr Situation liqi; 48 | inline constexpr Situation qianggang; 49 | inline constexpr Situation lingshang_kaihua; 50 | inline constexpr Situation haidi_moyue; 51 | inline constexpr Situation haidi_laoyue; 52 | inline constexpr Situation double_liqi; 53 | inline constexpr Situation yifa; 54 | inline constexpr Situation tianhu; 55 | inline constexpr Situation dihu; 56 | 57 | class Calculator 58 | { 59 | public: 60 | explicit Calculator(char const *map_path); 61 | explicit Calculator(std::string const &map_path); 62 | explicit Calculator(std::filesystem::path const &map_path); 63 | std::pair operator()( 64 | Hand const &hand, ChiList const &chi_list, PengList const &peng_list, 65 | GangList const &angang_list, GangList const &minggang_list, std::uint_fast8_t hupai, 66 | std::uint_fast8_t num_red_tiles, Situation situation) const; 67 | }; 68 | 69 | } 70 | ``` 71 | 72 | ### `Hand` 73 | 74 | The `Hand` type represents a set of tiles in a hand. It MUST NOT contain melded tiles (副露牌) nor the winning tile (和牌). This is an array type with 34 elements. The 0-th element MUST indicate the number of the 1 Character tile (一萬, 1m), the 1st element the number of the 2 Character tile (二萬, 2m), and so on. 75 | 76 | ### `ChiList` 77 | 78 | The `ChiList` type represents a set of chews (chi, 吃, チー). This is an array type with 21 elements. The 0-th element MUST indicate the number of the chew (1m, 2m, 3m), the 1st element the number of the chews (2m, 3m, 4m), and so on. 79 | 80 | ### `PengList` 81 | 82 | The `PengList` type represents a set of pengs (pon, 碰, ポン). This is an array type with 34 elements. The 0-th element MUST indicate the number of the peng (1m, 1m, 1m), the 1st element the number of the peng (2m, 2m, 2m), and so on. 83 | 84 | ### `GangList` 85 | 86 | The `GangList` type represents a set of kongs (gang, 槓, カン). This is an array type with 34 elements. The 0-th element MUST indicate the number of the kong (1m, 1m, 1m, 1m), the 1st element the number of the kong (2m, 2m, 2m, 2m), and so on. 87 | 88 | ### `Situation` 89 | 90 | The `Situation` enum type is used to specifiy situation, especially hand types (yaku, 役), that cannot be determined from just the hand, melded tiles, and the winning tile. Multiple objects of the type `Situation` can be combined with `operator|`. 91 | 92 | #### `zimo` 93 | 94 | `zimo` represents a self-drawn win (自摸和). 95 | 96 | #### `rong` 97 | 98 | `rong` represents a dealt-in win (栄和). 99 | 100 | #### `liqi` 101 | 102 | `liqi` represents a riichi (立直) declaration. 103 | 104 | #### `qianggang` 105 | 106 | `qianggang` represents a robbing of a kong (槍槓). 107 | 108 | #### `lingshang_kaihua` 109 | 110 | `lingshang_kaihua` represents an after-kong win (嶺上開花). 111 | 112 | #### `haidi_moyue` 113 | 114 | `haidi_moyue` represents a last-tile-draw win (海底撈月). 115 | 116 | #### `haidi_laoyue` 117 | 118 | `haidi_moyue` represents a last-tile-discard win (河底撈魚). 119 | 120 | #### `double_liqi` 121 | 122 | `liqi` represents a double riichi (ダブル立直) declaration. 123 | 124 | #### `yifa` 125 | 126 | `yifa` represents Ippatsu (一発). 127 | 128 | #### `tianhu` 129 | 130 | `tianhu` represents a heavenly hand (天和). 131 | 132 | #### `dihu` 133 | 134 | `dihu` represents an earthly hand (地和). 135 | 136 | ### `Calculator::Calculator(char const *map_path)` 137 | 138 | ### `Calculator::Calculator(std::string const &map_path)` 139 | 140 | ### `Calculator::Calculator(std::filesystem::path const &map_path)` 141 | 142 | These are the constructors of `Calculator`. `map_path` MUST specify the path to the `map.bin` file. 143 | 144 | ### `std::pair Calculator::operator()(Hand const &hand, ChiList const &chi_list, PengList const &peng_list, GangList const &angang_list, GangList const &minggang_list, std::uint_fast8_t hupai, std::uint_fast8_t num_red_tiles, Situation situation)` 145 | 146 | This function calculates fu (符) and fan (飜) for the winning situation represented by the arguments. `hand` MUST specify the hand, `chi_list` the set of chews, `peng_list` the set of pengs, `angang_list` the set of closed kongs, `minggang_list` the set of open kongs, `hupai` the winning tile, `num_red_tiles` the number of red tiles, and `situation` the situation of the win. 147 | 148 | The return value is a pair of fu and fan. If the situation represented by the arguments is not a win, a pair of 0s is returned. 149 | 150 | # Performance comparison 151 | 152 | It is approximately 100 times faster on average than the [mahjong Python package \(version 1.1.10\)](https://pypi.org/project/mahjong/1.1.10/). 153 | 154 | # Background theory 155 | 156 | The most important core of the theory behind this library is [the implementation of a near-minimal perfect (collisionless) hash function for the set of all possible mahjong winning hands](https://github.com/Cryolite/tsumonya/blob/master/tsumonya/hule_indexer.hpp). The current implementation maps an winning hand to a natural number in the range `[0, 1062518406)`. Therefore, by preparing an array with `13 * 1062518406` elements, where the number `13` means that the library has additional information to identify which tile of each winning hand is the winning tile, and by calling some score calculation routine for each winning hand and recording the result of the routine in the \[*i* * 13, *i* * 13 + 13\)-th elements of the array (where *i* is the hash of the winning hand), when calculating scores, it is only necessary to calculate the hash of the given winning hand and access the array element. 157 | 158 | # Build from scratch (For developers only) 159 | 160 | Execute the following commands with the top directory of the working tree of this repository as the current directory. Note that the build process can take a verrrrrrrrrry long time (~20 days). 161 | 162 | ``` 163 | tsumonya$ docker build --pull -t cryolite/tsumonya . 164 | tsumonya$ docker run -v /path/to/working-tree:/workspace/tsumonya -it --rm cryolite/tsumonya 165 | ``` 166 | -------------------------------------------------------------------------------- /tsumonya/hule_indexer.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | 12 | namespace Tsumonya{ 13 | 14 | using Hand = std::array; 15 | using ChiList = std::array; 16 | using PengList = std::array; 17 | using GangList = std::array; 18 | 19 | class HuleIndexer 20 | { 21 | private: 22 | static constexpr bool debugging_ = false; 23 | 24 | using StateSeq_ = std::array, 34u>; 25 | 26 | private: 27 | std::tuple encodeShupai_( 28 | std::uint_fast8_t const color, Hand const &hand, ChiList const &chi_list, 29 | PengList const &peng_list, GangList const &angang_list, GangList const &minggang_list, 30 | std::uint_fast8_t const head, std::uint_fast8_t m, std::uint_fast8_t h, 31 | StateSeq_ &state_seq) const 32 | { 33 | std::uint_fast8_t x = 0u; 34 | std::uint_fast8_t y = 0u; 35 | 36 | std::uint_fast8_t a = hand[color * 9u + 0u]; 37 | std::uint_fast8_t b = hand[color * 9u + 1u]; 38 | 39 | for (std::uint_fast8_t i = color * 9u; i < (color + 1u) * 9u; ++i) { 40 | std::uint_fast8_t const number = i - color * 9u; 41 | std::uint_fast8_t const cindex = number <= 6u ? color * 7u + number : UINT_FAST8_MAX; 42 | 43 | std::uint_fast8_t s = UINT_FAST8_MAX; 44 | for (std::uint_fast8_t ss = 0u; ss < stable.size(); ++ss) { 45 | if (m + mtable[ss] > 5u) { 46 | continue; 47 | } 48 | if ((head == i) != (stable[ss][0u] == 1u)) { 49 | continue; 50 | } 51 | if (h + stable[ss][0u] > 1u) { 52 | continue; 53 | } 54 | if (ntable[ss] + x > 4u) { 55 | continue; 56 | } 57 | if (xytable[ss] + y > 4u) { 58 | continue; 59 | } 60 | if (cindex == UINT_FAST8_MAX && xytable[ss] > 0u) { 61 | continue; 62 | } 63 | if (a < 2u * stable[ss][0u] + 3u * stable[ss][1u] + stable[ss][2u]) { 64 | continue; 65 | } 66 | if (b < stable[ss][2u]) { 67 | continue; 68 | } 69 | if (number <= 6u && hand[i + 2u] < stable[ss][2u]) { 70 | continue; 71 | } 72 | if (cindex != UINT_FAST8_MAX && stable[ss][3u] != chi_list[cindex]) { 73 | continue; 74 | } 75 | if (stable[ss][4u] != peng_list[i]) { 76 | continue; 77 | } 78 | if (stable[ss][5u] != angang_list[i]) { 79 | continue; 80 | } 81 | if (stable[ss][6u] != minggang_list[i]) { 82 | continue; 83 | } 84 | 85 | if (a > 2u * stable[ss][0u] + 3u * stable[ss][1u] + stable[ss][2u]) { 86 | return { UINT_FAST8_MAX, UINT_FAST8_MAX }; 87 | } 88 | s = ss; 89 | break; 90 | } 91 | if (s == UINT_FAST8_MAX) { 92 | return { UINT_FAST8_MAX, UINT_FAST8_MAX }; 93 | } 94 | 95 | state_seq[i] = { m, h, s, x, y }; 96 | 97 | x = number <= 6u ? xytable[s] + y : y; 98 | y = number <= 6u ? xytable[s] : 0u; 99 | a = number <= 6u ? b - stable[s][2u] : b; 100 | b = number <= 6u ? hand[i + 2u] - stable[s][2u] : 0u; 101 | m += mtable[s]; 102 | h += stable[s][0u]; 103 | } 104 | 105 | return { m, h }; 106 | } 107 | 108 | bool encodeZipai_( 109 | Hand const &hand, PengList const &peng_list, GangList const &angang_list, 110 | GangList const &minggang_list, std::uint_fast8_t m, std::uint_fast8_t h, 111 | StateSeq_ &state_seq) const 112 | { 113 | for (std::uint_fast8_t i = 27u; i < 34u; ++i) { 114 | std::uint_fast8_t s = UINT_FAST8_MAX; 115 | for (std::uint_fast8_t ss = 0u; ss < stable.size(); ++ss) { 116 | if (m + mtable[ss] > 5u) { 117 | continue; 118 | } 119 | if ((hand[i] == 2u) != (stable[ss][0u] == 1u)) { 120 | continue; 121 | } 122 | if (h + stable[ss][0u] > 1u) { 123 | continue; 124 | } 125 | if (xytable[ss] > 0u) { 126 | continue; 127 | } 128 | if (hand[i] < 2u * stable[ss][0u] + 3u * stable[ss][1u]) { 129 | continue; 130 | } 131 | if (stable[ss][4u] != peng_list[i]) { 132 | continue; 133 | } 134 | if (stable[ss][5u] != angang_list[i]) { 135 | continue; 136 | } 137 | if (stable[ss][6u] != minggang_list[i]) { 138 | continue; 139 | } 140 | 141 | if (hand[i] > 2u * stable[ss][0u] + 3u * stable[ss][1u]) { 142 | return false; 143 | } 144 | s = ss; 145 | break; 146 | } 147 | if (s == UINT_FAST8_MAX) { 148 | return false; 149 | } 150 | 151 | state_seq[i] = { m, h, s, 0u, 0u }; 152 | 153 | m += mtable[s]; 154 | h += stable[s][0u]; 155 | } 156 | 157 | return true; 158 | } 159 | 160 | std::uint_fast32_t encodeStateSeq_(StateSeq_ const &state_seq) const 161 | { 162 | std::uint_fast32_t code = 0u; 163 | 164 | for (std::uint_fast8_t i = 0u; i < 34u; ++i) { 165 | std::uint_fast8_t const color = i / 9u; 166 | std::uint_fast8_t const number = color <= 2u ? i % 9u : UINT_FAST8_MAX; 167 | bool const shunzi_prohibited = color <= 2u && number >= 7u || color == 3u; 168 | auto const [m, h, s, x, y] = state_seq[i]; 169 | 170 | for (std::uint_fast8_t ss = 0u; ss < s; ++ss) { 171 | if constexpr (debugging_) { 172 | std::cout << "i = " << static_cast(i) 173 | << ", m = " << static_cast(m + mtable[ss]) 174 | << ", h = " << static_cast(h + stable[ss][0u]) 175 | << ", s = " << static_cast(ss) 176 | << ", s* = " << static_cast(s) 177 | << ", x = " << static_cast(xytable[ss] + y) 178 | << ", y = " << static_cast(xytable[ss]); 179 | } 180 | if (m + mtable[ss] > 5u) { 181 | if constexpr (debugging_) { 182 | std::cout << ", delta = (skip)" << std::endl; 183 | } 184 | continue; 185 | } 186 | if (h + stable[ss][0u] > 1u) { 187 | if constexpr (debugging_) { 188 | std::cout << ", delta = (skip)" << std::endl; 189 | } 190 | continue; 191 | } 192 | if (shunzi_prohibited && xytable[ss] > 0u) { 193 | if constexpr (debugging_) { 194 | std::cout << ", delta = (skip)" << std::endl; 195 | } 196 | continue; 197 | } 198 | if (ntable[ss] + x > 4u) { 199 | if constexpr (debugging_) { 200 | std::cout << ", delta = (skip)" << std::endl; 201 | } 202 | continue; 203 | } 204 | if (xytable[ss] + y > 4u) { 205 | if constexpr (debugging_) { 206 | std::cout << ", delta = (skip)" << std::endl; 207 | } 208 | continue; 209 | } 210 | 211 | assert((i != 0u || y == 0u)); 212 | assert((!(color <= 2u && number == 8u || color == 3u) || y == 0u)); 213 | std::uint_fast32_t const delta = [&]() -> std::uint_fast32_t { 214 | if (i + 1u < 34u) { 215 | return table[i + 1u][m + mtable[ss]][h + stable[ss][0u]][xytable[ss] + y][xytable[ss]]; 216 | } 217 | return 1u; 218 | }(); 219 | code += delta; 220 | if constexpr (debugging_) { 221 | std::cout << ", delta = " << delta << std::endl; 222 | } 223 | } 224 | } 225 | 226 | return code; 227 | } 228 | 229 | public: 230 | std::uint_fast32_t operator()( 231 | Hand const &hand, ChiList const &chi_list, PengList const &peng_list, 232 | GangList const &angang_list, GangList const &minggang_list) const 233 | { 234 | for (std::uint_fast8_t i = 0u; i < 27u; ++i) { 235 | std::uint_fast8_t const color = i / 9u; 236 | std::uint_fast8_t const number = i % 9u; 237 | std::uint_fast8_t const cindex = color * 7u + number; 238 | std::uint_fast8_t const c = [&]() -> std::uint_fast8_t { 239 | if (number == 0u) { 240 | return chi_list[cindex]; 241 | } 242 | assert((cindex >= 1u)); 243 | if (number == 1u) { 244 | return chi_list[cindex - 1u] + chi_list[cindex]; 245 | } 246 | assert((cindex >= 2u)); 247 | if (2u <= number && number <= 6u) { 248 | return chi_list[cindex - 2u] + chi_list[cindex - 1u] + chi_list[cindex]; 249 | } 250 | if (number == 7u) { 251 | return chi_list[cindex - 2u] + chi_list[cindex - 1u]; 252 | } 253 | return chi_list[cindex - 2u]; 254 | }(); 255 | 256 | if (hand[i] + c + 3u * peng_list[i] + 4u * angang_list[i] + 4u * minggang_list[i] > 4u) { 257 | throw std::invalid_argument("Invalid arguments."); 258 | } 259 | } 260 | for (std::uint_fast8_t i = 27u; i < 34u; ++i) { 261 | if (hand[i] + 3u * peng_list[i] + 4u * angang_list[i] + 4u * minggang_list[i] > 4u) { 262 | throw std::invalid_argument("Invalid arguments."); 263 | } 264 | } 265 | 266 | std::array s = { 0u, 0u, 0u }; 267 | for (std::uint_fast8_t i = 0u; i < 3u; ++i) { 268 | for (std::uint_fast8_t j = 0u; j < 9u; ++j) { 269 | s[i] += j * hand[i * 9u + j]; 270 | } 271 | } 272 | 273 | std::uint_fast8_t m = 0u; 274 | std::uint_fast8_t h = 0u; 275 | StateSeq_ state_seq; 276 | 277 | for (std::uint_fast8_t i = 0u; i < 3u; ++i) { 278 | auto [m_, h_] = encodeShupai_( 279 | i, hand, chi_list, peng_list, angang_list, minggang_list, 280 | UINT_FAST8_MAX, m, h, state_seq); 281 | if (m_ != UINT_FAST8_MAX) { 282 | assert((h_ != UINT_FAST8_MAX)); 283 | m = m_; 284 | h = h_; 285 | } 286 | else { 287 | assert((h_ == UINT_FAST8_MAX)); 288 | for (std::uint_fast8_t j = (s[i] * 2u) % 3u; j < 9u; j += 3u) { 289 | if (hand[i * 9u + j] < 2u) { 290 | continue; 291 | } 292 | std::tie(m_, h_) = encodeShupai_( 293 | i, hand, chi_list, peng_list, angang_list, minggang_list, 294 | i * 9u + j, m, h, state_seq); 295 | if (m_ != UINT_FAST8_MAX) { 296 | assert((h_ != UINT_FAST8_MAX)); 297 | m = m_; 298 | h = h_; 299 | assert((h == 1u)); 300 | break; 301 | } 302 | } 303 | if (m_ == UINT_FAST8_MAX) { 304 | assert((h_ == UINT_FAST8_MAX)); 305 | return UINT_FAST32_MAX; 306 | } 307 | } 308 | } 309 | 310 | if (!encodeZipai_(hand, peng_list, angang_list, minggang_list, m, h, state_seq)) { 311 | return UINT_FAST32_MAX; 312 | } 313 | 314 | return encodeStateSeq_(state_seq); 315 | } 316 | }; // class HuleIndexer 317 | 318 | } // namespace Tsumonya 319 | -------------------------------------------------------------------------------- /tsumonya/calculator.hpp: -------------------------------------------------------------------------------- 1 | #if !defined(TSUMONYA_CALCULATOR_HPP_INCLUDE_GUARD) 2 | #define TSUMONYA_CALCULATOR_HPP_INCLUDE_GUARD 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | 22 | namespace Tsumonya{ 23 | 24 | enum Situation 25 | : std::uint_fast16_t 26 | { 27 | zimo_ = 1u << 0u, 28 | rong_ = 1u << 1u, 29 | liqi_ = 1u << 2u, 30 | qianggang_ = 1u << 3u, 31 | lingshang_kaihua_ = 1u << 4u, 32 | haidi_moyue_ = 1u << 5u, 33 | haidi_laoyue_ = 1u << 6u, 34 | double_liqi_ = 1u << 7u, 35 | yifa_ = 1u << 8u, 36 | tianhu_ = 1u << 9u, 37 | dihu_ = 1u << 10u 38 | }; // enum Situation 39 | 40 | inline constexpr Situation zimo(zimo_); 41 | inline constexpr Situation rong(rong_); 42 | inline constexpr Situation liqi(liqi_); 43 | inline constexpr Situation qianggang(qianggang_); 44 | inline constexpr Situation lingshang_kaihua(lingshang_kaihua_); 45 | inline constexpr Situation haidi_moyue(haidi_moyue_); 46 | inline constexpr Situation haidi_laoyue(haidi_laoyue_); 47 | inline constexpr Situation double_liqi(double_liqi_); 48 | inline constexpr Situation yifa(yifa_); 49 | inline constexpr Situation tianhu(tianhu_); 50 | inline constexpr Situation dihu(dihu_); 51 | 52 | constexpr Situation operator&(Situation lhs, Situation rhs) 53 | { 54 | return static_cast( 55 | static_cast(lhs) & static_cast(rhs)); 56 | } 57 | 58 | constexpr Situation operator|(Situation lhs, Situation rhs) 59 | { 60 | return static_cast( 61 | static_cast(lhs) | static_cast(rhs)); 62 | } 63 | 64 | constexpr Situation &operator&=(Situation &lhs, Situation rhs) 65 | { 66 | lhs = lhs & rhs; 67 | return lhs; 68 | } 69 | 70 | constexpr Situation &operator|=(Situation &lhs, Situation rhs) 71 | { 72 | lhs = lhs | rhs; 73 | return lhs; 74 | } 75 | 76 | class Calculator 77 | { 78 | private: 79 | static constexpr std::uint_fast64_t map_size_ = 28u * Tsumonya::e; 80 | 81 | class Impl_ 82 | { 83 | public: 84 | explicit Impl_(std::filesystem::path const &map_path, bool full_fetch) 85 | : fd_(-1) 86 | , p_(nullptr) 87 | , array_() 88 | , hule_indexer_() 89 | { 90 | if (!std::filesystem::exists(map_path)) { 91 | std::ostringstream oss; 92 | oss << map_path << ": Does not exist."; 93 | throw std::runtime_error(oss.str()); 94 | } 95 | if (!std::filesystem::is_regular_file(map_path) && !std::filesystem::is_symlink(map_path)) { 96 | std::ostringstream oss; 97 | oss << map_path << ": Not a file."; 98 | throw std::runtime_error(oss.str()); 99 | } 100 | if (std::filesystem::file_size(map_path) != map_size_) { 101 | std::ostringstream oss; 102 | oss << map_path << ": Not a map file."; 103 | throw std::runtime_error(oss.str()); 104 | } 105 | 106 | if (full_fetch) { 107 | std::ifstream ifs(map_path, std::ios_base::in | std::ios_base::binary); 108 | std::istreambuf_iterator iter(ifs); 109 | std::istreambuf_iterator jter; 110 | array_.reserve(map_size_); 111 | std::copy(iter, jter, std::back_inserter(array_)); 112 | array_.shrink_to_fit(); 113 | p_ = &array_[0u]; 114 | } 115 | else { 116 | fd_ = open(map_path.c_str(), O_RDONLY); 117 | if (fd_ == -1) { 118 | std::ostringstream oss; 119 | oss << map_path << ": Failed to open."; 120 | throw std::runtime_error(oss.str()); 121 | } 122 | 123 | p_ = mmap(nullptr, map_size_, PROT_READ, MAP_PRIVATE, fd_, 0); 124 | if (p_ == reinterpret_cast(-1)) { 125 | close(fd_); 126 | std::ostringstream oss; 127 | oss << map_path << ": Failed to mmap."; 128 | throw std::runtime_error(oss.str()); 129 | } 130 | } 131 | } 132 | 133 | Impl_(Impl_ const &) = delete; 134 | 135 | ~Impl_() 136 | { 137 | if (fd_ != -1) { 138 | munmap(p_, map_size_); 139 | close(fd_); 140 | } 141 | } 142 | 143 | Impl_ &operator=(Impl_ const &) = delete; 144 | 145 | std::pair operator()( 146 | Hand const &hand, ChiList const &chi_list, PengList const &peng_list, 147 | GangList const &angang_list, GangList const &minggang_list, 148 | std::uint_fast8_t hupai_index, bool rong) const 149 | { 150 | std::uint_fast32_t const index = hule_indexer_( 151 | hand, chi_list, peng_list, angang_list, minggang_list); 152 | if (index == UINT_FAST32_MAX) { 153 | return std::pair(0u, 0u); 154 | } 155 | std::uint8_t const *p = static_cast(p_); 156 | std::uint_fast64_t const map_index 157 | = (hupai_index * static_cast(Tsumonya::e) + index) * 2u 158 | + (rong ? 1u : 0u); 159 | std::uint8_t const encode = p[map_index]; 160 | 161 | std::uint_fast8_t const fu = [](std::uint8_t encode) -> std::uint_fast8_t { 162 | std::uint_fast8_t const fu_encode = encode / 19u; 163 | if (fu_encode == 0u) { 164 | return 0u; 165 | } 166 | else if (fu_encode == 1u) { 167 | return 20u; 168 | } 169 | else if (fu_encode == 2u) { 170 | return 25u; 171 | } 172 | 173 | return fu_encode * 10u; 174 | }(encode); 175 | 176 | std::uint_fast8_t const fan = [](std::uint8_t encode) -> std::uint_fast8_t { 177 | std::uint_fast8_t const fan_encode = encode % 19u; 178 | if (fan_encode <= 12u) { 179 | return fan_encode; 180 | } 181 | return (fan_encode - 12u) * 13u; 182 | }(encode); 183 | 184 | return std::make_pair(fu, fan); 185 | } 186 | 187 | private: 188 | int fd_; 189 | void *p_; 190 | std::vector array_; 191 | Tsumonya::HuleIndexer hule_indexer_; 192 | }; // class Impl_ 193 | 194 | public: 195 | explicit Calculator(char const *map_path, bool full_fetch = false) 196 | : Calculator(std::filesystem::path(map_path), full_fetch) 197 | {} 198 | 199 | explicit Calculator(std::string const &map_path, bool full_fetch = false) 200 | : Calculator(std::filesystem::path(map_path), full_fetch) 201 | {} 202 | 203 | explicit Calculator(std::filesystem::path const &map_path, bool full_fetch = false) 204 | : p_impl_(new Impl_(map_path, full_fetch)) 205 | {} 206 | 207 | std::pair operator()( 208 | Hand const &hand, ChiList const &chi_list, PengList const &peng_list, 209 | GangList const &angang_list, GangList const &minggang_list, std::uint_fast8_t hupai, 210 | std::uint_fast8_t num_red_tiles, Situation situation) const 211 | { 212 | if (hupai >= hand.size()) { 213 | std::ostringstream oss; 214 | oss << static_cast(hupai) << ": An invalid hupai."; 215 | throw std::invalid_argument(oss.str()); 216 | } 217 | if ((situation & zimo) == 0u && (situation & rong) == 0u) { 218 | throw std::invalid_argument("`Tsumonya::zimo` or `Tsumonya::rong` MUST be specified."); 219 | } 220 | if (((situation & zimo) != 0u) && ((situation & rong) != 0u)) { 221 | throw std::invalid_argument("`Tsumonya::zimo` and `Tsumonya::rong` conflict."); 222 | } 223 | if (((situation & zimo) != 0u) && ((situation & qianggang) != 0u)) { 224 | throw std::invalid_argument("`Tsumonya::zimo` and `Tsumonya::qianggang` conflict."); 225 | } 226 | if (((situation & rong) != 0u) && ((situation & lingshang_kaihua) != 0u)) { 227 | throw std::invalid_argument( 228 | "`Tsumonya::rong` and `Tsumonya::lingshang_kaihua` conflict."); 229 | } 230 | if (((situation & qianggang) != 0u) && ((situation & lingshang_kaihua) != 0u)) { 231 | throw std::invalid_argument( 232 | "`Tsumonya::qianggang` and `Tsumonya::lingshang_kaihua` conflict."); 233 | } 234 | if (((situation & rong) != 0u) && ((situation & haidi_moyue) != 0u)) { 235 | throw std::invalid_argument("`Tsumonya::rong` and `Tsumonya::haidi_moyue` conflict."); 236 | } 237 | if (((situation & qianggang) != 0u) && ((situation & haidi_moyue) != 0u)) { 238 | throw std::invalid_argument( 239 | "`Tsumonya::qianggang` and `Tsumonya::haidi_moyue` conflict."); 240 | } 241 | if (((situation & lingshang_kaihua) != 0u) && ((situation & haidi_moyue) != 0u)) { 242 | throw std::invalid_argument( 243 | "`Tsumonya::lingshang_kaihua` and `Tsumonya::haidi_moyue` conflict."); 244 | } 245 | if (((situation & zimo) != 0u) && ((situation & haidi_laoyue) != 0u)) { 246 | throw std::invalid_argument("`Tsumonya::zimo` and `Tsumonya::haidi_laoyue` conflict."); 247 | } 248 | if (((situation & qianggang) != 0u) && ((situation & haidi_laoyue) != 0u)) { 249 | throw std::invalid_argument( 250 | "`Tsumonya::qianggang` and `Tsumonya::haidi_laoyue` conflict."); 251 | } 252 | if (((situation & lingshang_kaihua) != 0u) && ((situation & haidi_laoyue) != 0u)) { 253 | throw std::invalid_argument( 254 | "`Tsumonya::lingshang_kaihua` and `Tsumonya::haidi_laoyue` conflict."); 255 | } 256 | if (((situation & liqi) != 0u) && ((situation & double_liqi) != 0u)) { 257 | throw std::invalid_argument("`Tsumonya::liqi` and `Tsumonya::double_liqi` conflict."); 258 | } 259 | if (((situation & qianggang) != 0u) && ((situation & yifa) != 0u)) { 260 | throw std::invalid_argument("`Tsumonya::qianggang` and `Tsumonya::yifa` conflict."); 261 | } 262 | if (((situation & lingshang_kaihua) != 0u) && ((situation & yifa) != 0u)) { 263 | throw std::invalid_argument( 264 | "`Tsumonya::lingshang_kaihua` and `Tsumonya::yifa` conflict."); 265 | } 266 | if (((situation & rong) != 0u) && ((situation & tianhu) != 0u)) { 267 | throw std::invalid_argument("`Tsumonya::rong` and `Tsumonya::tianhu` conflict."); 268 | } 269 | if (((situation & liqi) != 0u) && ((situation & tianhu) != 0u)) { 270 | throw std::invalid_argument("`Tsumonya::liqi` and `Tsumonya::tianhu` conflict."); 271 | } 272 | if (((situation & qianggang) != 0u) && ((situation & tianhu) != 0u)) { 273 | throw std::invalid_argument("`Tsumonya::qianggang` and `Tsumonya::tianhu` conflict."); 274 | } 275 | if (((situation & lingshang_kaihua) != 0u) && ((situation & tianhu) != 0u)) { 276 | throw std::invalid_argument( 277 | "`Tsumonya::lingshang_kaihua` and `Tsumonya::tianhu` conflict."); 278 | } 279 | if (((situation & haidi_moyue) != 0u) && ((situation & tianhu) != 0u)) { 280 | throw std::invalid_argument("`Tsumonya::haidi_moyue` and `Tsumonya::tianhu` conflict."); 281 | } 282 | if (((situation & haidi_laoyue) != 0u) && ((situation & tianhu) != 0u)) { 283 | throw std::invalid_argument( 284 | "`Tsumonya::haidi_laoyue` and `Tsumonya::tianhu` conflict."); 285 | } 286 | if (((situation & double_liqi) != 0u) && ((situation & tianhu) != 0u)) { 287 | throw std::invalid_argument("`Tsumonya::double_liqi` and `Tsumonya::tianhu` conflict."); 288 | } 289 | if (((situation & yifa) != 0u) && ((situation & tianhu) != 0)) { 290 | throw std::invalid_argument("`Tsumonya::yifa` and `Tsumonya::tianhu` conflict."); 291 | } 292 | if (((situation & rong) != 0u) && ((situation & dihu) != 0u)) { 293 | throw std::invalid_argument("`Tsumonya::rong` and `Tsumonya::dihu` conflict."); 294 | } 295 | if (((situation & liqi) != 0u) && ((situation & dihu) != 0u)) { 296 | throw std::invalid_argument("`Tsumonya::liqi` and `Tsumonya::dihu` conflict."); 297 | } 298 | if (((situation & qianggang) != 0u) && ((situation & dihu) != 0u)) { 299 | throw std::invalid_argument("`Tsumonya::qianggang` and `Tsumonya::dihu` conflict."); 300 | } 301 | if (((situation & lingshang_kaihua) != 0u) && ((situation & dihu) != 0u)) { 302 | throw std::invalid_argument( 303 | "`Tsumonya::lingshang_kaihua` and `Tsumonya::dihu` conflict."); 304 | } 305 | if (((situation & haidi_moyue) != 0u) && ((situation & dihu) != 0u)) { 306 | throw std::invalid_argument("`Tsumonya::haidi_moyue` and `Tsumonya::dihu` conflict."); 307 | } 308 | if (((situation & haidi_laoyue) != 0u) && ((situation & dihu) != 0u)) { 309 | throw std::invalid_argument("`Tsumonya::haidi_laoyue` and `Tsumonya::dihu` conflict"); 310 | } 311 | if (((situation & double_liqi) != 0u) && ((situation & dihu) != 0u)) { 312 | throw std::invalid_argument("`Tsumonya::double_liqi` and `Tsumonya::dihu` conflict."); 313 | } 314 | if (((situation & yifa) != 0u) && ((situation & dihu) != 0u)) { 315 | throw std::invalid_argument("`Tsumonya::yifa` and `Tsumonya::dihu` conflict."); 316 | } 317 | if (((situation & tianhu) != 0u) && ((situation & dihu) != 0u)) { 318 | throw std::invalid_argument("`Tsumonya::tianhu` and `Tsumonya::dihu` conflict."); 319 | } 320 | 321 | Hand new_hand(hand); 322 | ++new_hand[hupai]; 323 | 324 | std::uint_fast8_t hupai_index = 0u; 325 | for (std::uint_fast8_t i = 0u;; ++i, ++hupai_index) { 326 | while (i < new_hand.size() && new_hand[i] == 0u) { 327 | ++i; 328 | } 329 | if (i == new_hand.size()) { 330 | throw std::logic_error("A logic error."); 331 | } 332 | 333 | if (hupai == i) { 334 | break; 335 | } 336 | } 337 | if (hupai_index >= 13u) { 338 | throw std::logic_error("A logic error."); 339 | } 340 | 341 | bool const is_rong = ((situation & rong) != 0u); 342 | auto [hu, fan] = (*p_impl_)( 343 | new_hand, chi_list, peng_list, angang_list, minggang_list, hupai_index, is_rong); 344 | 345 | if (fan >= 13u) { 346 | if ((situation & tianhu) != 0u) { 347 | fan += 13u; 348 | } 349 | if ((situation & dihu) != 0u) { 350 | fan += 13u; 351 | } 352 | return std::make_pair(hu, fan); 353 | } 354 | 355 | fan += num_red_tiles; 356 | if ((situation & liqi) != 0u) { 357 | fan += 1u; 358 | } 359 | if ((situation & qianggang) != 0u) { 360 | fan += 1u; 361 | } 362 | if ((situation & lingshang_kaihua) != 0u) { 363 | fan += 1u; 364 | } 365 | if ((situation & haidi_moyue) != 0u) { 366 | fan += 1u; 367 | } 368 | if ((situation & haidi_laoyue) != 0u) { 369 | fan += 1u; 370 | } 371 | if ((situation & double_liqi) != 0u) { 372 | fan += 2u; 373 | } 374 | 375 | if (fan > 13u) { 376 | fan = 13u; 377 | } 378 | return std::make_pair(hu, fan); 379 | } 380 | 381 | private: 382 | std::shared_ptr p_impl_; 383 | }; // class Calculator 384 | 385 | } // namespace Tsumonya 386 | 387 | 388 | #endif // !defined(TSUMONYA_CALCULATOR_HPP_INCLUDE_GUARD) 389 | -------------------------------------------------------------------------------- /tsumonya/table.hpp: -------------------------------------------------------------------------------- 1 | #if !defined(TSUMONYA_TABLE_HPP_INCLUDE_GUARD) 2 | #define TSUMONYA_TABLE_HPP_INCLUDE_GUARD 3 | 4 | #include 5 | #include 6 | 7 | 8 | namespace Tsumonya{ 9 | 10 | inline constexpr std::uint_fast32_t e = 1062518406; 11 | 12 | inline constexpr Table table = {{ 13 | {{ 14 | {{ 15 | {{ 16 | {{1062518406,1013625866,965372430,933006644,848594316,}}, 17 | {{1013682525,966495803,919968543,889084330,807798930,}}, 18 | {{965162545,919691431,874852701,845421498,767003544,}}, 19 | {{934194278,890186147,846750937,818513044,741369056,}}, 20 | {{890403838,848028135,805944923,779211682,741369056,}}, 21 | }}, 22 | {{ 23 | {{1067761620,1005491062,948501767,942125864,839385484,}}, 24 | {{1005422232,946105472,891867057,885662248,788116508,}}, 25 | {{945895730,889429312,837977879,831845340,736847532,}}, 26 | {{943909328,887444314,836066981,831845340,736847532,}}, 27 | {{890014918,836197548,784892467,783122410,736847532,}}, 28 | }}, 29 | }}, 30 | {{ 31 | {{ 32 | {{27031417,26107883,25174931,24382482,22706734,}}, 33 | {{26108805,25206533,24295627,23530738,21895718,}}, 34 | {{25180976,24300358,23410935,22673504,21084702,}}, 35 | {{24398406,23545548,22682940,21961157,20397693,}}, 36 | {{23539712,22707982,21871538,21169739,20397693,}}, 37 | }}, 38 | {{ 39 | {{34330381,32743296,31259882,31133152,28382524,}}, 40 | {{32742370,31211148,29781004,29656502,27008506,}}, 41 | {{31208430,29731762,28355362,28231808,25634488,}}, 42 | {{31169454,29692795,28317355,28231808,25634488,}}, 43 | {{29743778,28319081,26944589,26908454,25634488,}}, 44 | }}, 45 | }}, 46 | {{ 47 | {{ 48 | {{498114,486884,475264,460957,439557,}}, 49 | {{486891,475789,464305,450333,429189,}}, 50 | {{475467,464497,453145,439509,418821,}}, 51 | {{461060,450429,439409,425872,405508,}}, 52 | {{450228,439729,429037,415628,405508,}}, 53 | }}, 54 | {{ 55 | {{852403,823121,795149,793529,740261,}}, 56 | {{823115,794513,767205,765599,713635,}}, 57 | {{794496,766566,739925,738325,687009,}}, 58 | {{794004,766074,739439,738325,687009,}}, 59 | {{766724,739450,712821,712347,687009,}}, 60 | }}, 61 | }}, 62 | {{ 63 | {{ 64 | {{5916,5850,5780,5610,5478,}}, 65 | {{5850,5784,5714,5546,5414,}}, 66 | {{5782,5716,5646,5480,5350,}}, 67 | {{5610,5546,5478,5312,5184,}}, 68 | {{5544,5480,5414,5248,5184,}}, 69 | }}, 70 | {{ 71 | {{15339,14991,14651,14641,13977,}}, 72 | {{14991,14647,14311,14301,13645,}}, 73 | {{14647,14307,13975,13965,13313,}}, 74 | {{14644,14304,13972,13965,13313,}}, 75 | {{14308,13972,13640,13637,13313,}}, 76 | }}, 77 | }}, 78 | {{ 79 | {{ 80 | {{34,34,34,33,33,}}, 81 | {{34,34,34,33,33,}}, 82 | {{34,34,34,33,33,}}, 83 | {{33,33,33,32,32,}}, 84 | {{33,33,33,32,32,}}, 85 | }}, 86 | {{ 87 | {{178,176,174,174,170,}}, 88 | {{176,174,172,172,168,}}, 89 | {{174,172,170,170,166,}}, 90 | {{174,172,170,170,166,}}, 91 | {{172,170,168,168,166,}}, 92 | }}, 93 | }}, 94 | {{ 95 | {{ 96 | {{0,0,0,0,0,}}, 97 | {{0,0,0,0,0,}}, 98 | {{0,0,0,0,0,}}, 99 | {{0,0,0,0,0,}}, 100 | {{0,0,0,0,0,}}, 101 | }}, 102 | {{ 103 | {{1,1,1,1,1,}}, 104 | {{1,1,1,1,1,}}, 105 | {{1,1,1,1,1,}}, 106 | {{1,1,1,1,1,}}, 107 | {{1,1,1,1,1,}}, 108 | }}, 109 | }}, 110 | }}, 111 | {{ 112 | {{ 113 | {{ 114 | {{890403838,847975883,806138751,778147600,705302312,}}, 115 | {{848028135,807133743,766848557,740183464,670139904,}}, 116 | {{805944923,766592909,727824809,702459060,634977496,}}, 117 | {{779211682,741168163,703653615,679357537,613009437,}}, 118 | {{741369056,704790323,668481575,645531613,613009437,}}, 119 | }}, 120 | {{ 121 | {{890014918,836261044,787213029,781539876,693480172,}}, 122 | {{836197548,785086530,738493419,732978510,649544054,}}, 123 | {{784892467,736328407,692223569,686775464,605607936,}}, 124 | {{783122410,734559700,690523424,686775464,605607936,}}, 125 | {{736847532,690644042,646674552,645104460,605607936,}}, 126 | }}, 127 | }}, 128 | {{ 129 | {{ 130 | {{23539712,22707096,21866024,21154878,19649630,}}, 131 | {{22707982,21895220,21074754,20389218,18921938,}}, 132 | {{21871538,21079006,20278604,19618578,18194246,}}, 133 | {{21169739,20403007,19627496,18982068,17581204,}}, 134 | {{20397693,19650681,18899434,18272622,17581204,}}, 135 | }}, 136 | {{ 137 | {{29743778,28319971,26992271,26874891,24420227,}}, 138 | {{28319081,26947205,25668939,25553703,23194143,}}, 139 | {{26944589,25623383,24395007,24280683,21968059,}}, 140 | {{26908454,25587257,24359805,24280683,21968059,}}, 141 | {{25634488,24361465,23134925,23101523,21968059,}}, 142 | }}, 143 | }}, 144 | {{ 145 | {{ 146 | {{450228,439722,428842,415528,395544,}}, 147 | {{439729,429347,418599,405608,385872,}}, 148 | {{429037,418783,408163,395496,376200,}}, 149 | {{415628,405701,395401,382830,363846,}}, 150 | {{405508,395709,385725,373278,363846,}}, 151 | }}, 152 | {{ 153 | {{766724,739456,713450,711890,662458,}}, 154 | {{739450,712838,687472,685926,637750,}}, 155 | {{712821,686857,662134,660594,613042,}}, 156 | {{712347,686383,661666,660594,613042,}}, 157 | {{687009,661677,636966,636510,613042,}}, 158 | }}, 159 | }}, 160 | {{ 161 | {{ 162 | {{5544,5480,5412,5248,5120,}}, 163 | {{5480,5416,5348,5186,5058,}}, 164 | {{5414,5350,5282,5122,4996,}}, 165 | {{5248,5186,5120,4960,4836,}}, 166 | {{5184,5122,5058,4898,4836,}}, 167 | }}, 168 | {{ 169 | {{14308,13972,13644,13634,12994,}}, 170 | {{13972,13640,13316,13306,12674,}}, 171 | {{13640,13312,12992,12982,12354,}}, 172 | {{13637,13309,12989,12982,12354,}}, 173 | {{13313,12989,12669,12666,12354,}}, 174 | }}, 175 | }}, 176 | {{ 177 | {{ 178 | {{33,33,33,32,32,}}, 179 | {{33,33,33,32,32,}}, 180 | {{33,33,33,32,32,}}, 181 | {{32,32,32,31,31,}}, 182 | {{32,32,32,31,31,}}, 183 | }}, 184 | {{ 185 | {{172,170,168,168,164,}}, 186 | {{170,168,166,166,162,}}, 187 | {{168,166,164,164,160,}}, 188 | {{168,166,164,164,160,}}, 189 | {{166,164,162,162,160,}}, 190 | }}, 191 | }}, 192 | {{ 193 | {{ 194 | {{0,0,0,0,0,}}, 195 | {{0,0,0,0,0,}}, 196 | {{0,0,0,0,0,}}, 197 | {{0,0,0,0,0,}}, 198 | {{0,0,0,0,0,}}, 199 | }}, 200 | {{ 201 | {{1,1,1,1,1,}}, 202 | {{1,1,1,1,1,}}, 203 | {{1,1,1,1,1,}}, 204 | {{1,1,1,1,1,}}, 205 | {{1,1,1,1,1,}}, 206 | }}, 207 | }}, 208 | }}, 209 | {{ 210 | {{ 211 | {{ 212 | {{741369056,704742298,668659986,644582257,582072737,}}, 213 | {{704790323,669536865,634844357,611948511,551938831,}}, 214 | {{668481575,634609305,601274419,579535531,521804925,}}, 215 | {{645531613,612824666,580604500,559820458,503093590,}}, 216 | {{613009437,581611482,550461910,530876960,503093590,}}, 217 | }}, 218 | {{ 219 | {{736847532,690702420,648731371,643707088,568688664,}}, 220 | {{690644042,646853548,607063555,602185170,531265994,}}, 221 | {{646674552,605150048,567571855,562755024,493843324,}}, 222 | {{645104460,603581252,566066299,562755024,493843324,}}, 223 | {{605607936,566177364,528723947,527338088,493843324,}}, 224 | }}, 225 | }}, 226 | {{ 227 | {{ 228 | {{20397693,19649831,18894427,18258788,16912096,}}, 229 | {{19650681,18921313,18185123,17573216,16261828,}}, 230 | {{18899434,18188920,17471423,16883150,15611560,}}, 231 | {{18272622,17586020,16891562,16316873,15066953,}}, 232 | {{17581204,16912962,16240940,15683547,15066953,}}, 233 | }}, 234 | {{ 235 | {{25634488,24362319,23178981,23070591,20889763,}}, 236 | {{24361465,23137439,21999843,21893513,19800549,}}, 237 | {{23134925,21957829,20866413,20760959,18711335,}}, 238 | {{23101523,21924436,20833908,20760959,18711335,}}, 239 | {{21968059,20835502,19745850,19715073,18711335,}}, 240 | }}, 241 | }}, 242 | {{ 243 | {{ 244 | {{405508,395702,385538,373181,354565,}}, 245 | {{395709,386023,375987,363941,345565,}}, 246 | {{385725,376163,366251,354517,336565,}}, 247 | {{373278,364031,354427,342786,325134,}}, 248 | {{363846,354723,345423,333902,325134,}}, 249 | }}, 250 | {{ 251 | {{687009,661683,637571,636071,590331,}}, 252 | {{661677,636983,613487,612001,567469,}}, 253 | {{636966,612896,590019,588539,544607,}}, 254 | {{636510,612440,589569,588539,544607,}}, 255 | {{613042,589580,566715,566277,544607,}}, 256 | }}, 257 | }}, 258 | {{ 259 | {{ 260 | {{5184,5122,5056,4898,4774,}}, 261 | {{5122,5060,4994,4838,4714,}}, 262 | {{5058,4996,4930,4776,4654,}}, 263 | {{4898,4838,4774,4620,4500,}}, 264 | {{4836,4776,4714,4560,4500,}}, 265 | }}, 266 | {{ 267 | {{13313,12989,12673,12663,12047,}}, 268 | {{12989,12669,12357,12347,11739,}}, 269 | {{12669,12353,12045,12035,11431,}}, 270 | {{12666,12350,12042,12035,11431,}}, 271 | {{12354,12042,11734,11731,11431,}}, 272 | }}, 273 | }}, 274 | {{ 275 | {{ 276 | {{32,32,32,31,31,}}, 277 | {{32,32,32,31,31,}}, 278 | {{32,32,32,31,31,}}, 279 | {{31,31,31,30,30,}}, 280 | {{31,31,31,30,30,}}, 281 | }}, 282 | {{ 283 | {{166,164,162,162,158,}}, 284 | {{164,162,160,160,156,}}, 285 | {{162,160,158,158,154,}}, 286 | {{162,160,158,158,154,}}, 287 | {{160,158,156,156,154,}}, 288 | }}, 289 | }}, 290 | {{ 291 | {{ 292 | {{0,0,0,0,0,}}, 293 | {{0,0,0,0,0,}}, 294 | {{0,0,0,0,0,}}, 295 | {{0,0,0,0,0,}}, 296 | {{0,0,0,0,0,}}, 297 | }}, 298 | {{ 299 | {{1,1,1,1,1,}}, 300 | {{1,1,1,1,1,}}, 301 | {{1,1,1,1,1,}}, 302 | {{1,1,1,1,1,}}, 303 | {{1,1,1,1,1,}}, 304 | }}, 305 | }}, 306 | }}, 307 | {{ 308 | {{ 309 | {{ 310 | {{613009437,581567504,550625544,530033828,476719380,}}, 311 | {{581611482,551394146,521691504,502148404,451054356,}}, 312 | {{550461910,521476180,492983244,474465564,425389332,}}, 313 | {{530876960,502924265,475417921,457748752,409556876,}}, 314 | {{503093590,476305509,449745113,433139092,409556876,}}, 315 | }}, 316 | {{ 317 | {{605607936,566230840,530537891,526110758,462621658,}}, 318 | {{566177364,528888488,495124011,490830934,430956746,}}, 319 | {{528723947,493441645,461633867,457397310,399291834,}}, 320 | {{527338088,492057028,460307384,457397310,399291834,}}, 321 | {{493843324,460409292,428716150,427499440,399291834,}}, 322 | }}, 323 | }}, 324 | {{ 325 | {{ 326 | {{17581204,16912148,16236416,15670704,14471056,}}, 327 | {{16912962,16261088,15603226,15059440,13892528,}}, 328 | {{16240940,15606592,14966100,14444144,13314000,}}, 329 | {{15683547,15071295,14452062,13942712,12832512,}}, 330 | {{15066953,14471749,13873196,13379870,12832512,}}, 331 | }}, 332 | {{ 333 | {{21968059,20836320,19786424,19686664,17758408,}}, 334 | {{20835502,19748262,18740560,18642776,16795432,}}, 335 | {{19745850,18701944,17736856,17639912,15832456,}}, 336 | {{19715073,18671176,17706940,17639912,15832456,}}, 337 | {{18711335,17708468,16745072,16716812,15832456,}}, 338 | }}, 339 | }}, 340 | {{ 341 | {{ 342 | {{363846,354716,345244,333808,316512,}}, 343 | {{354723,345709,336361,325224,308160,}}, 344 | {{345423,336529,327301,316464,299808,}}, 345 | {{333902,325311,316379,305632,289264,}}, 346 | {{325134,316663,308023,297392,289264,}}, 347 | }}, 348 | {{ 349 | {{613042,589586,567296,565856,523664,}}, 350 | {{589580,566732,545034,543608,502576,}}, 351 | {{566715,544467,523364,521944,481488,}}, 352 | {{566277,544029,522932,521944,481488,}}, 353 | {{544607,522943,501852,501432,481488,}}, 354 | }}, 355 | }}, 356 | {{ 357 | {{ 358 | {{4836,4776,4712,4560,4440,}}, 359 | {{4776,4716,4652,4502,4382,}}, 360 | {{4714,4654,4590,4442,4324,}}, 361 | {{4560,4502,4440,4292,4176,}}, 362 | {{4500,4442,4382,4234,4176,}}, 363 | }}, 364 | {{ 365 | {{12354,12042,11738,11728,11136,}}, 366 | {{12042,11734,11434,11424,10840,}}, 367 | {{11734,11430,11134,11124,10544,}}, 368 | {{11731,11427,11131,11124,10544,}}, 369 | {{11431,11131,10835,10832,10544,}}, 370 | }}, 371 | }}, 372 | {{ 373 | {{ 374 | {{31,31,31,30,30,}}, 375 | {{31,31,31,30,30,}}, 376 | {{31,31,31,30,30,}}, 377 | {{30,30,30,29,29,}}, 378 | {{30,30,30,29,29,}}, 379 | }}, 380 | {{ 381 | {{160,158,156,156,152,}}, 382 | {{158,156,154,154,150,}}, 383 | {{156,154,152,152,148,}}, 384 | {{156,154,152,152,148,}}, 385 | {{154,152,150,150,148,}}, 386 | }}, 387 | }}, 388 | {{ 389 | {{ 390 | {{0,0,0,0,0,}}, 391 | {{0,0,0,0,0,}}, 392 | {{0,0,0,0,0,}}, 393 | {{0,0,0,0,0,}}, 394 | {{0,0,0,0,0,}}, 395 | }}, 396 | {{ 397 | {{1,1,1,1,1,}}, 398 | {{1,1,1,1,1,}}, 399 | {{1,1,1,1,1,}}, 400 | {{1,1,1,1,1,}}, 401 | {{1,1,1,1,1,}}, 402 | }}, 403 | }}, 404 | }}, 405 | {{ 406 | {{ 407 | {{ 408 | {{503093590,476265422,449894674,432393565,387219265,}}, 409 | {{476305509,450564363,425293671,408718399,365506671,}}, 410 | {{449745113,425097167,400899381,385228419,343794077,}}, 411 | {{433139092,409402345,386073295,371152663,330493195,}}, 412 | {{409556876,386851349,364353741,350370989,330493195,}}, 413 | }}, 414 | {{ 415 | {{493843324,460458052,430307160,426429168,373081040,}}, 416 | {{460409292,428866818,400412214,396656916,346479276,}}, 417 | {{428716150,398941522,372209024,368505404,319877512,}}, 418 | {{427499440,397726000,371046746,368505404,319877512,}}, 419 | {{399291834,371139926,344512332,343451814,319877512,}}, 420 | }}, 421 | }}, 422 | {{ 423 | {{ 424 | {{15066953,14470971,13869131,13367976,12304278,}}, 425 | {{14471749,13891685,13306419,12825456,11792022,}}, 426 | {{13873196,13309378,12740207,12279342,11279766,}}, 427 | {{13379870,12836404,12286784,11837583,10856297,}}, 428 | {{12832512,12304830,11774206,11339805,10856297,}}, 429 | }}, 430 | {{ 431 | {{18711335,17709250,16782308,16690830,14994758,}}, 432 | {{17708468,16747382,15859230,15769644,14147820,}}, 433 | {{16745072,15823868,14974908,14886126,13300882,}}, 434 | {{16716812,15795617,14947473,14886126,13300882,}}, 435 | {{15832456,14948935,14101595,14075756,13300882,}}, 436 | }}, 437 | }}, 438 | {{ 439 | {{ 440 | {{325134,316656,307852,297301,281277,}}, 441 | {{316663,308297,299613,289349,273549,}}, 442 | {{308023,299773,291205,281229,265821,}}, 443 | {{297392,289433,281149,271260,256128,}}, 444 | {{289264,281421,273417,263640,256128,}}, 445 | }}, 446 | {{ 447 | {{544607,522949,502409,501029,462241,}}, 448 | {{522943,501869,481897,480531,442855,}}, 449 | {{501852,481354,461953,460593,423469,}}, 450 | {{501432,480934,461539,460593,423469,}}, 451 | {{481488,461550,442161,441759,423469,}}, 452 | }}, 453 | }}, 454 | {{ 455 | {{ 456 | {{4500,4442,4380,4234,4118,}}, 457 | {{4442,4384,4322,4178,4062,}}, 458 | {{4382,4324,4262,4120,4006,}}, 459 | {{4234,4178,4118,3976,3864,}}, 460 | {{4176,4120,4062,3920,3864,}}, 461 | }}, 462 | {{ 463 | {{11431,11131,10839,10829,10261,}}, 464 | {{11131,10835,10547,10537,9977,}}, 465 | {{10835,10543,10259,10249,9693,}}, 466 | {{10832,10540,10256,10249,9693,}}, 467 | {{10544,10256,9972,9969,9693,}}, 468 | }}, 469 | }}, 470 | {{ 471 | {{ 472 | {{30,30,30,29,29,}}, 473 | {{30,30,30,29,29,}}, 474 | {{30,30,30,29,29,}}, 475 | {{29,29,29,28,28,}}, 476 | {{29,29,29,28,28,}}, 477 | }}, 478 | {{ 479 | {{154,152,150,150,146,}}, 480 | {{152,150,148,148,144,}}, 481 | {{150,148,146,146,142,}}, 482 | {{150,148,146,146,142,}}, 483 | {{148,146,144,144,142,}}, 484 | }}, 485 | }}, 486 | {{ 487 | {{ 488 | {{0,0,0,0,0,}}, 489 | {{0,0,0,0,0,}}, 490 | {{0,0,0,0,0,}}, 491 | {{0,0,0,0,0,}}, 492 | {{0,0,0,0,0,}}, 493 | }}, 494 | {{ 495 | {{1,1,1,1,1,}}, 496 | {{1,1,1,1,1,}}, 497 | {{1,1,1,1,1,}}, 498 | {{1,1,1,1,1,}}, 499 | {{1,1,1,1,1,}}, 500 | }}, 501 | }}, 502 | }}, 503 | {{ 504 | {{ 505 | {{ 506 | {{409556876,386815029,364489897,349714248,311709248,}}, 507 | {{386851349,365069645,343716099,329753568,293474040,}}, 508 | {{364353741,343537575,323130819,309961468,275238832,}}, 509 | {{350370989,330354194,310708158,298199239,264151495,}}, 510 | {{330493195,311384774,292465374,280779855,264151495,}}, 511 | }}, 512 | {{ 513 | {{399291834,371184088,345899514,342528126,298045178,}}, 514 | {{371139926,344649674,320848740,317589132,275870504,}}, 515 | {{344512332,319571034,297277254,294064674,253695830,}}, 516 | {{343451814,318511668,296266452,294064674,253695830,}}, 517 | {{319877512,296352670,274154482,273237736,253695830,}}, 518 | }}, 519 | }}, 520 | {{ 521 | {{ 522 | {{12832512,12304088,11770576,11328810,10390410,}}, 523 | {{12304830,11791108,11272922,10849686,9939174,}}, 524 | {{11774206,11275498,10772180,10367382,9487938,}}, 525 | {{11339805,10859777,10374374,9980340,9117604,}}, 526 | {{10856297,10390837,9922818,9542416,9117604,}}, 527 | }}, 528 | {{ 529 | {{15832456,14949681,14135637,14052121,12568673,}}, 530 | {{14948935,14103803,13325289,13243581,11828005,}}, 531 | {{14101595,13293037,12550437,12469497,11087337,}}, 532 | {{14075756,13267207,12525387,12469497,11087337,}}, 533 | {{13300882,12526795,11785743,11762229,11087337,}}, 534 | }}, 535 | }}, 536 | {{ 537 | {{ 538 | {{289264,281414,273254,263552,248752,}}, 539 | {{281421,273679,265635,256208,241624,}}, 540 | {{273417,265787,257855,248704,234496,}}, 541 | {{263640,256289,248629,239562,225618,}}, 542 | {{256128,248889,241497,232538,225618,}}, 543 | }}, 544 | {{ 545 | {{481488,461556,442694,441374,405846,}}, 546 | {{461550,442178,423860,422554,388090,}}, 547 | {{442161,423341,405570,404270,370334,}}, 548 | {{441759,422939,405174,404270,370334,}}, 549 | {{423469,405185,387426,387042,370334,}}, 550 | }}, 551 | }}, 552 | {{ 553 | {{ 554 | {{4176,4120,4060,3920,3808,}}, 555 | {{4120,4064,4004,3866,3754,}}, 556 | {{4062,4006,3946,3810,3700,}}, 557 | {{3920,3866,3808,3672,3564,}}, 558 | {{3864,3810,3754,3618,3564,}}, 559 | }}, 560 | {{ 561 | {{10544,10256,9976,9966,9422,}}, 562 | {{10256,9972,9696,9686,9150,}}, 563 | {{9972,9692,9420,9410,8878,}}, 564 | {{9969,9689,9417,9410,8878,}}, 565 | {{9693,9417,9145,9142,8878,}}, 566 | }}, 567 | }}, 568 | {{ 569 | {{ 570 | {{29,29,29,28,28,}}, 571 | {{29,29,29,28,28,}}, 572 | {{29,29,29,28,28,}}, 573 | {{28,28,28,27,27,}}, 574 | {{28,28,28,27,27,}}, 575 | }}, 576 | {{ 577 | {{148,146,144,144,140,}}, 578 | {{146,144,142,142,138,}}, 579 | {{144,142,140,140,136,}}, 580 | {{144,142,140,140,136,}}, 581 | {{142,140,138,138,136,}}, 582 | }}, 583 | }}, 584 | {{ 585 | {{ 586 | {{0,0,0,0,0,}}, 587 | {{0,0,0,0,0,}}, 588 | {{0,0,0,0,0,}}, 589 | {{0,0,0,0,0,}}, 590 | {{0,0,0,0,0,}}, 591 | }}, 592 | {{ 593 | {{1,1,1,1,1,}}, 594 | {{1,1,1,1,1,}}, 595 | {{1,1,1,1,1,}}, 596 | {{1,1,1,1,1,}}, 597 | {{1,1,1,1,1,}}, 598 | }}, 599 | }}, 600 | }}, 601 | {{ 602 | {{ 603 | {{ 604 | {{330493195,311384774,292465374,280779855,264151495,}}, 605 | {{311384774,293118476,275047276,264059139,248221803,}}, 606 | {{292465374,275047276,257801200,247486931,232292111,}}, 607 | {{280779855,264059139,247486931,237747330,222552510,}}, 608 | {{264151495,248221803,232292111,222552510,222552510,}}, 609 | }}, 610 | {{ 611 | {{319877512,296352670,274154482,273237736,253695830,}}, 612 | {{296352670,274240700,253390248,252473502,234216628,}}, 613 | {{274154482,253390248,233911046,232994300,214737426,}}, 614 | {{273237736,252473502,232994300,232994300,214737426,}}, 615 | {{253695830,234216628,214737426,214737426,214737426,}}, 616 | }}, 617 | }}, 618 | {{ 619 | {{ 620 | {{10856297,10390837,9922818,9542416,9117604,}}, 621 | {{10390837,9938897,9484710,9121392,8709692,}}, 622 | {{9922818,9484710,9043910,8697292,8301780,}}, 623 | {{9542416,9121392,8697292,8360358,7964846,}}, 624 | {{9117604,8709692,8301780,7964846,7964846,}}, 625 | }}, 626 | {{ 627 | {{13300882,12526795,11785743,11762229,11087337,}}, 628 | {{12526795,11787151,11079499,11055985,10413469,}}, 629 | {{11785743,11079499,10405631,10382117,9739601,}}, 630 | {{11762229,11055985,10382117,10382117,9739601,}}, 631 | {{11087337,10413469,9739601,9739601,9739601,}}, 632 | }}, 633 | }}, 634 | {{ 635 | {{ 636 | {{256128,248889,241497,232538,225618,}}, 637 | {{248889,241754,234470,225778,218962,}}, 638 | {{241497,234470,227290,218862,212306,}}, 639 | {{232538,225778,218862,210512,203956,}}, 640 | {{225618,218962,212306,203956,203956,}}, 641 | }}, 642 | {{ 643 | {{423469,405185,387426,387042,370334,}}, 644 | {{405185,387437,370206,369822,353634,}}, 645 | {{387426,370206,353506,353122,336934,}}, 646 | {{387042,369822,353122,353122,336934,}}, 647 | {{370334,353634,336934,336934,336934,}}, 648 | }}, 649 | }}, 650 | {{ 651 | {{ 652 | {{3864,3810,3754,3618,3564,}}, 653 | {{3810,3756,3700,3566,3512,}}, 654 | {{3754,3700,3644,3512,3460,}}, 655 | {{3618,3566,3512,3380,3328,}}, 656 | {{3564,3512,3460,3328,3328,}}, 657 | }}, 658 | {{ 659 | {{9693,9417,9145,9142,8878,}}, 660 | {{9417,9145,8877,8874,8614,}}, 661 | {{9145,8877,8613,8610,8350,}}, 662 | {{9142,8874,8610,8610,8350,}}, 663 | {{8878,8614,8350,8350,8350,}}, 664 | }}, 665 | }}, 666 | {{ 667 | {{ 668 | {{28,28,28,27,27,}}, 669 | {{28,28,28,27,27,}}, 670 | {{28,28,28,27,27,}}, 671 | {{27,27,27,26,26,}}, 672 | {{27,27,27,26,26,}}, 673 | }}, 674 | {{ 675 | {{142,140,138,138,136,}}, 676 | {{140,138,136,136,134,}}, 677 | {{138,136,134,134,132,}}, 678 | {{138,136,134,134,132,}}, 679 | {{136,134,132,132,132,}}, 680 | }}, 681 | }}, 682 | {{ 683 | {{ 684 | {{0,0,0,0,0,}}, 685 | {{0,0,0,0,0,}}, 686 | {{0,0,0,0,0,}}, 687 | {{0,0,0,0,0,}}, 688 | {{0,0,0,0,0,}}, 689 | }}, 690 | {{ 691 | {{1,1,1,1,1,}}, 692 | {{1,1,1,1,1,}}, 693 | {{1,1,1,1,1,}}, 694 | {{1,1,1,1,1,}}, 695 | {{1,1,1,1,1,}}, 696 | }}, 697 | }}, 698 | }}, 699 | {{ 700 | {{ 701 | {{ 702 | {{264151495,248221803,232292111,222552510,222552510,}}, 703 | {{248221803,233026983,217832163,208703726,208703726,}}, 704 | {{232292111,217832163,203372215,194854942,194854942,}}, 705 | {{222552510,208703726,194854942,186337669,186337669,}}, 706 | {{222552510,208703726,194854942,186337669,186337669,}}, 707 | }}, 708 | {{ 709 | {{253695830,234216628,214737426,214737426,214737426,}}, 710 | {{234216628,215959754,197702880,197702880,197702880,}}, 711 | {{214737426,197702880,180668334,180668334,180668334,}}, 712 | {{214737426,197702880,180668334,180668334,180668334,}}, 713 | {{214737426,197702880,180668334,180668334,180668334,}}, 714 | }}, 715 | }}, 716 | {{ 717 | {{ 718 | {{9117604,8709692,8301780,7964846,7964846,}}, 719 | {{8709692,8314180,7918668,7597410,7597410,}}, 720 | {{8301780,7918668,7535556,7229974,7229974,}}, 721 | {{7964846,7597410,7229974,6924392,6924392,}}, 722 | {{7964846,7597410,7229974,6924392,6924392,}}, 723 | }}, 724 | {{ 725 | {{11087337,10413469,9739601,9739601,9739601,}}, 726 | {{10413469,9770953,9128437,9128437,9128437,}}, 727 | {{9739601,9128437,8517273,8517273,8517273,}}, 728 | {{9739601,9128437,8517273,8517273,8517273,}}, 729 | {{9739601,9128437,8517273,8517273,8517273,}}, 730 | }}, 731 | }}, 732 | {{ 733 | {{ 734 | {{225618,218962,212306,203956,203956,}}, 735 | {{218962,212406,205850,197756,197756,}}, 736 | {{212306,205850,199394,191556,191556,}}, 737 | {{203956,197756,191556,183718,183718,}}, 738 | {{203956,197756,191556,183718,183718,}}, 739 | }}, 740 | {{ 741 | {{370334,353634,336934,336934,336934,}}, 742 | {{353634,337446,321258,321258,321258,}}, 743 | {{336934,321258,305582,305582,305582,}}, 744 | {{336934,321258,305582,305582,305582,}}, 745 | {{336934,321258,305582,305582,305582,}}, 746 | }}, 747 | }}, 748 | {{ 749 | {{ 750 | {{3564,3512,3460,3328,3328,}}, 751 | {{3512,3460,3408,3278,3278,}}, 752 | {{3460,3408,3356,3228,3228,}}, 753 | {{3328,3278,3228,3100,3100,}}, 754 | {{3328,3278,3228,3100,3100,}}, 755 | }}, 756 | {{ 757 | {{8878,8614,8350,8350,8350,}}, 758 | {{8614,8354,8094,8094,8094,}}, 759 | {{8350,8094,7838,7838,7838,}}, 760 | {{8350,8094,7838,7838,7838,}}, 761 | {{8350,8094,7838,7838,7838,}}, 762 | }}, 763 | }}, 764 | {{ 765 | {{ 766 | {{27,27,27,26,26,}}, 767 | {{27,27,27,26,26,}}, 768 | {{27,27,27,26,26,}}, 769 | {{26,26,26,25,25,}}, 770 | {{26,26,26,25,25,}}, 771 | }}, 772 | {{ 773 | {{136,134,132,132,132,}}, 774 | {{134,132,130,130,130,}}, 775 | {{132,130,128,128,128,}}, 776 | {{132,130,128,128,128,}}, 777 | {{132,130,128,128,128,}}, 778 | }}, 779 | }}, 780 | {{ 781 | {{ 782 | {{0,0,0,0,0,}}, 783 | {{0,0,0,0,0,}}, 784 | {{0,0,0,0,0,}}, 785 | {{0,0,0,0,0,}}, 786 | {{0,0,0,0,0,}}, 787 | }}, 788 | {{ 789 | {{1,1,1,1,1,}}, 790 | {{1,1,1,1,1,}}, 791 | {{1,1,1,1,1,}}, 792 | {{1,1,1,1,1,}}, 793 | {{1,1,1,1,1,}}, 794 | }}, 795 | }}, 796 | }}, 797 | {{ 798 | {{ 799 | {{ 800 | {{222552510,0,0,0,0,}}, 801 | {{208703726,0,0,0,0,}}, 802 | {{194854942,0,0,0,0,}}, 803 | {{186337669,0,0,0,0,}}, 804 | {{186337669,0,0,0,0,}}, 805 | }}, 806 | {{ 807 | {{214737426,0,0,0,0,}}, 808 | {{197702880,0,0,0,0,}}, 809 | {{180668334,0,0,0,0,}}, 810 | {{180668334,0,0,0,0,}}, 811 | {{180668334,0,0,0,0,}}, 812 | }}, 813 | }}, 814 | {{ 815 | {{ 816 | {{7964846,0,0,0,0,}}, 817 | {{7597410,0,0,0,0,}}, 818 | {{7229974,0,0,0,0,}}, 819 | {{6924392,0,0,0,0,}}, 820 | {{6924392,0,0,0,0,}}, 821 | }}, 822 | {{ 823 | {{9739601,0,0,0,0,}}, 824 | {{9128437,0,0,0,0,}}, 825 | {{8517273,0,0,0,0,}}, 826 | {{8517273,0,0,0,0,}}, 827 | {{8517273,0,0,0,0,}}, 828 | }}, 829 | }}, 830 | {{ 831 | {{ 832 | {{203956,0,0,0,0,}}, 833 | {{197756,0,0,0,0,}}, 834 | {{191556,0,0,0,0,}}, 835 | {{183718,0,0,0,0,}}, 836 | {{183718,0,0,0,0,}}, 837 | }}, 838 | {{ 839 | {{336934,0,0,0,0,}}, 840 | {{321258,0,0,0,0,}}, 841 | {{305582,0,0,0,0,}}, 842 | {{305582,0,0,0,0,}}, 843 | {{305582,0,0,0,0,}}, 844 | }}, 845 | }}, 846 | {{ 847 | {{ 848 | {{3328,0,0,0,0,}}, 849 | {{3278,0,0,0,0,}}, 850 | {{3228,0,0,0,0,}}, 851 | {{3100,0,0,0,0,}}, 852 | {{3100,0,0,0,0,}}, 853 | }}, 854 | {{ 855 | {{8350,0,0,0,0,}}, 856 | {{8094,0,0,0,0,}}, 857 | {{7838,0,0,0,0,}}, 858 | {{7838,0,0,0,0,}}, 859 | {{7838,0,0,0,0,}}, 860 | }}, 861 | }}, 862 | {{ 863 | {{ 864 | {{26,0,0,0,0,}}, 865 | {{26,0,0,0,0,}}, 866 | {{26,0,0,0,0,}}, 867 | {{25,0,0,0,0,}}, 868 | {{25,0,0,0,0,}}, 869 | }}, 870 | {{ 871 | {{132,0,0,0,0,}}, 872 | {{130,0,0,0,0,}}, 873 | {{128,0,0,0,0,}}, 874 | {{128,0,0,0,0,}}, 875 | {{128,0,0,0,0,}}, 876 | }}, 877 | }}, 878 | {{ 879 | {{ 880 | {{0,0,0,0,0,}}, 881 | {{0,0,0,0,0,}}, 882 | {{0,0,0,0,0,}}, 883 | {{0,0,0,0,0,}}, 884 | {{0,0,0,0,0,}}, 885 | }}, 886 | {{ 887 | {{1,0,0,0,0,}}, 888 | {{1,0,0,0,0,}}, 889 | {{1,0,0,0,0,}}, 890 | {{1,0,0,0,0,}}, 891 | {{1,0,0,0,0,}}, 892 | }}, 893 | }}, 894 | }}, 895 | {{ 896 | {{ 897 | {{ 898 | {{186337669,174310906,162550778,154712464,135242800,}}, 899 | {{174336676,162900940,151739750,144402640,125974752,}}, 900 | {{162469040,151628010,141047858,134197520,116706704,}}, 901 | {{155108270,144758617,134642193,128191542,111103282,}}, 902 | {{144843272,135046997,125369841,119411570,111103282,}}, 903 | }}, 904 | {{ 905 | {{180668334,165859802,152750529,150733676,128224776,}}, 906 | {{165828878,152016742,139808213,137870640,117017932,}}, 907 | {{151919117,139054179,127762993,125858684,105811088,}}, 908 | {{151279886,138415902,127159210,125858684,105811088,}}, 909 | {{139231134,127218866,115995420,115455666,105811088,}}, 910 | }}, 911 | }}, 912 | {{ 913 | {{ 914 | {{6924392,6593672,6259536,5983220,5407988,}}, 915 | {{6594298,6274264,5951342,5688508,5133356,}}, 916 | {{6262162,5953078,5640980,5391548,4858724,}}, 917 | {{5991177,5695701,5396562,5154912,4634024,}}, 918 | {{5693211,5408303,5121672,4889790,4634024,}}, 919 | }}, 920 | {{ 921 | {{8517273,7965222,7462534,7402814,6502222,}}, 922 | {{7964596,7440004,6962982,6904790,6052822,}}, 923 | {{7438136,6940094,6489062,6431518,5603422,}}, 924 | {{7419563,6921530,6471158,6431518,5603422,}}, 925 | {{6945609,6472334,6022610,6005978,5603422,}}, 926 | }}, 927 | }}, 928 | {{ 929 | {{ 930 | {{183718,177948,171916,164800,154032,}}, 931 | {{177955,172277,166345,159464,148880,}}, 932 | {{172055,166473,160637,153992,143728,}}, 933 | {{164876,159533,153929,147356,137316,}}, 934 | {{159396,154149,148773,142292,137316,}}, 935 | }}, 936 | {{ 937 | {{305582,290902,277132,276012,250348,}}, 938 | {{290896,276696,263390,262284,237524,}}, 939 | {{276679,262951,250112,249012,224700,}}, 940 | {{276337,262609,249776,249012,224700,}}, 941 | {{263059,249787,236960,236636,224700,}}, 942 | }}, 943 | }}, 944 | {{ 945 | {{ 946 | {{3100,3052,3000,2880,2784,}}, 947 | {{3052,3004,2952,2834,2738,}}, 948 | {{3002,2954,2902,2786,2692,}}, 949 | {{2880,2834,2784,2668,2576,}}, 950 | {{2832,2786,2738,2622,2576,}}, 951 | }}, 952 | {{ 953 | {{7838,7590,7350,7340,6876,}}, 954 | {{7590,7346,7110,7100,6644,}}, 955 | {{7346,7106,6874,6864,6412,}}, 956 | {{7343,7103,6871,6864,6412,}}, 957 | {{7107,6871,6639,6636,6412,}}, 958 | }}, 959 | }}, 960 | {{ 961 | {{ 962 | {{25,25,25,24,24,}}, 963 | {{25,25,25,24,24,}}, 964 | {{25,25,25,24,24,}}, 965 | {{24,24,24,23,23,}}, 966 | {{24,24,24,23,23,}}, 967 | }}, 968 | {{ 969 | {{128,126,124,124,120,}}, 970 | {{126,124,122,122,118,}}, 971 | {{124,122,120,120,116,}}, 972 | {{124,122,120,120,116,}}, 973 | {{122,120,118,118,116,}}, 974 | }}, 975 | }}, 976 | {{ 977 | {{ 978 | {{0,0,0,0,0,}}, 979 | {{0,0,0,0,0,}}, 980 | {{0,0,0,0,0,}}, 981 | {{0,0,0,0,0,}}, 982 | {{0,0,0,0,0,}}, 983 | }}, 984 | {{ 985 | {{1,1,1,1,1,}}, 986 | {{1,1,1,1,1,}}, 987 | {{1,1,1,1,1,}}, 988 | {{1,1,1,1,1,}}, 989 | {{1,1,1,1,1,}}, 990 | }}, 991 | }}, 992 | }}, 993 | {{ 994 | {{ 995 | {{ 996 | {{144843272,135024158,125442430,119074460,103362012,}}, 997 | {{135046997,125735183,116667427,110726614,95901974,}}, 998 | {{125369841,116568399,107998613,102471842,88441936,}}, 999 | {{119411570,111028229,102851939,97666016,83974876,}}, 1000 | {{111103282,103192909,95388225,90620514,83974876,}}, 1001 | }}, 1002 | {{ 1003 | {{139231134,127246256,116696281,114998618,97045326,}}, 1004 | {{127218866,116082466,106295483,104668450,88111206,}}, 1005 | {{115995420,105663458,96654233,95056798,79177086,}}, 1006 | {{115455666,105124604,96146135,95056798,79177086,}}, 1007 | {{105811088,96199142,87250253,86798996,79177086,}}, 1008 | }}, 1009 | }}, 1010 | {{ 1011 | {{ 1012 | {{5693211,5407713,5119393,4882584,4389788,}}, 1013 | {{5408303,5132499,4854369,4629692,4155048,}}, 1014 | {{5121672,4855810,4587501,4374878,3920308,}}, 1015 | {{4889790,4636176,4379502,4173923,3730019,}}, 1016 | {{4634024,4389986,4144520,3947757,3730019,}}, 1017 | }}, 1018 | {{ 1019 | {{6945609,6472924,6044438,5991068,5228216,}}, 1020 | {{6472334,6024376,5618920,5566994,4847638,}}, 1021 | {{6022610,5598518,5216398,5165084,4467060,}}, 1022 | {{6005978,5581895,5200399,5165084,4467060,}}, 1023 | {{5603422,5201509,4820625,4805826,4467060,}}, 1024 | }}, 1025 | }}, 1026 | {{ 1027 | {{ 1028 | {{159396,154142,148642,142219,132451,}}, 1029 | {{154149,148983,143579,137379,127787,}}, 1030 | {{148773,143699,138387,132411,123123,}}, 1031 | {{142292,137445,132353,126446,117370,}}, 1032 | {{137316,132561,127685,121866,117370,}}, 1033 | }}, 1034 | {{ 1035 | {{263059,249793,237389,236329,213301,}}, 1036 | {{249787,236977,225013,223967,201795,}}, 1037 | {{236960,224598,213077,212037,190289,}}, 1038 | {{236636,224274,212759,212037,190289,}}, 1039 | {{224700,212770,201261,200955,190289,}}, 1040 | }}, 1041 | }}, 1042 | {{ 1043 | {{ 1044 | {{2832,2786,2736,2622,2530,}}, 1045 | {{2786,2740,2690,2578,2486,}}, 1046 | {{2738,2692,2642,2532,2442,}}, 1047 | {{2622,2578,2530,2420,2332,}}, 1048 | {{2576,2532,2486,2376,2332,}}, 1049 | }}, 1050 | {{ 1051 | {{7107,6871,6643,6633,6193,}}, 1052 | {{6871,6639,6415,6405,5973,}}, 1053 | {{6639,6411,6191,6181,5753,}}, 1054 | {{6636,6408,6188,6181,5753,}}, 1055 | {{6412,6188,5968,5965,5753,}}, 1056 | }}, 1057 | }}, 1058 | {{ 1059 | {{ 1060 | {{24,24,24,23,23,}}, 1061 | {{24,24,24,23,23,}}, 1062 | {{24,24,24,23,23,}}, 1063 | {{23,23,23,22,22,}}, 1064 | {{23,23,23,22,22,}}, 1065 | }}, 1066 | {{ 1067 | {{122,120,118,118,114,}}, 1068 | {{120,118,116,116,112,}}, 1069 | {{118,116,114,114,110,}}, 1070 | {{118,116,114,114,110,}}, 1071 | {{116,114,112,112,110,}}, 1072 | }}, 1073 | }}, 1074 | {{ 1075 | {{ 1076 | {{0,0,0,0,0,}}, 1077 | {{0,0,0,0,0,}}, 1078 | {{0,0,0,0,0,}}, 1079 | {{0,0,0,0,0,}}, 1080 | {{0,0,0,0,0,}}, 1081 | }}, 1082 | {{ 1083 | {{1,1,1,1,1,}}, 1084 | {{1,1,1,1,1,}}, 1085 | {{1,1,1,1,1,}}, 1086 | {{1,1,1,1,1,}}, 1087 | {{1,1,1,1,1,}}, 1088 | }}, 1089 | }}, 1090 | }}, 1091 | {{ 1092 | {{ 1093 | {{ 1094 | {{111103282,103172821,95452209,90336046,77808758,}}, 1095 | {{103192909,95694317,88411103,83655790,71878262,}}, 1096 | {{95388225,88324015,81463987,77057666,65947766,}}, 1097 | {{90620514,83908845,77379617,73261347,62433599,}}, 1098 | {{83974876,77663917,71446025,67679615,62433599,}}, 1099 | }}, 1100 | {{ 1101 | {{105811088,96223214,87835095,86420742,72288606,}}, 1102 | {{96199142,87327332,79579381,78227512,65260272,}}, 1103 | {{87250253,79055337,71960595,70634874,58231938,}}, 1104 | {{86798996,78604926,71537418,70634874,58231938,}}, 1105 | {{79177086,71584172,64542794,64169702,58231938,}}, 1106 | }}, 1107 | }}, 1108 | {{ 1109 | {{ 1110 | {{4634024,4389432,4142564,3941266,3522658,}}, 1111 | {{4389986,4154144,3916490,3726046,3323758,}}, 1112 | {{4144520,3917660,3688872,3509206,3124858,}}, 1113 | {{3947757,3731857,3513452,3340128,2965248,}}, 1114 | {{3730019,3522751,3314326,3148914,2965248,}}, 1115 | }}, 1116 | {{ 1117 | {{5603422,5202063,4840027,4792647,4152607,}}, 1118 | {{5201509,4822289,4480791,4434771,3833387,}}, 1119 | {{4820625,4462731,4142059,4096615,3514167,}}, 1120 | {{4805826,4447941,4127857,4096615,3514167,}}, 1121 | {{4467060,4128901,3809393,3796319,3514167,}}, 1122 | }}, 1123 | }}, 1124 | {{ 1125 | {{ 1126 | {{137316,132554,127562,121796,112980,}}, 1127 | {{132561,127883,122983,117428,108780,}}, 1128 | {{127685,123095,118283,112940,104580,}}, 1129 | {{121866,117491,112887,107610,99450,}}, 1130 | {{117370,113083,108683,103490,99450,}}, 1131 | }}, 1132 | {{ 1133 | {{224700,212776,201666,200666,180130,}}, 1134 | {{212770,201278,190584,189598,169870,}}, 1135 | {{201261,190193,179918,178938,159610,}}, 1136 | {{200955,189887,179618,178938,159610,}}, 1137 | {{190289,179629,169366,169078,159610,}}, 1138 | }}, 1139 | }}, 1140 | {{ 1141 | {{ 1142 | {{2576,2532,2484,2376,2288,}}, 1143 | {{2532,2488,2440,2334,2246,}}, 1144 | {{2486,2442,2394,2290,2204,}}, 1145 | {{2376,2334,2288,2184,2100,}}, 1146 | {{2332,2290,2246,2142,2100,}}, 1147 | }}, 1148 | {{ 1149 | {{6412,6188,5972,5962,5546,}}, 1150 | {{6188,5968,5756,5746,5338,}}, 1151 | {{5968,5752,5544,5534,5130,}}, 1152 | {{5965,5749,5541,5534,5130,}}, 1153 | {{5753,5541,5333,5330,5130,}}, 1154 | }}, 1155 | }}, 1156 | {{ 1157 | {{ 1158 | {{23,23,23,22,22,}}, 1159 | {{23,23,23,22,22,}}, 1160 | {{23,23,23,22,22,}}, 1161 | {{22,22,22,21,21,}}, 1162 | {{22,22,22,21,21,}}, 1163 | }}, 1164 | {{ 1165 | {{116,114,112,112,108,}}, 1166 | {{114,112,110,110,106,}}, 1167 | {{112,110,108,108,104,}}, 1168 | {{112,110,108,108,104,}}, 1169 | {{110,108,106,106,104,}}, 1170 | }}, 1171 | }}, 1172 | {{ 1173 | {{ 1174 | {{0,0,0,0,0,}}, 1175 | {{0,0,0,0,0,}}, 1176 | {{0,0,0,0,0,}}, 1177 | {{0,0,0,0,0,}}, 1178 | {{0,0,0,0,0,}}, 1179 | }}, 1180 | {{ 1181 | {{1,1,1,1,1,}}, 1182 | {{1,1,1,1,1,}}, 1183 | {{1,1,1,1,1,}}, 1184 | {{1,1,1,1,1,}}, 1185 | {{1,1,1,1,1,}}, 1186 | }}, 1187 | }}, 1188 | }}, 1189 | {{ 1190 | {{ 1191 | {{ 1192 | {{83974876,77646400,71501948,67442059,57589075,}}, 1193 | {{77663917,71699743,65924075,62166037,52939821,}}, 1194 | {{71446025,65848155,60428741,56961893,48290567,}}, 1195 | {{67679615,62376010,57231804,54005928,45566884,}}, 1196 | {{62433599,57466166,52579986,49647002,45566884,}}, 1197 | }}, 1198 | {{ 1199 | {{79177086,71605142,65025285,63860522,52899330,}}, 1200 | {{71584172,64610518,58562069,57452148,47451964,}}, 1201 | {{64542794,58132842,52627225,51540218,42004598,}}, 1202 | {{64169702,57760542,52278853,51540218,42004598,}}, 1203 | {{58231938,52319750,46860957,46556346,42004598,}}, 1204 | }}, 1205 | }}, 1206 | {{ 1207 | {{ 1208 | {{3730019,3522233,3312669,3143102,2790866,}}, 1209 | {{3522751,3322819,3121541,2961622,2623970,}}, 1210 | {{3314326,3122464,2929145,2778800,2457074,}}, 1211 | {{3148914,2966796,2782680,2638011,2324627,}}, 1212 | {{2965248,2790866,2615574,2477961,2324627,}}, 1213 | }}, 1214 | {{ 1215 | {{4467060,4129419,3826513,3784763,3253471,}}, 1216 | {{4128901,3810955,3526239,3485765,2988577,}}, 1217 | {{3809393,3510377,3244121,3204187,2723683,}}, 1218 | {{3796319,3497312,3231608,3204187,2723683,}}, 1219 | {{3514167,3232586,2967422,2955965,2723683,}}, 1220 | }}, 1221 | }}, 1222 | {{ 1223 | {{ 1224 | {{117370,113076,108568,103423,95511,}}, 1225 | {{113083,108869,104449,99503,91751,}}, 1226 | {{108683,104553,100217,95471,87991,}}, 1227 | {{103490,99563,95423,90740,83448,}}, 1228 | {{99450,95607,91659,87056,83448,}}, 1229 | }}, 1230 | {{ 1231 | {{190289,179635,169747,168807,150619,}}, 1232 | {{179629,169383,159887,158961,141533,}}, 1233 | {{169366,159520,150419,149499,132447,}}, 1234 | {{169078,159232,150137,149499,132447,}}, 1235 | {{159610,150148,141059,140789,132447,}}, 1236 | }}, 1237 | }}, 1238 | {{ 1239 | {{ 1240 | {{2332,2290,2244,2142,2058,}}, 1241 | {{2290,2248,2202,2102,2018,}}, 1242 | {{2246,2204,2158,2060,1978,}}, 1243 | {{2142,2102,2058,1960,1880,}}, 1244 | {{2100,2060,2018,1920,1880,}}, 1245 | }}, 1246 | {{ 1247 | {{5753,5541,5337,5327,4935,}}, 1248 | {{5541,5333,5133,5123,4739,}}, 1249 | {{5333,5129,4933,4923,4543,}}, 1250 | {{5330,5126,4930,4923,4543,}}, 1251 | {{5130,4930,4734,4731,4543,}}, 1252 | }}, 1253 | }}, 1254 | {{ 1255 | {{ 1256 | {{22,22,22,21,21,}}, 1257 | {{22,22,22,21,21,}}, 1258 | {{22,22,22,21,21,}}, 1259 | {{21,21,21,20,20,}}, 1260 | {{21,21,21,20,20,}}, 1261 | }}, 1262 | {{ 1263 | {{110,108,106,106,102,}}, 1264 | {{108,106,104,104,100,}}, 1265 | {{106,104,102,102,98,}}, 1266 | {{106,104,102,102,98,}}, 1267 | {{104,102,100,100,98,}}, 1268 | }}, 1269 | }}, 1270 | {{ 1271 | {{ 1272 | {{0,0,0,0,0,}}, 1273 | {{0,0,0,0,0,}}, 1274 | {{0,0,0,0,0,}}, 1275 | {{0,0,0,0,0,}}, 1276 | {{0,0,0,0,0,}}, 1277 | }}, 1278 | {{ 1279 | {{1,1,1,1,1,}}, 1280 | {{1,1,1,1,1,}}, 1281 | {{1,1,1,1,1,}}, 1282 | {{1,1,1,1,1,}}, 1283 | {{1,1,1,1,1,}}, 1284 | }}, 1285 | }}, 1286 | }}, 1287 | {{ 1288 | {{ 1289 | {{ 1290 | {{62433599,57451064,52628456,49450703,41818155,}}, 1291 | {{57466166,52787798,48272888,45344875,38230323,}}, 1292 | {{52579986,48207324,43989156,41301359,34642491,}}, 1293 | {{49647002,45517181,41525301,39036779,32566623,}}, 1294 | {{45566884,41715985,37935361,35687743,32566623,}}, 1295 | }}, 1296 | {{ 1297 | {{58231938,52337804,47253838,46308056,37947400,}}, 1298 | {{52319750,46919908,42271790,41373688,33795664,}}, 1299 | {{46860957,41925113,37722758,36844528,29643928,}}, 1300 | {{46556346,41621240,37439723,36844528,29643928,}}, 1301 | {{42004598,37475192,33313529,33069242,29643928,}}, 1302 | }}, 1303 | }}, 1304 | {{ 1305 | {{ 1306 | {{2965248,2790384,2614192,2472786,2179524,}}, 1307 | {{2790866,2623008,2454222,2321330,2041012,}}, 1308 | {{2615574,2454922,2293236,2168786,1902500,}}, 1309 | {{2477961,2325909,2172318,2052914,1793916,}}, 1310 | {{2324627,2179463,2033612,1920456,1793916,}}, 1311 | }}, 1312 | {{ 1313 | {{3514167,3233068,2982404,2945936,2510204,}}, 1314 | {{3232586,2968882,2734204,2698928,2293036,}}, 1315 | {{2967422,2720396,2501956,2467184,2075868,}}, 1316 | {{2955965,2708948,2491024,2467184,2075868,}}, 1317 | {{2723683,2491936,2274516,2264580,2075868,}}, 1318 | }}, 1319 | }}, 1320 | {{ 1321 | {{ 1322 | {{99450,95600,91552,86992,79936,}}, 1323 | {{95607,91833,87869,83496,76592,}}, 1324 | {{91659,87965,84081,79896,73248,}}, 1325 | {{87056,83553,79853,75728,69256,}}, 1326 | {{83448,80025,76505,72456,69256,}}, 1327 | }}, 1328 | {{ 1329 | {{159610,150154,141416,140536,124552,}}, 1330 | {{150148,141076,132706,131840,116568,}}, 1331 | {{141059,132363,124364,123504,108584,}}, 1332 | {{140789,132093,124100,123504,108584,}}, 1333 | {{132447,124111,116124,115872,108584,}}, 1334 | }}, 1335 | }}, 1336 | {{ 1337 | {{ 1338 | {{2100,2060,2016,1920,1840,}}, 1339 | {{2060,2020,1976,1882,1802,}}, 1340 | {{2018,1978,1934,1842,1764,}}, 1341 | {{1920,1882,1840,1748,1672,}}, 1342 | {{1880,1842,1802,1710,1672,}}, 1343 | }}, 1344 | {{ 1345 | {{5130,4930,4738,4728,4360,}}, 1346 | {{4930,4734,4546,4536,4176,}}, 1347 | {{4734,4542,4358,4348,3992,}}, 1348 | {{4731,4539,4355,4348,3992,}}, 1349 | {{4543,4355,4171,4168,3992,}}, 1350 | }}, 1351 | }}, 1352 | {{ 1353 | {{ 1354 | {{21,21,21,20,20,}}, 1355 | {{21,21,21,20,20,}}, 1356 | {{21,21,21,20,20,}}, 1357 | {{20,20,20,19,19,}}, 1358 | {{20,20,20,19,19,}}, 1359 | }}, 1360 | {{ 1361 | {{104,102,100,100,96,}}, 1362 | {{102,100,98,98,94,}}, 1363 | {{100,98,96,96,92,}}, 1364 | {{100,98,96,96,92,}}, 1365 | {{98,96,94,94,92,}}, 1366 | }}, 1367 | }}, 1368 | {{ 1369 | {{ 1370 | {{0,0,0,0,0,}}, 1371 | {{0,0,0,0,0,}}, 1372 | {{0,0,0,0,0,}}, 1373 | {{0,0,0,0,0,}}, 1374 | {{0,0,0,0,0,}}, 1375 | }}, 1376 | {{ 1377 | {{1,1,1,1,1,}}, 1378 | {{1,1,1,1,1,}}, 1379 | {{1,1,1,1,1,}}, 1380 | {{1,1,1,1,1,}}, 1381 | {{1,1,1,1,1,}}, 1382 | }}, 1383 | }}, 1384 | }}, 1385 | {{ 1386 | {{ 1387 | {{ 1388 | {{45566884,41703174,37976950,35527102,29715646,}}, 1389 | {{41715985,38103307,34630791,32385032,26996136,}}, 1390 | {{37935361,34574839,31346541,29296404,24276626,}}, 1391 | {{35687743,32525046,29480356,27593116,22724380,}}, 1392 | {{32566623,29632450,26758346,25066858,22724380,}}, 1393 | }}, 1394 | {{ 1395 | {{42004598,37490448,33628706,32875368,26616000,}}, 1396 | {{37475192,33364254,29855136,29142764,23511508,}}, 1397 | {{33313529,29579521,26431538,25736188,20407016,}}, 1398 | {{33069242,29335936,26205911,25736188,20407016,}}, 1399 | {{29643928,26237118,23124115,22932532,20407016,}}, 1400 | }}, 1401 | }}, 1402 | {{ 1403 | {{ 1404 | {{2324627,2179017,2032481,1915868,1674624,}}, 1405 | {{2179463,2040059,1900097,1790936,1561092,}}, 1406 | {{2033612,1900598,1766925,1665146,1447560,}}, 1407 | {{1920456,1794970,1668356,1571035,1359755,}}, 1408 | {{1793916,1674518,1554632,1462807,1359755,}}, 1409 | }}, 1410 | {{ 1411 | {{2723683,2492382,2287504,2255998,1903466,}}, 1412 | {{2491936,2275874,2084922,2054524,1727856,}}, 1413 | {{2274516,2073024,1896232,1866302,1552246,}}, 1414 | {{2264580,2063097,1886785,1866302,1552246,}}, 1415 | {{2075868,1887643,1711799,1703288,1552246,}}, 1416 | }}, 1417 | }}, 1418 | {{ 1419 | {{ 1420 | {{83448,80018,76406,72395,66147,}}, 1421 | {{80025,76667,73135,69299,63195,}}, 1422 | {{76505,73223,69767,66107,60243,}}, 1423 | {{72456,69353,66069,62466,56766,}}, 1424 | {{69256,66229,63113,59582,56766,}}, 1425 | }}, 1426 | {{ 1427 | {{132447,124117,116457,115637,101713,}}, 1428 | {{124111,116141,108825,108019,94759,}}, 1429 | {{116124,108506,101537,100737,87805,}}, 1430 | {{115872,108254,101291,100737,87805,}}, 1431 | {{108584,101302,94345,94111,87805,}}, 1432 | }}, 1433 | }}, 1434 | {{ 1435 | {{ 1436 | {{1880,1842,1800,1710,1634,}}, 1437 | {{1842,1804,1762,1674,1598,}}, 1438 | {{1802,1764,1722,1636,1562,}}, 1439 | {{1710,1674,1634,1548,1476,}}, 1440 | {{1672,1636,1598,1512,1476,}}, 1441 | }}, 1442 | {{ 1443 | {{4543,4355,4175,4165,3821,}}, 1444 | {{4355,4171,3995,3985,3649,}}, 1445 | {{4171,3991,3819,3809,3477,}}, 1446 | {{4168,3988,3816,3809,3477,}}, 1447 | {{3992,3816,3644,3641,3477,}}, 1448 | }}, 1449 | }}, 1450 | {{ 1451 | {{ 1452 | {{20,20,20,19,19,}}, 1453 | {{20,20,20,19,19,}}, 1454 | {{20,20,20,19,19,}}, 1455 | {{19,19,19,18,18,}}, 1456 | {{19,19,19,18,18,}}, 1457 | }}, 1458 | {{ 1459 | {{98,96,94,94,90,}}, 1460 | {{96,94,92,92,88,}}, 1461 | {{94,92,90,90,86,}}, 1462 | {{94,92,90,90,86,}}, 1463 | {{92,90,88,88,86,}}, 1464 | }}, 1465 | }}, 1466 | {{ 1467 | {{ 1468 | {{0,0,0,0,0,}}, 1469 | {{0,0,0,0,0,}}, 1470 | {{0,0,0,0,0,}}, 1471 | {{0,0,0,0,0,}}, 1472 | {{0,0,0,0,0,}}, 1473 | }}, 1474 | {{ 1475 | {{1,1,1,1,1,}}, 1476 | {{1,1,1,1,1,}}, 1477 | {{1,1,1,1,1,}}, 1478 | {{1,1,1,1,1,}}, 1479 | {{1,1,1,1,1,}}, 1480 | }}, 1481 | }}, 1482 | }}, 1483 | {{ 1484 | {{ 1485 | {{ 1486 | {{32566623,29632450,26758346,25066858,22724380,}}, 1487 | {{29632450,26901929,24233049,22700490,20541792,}}, 1488 | {{26758346,24233049,21760973,20378832,18359204,}}, 1489 | {{25066858,22700490,20378832,19127422,17107794,}}, 1490 | {{22724380,20541792,18359204,17107794,17107794,}}, 1491 | }}, 1492 | {{ 1493 | {{29643928,26237118,23124115,22932532,20407016,}}, 1494 | {{26237118,23155322,20343155,20151572,17904196,}}, 1495 | {{23124115,20343155,17840335,17648752,15401376,}}, 1496 | {{22932532,20151572,17648752,17648752,15401376,}}, 1497 | {{20407016,17904196,15401376,15401376,15401376,}}, 1498 | }}, 1499 | }}, 1500 | {{ 1501 | {{ 1502 | {{1793916,1674518,1554632,1462807,1359755,}}, 1503 | {{1674518,1560560,1446298,1361005,1263129,}}, 1504 | {{1554632,1446298,1337388,1258393,1166503,}}, 1505 | {{1462807,1361005,1258393,1183184,1091294,}}, 1506 | {{1359755,1263129,1166503,1091294,1091294,}}, 1507 | }}, 1508 | {{ 1509 | {{2075868,1887643,1711799,1703288,1552246,}}, 1510 | {{1887643,1712657,1549409,1540898,1401828,}}, 1511 | {{1711799,1549409,1398991,1390480,1251410,}}, 1512 | {{1703288,1540898,1390480,1390480,1251410,}}, 1513 | {{1552246,1401828,1251410,1251410,1251410,}}, 1514 | }}, 1515 | }}, 1516 | {{ 1517 | {{ 1518 | {{69256,66229,63113,59582,56766,}}, 1519 | {{66229,63270,60226,56862,54114,}}, 1520 | {{63113,60226,57250,54050,51462,}}, 1521 | {{59582,56862,54050,50901,48313,}}, 1522 | {{56766,54114,51462,48313,48313,}}, 1523 | }}, 1524 | {{ 1525 | {{108584,101302,94345,94111,87805,}}, 1526 | {{101302,94356,87727,87493,81507,}}, 1527 | {{94345,87727,81429,81195,75209,}}, 1528 | {{94111,87493,81195,81195,75209,}}, 1529 | {{87805,81507,75209,75209,75209,}}, 1530 | }}, 1531 | }}, 1532 | {{ 1533 | {{ 1534 | {{1672,1636,1598,1512,1476,}}, 1535 | {{1636,1600,1562,1478,1442,}}, 1536 | {{1598,1562,1524,1442,1408,}}, 1537 | {{1512,1478,1442,1360,1326,}}, 1538 | {{1476,1442,1408,1326,1326,}}, 1539 | }}, 1540 | {{ 1541 | {{3992,3816,3644,3641,3477,}}, 1542 | {{3816,3644,3476,3473,3313,}}, 1543 | {{3644,3476,3312,3309,3149,}}, 1544 | {{3641,3473,3309,3309,3149,}}, 1545 | {{3477,3313,3149,3149,3149,}}, 1546 | }}, 1547 | }}, 1548 | {{ 1549 | {{ 1550 | {{19,19,19,18,18,}}, 1551 | {{19,19,19,18,18,}}, 1552 | {{19,19,19,18,18,}}, 1553 | {{18,18,18,17,17,}}, 1554 | {{18,18,18,17,17,}}, 1555 | }}, 1556 | {{ 1557 | {{92,90,88,88,86,}}, 1558 | {{90,88,86,86,84,}}, 1559 | {{88,86,84,84,82,}}, 1560 | {{88,86,84,84,82,}}, 1561 | {{86,84,82,82,82,}}, 1562 | }}, 1563 | }}, 1564 | {{ 1565 | {{ 1566 | {{0,0,0,0,0,}}, 1567 | {{0,0,0,0,0,}}, 1568 | {{0,0,0,0,0,}}, 1569 | {{0,0,0,0,0,}}, 1570 | {{0,0,0,0,0,}}, 1571 | }}, 1572 | {{ 1573 | {{1,1,1,1,1,}}, 1574 | {{1,1,1,1,1,}}, 1575 | {{1,1,1,1,1,}}, 1576 | {{1,1,1,1,1,}}, 1577 | {{1,1,1,1,1,}}, 1578 | }}, 1579 | }}, 1580 | }}, 1581 | {{ 1582 | {{ 1583 | {{ 1584 | {{22724380,20541792,18359204,17107794,17107794,}}, 1585 | {{20541792,18522164,16502536,15378848,15378848,}}, 1586 | {{18359204,16502536,14645868,13649902,13649902,}}, 1587 | {{17107794,15378848,13649902,12653936,12653936,}}, 1588 | {{17107794,15378848,13649902,12653936,12653936,}}, 1589 | }}, 1590 | {{ 1591 | {{20407016,17904196,15401376,15401376,15401376,}}, 1592 | {{17904196,15656820,13409444,13409444,13409444,}}, 1593 | {{15401376,13409444,11417512,11417512,11417512,}}, 1594 | {{15401376,13409444,11417512,11417512,11417512,}}, 1595 | {{15401376,13409444,11417512,11417512,11417512,}}, 1596 | }}, 1597 | }}, 1598 | {{ 1599 | {{ 1600 | {{1359755,1263129,1166503,1091294,1091294,}}, 1601 | {{1263129,1171239,1079349,1009814,1009814,}}, 1602 | {{1166503,1079349,992195,928334,928334,}}, 1603 | {{1091294,1009814,928334,864473,864473,}}, 1604 | {{1091294,1009814,928334,864473,864473,}}, 1605 | }}, 1606 | {{ 1607 | {{1552246,1401828,1251410,1251410,1251410,}}, 1608 | {{1401828,1262758,1123688,1123688,1123688,}}, 1609 | {{1251410,1123688,995966,995966,995966,}}, 1610 | {{1251410,1123688,995966,995966,995966,}}, 1611 | {{1251410,1123688,995966,995966,995966,}}, 1612 | }}, 1613 | }}, 1614 | {{ 1615 | {{ 1616 | {{56766,54114,51462,48313,48313,}}, 1617 | {{54114,51526,48938,45945,45945,}}, 1618 | {{51462,48938,46414,43577,43577,}}, 1619 | {{48313,45945,43577,40740,40740,}}, 1620 | {{48313,45945,43577,40740,40740,}}, 1621 | }}, 1622 | {{ 1623 | {{87805,81507,75209,75209,75209,}}, 1624 | {{81507,75521,69535,69535,69535,}}, 1625 | {{75209,69535,63861,63861,63861,}}, 1626 | {{75209,69535,63861,63861,63861,}}, 1627 | {{75209,69535,63861,63861,63861,}}, 1628 | }}, 1629 | }}, 1630 | {{ 1631 | {{ 1632 | {{1476,1442,1408,1326,1326,}}, 1633 | {{1442,1408,1374,1294,1294,}}, 1634 | {{1408,1374,1340,1262,1262,}}, 1635 | {{1326,1294,1262,1184,1184,}}, 1636 | {{1326,1294,1262,1184,1184,}}, 1637 | }}, 1638 | {{ 1639 | {{3477,3313,3149,3149,3149,}}, 1640 | {{3313,3153,2993,2993,2993,}}, 1641 | {{3149,2993,2837,2837,2837,}}, 1642 | {{3149,2993,2837,2837,2837,}}, 1643 | {{3149,2993,2837,2837,2837,}}, 1644 | }}, 1645 | }}, 1646 | {{ 1647 | {{ 1648 | {{18,18,18,17,17,}}, 1649 | {{18,18,18,17,17,}}, 1650 | {{18,18,18,17,17,}}, 1651 | {{17,17,17,16,16,}}, 1652 | {{17,17,17,16,16,}}, 1653 | }}, 1654 | {{ 1655 | {{86,84,82,82,82,}}, 1656 | {{84,82,80,80,80,}}, 1657 | {{82,80,78,78,78,}}, 1658 | {{82,80,78,78,78,}}, 1659 | {{82,80,78,78,78,}}, 1660 | }}, 1661 | }}, 1662 | {{ 1663 | {{ 1664 | {{0,0,0,0,0,}}, 1665 | {{0,0,0,0,0,}}, 1666 | {{0,0,0,0,0,}}, 1667 | {{0,0,0,0,0,}}, 1668 | {{0,0,0,0,0,}}, 1669 | }}, 1670 | {{ 1671 | {{1,1,1,1,1,}}, 1672 | {{1,1,1,1,1,}}, 1673 | {{1,1,1,1,1,}}, 1674 | {{1,1,1,1,1,}}, 1675 | {{1,1,1,1,1,}}, 1676 | }}, 1677 | }}, 1678 | }}, 1679 | {{ 1680 | {{ 1681 | {{ 1682 | {{17107794,0,0,0,0,}}, 1683 | {{15378848,0,0,0,0,}}, 1684 | {{13649902,0,0,0,0,}}, 1685 | {{12653936,0,0,0,0,}}, 1686 | {{12653936,0,0,0,0,}}, 1687 | }}, 1688 | {{ 1689 | {{15401376,0,0,0,0,}}, 1690 | {{13409444,0,0,0,0,}}, 1691 | {{11417512,0,0,0,0,}}, 1692 | {{11417512,0,0,0,0,}}, 1693 | {{11417512,0,0,0,0,}}, 1694 | }}, 1695 | }}, 1696 | {{ 1697 | {{ 1698 | {{1091294,0,0,0,0,}}, 1699 | {{1009814,0,0,0,0,}}, 1700 | {{928334,0,0,0,0,}}, 1701 | {{864473,0,0,0,0,}}, 1702 | {{864473,0,0,0,0,}}, 1703 | }}, 1704 | {{ 1705 | {{1251410,0,0,0,0,}}, 1706 | {{1123688,0,0,0,0,}}, 1707 | {{995966,0,0,0,0,}}, 1708 | {{995966,0,0,0,0,}}, 1709 | {{995966,0,0,0,0,}}, 1710 | }}, 1711 | }}, 1712 | {{ 1713 | {{ 1714 | {{48313,0,0,0,0,}}, 1715 | {{45945,0,0,0,0,}}, 1716 | {{43577,0,0,0,0,}}, 1717 | {{40740,0,0,0,0,}}, 1718 | {{40740,0,0,0,0,}}, 1719 | }}, 1720 | {{ 1721 | {{75209,0,0,0,0,}}, 1722 | {{69535,0,0,0,0,}}, 1723 | {{63861,0,0,0,0,}}, 1724 | {{63861,0,0,0,0,}}, 1725 | {{63861,0,0,0,0,}}, 1726 | }}, 1727 | }}, 1728 | {{ 1729 | {{ 1730 | {{1326,0,0,0,0,}}, 1731 | {{1294,0,0,0,0,}}, 1732 | {{1262,0,0,0,0,}}, 1733 | {{1184,0,0,0,0,}}, 1734 | {{1184,0,0,0,0,}}, 1735 | }}, 1736 | {{ 1737 | {{3149,0,0,0,0,}}, 1738 | {{2993,0,0,0,0,}}, 1739 | {{2837,0,0,0,0,}}, 1740 | {{2837,0,0,0,0,}}, 1741 | {{2837,0,0,0,0,}}, 1742 | }}, 1743 | }}, 1744 | {{ 1745 | {{ 1746 | {{17,0,0,0,0,}}, 1747 | {{17,0,0,0,0,}}, 1748 | {{17,0,0,0,0,}}, 1749 | {{16,0,0,0,0,}}, 1750 | {{16,0,0,0,0,}}, 1751 | }}, 1752 | {{ 1753 | {{82,0,0,0,0,}}, 1754 | {{80,0,0,0,0,}}, 1755 | {{78,0,0,0,0,}}, 1756 | {{78,0,0,0,0,}}, 1757 | {{78,0,0,0,0,}}, 1758 | }}, 1759 | }}, 1760 | {{ 1761 | {{ 1762 | {{0,0,0,0,0,}}, 1763 | {{0,0,0,0,0,}}, 1764 | {{0,0,0,0,0,}}, 1765 | {{0,0,0,0,0,}}, 1766 | {{0,0,0,0,0,}}, 1767 | }}, 1768 | {{ 1769 | {{1,0,0,0,0,}}, 1770 | {{1,0,0,0,0,}}, 1771 | {{1,0,0,0,0,}}, 1772 | {{1,0,0,0,0,}}, 1773 | {{1,0,0,0,0,}}, 1774 | }}, 1775 | }}, 1776 | }}, 1777 | {{ 1778 | {{ 1779 | {{ 1780 | {{12653936,11290082,9993738,9131715,7254355,}}, 1781 | {{11297063,10046317,8864145,8093257,6395865,}}, 1782 | {{9975275,8838005,7764551,7079797,5537375,}}, 1783 | {{9199347,8149548,7155630,6540494,5059418,}}, 1784 | {{8168339,7218140,6296360,5762204,5059418,}}, 1785 | }}, 1786 | {{ 1787 | {{11417512,9858204,8571951,8263148,6323324,}}, 1788 | {{9850186,8470272,7335027,7048690,5367410,}}, 1789 | {{8442264,7226804,6247163,5970084,4411496,}}, 1790 | {{8339904,7124948,6155195,5970084,4411496,}}, 1791 | {{7250208,6171440,5210927,5136176,4411496,}}, 1792 | }}, 1793 | }}, 1794 | {{ 1795 | {{ 1796 | {{864473,795931,727175,672892,565704,}}, 1797 | {{796261,731429,666655,616776,516220,}}, 1798 | {{727782,666796,605787,560254,466736,}}, 1799 | {{675582,619052,562146,519229,429245,}}, 1800 | {{618508,565586,512532,472767,429245,}}, 1801 | }}, 1802 | {{ 1803 | {{995966,888749,796587,778877,627921,}}, 1804 | {{888423,790261,706161,689279,552939,}}, 1805 | {{789243,699627,623763,607229,477957,}}, 1806 | {{783573,693966,618462,607229,477957,}}, 1807 | {{701141,619088,543932,539303,477957,}}, 1808 | }}, 1809 | }}, 1810 | {{ 1811 | {{ 1812 | {{40740,38630,36386,33961,30225,}}, 1813 | {{38637,36583,34403,32113,28489,}}, 1814 | {{36461,34467,32347,30193,26753,}}, 1815 | {{34010,32155,30167,28058,24742,}}, 1816 | {{32082,30287,28427,26374,24742,}}, 1817 | }}, 1818 | {{ 1819 | {{63861,58783,54215,53595,45535,}}, 1820 | {{58777,53979,49675,49069,41513,}}, 1821 | {{53962,49436,45399,44799,37491,}}, 1822 | {{53770,49244,45213,44799,37491,}}, 1823 | {{49494,45224,41199,41025,37491,}}, 1824 | }}, 1825 | }}, 1826 | {{ 1827 | {{ 1828 | {{1184,1154,1120,1050,990,}}, 1829 | {{1154,1124,1090,1022,962,}}, 1830 | {{1122,1092,1058,992,934,}}, 1831 | {{1050,1022,990,924,868,}}, 1832 | {{1020,992,962,896,868,}}, 1833 | }}, 1834 | {{ 1835 | {{2837,2689,2549,2539,2275,}}, 1836 | {{2689,2545,2409,2399,2143,}}, 1837 | {{2545,2405,2273,2263,2011,}}, 1838 | {{2542,2402,2270,2263,2011,}}, 1839 | {{2406,2270,2138,2135,2011,}}, 1840 | }}, 1841 | }}, 1842 | {{ 1843 | {{ 1844 | {{16,16,16,15,15,}}, 1845 | {{16,16,16,15,15,}}, 1846 | {{16,16,16,15,15,}}, 1847 | {{15,15,15,14,14,}}, 1848 | {{15,15,15,14,14,}}, 1849 | }}, 1850 | {{ 1851 | {{78,76,74,74,70,}}, 1852 | {{76,74,72,72,68,}}, 1853 | {{74,72,70,70,66,}}, 1854 | {{74,72,70,70,66,}}, 1855 | {{72,70,68,68,66,}}, 1856 | }}, 1857 | }}, 1858 | {{ 1859 | {{ 1860 | {{0,0,0,0,0,}}, 1861 | {{0,0,0,0,0,}}, 1862 | {{0,0,0,0,0,}}, 1863 | {{0,0,0,0,0,}}, 1864 | {{0,0,0,0,0,}}, 1865 | }}, 1866 | {{ 1867 | {{1,1,1,1,1,}}, 1868 | {{1,1,1,1,1,}}, 1869 | {{1,1,1,1,1,}}, 1870 | {{1,1,1,1,1,}}, 1871 | {{1,1,1,1,1,}}, 1872 | }}, 1873 | }}, 1874 | }}, 1875 | {{ 1876 | {{ 1877 | {{ 1878 | {{8168339,7212614,6310982,5712112,4444176,}}, 1879 | {{7218140,6348724,5533962,5003648,3869744,}}, 1880 | {{6296360,5513382,4781046,4315072,3295312,}}, 1881 | {{5762204,5044633,4371337,3957242,2981750,}}, 1882 | {{5059418,4416669,3796385,3441870,2981750,}}, 1883 | }}, 1884 | {{ 1885 | {{7250208,6177724,5304987,5081814,3804930,}}, 1886 | {{6171440,5233456,4472199,4267042,3177806,}}, 1887 | {{5210927,4395261,3749147,3551382,2550682,}}, 1888 | {{5136176,4320960,3682796,3551382,2550682,}}, 1889 | {{4411496,3695692,3064902,3012180,2550682,}}, 1890 | }}, 1891 | }}, 1892 | {{ 1893 | {{ 1894 | {{618508,565292,512088,470516,389300,}}, 1895 | {{565586,515504,465674,427756,352076,}}, 1896 | {{512532,465704,419052,384732,314852,}}, 1897 | {{472767,429635,386362,354232,287216,}}, 1898 | {{429245,389145,349024,319510,287216,}}, 1899 | }}, 1900 | {{ 1901 | {{701141,619378,549906,535546,424106,}}, 1902 | {{619088,544848,482002,468386,368834,}}, 1903 | {{543932,476754,420690,407386,313562,}}, 1904 | {{539303,472134,416394,407386,313562,}}, 1905 | {{477957,416954,361526,357830,313562,}}, 1906 | }}, 1907 | }}, 1908 | {{ 1909 | {{ 1910 | {{32082,30280,28360,26328,23176,}}, 1911 | {{30287,28537,26677,24768,21720,}}, 1912 | {{28427,26733,24929,23144,20264,}}, 1913 | {{26374,24807,23123,21380,18612,}}, 1914 | {{24742,23231,21663,19972,18612,}}, 1915 | }}, 1916 | {{ 1917 | {{49494,45230,41428,40868,34244,}}, 1918 | {{45224,41216,37654,37108,30940,}}, 1919 | {{41199,37439,34120,33580,27636,}}, 1920 | {{41025,37265,33952,33580,27636,}}, 1921 | {{37491,33963,30656,30500,27636,}}, 1922 | }}, 1923 | }}, 1924 | {{ 1925 | {{ 1926 | {{1020,992,960,896,840,}}, 1927 | {{992,964,932,870,814,}}, 1928 | {{962,934,902,842,788,}}, 1929 | {{896,870,840,780,728,}}, 1930 | {{868,842,814,754,728,}}, 1931 | }}, 1932 | {{ 1933 | {{2406,2270,2142,2132,1892,}}, 1934 | {{2270,2138,2014,2004,1772,}}, 1935 | {{2138,2010,1890,1880,1652,}}, 1936 | {{2135,2007,1887,1880,1652,}}, 1937 | {{2011,1887,1767,1764,1652,}}, 1938 | }}, 1939 | }}, 1940 | {{ 1941 | {{ 1942 | {{15,15,15,14,14,}}, 1943 | {{15,15,15,14,14,}}, 1944 | {{15,15,15,14,14,}}, 1945 | {{14,14,14,13,13,}}, 1946 | {{14,14,14,13,13,}}, 1947 | }}, 1948 | {{ 1949 | {{72,70,68,68,64,}}, 1950 | {{70,68,66,66,62,}}, 1951 | {{68,66,64,64,60,}}, 1952 | {{68,66,64,64,60,}}, 1953 | {{66,64,62,62,60,}}, 1954 | }}, 1955 | }}, 1956 | {{ 1957 | {{ 1958 | {{0,0,0,0,0,}}, 1959 | {{0,0,0,0,0,}}, 1960 | {{0,0,0,0,0,}}, 1961 | {{0,0,0,0,0,}}, 1962 | {{0,0,0,0,0,}}, 1963 | }}, 1964 | {{ 1965 | {{1,1,1,1,1,}}, 1966 | {{1,1,1,1,1,}}, 1967 | {{1,1,1,1,1,}}, 1968 | {{1,1,1,1,1,}}, 1969 | {{1,1,1,1,1,}}, 1970 | }}, 1971 | }}, 1972 | }}, 1973 | {{ 1974 | {{ 1975 | {{ 1976 | {{5059418,4412418,3807614,3406036,2585084,}}, 1977 | {{4416669,3833779,3293239,2941778,2217450,}}, 1978 | {{3796385,3277543,2797725,2492890,1849816,}}, 1979 | {{3441870,2970487,2533149,2265724,1653416,}}, 1980 | {{2981750,2564867,2165207,1940082,1653416,}}, 1981 | }}, 1982 | {{ 1983 | {{4411496,3700458,3130667,2975244,2171792,}}, 1984 | {{3695692,3082564,2592453,2451100,1778992,}}, 1985 | {{3064902,2539972,2132379,1996768,1386192,}}, 1986 | {{3012180,2487646,2086281,1996768,1386192,}}, 1987 | {{2550682,2096224,1700583,1664958,1386192,}}, 1988 | }}, 1989 | }}, 1990 | {{ 1991 | {{ 1992 | {{429245,388887,348719,317662,257866,}}, 1993 | {{389145,351393,314039,285958,230698,}}, 1994 | {{349024,313982,279267,254108,203530,}}, 1995 | {{319510,287476,255488,232129,183817,}}, 1996 | {{287216,257686,228222,206991,183817,}}, 1997 | }}, 1998 | {{ 1999 | {{477957,417208,366274,354904,275252,}}, 2000 | {{416954,362340,316740,306030,235826,}}, 2001 | {{361526,312634,272506,262072,196400,}}, 2002 | {{357830,308947,269107,262072,196400,}}, 2003 | {{313562,269601,230037,227166,196400,}}, 2004 | }}, 2005 | }}, 2006 | {{ 2007 | {{ 2008 | {{24742,23224,21604,19929,17313,}}, 2009 | {{23231,21761,20197,18633,16113,}}, 2010 | {{21663,20245,18733,17281,14913,}}, 2011 | {{19972,18669,17265,15852,13584,}}, 2012 | {{18612,17361,16061,14696,13584,}}, 2013 | }}, 2014 | {{ 2015 | {{37491,33969,30861,30361,25029,}}, 2016 | {{33963,30673,27781,27295,22371,}}, 2017 | {{30656,27590,24917,24437,19713,}}, 2018 | {{30500,27434,24767,24437,19713,}}, 2019 | {{27636,24778,22117,21979,19713,}}, 2020 | }}, 2021 | }}, 2022 | {{ 2023 | {{ 2024 | {{868,842,812,754,702,}}, 2025 | {{842,816,786,730,678,}}, 2026 | {{814,788,758,704,654,}}, 2027 | {{754,730,702,648,600,}}, 2028 | {{728,704,678,624,600,}}, 2029 | }}, 2030 | {{ 2031 | {{2011,1887,1771,1761,1545,}}, 2032 | {{1887,1767,1655,1645,1437,}}, 2033 | {{1767,1651,1543,1533,1329,}}, 2034 | {{1764,1648,1540,1533,1329,}}, 2035 | {{1652,1540,1432,1429,1329,}}, 2036 | }}, 2037 | }}, 2038 | {{ 2039 | {{ 2040 | {{14,14,14,13,13,}}, 2041 | {{14,14,14,13,13,}}, 2042 | {{14,14,14,13,13,}}, 2043 | {{13,13,13,12,12,}}, 2044 | {{13,13,13,12,12,}}, 2045 | }}, 2046 | {{ 2047 | {{66,64,62,62,58,}}, 2048 | {{64,62,60,60,56,}}, 2049 | {{62,60,58,58,54,}}, 2050 | {{62,60,58,58,54,}}, 2051 | {{60,58,56,56,54,}}, 2052 | }}, 2053 | }}, 2054 | {{ 2055 | {{ 2056 | {{0,0,0,0,0,}}, 2057 | {{0,0,0,0,0,}}, 2058 | {{0,0,0,0,0,}}, 2059 | {{0,0,0,0,0,}}, 2060 | {{0,0,0,0,0,}}, 2061 | }}, 2062 | {{ 2063 | {{1,1,1,1,1,}}, 2064 | {{1,1,1,1,1,}}, 2065 | {{1,1,1,1,1,}}, 2066 | {{1,1,1,1,1,}}, 2067 | {{1,1,1,1,1,}}, 2068 | }}, 2069 | }}, 2070 | }}, 2071 | {{ 2072 | {{ 2073 | {{ 2074 | {{2981750,2561711,2173491,1915548,1410964,}}, 2075 | {{2564867,2190907,1848609,1626052,1188348,}}, 2076 | {{2165207,1837121,1537997,1348000,965732,}}, 2077 | {{1940082,1645191,1375491,1211381,849521,}}, 2078 | {{1653416,1396727,1152731,1017329,849521,}}, 2079 | }}, 2080 | {{ 2081 | {{2550682,2099688,1744521,1641128,1162640,}}, 2082 | {{2096224,1713990,1413567,1320802,930218,}}, 2083 | {{1700583,1379579,1136021,1047564,697796,}}, 2084 | {{1664958,1344296,1105460,1047564,697796,}}, 2085 | {{1386192,1112846,878300,855488,697796,}}, 2086 | }}, 2087 | }}, 2088 | {{ 2089 | {{ 2090 | {{287216,257464,228032,205510,163014,}}, 2091 | {{257686,230060,202930,182778,143914,}}, 2092 | {{228222,202810,177828,159994,124814,}}, 2093 | {{206991,183971,161136,144748,111308,}}, 2094 | {{183817,162821,141954,127254,111308,}}, 2095 | }}, 2096 | {{ 2097 | {{313562,269819,233703,224963,170235,}}, 2098 | {{269601,230749,198819,190655,143223,}}, 2099 | {{230037,195711,168087,160163,116211,}}, 2100 | {{227166,192849,165477,160163,116211,}}, 2101 | {{196400,165905,138773,136619,116211,}}, 2102 | }}, 2103 | }}, 2104 | {{ 2105 | {{ 2106 | {{18612,17354,16010,14656,12528,}}, 2107 | {{17361,16147,14855,13600,11560,}}, 2108 | {{16061,14895,13651,12496,10592,}}, 2109 | {{14696,13633,12485,11366,9550,}}, 2110 | {{13584,12569,11513,10438,9550,}}, 2111 | }}, 2112 | {{ 2113 | {{27636,24784,22298,21858,17674,}}, 2114 | {{24778,22134,19840,19414,15590,}}, 2115 | {{22117,19673,17574,17154,13506,}}, 2116 | {{21979,19535,17442,17154,13506,}}, 2117 | {{19713,17453,15366,15246,13506,}}, 2118 | }}, 2119 | }}, 2120 | {{ 2121 | {{ 2122 | {{728,704,676,624,576,}}, 2123 | {{704,680,652,602,554,}}, 2124 | {{678,654,626,578,532,}}, 2125 | {{624,602,576,528,484,}}, 2126 | {{600,578,554,506,484,}}, 2127 | }}, 2128 | {{ 2129 | {{1652,1540,1436,1426,1234,}}, 2130 | {{1540,1432,1332,1322,1138,}}, 2131 | {{1432,1328,1232,1222,1042,}}, 2132 | {{1429,1325,1229,1222,1042,}}, 2133 | {{1329,1229,1133,1130,1042,}}, 2134 | }}, 2135 | }}, 2136 | {{ 2137 | {{ 2138 | {{13,13,13,12,12,}}, 2139 | {{13,13,13,12,12,}}, 2140 | {{13,13,13,12,12,}}, 2141 | {{12,12,12,11,11,}}, 2142 | {{12,12,12,11,11,}}, 2143 | }}, 2144 | {{ 2145 | {{60,58,56,56,52,}}, 2146 | {{58,56,54,54,50,}}, 2147 | {{56,54,52,52,48,}}, 2148 | {{56,54,52,52,48,}}, 2149 | {{54,52,50,50,48,}}, 2150 | }}, 2151 | }}, 2152 | {{ 2153 | {{ 2154 | {{0,0,0,0,0,}}, 2155 | {{0,0,0,0,0,}}, 2156 | {{0,0,0,0,0,}}, 2157 | {{0,0,0,0,0,}}, 2158 | {{0,0,0,0,0,}}, 2159 | }}, 2160 | {{ 2161 | {{1,1,1,1,1,}}, 2162 | {{1,1,1,1,1,}}, 2163 | {{1,1,1,1,1,}}, 2164 | {{1,1,1,1,1,}}, 2165 | {{1,1,1,1,1,}}, 2166 | }}, 2167 | }}, 2168 | }}, 2169 | {{ 2170 | {{ 2171 | {{ 2172 | {{1653416,1394510,1158582,1001404,710776,}}, 2173 | {{1396727,1169605,965089,831854,585190,}}, 2174 | {{1152731,957093,781927,670414,459604,}}, 2175 | {{1017329,843874,688148,593609,395549,}}, 2176 | {{849521,701562,562506,486367,395549,}}, 2177 | }}, 2178 | {{ 2179 | {{1386192,1115194,905952,841380,575392,}}, 2180 | {{1112846,888034,714600,657694,447282,}}, 2181 | {{878300,694038,557924,504084,319172,}}, 2182 | {{855488,671514,538832,504084,319172,}}, 2183 | {{697796,544090,414456,401100,319172,}}, 2184 | }}, 2185 | }}, 2186 | {{ 2187 | {{ 2188 | {{183817,162635,141855,126098,97200,}}, 2189 | {{162821,143333,124391,110470,84396,}}, 2190 | {{141954,124232,106995,94860,71592,}}, 2191 | {{127254,111380,95782,84775,62793,}}, 2192 | {{111308,97026,82912,73201,62793,}}, 2193 | }}, 2194 | {{ 2195 | {{196400,166087,141501,135043,99251,}}, 2196 | {{165905,139383,117979,112013,81653,}}, 2197 | {{138773,115725,97605,91843,64055,}}, 2198 | {{136619,113580,95676,91843,64055,}}, 2199 | {{116211,96038,78338,76805,64055,}}, 2200 | }}, 2201 | }}, 2202 | {{ 2203 | {{ 2204 | {{13584,12562,11470,10401,8713,}}, 2205 | {{12569,11587,10543,9561,7953,}}, 2206 | {{11513,10575,9575,8681,7193,}}, 2207 | {{10438,9591,8675,7814,6402,}}, 2208 | {{9550,8747,7911,7090,6402,}}, 2209 | }}, 2210 | {{ 2211 | {{19713,17459,15523,15143,11963,}}, 2212 | {{17453,15383,13615,13249,10381,}}, 2213 | {{15366,13472,11875,11515,8799,}}, 2214 | {{15246,13352,11761,11515,8799,}}, 2215 | {{13506,11772,10187,10085,8799,}}, 2216 | }}, 2217 | }}, 2218 | {{ 2219 | {{ 2220 | {{600,578,552,506,462,}}, 2221 | {{578,556,530,486,442,}}, 2222 | {{554,532,506,464,422,}}, 2223 | {{506,486,462,420,380,}}, 2224 | {{484,464,442,400,380,}}, 2225 | }}, 2226 | {{ 2227 | {{1329,1229,1137,1127,959,}}, 2228 | {{1229,1133,1045,1035,875,}}, 2229 | {{1133,1041,957,947,791,}}, 2230 | {{1130,1038,954,947,791,}}, 2231 | {{1042,954,870,867,791,}}, 2232 | }}, 2233 | }}, 2234 | {{ 2235 | {{ 2236 | {{12,12,12,11,11,}}, 2237 | {{12,12,12,11,11,}}, 2238 | {{12,12,12,11,11,}}, 2239 | {{11,11,11,10,10,}}, 2240 | {{11,11,11,10,10,}}, 2241 | }}, 2242 | {{ 2243 | {{54,52,50,50,46,}}, 2244 | {{52,50,48,48,44,}}, 2245 | {{50,48,46,46,42,}}, 2246 | {{50,48,46,46,42,}}, 2247 | {{48,46,44,44,42,}}, 2248 | }}, 2249 | }}, 2250 | {{ 2251 | {{ 2252 | {{0,0,0,0,0,}}, 2253 | {{0,0,0,0,0,}}, 2254 | {{0,0,0,0,0,}}, 2255 | {{0,0,0,0,0,}}, 2256 | {{0,0,0,0,0,}}, 2257 | }}, 2258 | {{ 2259 | {{1,1,1,1,1,}}, 2260 | {{1,1,1,1,1,}}, 2261 | {{1,1,1,1,1,}}, 2262 | {{1,1,1,1,1,}}, 2263 | {{1,1,1,1,1,}}, 2264 | }}, 2265 | }}, 2266 | }}, 2267 | {{ 2268 | {{ 2269 | {{ 2270 | {{849521,700160,566400,476672,322560,}}, 2271 | {{701562,572994,459536,385168,258048,}}, 2272 | {{562506,454384,359744,299040,193536,}}, 2273 | {{486367,392224,309680,259392,161280,}}, 2274 | {{395549,317352,244944,205632,161280,}}, 2275 | }}, 2276 | {{ 2277 | {{697796,545440,430528,394240,258048,}}, 2278 | {{544090,421064,328160,297024,193536,}}, 2279 | {{414456,316736,246848,217728,129024,}}, 2280 | {{401100,303632,236096,217728,129024,}}, 2281 | {{319172,239792,174272,167552,129024,}}, 2282 | }}, 2283 | }}, 2284 | {{ 2285 | {{ 2286 | {{111308,96876,82880,72320,53760,}}, 2287 | {{97026,83904,71330,62144,45696,}}, 2288 | {{82912,71156,59892,52032,37632,}}, 2289 | {{73201,62821,52760,45752,32256,}}, 2290 | {{62793,53621,44632,38584,32256,}}, 2291 | }}, 2292 | {{ 2293 | {{116211,96184,80272,75776,53760,}}, 2294 | {{96038,78846,65256,61168,43008,}}, 2295 | {{78338,63712,52528,48608,32256,}}, 2296 | {{76805,62188,51184,48608,32256,}}, 2297 | {{64055,51492,40656,39648,32256,}}, 2298 | }}, 2299 | }}, 2300 | {{ 2301 | {{ 2302 | {{9550,8740,7876,7056,5760,}}, 2303 | {{8747,7973,7153,6408,5184,}}, 2304 | {{7911,7177,6397,5728,4608,}}, 2305 | {{7090,6435,5727,5088,4032,}}, 2306 | {{6402,5787,5147,4544,4032,}}, 2307 | }}, 2308 | {{ 2309 | {{13506,11778,10320,10000,7680,}}, 2310 | {{11772,10204,8890,8584,6528,}}, 2311 | {{10187,8771,7604,7304,5376,}}, 2312 | {{10085,8669,7508,7304,5376,}}, 2313 | {{8799,7519,6364,6280,5376,}}, 2314 | }}, 2315 | }}, 2316 | {{ 2317 | {{ 2318 | {{484,464,440,400,360,}}, 2319 | {{464,444,420,382,342,}}, 2320 | {{442,422,398,362,324,}}, 2321 | {{400,382,360,324,288,}}, 2322 | {{380,362,342,306,288,}}, 2323 | }}, 2324 | {{ 2325 | {{1042,954,874,864,720,}}, 2326 | {{954,870,794,784,648,}}, 2327 | {{870,790,718,708,576,}}, 2328 | {{867,787,715,708,576,}}, 2329 | {{791,715,643,640,576,}}, 2330 | }}, 2331 | }}, 2332 | {{ 2333 | {{ 2334 | {{11,11,11,10,10,}}, 2335 | {{11,11,11,10,10,}}, 2336 | {{11,11,11,10,10,}}, 2337 | {{10,10,10,9,9,}}, 2338 | {{10,10,10,9,9,}}, 2339 | }}, 2340 | {{ 2341 | {{48,46,44,44,40,}}, 2342 | {{46,44,42,42,38,}}, 2343 | {{44,42,40,40,36,}}, 2344 | {{44,42,40,40,36,}}, 2345 | {{42,40,38,38,36,}}, 2346 | }}, 2347 | }}, 2348 | {{ 2349 | {{ 2350 | {{0,0,0,0,0,}}, 2351 | {{0,0,0,0,0,}}, 2352 | {{0,0,0,0,0,}}, 2353 | {{0,0,0,0,0,}}, 2354 | {{0,0,0,0,0,}}, 2355 | }}, 2356 | {{ 2357 | {{1,1,1,1,1,}}, 2358 | {{1,1,1,1,1,}}, 2359 | {{1,1,1,1,1,}}, 2360 | {{1,1,1,1,1,}}, 2361 | {{1,1,1,1,1,}}, 2362 | }}, 2363 | }}, 2364 | }}, 2365 | {{ 2366 | {{ 2367 | {{ 2368 | {{395549,317352,244944,205632,161280,}}, 2369 | {{317352,251608,191520,160384,125440,}}, 2370 | {{244944,191520,142688,118720,89600,}}, 2371 | {{205632,160384,118720,100800,71680,}}, 2372 | {{161280,125440,89600,71680,71680,}}, 2373 | }}, 2374 | {{ 2375 | {{319172,239792,174272,167552,129024,}}, 2376 | {{239792,177968,126784,120064,93184,}}, 2377 | {{174272,126784,90944,84224,57344,}}, 2378 | {{167552,120064,84224,84224,57344,}}, 2379 | {{129024,93184,57344,57344,57344,}}, 2380 | }}, 2381 | }}, 2382 | {{ 2383 | {{ 2384 | {{62793,53621,44632,38584,32256,}}, 2385 | {{53621,45409,37436,32368,26880,}}, 2386 | {{44632,37436,30380,26208,21504,}}, 2387 | {{38584,32368,26208,22624,17920,}}, 2388 | {{32256,26880,21504,17920,17920,}}, 2389 | }}, 2390 | {{ 2391 | {{64055,51492,40656,39648,32256,}}, 2392 | {{51492,40964,31920,30912,25088,}}, 2393 | {{40656,31920,24752,23744,17920,}}, 2394 | {{39648,30912,23744,23744,17920,}}, 2395 | {{32256,25088,17920,17920,17920,}}, 2396 | }}, 2397 | }}, 2398 | {{ 2399 | {{ 2400 | {{6402,5787,5147,4544,4032,}}, 2401 | {{5787,5204,4600,4064,3584,}}, 2402 | {{5147,4600,4028,3556,3136,}}, 2403 | {{4544,4064,3556,3108,2688,}}, 2404 | {{4032,3584,3136,2688,2688,}}, 2405 | }}, 2406 | {{ 2407 | {{8799,7519,6364,6280,5376,}}, 2408 | {{7519,6375,5348,5264,4480,}}, 2409 | {{6364,5348,4452,4368,3584,}}, 2410 | {{6280,5264,4368,4368,3584,}}, 2411 | {{5376,4480,3584,3584,3584,}}, 2412 | }}, 2413 | }}, 2414 | {{ 2415 | {{ 2416 | {{380,362,342,306,288,}}, 2417 | {{362,344,324,290,272,}}, 2418 | {{342,324,304,272,256,}}, 2419 | {{306,290,272,240,224,}}, 2420 | {{288,272,256,224,224,}}, 2421 | }}, 2422 | {{ 2423 | {{791,715,643,640,576,}}, 2424 | {{715,643,575,572,512,}}, 2425 | {{643,575,511,508,448,}}, 2426 | {{640,572,508,508,448,}}, 2427 | {{576,512,448,448,448,}}, 2428 | }}, 2429 | }}, 2430 | {{ 2431 | {{ 2432 | {{10,10,10,9,9,}}, 2433 | {{10,10,10,9,9,}}, 2434 | {{10,10,10,9,9,}}, 2435 | {{9,9,9,8,8,}}, 2436 | {{9,9,9,8,8,}}, 2437 | }}, 2438 | {{ 2439 | {{42,40,38,38,36,}}, 2440 | {{40,38,36,36,34,}}, 2441 | {{38,36,34,34,32,}}, 2442 | {{38,36,34,34,32,}}, 2443 | {{36,34,32,32,32,}}, 2444 | }}, 2445 | }}, 2446 | {{ 2447 | {{ 2448 | {{0,0,0,0,0,}}, 2449 | {{0,0,0,0,0,}}, 2450 | {{0,0,0,0,0,}}, 2451 | {{0,0,0,0,0,}}, 2452 | {{0,0,0,0,0,}}, 2453 | }}, 2454 | {{ 2455 | {{1,1,1,1,1,}}, 2456 | {{1,1,1,1,1,}}, 2457 | {{1,1,1,1,1,}}, 2458 | {{1,1,1,1,1,}}, 2459 | {{1,1,1,1,1,}}, 2460 | }}, 2461 | }}, 2462 | }}, 2463 | {{ 2464 | {{ 2465 | {{ 2466 | {{161280,125440,89600,71680,71680,}}, 2467 | {{125440,96320,67200,53760,53760,}}, 2468 | {{89600,67200,44800,35840,35840,}}, 2469 | {{71680,53760,35840,26880,26880,}}, 2470 | {{71680,53760,35840,26880,26880,}}, 2471 | }}, 2472 | {{ 2473 | {{129024,93184,57344,57344,57344,}}, 2474 | {{93184,66304,39424,39424,39424,}}, 2475 | {{57344,39424,21504,21504,21504,}}, 2476 | {{57344,39424,21504,21504,21504,}}, 2477 | {{57344,39424,21504,21504,21504,}}, 2478 | }}, 2479 | }}, 2480 | {{ 2481 | {{ 2482 | {{32256,26880,21504,17920,17920,}}, 2483 | {{26880,22176,17472,14560,14560,}}, 2484 | {{21504,17472,13440,11200,11200,}}, 2485 | {{17920,14560,11200,8960,8960,}}, 2486 | {{17920,14560,11200,8960,8960,}}, 2487 | }}, 2488 | {{ 2489 | {{32256,25088,17920,17920,17920,}}, 2490 | {{25088,19264,13440,13440,13440,}}, 2491 | {{17920,13440,8960,8960,8960,}}, 2492 | {{17920,13440,8960,8960,8960,}}, 2493 | {{17920,13440,8960,8960,8960,}}, 2494 | }}, 2495 | }}, 2496 | {{ 2497 | {{ 2498 | {{4032,3584,3136,2688,2688,}}, 2499 | {{3584,3164,2744,2352,2352,}}, 2500 | {{3136,2744,2352,2016,2016,}}, 2501 | {{2688,2352,2016,1680,1680,}}, 2502 | {{2688,2352,2016,1680,1680,}}, 2503 | }}, 2504 | {{ 2505 | {{5376,4480,3584,3584,3584,}}, 2506 | {{4480,3696,2912,2912,2912,}}, 2507 | {{3584,2912,2240,2240,2240,}}, 2508 | {{3584,2912,2240,2240,2240,}}, 2509 | {{3584,2912,2240,2240,2240,}}, 2510 | }}, 2511 | }}, 2512 | {{ 2513 | {{ 2514 | {{288,272,256,224,224,}}, 2515 | {{272,256,240,210,210,}}, 2516 | {{256,240,224,196,196,}}, 2517 | {{224,210,196,168,168,}}, 2518 | {{224,210,196,168,168,}}, 2519 | }}, 2520 | {{ 2521 | {{576,512,448,448,448,}}, 2522 | {{512,452,392,392,392,}}, 2523 | {{448,392,336,336,336,}}, 2524 | {{448,392,336,336,336,}}, 2525 | {{448,392,336,336,336,}}, 2526 | }}, 2527 | }}, 2528 | {{ 2529 | {{ 2530 | {{9,9,9,8,8,}}, 2531 | {{9,9,9,8,8,}}, 2532 | {{9,9,9,8,8,}}, 2533 | {{8,8,8,7,7,}}, 2534 | {{8,8,8,7,7,}}, 2535 | }}, 2536 | {{ 2537 | {{36,34,32,32,32,}}, 2538 | {{34,32,30,30,30,}}, 2539 | {{32,30,28,28,28,}}, 2540 | {{32,30,28,28,28,}}, 2541 | {{32,30,28,28,28,}}, 2542 | }}, 2543 | }}, 2544 | {{ 2545 | {{ 2546 | {{0,0,0,0,0,}}, 2547 | {{0,0,0,0,0,}}, 2548 | {{0,0,0,0,0,}}, 2549 | {{0,0,0,0,0,}}, 2550 | {{0,0,0,0,0,}}, 2551 | }}, 2552 | {{ 2553 | {{1,1,1,1,1,}}, 2554 | {{1,1,1,1,1,}}, 2555 | {{1,1,1,1,1,}}, 2556 | {{1,1,1,1,1,}}, 2557 | {{1,1,1,1,1,}}, 2558 | }}, 2559 | }}, 2560 | }}, 2561 | {{ 2562 | {{ 2563 | {{ 2564 | {{71680,0,0,0,0,}}, 2565 | {{53760,0,0,0,0,}}, 2566 | {{35840,0,0,0,0,}}, 2567 | {{26880,0,0,0,0,}}, 2568 | {{26880,0,0,0,0,}}, 2569 | }}, 2570 | {{ 2571 | {{57344,0,0,0,0,}}, 2572 | {{39424,0,0,0,0,}}, 2573 | {{21504,0,0,0,0,}}, 2574 | {{21504,0,0,0,0,}}, 2575 | {{21504,0,0,0,0,}}, 2576 | }}, 2577 | }}, 2578 | {{ 2579 | {{ 2580 | {{17920,0,0,0,0,}}, 2581 | {{14560,0,0,0,0,}}, 2582 | {{11200,0,0,0,0,}}, 2583 | {{8960,0,0,0,0,}}, 2584 | {{8960,0,0,0,0,}}, 2585 | }}, 2586 | {{ 2587 | {{17920,0,0,0,0,}}, 2588 | {{13440,0,0,0,0,}}, 2589 | {{8960,0,0,0,0,}}, 2590 | {{8960,0,0,0,0,}}, 2591 | {{8960,0,0,0,0,}}, 2592 | }}, 2593 | }}, 2594 | {{ 2595 | {{ 2596 | {{2688,0,0,0,0,}}, 2597 | {{2352,0,0,0,0,}}, 2598 | {{2016,0,0,0,0,}}, 2599 | {{1680,0,0,0,0,}}, 2600 | {{1680,0,0,0,0,}}, 2601 | }}, 2602 | {{ 2603 | {{3584,0,0,0,0,}}, 2604 | {{2912,0,0,0,0,}}, 2605 | {{2240,0,0,0,0,}}, 2606 | {{2240,0,0,0,0,}}, 2607 | {{2240,0,0,0,0,}}, 2608 | }}, 2609 | }}, 2610 | {{ 2611 | {{ 2612 | {{224,0,0,0,0,}}, 2613 | {{210,0,0,0,0,}}, 2614 | {{196,0,0,0,0,}}, 2615 | {{168,0,0,0,0,}}, 2616 | {{168,0,0,0,0,}}, 2617 | }}, 2618 | {{ 2619 | {{448,0,0,0,0,}}, 2620 | {{392,0,0,0,0,}}, 2621 | {{336,0,0,0,0,}}, 2622 | {{336,0,0,0,0,}}, 2623 | {{336,0,0,0,0,}}, 2624 | }}, 2625 | }}, 2626 | {{ 2627 | {{ 2628 | {{8,0,0,0,0,}}, 2629 | {{8,0,0,0,0,}}, 2630 | {{8,0,0,0,0,}}, 2631 | {{7,0,0,0,0,}}, 2632 | {{7,0,0,0,0,}}, 2633 | }}, 2634 | {{ 2635 | {{32,0,0,0,0,}}, 2636 | {{30,0,0,0,0,}}, 2637 | {{28,0,0,0,0,}}, 2638 | {{28,0,0,0,0,}}, 2639 | {{28,0,0,0,0,}}, 2640 | }}, 2641 | }}, 2642 | {{ 2643 | {{ 2644 | {{0,0,0,0,0,}}, 2645 | {{0,0,0,0,0,}}, 2646 | {{0,0,0,0,0,}}, 2647 | {{0,0,0,0,0,}}, 2648 | {{0,0,0,0,0,}}, 2649 | }}, 2650 | {{ 2651 | {{1,0,0,0,0,}}, 2652 | {{1,0,0,0,0,}}, 2653 | {{1,0,0,0,0,}}, 2654 | {{1,0,0,0,0,}}, 2655 | {{1,0,0,0,0,}}, 2656 | }}, 2657 | }}, 2658 | }}, 2659 | {{ 2660 | {{ 2661 | {{ 2662 | {{26880,0,0,0,0,}}, 2663 | {{19200,0,0,0,0,}}, 2664 | {{11520,0,0,0,0,}}, 2665 | {{7680,0,0,0,0,}}, 2666 | {{7680,0,0,0,0,}}, 2667 | }}, 2668 | {{ 2669 | {{21504,0,0,0,0,}}, 2670 | {{13824,0,0,0,0,}}, 2671 | {{6144,0,0,0,0,}}, 2672 | {{6144,0,0,0,0,}}, 2673 | {{6144,0,0,0,0,}}, 2674 | }}, 2675 | }}, 2676 | {{ 2677 | {{ 2678 | {{8960,0,0,0,0,}}, 2679 | {{7040,0,0,0,0,}}, 2680 | {{5120,0,0,0,0,}}, 2681 | {{3840,0,0,0,0,}}, 2682 | {{3840,0,0,0,0,}}, 2683 | }}, 2684 | {{ 2685 | {{8960,0,0,0,0,}}, 2686 | {{6400,0,0,0,0,}}, 2687 | {{3840,0,0,0,0,}}, 2688 | {{3840,0,0,0,0,}}, 2689 | {{3840,0,0,0,0,}}, 2690 | }}, 2691 | }}, 2692 | {{ 2693 | {{ 2694 | {{1680,0,0,0,0,}}, 2695 | {{1440,0,0,0,0,}}, 2696 | {{1200,0,0,0,0,}}, 2697 | {{960,0,0,0,0,}}, 2698 | {{960,0,0,0,0,}}, 2699 | }}, 2700 | {{ 2701 | {{2240,0,0,0,0,}}, 2702 | {{1760,0,0,0,0,}}, 2703 | {{1280,0,0,0,0,}}, 2704 | {{1280,0,0,0,0,}}, 2705 | {{1280,0,0,0,0,}}, 2706 | }}, 2707 | }}, 2708 | {{ 2709 | {{ 2710 | {{168,0,0,0,0,}}, 2711 | {{156,0,0,0,0,}}, 2712 | {{144,0,0,0,0,}}, 2713 | {{120,0,0,0,0,}}, 2714 | {{120,0,0,0,0,}}, 2715 | }}, 2716 | {{ 2717 | {{336,0,0,0,0,}}, 2718 | {{288,0,0,0,0,}}, 2719 | {{240,0,0,0,0,}}, 2720 | {{240,0,0,0,0,}}, 2721 | {{240,0,0,0,0,}}, 2722 | }}, 2723 | }}, 2724 | {{ 2725 | {{ 2726 | {{7,0,0,0,0,}}, 2727 | {{7,0,0,0,0,}}, 2728 | {{7,0,0,0,0,}}, 2729 | {{6,0,0,0,0,}}, 2730 | {{6,0,0,0,0,}}, 2731 | }}, 2732 | {{ 2733 | {{28,0,0,0,0,}}, 2734 | {{26,0,0,0,0,}}, 2735 | {{24,0,0,0,0,}}, 2736 | {{24,0,0,0,0,}}, 2737 | {{24,0,0,0,0,}}, 2738 | }}, 2739 | }}, 2740 | {{ 2741 | {{ 2742 | {{0,0,0,0,0,}}, 2743 | {{0,0,0,0,0,}}, 2744 | {{0,0,0,0,0,}}, 2745 | {{0,0,0,0,0,}}, 2746 | {{0,0,0,0,0,}}, 2747 | }}, 2748 | {{ 2749 | {{1,0,0,0,0,}}, 2750 | {{1,0,0,0,0,}}, 2751 | {{1,0,0,0,0,}}, 2752 | {{1,0,0,0,0,}}, 2753 | {{1,0,0,0,0,}}, 2754 | }}, 2755 | }}, 2756 | }}, 2757 | {{ 2758 | {{ 2759 | {{ 2760 | {{7680,0,0,0,0,}}, 2761 | {{5120,0,0,0,0,}}, 2762 | {{2560,0,0,0,0,}}, 2763 | {{1280,0,0,0,0,}}, 2764 | {{1280,0,0,0,0,}}, 2765 | }}, 2766 | {{ 2767 | {{6144,0,0,0,0,}}, 2768 | {{3584,0,0,0,0,}}, 2769 | {{1024,0,0,0,0,}}, 2770 | {{1024,0,0,0,0,}}, 2771 | {{1024,0,0,0,0,}}, 2772 | }}, 2773 | }}, 2774 | {{ 2775 | {{ 2776 | {{3840,0,0,0,0,}}, 2777 | {{2880,0,0,0,0,}}, 2778 | {{1920,0,0,0,0,}}, 2779 | {{1280,0,0,0,0,}}, 2780 | {{1280,0,0,0,0,}}, 2781 | }}, 2782 | {{ 2783 | {{3840,0,0,0,0,}}, 2784 | {{2560,0,0,0,0,}}, 2785 | {{1280,0,0,0,0,}}, 2786 | {{1280,0,0,0,0,}}, 2787 | {{1280,0,0,0,0,}}, 2788 | }}, 2789 | }}, 2790 | {{ 2791 | {{ 2792 | {{960,0,0,0,0,}}, 2793 | {{800,0,0,0,0,}}, 2794 | {{640,0,0,0,0,}}, 2795 | {{480,0,0,0,0,}}, 2796 | {{480,0,0,0,0,}}, 2797 | }}, 2798 | {{ 2799 | {{1280,0,0,0,0,}}, 2800 | {{960,0,0,0,0,}}, 2801 | {{640,0,0,0,0,}}, 2802 | {{640,0,0,0,0,}}, 2803 | {{640,0,0,0,0,}}, 2804 | }}, 2805 | }}, 2806 | {{ 2807 | {{ 2808 | {{120,0,0,0,0,}}, 2809 | {{110,0,0,0,0,}}, 2810 | {{100,0,0,0,0,}}, 2811 | {{80,0,0,0,0,}}, 2812 | {{80,0,0,0,0,}}, 2813 | }}, 2814 | {{ 2815 | {{240,0,0,0,0,}}, 2816 | {{200,0,0,0,0,}}, 2817 | {{160,0,0,0,0,}}, 2818 | {{160,0,0,0,0,}}, 2819 | {{160,0,0,0,0,}}, 2820 | }}, 2821 | }}, 2822 | {{ 2823 | {{ 2824 | {{6,0,0,0,0,}}, 2825 | {{6,0,0,0,0,}}, 2826 | {{6,0,0,0,0,}}, 2827 | {{5,0,0,0,0,}}, 2828 | {{5,0,0,0,0,}}, 2829 | }}, 2830 | {{ 2831 | {{24,0,0,0,0,}}, 2832 | {{22,0,0,0,0,}}, 2833 | {{20,0,0,0,0,}}, 2834 | {{20,0,0,0,0,}}, 2835 | {{20,0,0,0,0,}}, 2836 | }}, 2837 | }}, 2838 | {{ 2839 | {{ 2840 | {{0,0,0,0,0,}}, 2841 | {{0,0,0,0,0,}}, 2842 | {{0,0,0,0,0,}}, 2843 | {{0,0,0,0,0,}}, 2844 | {{0,0,0,0,0,}}, 2845 | }}, 2846 | {{ 2847 | {{1,0,0,0,0,}}, 2848 | {{1,0,0,0,0,}}, 2849 | {{1,0,0,0,0,}}, 2850 | {{1,0,0,0,0,}}, 2851 | {{1,0,0,0,0,}}, 2852 | }}, 2853 | }}, 2854 | }}, 2855 | {{ 2856 | {{ 2857 | {{ 2858 | {{1280,0,0,0,0,}}, 2859 | {{768,0,0,0,0,}}, 2860 | {{256,0,0,0,0,}}, 2861 | {{0,0,0,0,0,}}, 2862 | {{0,0,0,0,0,}}, 2863 | }}, 2864 | {{ 2865 | {{1024,0,0,0,0,}}, 2866 | {{512,0,0,0,0,}}, 2867 | {{0,0,0,0,0,}}, 2868 | {{0,0,0,0,0,}}, 2869 | {{0,0,0,0,0,}}, 2870 | }}, 2871 | }}, 2872 | {{ 2873 | {{ 2874 | {{1280,0,0,0,0,}}, 2875 | {{896,0,0,0,0,}}, 2876 | {{512,0,0,0,0,}}, 2877 | {{256,0,0,0,0,}}, 2878 | {{256,0,0,0,0,}}, 2879 | }}, 2880 | {{ 2881 | {{1280,0,0,0,0,}}, 2882 | {{768,0,0,0,0,}}, 2883 | {{256,0,0,0,0,}}, 2884 | {{256,0,0,0,0,}}, 2885 | {{256,0,0,0,0,}}, 2886 | }}, 2887 | }}, 2888 | {{ 2889 | {{ 2890 | {{480,0,0,0,0,}}, 2891 | {{384,0,0,0,0,}}, 2892 | {{288,0,0,0,0,}}, 2893 | {{192,0,0,0,0,}}, 2894 | {{192,0,0,0,0,}}, 2895 | }}, 2896 | {{ 2897 | {{640,0,0,0,0,}}, 2898 | {{448,0,0,0,0,}}, 2899 | {{256,0,0,0,0,}}, 2900 | {{256,0,0,0,0,}}, 2901 | {{256,0,0,0,0,}}, 2902 | }}, 2903 | }}, 2904 | {{ 2905 | {{ 2906 | {{80,0,0,0,0,}}, 2907 | {{72,0,0,0,0,}}, 2908 | {{64,0,0,0,0,}}, 2909 | {{48,0,0,0,0,}}, 2910 | {{48,0,0,0,0,}}, 2911 | }}, 2912 | {{ 2913 | {{160,0,0,0,0,}}, 2914 | {{128,0,0,0,0,}}, 2915 | {{96,0,0,0,0,}}, 2916 | {{96,0,0,0,0,}}, 2917 | {{96,0,0,0,0,}}, 2918 | }}, 2919 | }}, 2920 | {{ 2921 | {{ 2922 | {{5,0,0,0,0,}}, 2923 | {{5,0,0,0,0,}}, 2924 | {{5,0,0,0,0,}}, 2925 | {{4,0,0,0,0,}}, 2926 | {{4,0,0,0,0,}}, 2927 | }}, 2928 | {{ 2929 | {{20,0,0,0,0,}}, 2930 | {{18,0,0,0,0,}}, 2931 | {{16,0,0,0,0,}}, 2932 | {{16,0,0,0,0,}}, 2933 | {{16,0,0,0,0,}}, 2934 | }}, 2935 | }}, 2936 | {{ 2937 | {{ 2938 | {{0,0,0,0,0,}}, 2939 | {{0,0,0,0,0,}}, 2940 | {{0,0,0,0,0,}}, 2941 | {{0,0,0,0,0,}}, 2942 | {{0,0,0,0,0,}}, 2943 | }}, 2944 | {{ 2945 | {{1,0,0,0,0,}}, 2946 | {{1,0,0,0,0,}}, 2947 | {{1,0,0,0,0,}}, 2948 | {{1,0,0,0,0,}}, 2949 | {{1,0,0,0,0,}}, 2950 | }}, 2951 | }}, 2952 | }}, 2953 | {{ 2954 | {{ 2955 | {{ 2956 | {{0,0,0,0,0,}}, 2957 | {{0,0,0,0,0,}}, 2958 | {{0,0,0,0,0,}}, 2959 | {{0,0,0,0,0,}}, 2960 | {{0,0,0,0,0,}}, 2961 | }}, 2962 | {{ 2963 | {{0,0,0,0,0,}}, 2964 | {{0,0,0,0,0,}}, 2965 | {{0,0,0,0,0,}}, 2966 | {{0,0,0,0,0,}}, 2967 | {{0,0,0,0,0,}}, 2968 | }}, 2969 | }}, 2970 | {{ 2971 | {{ 2972 | {{256,0,0,0,0,}}, 2973 | {{160,0,0,0,0,}}, 2974 | {{64,0,0,0,0,}}, 2975 | {{0,0,0,0,0,}}, 2976 | {{0,0,0,0,0,}}, 2977 | }}, 2978 | {{ 2979 | {{256,0,0,0,0,}}, 2980 | {{128,0,0,0,0,}}, 2981 | {{0,0,0,0,0,}}, 2982 | {{0,0,0,0,0,}}, 2983 | {{0,0,0,0,0,}}, 2984 | }}, 2985 | }}, 2986 | {{ 2987 | {{ 2988 | {{192,0,0,0,0,}}, 2989 | {{144,0,0,0,0,}}, 2990 | {{96,0,0,0,0,}}, 2991 | {{48,0,0,0,0,}}, 2992 | {{48,0,0,0,0,}}, 2993 | }}, 2994 | {{ 2995 | {{256,0,0,0,0,}}, 2996 | {{160,0,0,0,0,}}, 2997 | {{64,0,0,0,0,}}, 2998 | {{64,0,0,0,0,}}, 2999 | {{64,0,0,0,0,}}, 3000 | }}, 3001 | }}, 3002 | {{ 3003 | {{ 3004 | {{48,0,0,0,0,}}, 3005 | {{42,0,0,0,0,}}, 3006 | {{36,0,0,0,0,}}, 3007 | {{24,0,0,0,0,}}, 3008 | {{24,0,0,0,0,}}, 3009 | }}, 3010 | {{ 3011 | {{96,0,0,0,0,}}, 3012 | {{72,0,0,0,0,}}, 3013 | {{48,0,0,0,0,}}, 3014 | {{48,0,0,0,0,}}, 3015 | {{48,0,0,0,0,}}, 3016 | }}, 3017 | }}, 3018 | {{ 3019 | {{ 3020 | {{4,0,0,0,0,}}, 3021 | {{4,0,0,0,0,}}, 3022 | {{4,0,0,0,0,}}, 3023 | {{3,0,0,0,0,}}, 3024 | {{3,0,0,0,0,}}, 3025 | }}, 3026 | {{ 3027 | {{16,0,0,0,0,}}, 3028 | {{14,0,0,0,0,}}, 3029 | {{12,0,0,0,0,}}, 3030 | {{12,0,0,0,0,}}, 3031 | {{12,0,0,0,0,}}, 3032 | }}, 3033 | }}, 3034 | {{ 3035 | {{ 3036 | {{0,0,0,0,0,}}, 3037 | {{0,0,0,0,0,}}, 3038 | {{0,0,0,0,0,}}, 3039 | {{0,0,0,0,0,}}, 3040 | {{0,0,0,0,0,}}, 3041 | }}, 3042 | {{ 3043 | {{1,0,0,0,0,}}, 3044 | {{1,0,0,0,0,}}, 3045 | {{1,0,0,0,0,}}, 3046 | {{1,0,0,0,0,}}, 3047 | {{1,0,0,0,0,}}, 3048 | }}, 3049 | }}, 3050 | }}, 3051 | {{ 3052 | {{ 3053 | {{ 3054 | {{0,0,0,0,0,}}, 3055 | {{0,0,0,0,0,}}, 3056 | {{0,0,0,0,0,}}, 3057 | {{0,0,0,0,0,}}, 3058 | {{0,0,0,0,0,}}, 3059 | }}, 3060 | {{ 3061 | {{0,0,0,0,0,}}, 3062 | {{0,0,0,0,0,}}, 3063 | {{0,0,0,0,0,}}, 3064 | {{0,0,0,0,0,}}, 3065 | {{0,0,0,0,0,}}, 3066 | }}, 3067 | }}, 3068 | {{ 3069 | {{ 3070 | {{0,0,0,0,0,}}, 3071 | {{0,0,0,0,0,}}, 3072 | {{0,0,0,0,0,}}, 3073 | {{0,0,0,0,0,}}, 3074 | {{0,0,0,0,0,}}, 3075 | }}, 3076 | {{ 3077 | {{0,0,0,0,0,}}, 3078 | {{0,0,0,0,0,}}, 3079 | {{0,0,0,0,0,}}, 3080 | {{0,0,0,0,0,}}, 3081 | {{0,0,0,0,0,}}, 3082 | }}, 3083 | }}, 3084 | {{ 3085 | {{ 3086 | {{48,0,0,0,0,}}, 3087 | {{32,0,0,0,0,}}, 3088 | {{16,0,0,0,0,}}, 3089 | {{0,0,0,0,0,}}, 3090 | {{0,0,0,0,0,}}, 3091 | }}, 3092 | {{ 3093 | {{64,0,0,0,0,}}, 3094 | {{32,0,0,0,0,}}, 3095 | {{0,0,0,0,0,}}, 3096 | {{0,0,0,0,0,}}, 3097 | {{0,0,0,0,0,}}, 3098 | }}, 3099 | }}, 3100 | {{ 3101 | {{ 3102 | {{24,0,0,0,0,}}, 3103 | {{20,0,0,0,0,}}, 3104 | {{16,0,0,0,0,}}, 3105 | {{8,0,0,0,0,}}, 3106 | {{8,0,0,0,0,}}, 3107 | }}, 3108 | {{ 3109 | {{48,0,0,0,0,}}, 3110 | {{32,0,0,0,0,}}, 3111 | {{16,0,0,0,0,}}, 3112 | {{16,0,0,0,0,}}, 3113 | {{16,0,0,0,0,}}, 3114 | }}, 3115 | }}, 3116 | {{ 3117 | {{ 3118 | {{3,0,0,0,0,}}, 3119 | {{3,0,0,0,0,}}, 3120 | {{3,0,0,0,0,}}, 3121 | {{2,0,0,0,0,}}, 3122 | {{2,0,0,0,0,}}, 3123 | }}, 3124 | {{ 3125 | {{12,0,0,0,0,}}, 3126 | {{10,0,0,0,0,}}, 3127 | {{8,0,0,0,0,}}, 3128 | {{8,0,0,0,0,}}, 3129 | {{8,0,0,0,0,}}, 3130 | }}, 3131 | }}, 3132 | {{ 3133 | {{ 3134 | {{0,0,0,0,0,}}, 3135 | {{0,0,0,0,0,}}, 3136 | {{0,0,0,0,0,}}, 3137 | {{0,0,0,0,0,}}, 3138 | {{0,0,0,0,0,}}, 3139 | }}, 3140 | {{ 3141 | {{1,0,0,0,0,}}, 3142 | {{1,0,0,0,0,}}, 3143 | {{1,0,0,0,0,}}, 3144 | {{1,0,0,0,0,}}, 3145 | {{1,0,0,0,0,}}, 3146 | }}, 3147 | }}, 3148 | }}, 3149 | {{ 3150 | {{ 3151 | {{ 3152 | {{0,0,0,0,0,}}, 3153 | {{0,0,0,0,0,}}, 3154 | {{0,0,0,0,0,}}, 3155 | {{0,0,0,0,0,}}, 3156 | {{0,0,0,0,0,}}, 3157 | }}, 3158 | {{ 3159 | {{0,0,0,0,0,}}, 3160 | {{0,0,0,0,0,}}, 3161 | {{0,0,0,0,0,}}, 3162 | {{0,0,0,0,0,}}, 3163 | {{0,0,0,0,0,}}, 3164 | }}, 3165 | }}, 3166 | {{ 3167 | {{ 3168 | {{0,0,0,0,0,}}, 3169 | {{0,0,0,0,0,}}, 3170 | {{0,0,0,0,0,}}, 3171 | {{0,0,0,0,0,}}, 3172 | {{0,0,0,0,0,}}, 3173 | }}, 3174 | {{ 3175 | {{0,0,0,0,0,}}, 3176 | {{0,0,0,0,0,}}, 3177 | {{0,0,0,0,0,}}, 3178 | {{0,0,0,0,0,}}, 3179 | {{0,0,0,0,0,}}, 3180 | }}, 3181 | }}, 3182 | {{ 3183 | {{ 3184 | {{0,0,0,0,0,}}, 3185 | {{0,0,0,0,0,}}, 3186 | {{0,0,0,0,0,}}, 3187 | {{0,0,0,0,0,}}, 3188 | {{0,0,0,0,0,}}, 3189 | }}, 3190 | {{ 3191 | {{0,0,0,0,0,}}, 3192 | {{0,0,0,0,0,}}, 3193 | {{0,0,0,0,0,}}, 3194 | {{0,0,0,0,0,}}, 3195 | {{0,0,0,0,0,}}, 3196 | }}, 3197 | }}, 3198 | {{ 3199 | {{ 3200 | {{8,0,0,0,0,}}, 3201 | {{6,0,0,0,0,}}, 3202 | {{4,0,0,0,0,}}, 3203 | {{0,0,0,0,0,}}, 3204 | {{0,0,0,0,0,}}, 3205 | }}, 3206 | {{ 3207 | {{16,0,0,0,0,}}, 3208 | {{8,0,0,0,0,}}, 3209 | {{0,0,0,0,0,}}, 3210 | {{0,0,0,0,0,}}, 3211 | {{0,0,0,0,0,}}, 3212 | }}, 3213 | }}, 3214 | {{ 3215 | {{ 3216 | {{2,0,0,0,0,}}, 3217 | {{2,0,0,0,0,}}, 3218 | {{2,0,0,0,0,}}, 3219 | {{1,0,0,0,0,}}, 3220 | {{1,0,0,0,0,}}, 3221 | }}, 3222 | {{ 3223 | {{8,0,0,0,0,}}, 3224 | {{6,0,0,0,0,}}, 3225 | {{4,0,0,0,0,}}, 3226 | {{4,0,0,0,0,}}, 3227 | {{4,0,0,0,0,}}, 3228 | }}, 3229 | }}, 3230 | {{ 3231 | {{ 3232 | {{0,0,0,0,0,}}, 3233 | {{0,0,0,0,0,}}, 3234 | {{0,0,0,0,0,}}, 3235 | {{0,0,0,0,0,}}, 3236 | {{0,0,0,0,0,}}, 3237 | }}, 3238 | {{ 3239 | {{1,0,0,0,0,}}, 3240 | {{1,0,0,0,0,}}, 3241 | {{1,0,0,0,0,}}, 3242 | {{1,0,0,0,0,}}, 3243 | {{1,0,0,0,0,}}, 3244 | }}, 3245 | }}, 3246 | }}, 3247 | {{ 3248 | {{ 3249 | {{ 3250 | {{0,0,0,0,0,}}, 3251 | {{0,0,0,0,0,}}, 3252 | {{0,0,0,0,0,}}, 3253 | {{0,0,0,0,0,}}, 3254 | {{0,0,0,0,0,}}, 3255 | }}, 3256 | {{ 3257 | {{0,0,0,0,0,}}, 3258 | {{0,0,0,0,0,}}, 3259 | {{0,0,0,0,0,}}, 3260 | {{0,0,0,0,0,}}, 3261 | {{0,0,0,0,0,}}, 3262 | }}, 3263 | }}, 3264 | {{ 3265 | {{ 3266 | {{0,0,0,0,0,}}, 3267 | {{0,0,0,0,0,}}, 3268 | {{0,0,0,0,0,}}, 3269 | {{0,0,0,0,0,}}, 3270 | {{0,0,0,0,0,}}, 3271 | }}, 3272 | {{ 3273 | {{0,0,0,0,0,}}, 3274 | {{0,0,0,0,0,}}, 3275 | {{0,0,0,0,0,}}, 3276 | {{0,0,0,0,0,}}, 3277 | {{0,0,0,0,0,}}, 3278 | }}, 3279 | }}, 3280 | {{ 3281 | {{ 3282 | {{0,0,0,0,0,}}, 3283 | {{0,0,0,0,0,}}, 3284 | {{0,0,0,0,0,}}, 3285 | {{0,0,0,0,0,}}, 3286 | {{0,0,0,0,0,}}, 3287 | }}, 3288 | {{ 3289 | {{0,0,0,0,0,}}, 3290 | {{0,0,0,0,0,}}, 3291 | {{0,0,0,0,0,}}, 3292 | {{0,0,0,0,0,}}, 3293 | {{0,0,0,0,0,}}, 3294 | }}, 3295 | }}, 3296 | {{ 3297 | {{ 3298 | {{0,0,0,0,0,}}, 3299 | {{0,0,0,0,0,}}, 3300 | {{0,0,0,0,0,}}, 3301 | {{0,0,0,0,0,}}, 3302 | {{0,0,0,0,0,}}, 3303 | }}, 3304 | {{ 3305 | {{0,0,0,0,0,}}, 3306 | {{0,0,0,0,0,}}, 3307 | {{0,0,0,0,0,}}, 3308 | {{0,0,0,0,0,}}, 3309 | {{0,0,0,0,0,}}, 3310 | }}, 3311 | }}, 3312 | {{ 3313 | {{ 3314 | {{1,0,0,0,0,}}, 3315 | {{1,0,0,0,0,}}, 3316 | {{1,0,0,0,0,}}, 3317 | {{0,0,0,0,0,}}, 3318 | {{0,0,0,0,0,}}, 3319 | }}, 3320 | {{ 3321 | {{4,0,0,0,0,}}, 3322 | {{2,0,0,0,0,}}, 3323 | {{0,0,0,0,0,}}, 3324 | {{0,0,0,0,0,}}, 3325 | {{0,0,0,0,0,}}, 3326 | }}, 3327 | }}, 3328 | {{ 3329 | {{ 3330 | {{0,0,0,0,0,}}, 3331 | {{0,0,0,0,0,}}, 3332 | {{0,0,0,0,0,}}, 3333 | {{0,0,0,0,0,}}, 3334 | {{0,0,0,0,0,}}, 3335 | }}, 3336 | {{ 3337 | {{1,0,0,0,0,}}, 3338 | {{1,0,0,0,0,}}, 3339 | {{1,0,0,0,0,}}, 3340 | {{1,0,0,0,0,}}, 3341 | {{1,0,0,0,0,}}, 3342 | }}, 3343 | }}, 3344 | }}, 3345 | }}; 3346 | 3347 | } // namespace Tsumonya 3348 | 3349 | #endif // !defined(TSUMONYA_TABLE_HPP_INCLUDE_GUARD) 3350 | --------------------------------------------------------------------------------