| 2 | #include "../code/mathematics/mod_inv.cpp" |
| 3 | |
| 4 | struct Mod { |
| 5 | ll x; |
| 6 | Mod(ll _x = 0) { |
| 7 | x = (_x % 1000000007 + 1000000007) % 1000000007; |
| 8 | } |
| 9 | Mod operator +(const Mod &other) const { |
| 10 | return x + other.x; |
| 11 | } |
| 12 | Mod operator -(const Mod &other) const { |
| 13 | return x - other.x; |
| 14 | } |
| 15 | Mod operator -() const { |
| 16 | return -x; |
| 17 | } |
| 18 | Mod operator *(const Mod &other) const { |
| 19 | return x * other.x; |
| 20 | } |
| 21 | Mod operator /(const Mod &other) const { |
| 22 | return x * mod_inv(other.x, 1000000007); |
| 23 | } |
| 24 | bool operator ==(const Mod &other) const { |
| 25 | return x == other.x; |
| 26 | } |
| 27 | }; |
| 28 | ostream& operator <<(ostream &outs, const Mod &x) { |
| 29 | return outs << x.x; |
| 30 | } |
nothing calls this directly
no outgoing calls
no test coverage detected