2#include"../../kyopro_library/template.hpp"
7 ModInt(ll x=0){ value=(x>=0?x%MOD:MOD-(-x)%MOD); }
13 if(value>=MOD) value-=MOD;
17 value+=MOD-other.value;
18 if(value>=MOD) value-=MOD;
22 value=value*other.value%MOD;
53 ll
val() {
return value; }
54 static constexpr ll
get_mod() {
return MOD; }
63#define VM vector<mint>
64#define VVM vector<vector<mint>>
friend ostream & operator<<(ostream &os, const ModInt &x)
ModInt & operator*=(const ModInt other)
ModInt & operator+=(const ModInt &other)
ModInt operator*(const ModInt &other) const
ModInt & operator-=(const ModInt &other)
ModInt & operator/=(ModInt other)
bool operator!=(const ModInt &other) const
friend istream & operator>>(istream &is, ModInt &x)
static constexpr ll get_mod()
ModInt operator/(const ModInt &other) const
bool operator==(const ModInt &other) const
ModInt operator+(const ModInt &other) const
ModInt operator-(const ModInt &other) const