-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.cpp
More file actions
99 lines (85 loc) · 1.91 KB
/
Copy pathtemplate.cpp
File metadata and controls
99 lines (85 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/**
* @file template.cpp
* @brief Universal Competitive Programming Boilerplate in C++
* @author Pratham Kashyap
*/
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <deque>
#include <bitset>
#include <numeric>
#include <iomanip>
#include <cassert>
using namespace std;
// Type Aliases
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
using vpii = vector<pii>;
using vpll = vector<pll>;
// Constants
constexpr ll INF64 = 2e18;
constexpr int INF32 = 1e9 + 7;
constexpr ll MOD = 1e9 + 7; // or 998244353
constexpr ld EPS = 1e-9;
constexpr ld PI = 3.14159265358979323846;
// Macros
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) static_cast<int>((x).size())
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
// Math Functions
template<typename T>
T gcd(T a, T b) { return b == 0 ? a : gcd(b, a % b); }
template<typename T>
T lcm(T a, T b) { return (a / gcd(a, b)) * b; }
ll mod_exp(ll base, ll exp, ll mod = MOD) {
ll res = 1;
base %= mod;
while (exp > 0) {
if (exp % 2 == 1) res = (__int128)res * base % mod;
base = (__int128)base * base % mod;
exp /= 2;
}
return res;
}
ll mod_inv(ll n, ll mod = MOD) {
return mod_exp(n, mod - 2, mod);
}
// Fast I/O Setup
void fast_io() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cout << fixed << setprecision(10);
}
// Problem Solution
void solve() {
// Write your solution here
}
int main() {
fast_io();
int t = 1;
if (cin >> t) {
while (t--) {
solve();
}
}
return 0;
}