#include #include #include #include #include /* [begin]: numeric/leveler.hpp */ #include #include #include /* [begin]: snippet/iterations.hpp */ #include /* [begin]: macro/overload.hpp */ #define $OVERLOAD2(arg0, arg1, cmd, ...) cmd #define $OVERLOAD3(arg0, arg1, arg2, cmd, ...) cmd #define $OVERLOAD4(arg0, arg1, arg2, arg3, cmd, ...) cmd #define $OVERLOAD5(arg0, arg1, arg2, arg3, arg4, cmd, ...) cmd #define $OVERLOAD6(arg0, arg1, arg2, arg3, arg4, arg5, cmd, ...) cmd /* [end]: macro/overload.hpp*/ #define LOOP(n) REPI(_$, (n)) #define REPI(i,n) for(std::decay_t i=0, i##_length=(n); i,std::decay_t> i=(l), i##_last=(r); i,std::decay_t,std::decay_t> i=(l), i##_last=(r); i=0;) #define REPB(i,l,r) for(std::common_type_t,std::decay_t> i=(r), i##_last=(l); --i>=i##_last;) #define REPRS(i,l,r,s) for(std::common_type_t,std::decay_t,std::decay_t> i=(l)+((r)-(l)-1)/(s)*(s), i##_last=(l); i>=i##_last; (i-=(s))) #define REP(...) $OVERLOAD4(__VA_ARGS__, REPIS, REPF, REPI, LOOP)(__VA_ARGS__) #define REPD(...) $OVERLOAD4(__VA_ARGS__, REPRS, REPB, REPR)(__VA_ARGS__) #define FORO(i,n) for(int i=0, i##_last=static_cast(n); i<=i##_last; ++i) #define FORI(i,l,r) for(std::common_type_t,std::decay_t> i=(l), i##_last=(r); i<=i##_last; ++i) #define FORIS(i,l,r,s) for(std::common_type_t,std::decay_t,std::decay_t> i=(l), i##_last=(r); i<=i##_last; i+=(s)) #define FORRO(i,n) for(auto i=(n); i>=0; --i) #define FORR(i,l,r) for(std::common_type_t,std::decay_t> i=(r), i##_last=(l); i>=i##_last; --i) #define FORRS(i,l,r,s) for(std::common_type_t,std::decay_t,std::decay_t> i=(l)+((r)-(l))/(s)*(s), i##_last=(l); i>=i##_last; i-=(s)) #define FOR(...) $OVERLOAD4(__VA_ARGS__, FORIS, FORI, FORO)(__VA_ARGS__) #define FORD(...) $OVERLOAD4(__VA_ARGS__, FORRS, FORR, FORRO)(__VA_ARGS__) #define ITR1(e0,v) for(const auto &e0 : (v)) #define ITRP1(e0,v) for(auto e0 : (v)) #define ITRR1(e0,v) for(auto &e0 : (v)) #define ITR2(e0,e1,v) for(const auto [e0, e1] : (v)) #define ITRP2(e0,e1,v) for(auto [e0, e1] : (v)) #define ITRR2(e0,e1,v) for(auto &[e0, e1] : (v)) #define ITR3(e0,e1,e2,v) for(const auto [e0, e1, e2] : (v)) #define ITRP3(e0,e1,e2,v) for(auto [e0, e1, e2] : (v)) #define ITRR3(e0,e1,e2,v) for(auto &[e0, e1, e2] : (v)) #define ITR4(e0,e1,e2,e3,v) for(const auto [e0, e1, e2, e3] : (v)) #define ITRP4(e0,e1,e2,e3,v) for(auto [e0, e1, e2, e3] : (v)) #define ITRR4(e0,e1,e2,e3,v) for(auto &[e0, e1, e2, e3] : (v)) #define ITR5(e0,e1,e2,e3,e4,v) for(const auto [e0, e1, e2, e3, e4] : (v)) #define ITRP5(e0,e1,e2,e3,e4,v) for(auto [e0, e1, e2, e3, e4] : (v)) #define ITRR5(e0,e1,e2,e3,e4,v) for(auto &[e0, e1, e2, e3, e4] : (v)) #define ITR(...) $OVERLOAD6(__VA_ARGS__, ITR5, ITR4, ITR3, ITR2, ITR1)(__VA_ARGS__) #define ITRP(...) $OVERLOAD6(__VA_ARGS__, ITRP5, ITRP4, ITRP3, ITRP2, ITRP1)(__VA_ARGS__) #define ITRR(...) $OVERLOAD6(__VA_ARGS__, ITRR5, ITRR4, ITRR3, ITRR2, ITRR1)(__VA_ARGS__) /* [end]: snippet/iterations.hpp*/ /* [begin]: internal/types.hpp */ #include namespace lib { namespace internal { using size_t = std::int64_t; using int128_t = __int128_t; using uint128_t = __uint128_t; } } /* [end]: internal/types.hpp*/ /* [begin]: internal/dev_env.hpp */ #ifdef LOCAL_JUDGE inline constexpr bool DEV_ENV = true; inline constexpr bool NO_EXCEPT = false; #else inline constexpr bool DEV_ENV = false; inline constexpr bool NO_EXCEPT = true; #endif #if __cplusplus >= 202100L #define CPP20 true #define CPP23 true #elif __cplusplus >= 202002L #define CPP20 true #define CPP23 false #else #define CPP20 false #define CPP23 false #endif /* [end]: internal/dev_env.hpp*/ /* [begin]: adaptor/valarray.hpp */ #include #include #include #include /* [begin]: adaptor/internal/container_extender.hpp */ #include #include /* [begin]: numeric/internal/mod.hpp */ /* [begin]: internal/concepts.hpp */ #include #include #include namespace lib { namespace internal { template concept available = requires () { typename Structure; }; template< template class Structure, class... TemplateParameters > concept available_with = available>; template concept arithmetic = std::is_arithmetic_v; template concept pointer = std::is_pointer_v; template concept structural = std::is_class_v; template concept has_double_digits_of = (std::numeric_limits::digits == 2 * std::numeric_limits::digits); template concept has_more_digits_than = (std::numeric_limits::digits > std::numeric_limits::digits); template concept has_or_more_digits_than = (std::numeric_limits::digits >= std::numeric_limits::digits); template concept has_static_zero = requires { T::zero; }; template concept has_static_one = requires { T::one; }; template concept weakly_addable = requires (L lhs, R rhs) { lhs + rhs; }; template concept weakly_subtractable = requires (L lhs, R rhs) { lhs - rhs; }; template concept weakly_multipliable = requires (L lhs, R rhs) { lhs * rhs; }; template concept weakly_divisable = requires (L lhs, R rhs) { lhs / rhs; }; template concept weakly_remainder_calculable = requires (L lhs, R rhs) { lhs % rhs; }; template concept weakly_addition_assignable = requires (L lhs, R rhs) { lhs += rhs; }; template concept weakly_subtraction_assignable = requires (L lhs, R rhs) { lhs -= rhs; }; template concept weakly_multipliation_assignalbe = requires (L lhs, R rhs) { lhs *= rhs; }; template concept weakly_division_assignable = requires (L lhs, R rhs) { lhs /= rhs; }; template concept weakly_remainder_assignable = requires (L lhs, R rhs) { lhs /= rhs; }; template concept addable = weakly_addable && weakly_addable&, L, R>, R> && weakly_addable&, L, R>> && weakly_addable&, L, R>, std::invoke_result_t&, L, R>>; template concept subtractable = weakly_subtractable && weakly_subtractable&, L, R>, R> && weakly_subtractable&, L, R>> && weakly_subtractable&, L, R>, std::invoke_result_t&, L, R>>; template concept multipliable = weakly_multipliable && weakly_multipliable&, L, R>, R> && weakly_multipliable&, L, R>> && weakly_multipliable&, L, R>, std::invoke_result_t&, L, R>>; template concept divisable = weakly_divisable && weakly_divisable&, L, R>, R> && weakly_divisable&, L, R>> && weakly_divisable&, L, R>, std::invoke_result_t&, L, R>>; template concept remainder_calculable = weakly_remainder_calculable && weakly_remainder_calculable&, L, R>, R> && weakly_remainder_calculable&, L, R>> && weakly_remainder_calculable&, L, R>, std::invoke_result_t&, L, R>>; template concept addition_assignable = weakly_addition_assignable && weakly_addition_assignable&, L, R>>, R> && weakly_addition_assignable&, L, R>> && weakly_addition_assignable&, L, R>>, std::invoke_result_t&, L, R>>; template concept subtraction_assignable = weakly_subtraction_assignable && weakly_subtraction_assignable&, L, R>>, R> && weakly_subtraction_assignable&, L, R>> && weakly_subtraction_assignable&, L, R>>, std::invoke_result_t&, L, R>>; template concept multipliation_assignalbe = weakly_multipliation_assignalbe && weakly_multipliation_assignalbe&, L, R>>, R> && weakly_multipliation_assignalbe&, L, R>> && weakly_multipliation_assignalbe&, L, R>>, std::invoke_result_t&, L, R>>; template concept division_assignable = weakly_division_assignable && weakly_division_assignable&, L, R>>, R> && weakly_division_assignable&, L, R>> && weakly_division_assignable&, L, R>>, std::invoke_result_t&, L, R>>; template concept remainder_assignable = weakly_remainder_assignable && weakly_remainder_assignable&, L, R>>, R> && weakly_remainder_assignable&, L, R>> && weakly_remainder_assignable&, L, R>>, std::invoke_result_t&, L, R>>; template concept weakly_incrementable = std::movable && requires (T v) { { ++v } -> std::same_as; v++; }; template concept weakly_decrementable = std::movable && requires (T v) { { --v } -> std::same_as; v--; }; template concept incrementable = std::regular && weakly_incrementable && requires (T v) { { v++ } -> std::same_as; }; template concept decrementable = std::regular && weakly_decrementable && requires (T v) { { v-- } -> std::same_as; }; template concept weakly_arithmetic_operable = weakly_addable && weakly_subtractable && weakly_multipliable && weakly_divisable; template concept weakly_arithmetic_operation_assignable = weakly_addition_assignable && weakly_subtraction_assignable && weakly_multipliation_assignalbe && weakly_division_assignable; template concept arithmetic_operable = weakly_arithmetic_operable && addable && subtractable && multipliable && divisable; template concept arithmetic_operation_assignable = weakly_arithmetic_operation_assignable && addition_assignable && subtraction_assignable && multipliation_assignalbe && division_assignable; template concept unary_addable = requires (T v) { { +v } -> std::same_as; }; template concept unary_subtractable = requires (T v) { { -v } -> std::same_as; }; template concept numeric = std::regular && arithmetic_operable && arithmetic_operation_assignable && weakly_incrementable && unary_addable && unary_subtractable; } } /* [end]: internal/concepts.hpp*/ namespace lib { template requires internal::remainder_calculable && internal::subtractable && internal::unary_subtractable inline T mod(T x, const R& r) noexcept(NO_EXCEPT) { if(x >= 0) return x % r; x = -x % r; if(x != 0) x = r - x; return x; } } /* [end]: numeric/internal/mod.hpp*/ /* [begin]: iterable/internal/operation_base.hpp */ #include /* [begin]: snippet/aliases.hpp */ #include /* [begin]: snippet/internal/types.hpp */ namespace lib { using i16 = std::int16_t; using u16 = std::uint16_t; using i32 = std::int32_t; using u32 = std::uint32_t; using i64 = std::int64_t; using u64 = std::uint64_t; #ifdef __GNUC__ using i128 = __int128_t; using u128 = __uint128_t; #endif using uint = unsigned; using ll = long long; using ull = unsigned long long; using ld = long double; } /* [end]: snippet/internal/types.hpp*/ #define until(...) while(!(__VA_ARGS__)) #define CONTINUE(...) { __VA_ARGS__; continue; } #define BREAK(...) { __VA_ARGS__; break; } #define ALL(x) std::ranges::begin((x)),std::ranges::end((x)) #define RALL(x) std::ranges::rbegin((x)),std::ranges::rend((x)) #define $F first #define $S second namespace lib { constexpr char LN = '\n'; constexpr char SPC = ' '; constexpr std::pair DIRS4[] = { { -1, 0 }, { 0, 1 }, { 1, 0 }, { 0, -1 } }; constexpr std::pair DIRS4P[] = { { -1, 0 }, { 0, 1 }, { 1, 0 }, { 0, -1 }, { 0, 0 } }; constexpr std::pair DIRS8[] = { { -1, 0 }, { -1, 1 }, { 0, 1 }, { 1, 1 }, { 1, 0 }, { 1, -1 }, { 0, -1 }, { -1, -1 } }; constexpr std::pair DIRS8P[] = { { -1, 0 }, { -1, 1 }, { 0, 1 }, { 1, 1 }, { 1, 0 }, { 1, -1 }, { 0, -1 }, { -1, -1 }, { 0, 0 } }; template using spair = std::pair; } namespace std { using bit_reference = std::vector::reference; bit_reference operator |= (bit_reference a, const bool b) noexcept(NO_EXCEPT) { return a = a | b; } bit_reference operator &= (bit_reference a, const bool b) noexcept(NO_EXCEPT) { return a = a & b; } } /* [end]: snippet/aliases.hpp*/ namespace lib { template S> std::string join(I first, S last, const char* sep = "") noexcept(NO_EXCEPT) { if(first == last) return ""; std::ostringstream res; while(true) { res << *first; std::ranges::advance(first, 1); if(first == last) break; res << sep; } return res.str(); } template std::string join(R&& range, const char* sep = "") noexcept(NO_EXCEPT) { return join(ALL(range), sep); } } /* [end]: iterable/internal/operation_base.hpp*/ namespace lib { namespace internal { template struct extended_container : Base { private: inline Base* _base() noexcept(NO_EXCEPT) { return static_cast(this); } inline const Base* _base() const noexcept(NO_EXCEPT) { return static_cast(this); } public: using Base::Base; extended_container(const Base& base) : Base(base) {} using size_type = decltype(std::ranges::size(std::declval())); using value_type = typename Base::value_type; inline auto ssize() const noexcept(NO_EXCEPT) { return std::ranges::ssize(*this); } inline const auto& operator[](internal::size_t p) const noexcept(NO_EXCEPT) { p = p < 0 ? p + this->size() : p; assert(0 <= p && p < static_cast(this->size())); return this->Base::operator[](p); } inline auto& operator[](internal::size_t p) noexcept(NO_EXCEPT) { p = p < 0 ? p + this->size() : p; assert(0 <= p && p < static_cast(this->size())); return this->Base::operator[](p); } inline auto& fill(const value_type& v) noexcept(NO_EXCEPT) { std::ranges::fill(*this->_base(), v); return *this; } inline auto& swap(const size_type i, const size_type j) noexcept(NO_EXCEPT) { std::swap(this->operator[](i), this->operator[](j)); return *this; } inline auto& sort() noexcept(NO_EXCEPT) { std::ranges::sort(*this->_base()); return *this; } template inline auto& sort(const F& f) noexcept(NO_EXCEPT) { std::ranges::sort(*this->_base(), f); return *this; } inline auto& stable_sort() noexcept(NO_EXCEPT) { std::ranges::stable_sort(*this->_base()); return *this; } template inline auto& stable_sort(const F& f) noexcept(NO_EXCEPT) { std::ranges::stable_sort(*this->_base(), f); return *this; } inline auto& reverse() noexcept(NO_EXCEPT) { std::ranges::reverse(*this->_base()); return *this; } inline auto count(const value_type& v) const noexcept(NO_EXCEPT) { return std::ranges::count(*this->_base(), v); } template inline auto count_if(F& f) const noexcept(NO_EXCEPT) { return std::ranges::count_if(*this->_base(), f); } inline auto& resize(const size_type k) noexcept(NO_EXCEPT) { this->Base::resize(k); return *this; } inline auto& resize(const size_type k, const value_type v) noexcept(NO_EXCEPT) { this->Base::resize(k, v); return *this; } template inline auto& shuffle(const F& f) noexcept(NO_EXCEPT) { std::ranges::shuffle(*this->_base(), f); return *this; } inline auto& unique() noexcept(NO_EXCEPT) { const auto rest = std::ranges::unique(*this->_base()); this->erase(ALL(rest)); return *this; } template inline auto binary_search(const T& v) noexcept(NO_EXCEPT) { return std::ranges::binary_search(*this->_base(), v); } template inline auto lower_bound(const T& v) noexcept(NO_EXCEPT) { return std::ranges::lower_bound(*this->_base(), v); } template inline auto upper_bound(const T& v) noexcept(NO_EXCEPT) { return std::ranges::upper_bound(*this->_base(), v); } inline auto join(const char* sep = "") noexcept(NO_EXCEPT) { return lib::join(*this->_base(), sep); } }; } } /* [end]: adaptor/internal/container_extender.hpp*/ namespace lib { template struct valarray : internal::extended_container> { private: using base = internal::extended_container>; public: using size_type = internal::size_t; using iterator = T*; using const_iterator = const T*; protected: inline bool _validate_index_in_right_open([[maybe_unused]] const size_type p) const noexcept(NO_EXCEPT) { return 0 <= p and p < this->size(); } inline bool _validate_index_in_closed([[maybe_unused]] const size_type p) const noexcept(NO_EXCEPT) { return 0 <= p and p <= this->size(); } inline bool _validate_rigth_open_interval([[maybe_unused]] const size_type l, [[maybe_unused]] const size_type r) const noexcept(NO_EXCEPT) { return 0 <= l and l <= r and r <= this->size(); } inline size_type _positivize_index(const size_type p) const noexcept(NO_EXCEPT) { return p < 0 ? this->size() + p : p; } public: valarray() noexcept(NO_EXCEPT) {} explicit valarray(const std::size_t length, const T& val = T{}) noexcept(NO_EXCEPT) : base(std::forward(val), length) {} template S> valarray(I first, S last) noexcept(NO_EXCEPT) : base(std::ranges::distance(first, last)) { std::ranges::copy(first, last, std::ranges::begin(*this)); } template valarray(const U* pointer, const size_t n) noexcept(NO_EXCEPT) : base(pointer, n) {}; valarray(const std::slice_array& arr) noexcept(NO_EXCEPT) : base(arr) {}; valarray(const std::gslice_array& arr) noexcept(NO_EXCEPT) : base(arr) {}; valarray(const std::mask_array& arr) noexcept(NO_EXCEPT) : base(arr) {}; valarray(const std::indirect_array& arr) noexcept(NO_EXCEPT) : base(arr) {}; valarray(const std::initializer_list& init) noexcept(NO_EXCEPT) : base(init) {} #ifdef __GNUC__ template valarray(const std::_Expr& expr) noexcept(NO_EXCEPT) : base(expr) {} #endif inline auto size() const noexcept(NO_EXCEPT) { return static_cast(this->base::size()); } inline void reserve(const size_type) noexcept(NO_EXCEPT) { /* do nothing */ } template S> inline void assign(I first, S last) noexcept(NO_EXCEPT) { this->resize(std::ranges::distance(first, last)); std::ranges::copy(first, last, std::ranges::begin(*this)); } inline void assign(const std::size_t length, const T& val = T{}) noexcept(NO_EXCEPT) { this->base::resize(length, val); } inline void resize(const std::size_t length, const T& val = T{}) noexcept(NO_EXCEPT) { base temp = *this; this->assign(length, val); std::move(std::begin(temp), std::min(std::end(temp), std::next(std::begin(temp), length)), std::begin(*this)); } inline const T& operator[](size_type pos) const noexcept(NO_EXCEPT) { pos = this->_positivize_index(pos), assert(this->_validate_index_in_right_open(pos)); return this->base::operator[](pos); } inline T& operator[](size_type pos) noexcept(NO_EXCEPT) { pos = this->_positivize_index(pos), assert(this->_validate_index_in_right_open(pos)); return this->base::operator[](pos); } inline const T& back() const noexcept(NO_EXCEPT) { return *std::prev(this->end()); } inline T& back() noexcept(NO_EXCEPT) { return *std::prev(this->end()); } inline const T& front() const noexcept(NO_EXCEPT) { return *this->begin(); } inline T& front() noexcept(NO_EXCEPT) { return *this->begin(); } inline const T* begin() const noexcept(NO_EXCEPT) { return this->size() ? std::addressof((*this)[0]) : nullptr; } inline T* begin() noexcept(NO_EXCEPT) { return this->size() ? std::addressof((*this)[0]) : nullptr; } inline const T* end() const noexcept(NO_EXCEPT) { if(auto n = this->size()) { return std::addressof((*this)[0]) + n; } else { return nullptr; } } inline T* end() noexcept(NO_EXCEPT) { if(auto n = this->size()) { return std::addressof((*this)[0]) + n; } else { return nullptr; } } inline auto rbegin() noexcept(NO_EXCEPT) { return std::make_reverse_iterator(std::end(*this)); } inline auto rend() noexcept(NO_EXCEPT) { return std::make_reverse_iterator(std::begin(*this)); } inline auto rbegin() const noexcept(NO_EXCEPT) { return std::make_reverse_iterator(std::end(*this)); } inline auto rend() const noexcept(NO_EXCEPT) { return std::make_reverse_iterator(std::begin(*this)); } }; } /* [end]: adaptor/valarray.hpp*/ namespace lib { template struct leveler { using value_type = T; using size_type = internal::size_t; private: lib::valarray _bases; size_type _dim; value_type _max; inline value_type _compute_max() const noexcept(NO_EXCEPT) { return std::reduce(std::begin(this->_bases), std::end(this->_bases), 1, std::multiplies{}); } public: leveler(const std::initializer_list bases) noexcept(NO_EXCEPT) : _bases(bases), _dim(std::ranges::size(bases)) { this->_max = this->_compute_max(); } template leveler(I first, I last) noexcept(NO_EXCEPT) : _bases(first, last), _dim(std::distance(first, last)) { this->_max = this->_compute_max(); } template leveler(R&& range) noexcept(NO_EXCEPT) : leveler(std::ranges::begin(range), std::ranges::end(range)) {} template leveler(const Values... bases) noexcept(NO_EXCEPT) : leveler(std::initializer_list{ bases... }) {} inline size_type dimension() const noexcept(NO_EXCEPT) { return this->_dim; } inline value_type sup() const noexcept(NO_EXCEPT) { return this->_max; } inline value_type convert(const std::initializer_list inds) const noexcept(NO_EXCEPT) { return this->convert(inds | std::views::all); } template inline value_type convert(R&& range) const noexcept(NO_EXCEPT) { assert(std::ranges::distance(range) == std::ranges::ssize(this->_bases)); value_type res = 0; { auto size = std::ranges::begin(this->_bases); ITR(v, range) { assert(0 <= v and v < *size); res *= *(size++); res += v; } } return res; } template inline value_type convert(const Values... inds) const noexcept(NO_EXCEPT) { return this->convert({ inds... }); } inline lib::valarray revert(value_type id) const noexcept(NO_EXCEPT) { assert(0 <= id and id < this->sup()); lib::valarray res(std::size(this->_bases)); REPD(i, std::size(this->_bases)) { res[i] = id % this->_bases[i]; id /= this->_bases[i]; } return res; } auto _debug() const { return this->_bases; } }; } /* [end]: numeric/leveler.hpp*/ /* [begin]: template/debug.hpp */ /* [begin]: debugger/debug.hpp */ #include #include #include #include #include #include #include #include #include #include #include #include /* [begin]: numeric/int128.hpp */ #include namespace std { template basic_istream& operator>>(std::basic_istream& in, lib::i128& v) noexcept(NO_EXCEPT) { std::string str; in >> str; v = 0; bool negative = (str[0] == '-'); REP(d, std::next(str.begin(), negative), str.end()) { assert(std::isdigit(*d)); v = v * 10 + *d - '0'; } if(negative) v *= -1; return in; } template basic_istream& operator>>(std::basic_istream& in, lib::u128& v) noexcept(NO_EXCEPT) { std::string str; in >> str; v = 0U; assert(str[0] != '-'); REP(d, str.begin(), str.end()) { assert(std::isdigit(*d)); v = v * 10U + *d - '0'; } return in; } template basic_ostream& operator<<(std::basic_ostream& out, lib::i128 v) noexcept(NO_EXCEPT) { if(v == 0) return out << 0; if(v < 0) out << '-', v *= -1; std::string str; while(v > 0) str += static_cast(v%10) + '0', v /= 10; std::reverse(str.begin(), str.end()); return out << str; } template basic_ostream& operator<<(std::basic_ostream& out, lib::u128 v) noexcept(NO_EXCEPT) { if(v == 0) return out << 0U; std::string str; while(v > 0) str += static_cast(v%10U) + '0', v /= 10U; std::reverse(str.begin(), str.end()); return out << str; } } /* [end]: numeric/int128.hpp*/ /* [begin]: internal/type_traits.hpp */ namespace lib { namespace internal { template struct tuple_or_pair { using type = std::tuple; }; template struct tuple_or_pair { using type = std::pair; }; template using tuple_or_pair_t = typename tuple_or_pair::type; template constexpr std::underlying_type_t to_underlying(const T& v) noexcept(NO_EXCEPT) { return static_cast>(v); } template using are_same = std::conjunction...>; template inline constexpr bool are_same_v = are_same::value; template using is_same_as_any_of = std::disjunction...>; template inline constexpr bool is_same_as_any_of_v = is_same_as_any_of::value; template concept same_as_any_of = is_same_as_any_of_v; template using is_base_of_all = std::conjunction...>; template inline constexpr bool is_base_of_all_v = is_base_of_all::value; template using is_base_of_any = std::disjunction...>; template inline constexpr bool is_base_of_any_v = is_base_of_any::value; template struct remove_cvref { using type = typename std::remove_cv_t>; }; template using remove_cvref_t = typename remove_cvref::type; template struct literal_operator { static constexpr const char* value = ""; }; template<> struct literal_operator { static constexpr const char* value = "U"; }; template<> struct literal_operator { static constexpr const char* value = "L"; }; template<> struct literal_operator { static constexpr const char* value = "UL"; }; template<> struct literal_operator { static constexpr const char* value = "LL"; }; template<> struct literal_operator { static constexpr const char* value = "ULL"; }; template<> struct literal_operator { static constexpr const char* value = "F"; }; template<> struct literal_operator { static constexpr const char* value = "D"; }; template<> struct literal_operator { static constexpr const char* value = "LD"; }; #ifdef __SIZEOF_INT128__ template<> struct literal_operator<__int128_t> { static constexpr const char* value = "LLL"; }; template<> struct literal_operator<__uint128_t> { static constexpr const char* value = "ULLL"; }; #endif template inline constexpr auto literal_operator_v = literal_operator::value; template struct nth_type {}; template struct nth_type<0, Head, Tail...> { using type = Head; }; template struct nth_type : public nth_type {}; template using nth_type_t = typename nth_type::type; template