#pragma once
/**
* Author: Teetat T.
* Date: 2024-01-15
* Description: n-th power using divide and conquer
* Time: $O(\log b)$
*/template<classT>constexprTbinpow(Ta,llb){Tres=1;for(;b>0;b>>=1,a*=a)if(b&1)res*=a;returnres;}
#line 2 "src/modular-arithmetic/binpow.hpp"
/**
* Author: Teetat T.
* Date: 2024-01-15
* Description: n-th power using divide and conquer
* Time: $O(\log b)$
*/template<classT>constexprTbinpow(Ta,llb){Tres=1;for(;b>0;b>>=1,a*=a)if(b&1)res*=a;returnres;}