-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
87 lines (70 loc) · 1.54 KB
/
main.cpp
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
//pragma
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define YOU using
#define DONT namespace
#define SAY std
YOU DONT SAY;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
typedef pair<int,ll> pil;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<pll> vll;
#define REPP(i,a,b,d) for(int i=a;i<=b;i+=d)
#define REP(i,a,b) REPP(i,a,b,1)
#define REVV(i,a,b,d) for(int i=a;i>=b;i-=d)
#define REV(i,a,b) REVV(i,a,b,1)
#define FOR(i,a) for(int i=0; i<a; i++)
#define FORD(i,a) for(int i=(int)a-1; i>=0; i--)
#define ALL(v) v.begin(), v.end()
#define pb push_back
#define F first
#define S second
const int OO = 1e9;
const ll INF = 1e18;
const int irand(int lo,int hi){
return ((double)rand()/(RAND_MAX + 1.0)) * (hi-lo+1) + lo;
}
const ll lrand(ll lo,ll hi){
return ((double)rand()/(RAND_MAX + 1.0)) * (hi-lo+1) + lo;
}
#define getc getchar
template<typename T>
T getnum(){
int sign = 1;
T ret = 0;
char c;
do{
c = getc();
}while(c == ' ' || c == '\n');
if(c == '-')sign = -1;
else ret = c-'0';
while(1){
c = getc();
if(c < '0' || c > '9')break;
ret = 10*ret + c-'0';
}
return sign * ret;
}
inline void ini(int& x){
x = getnum<int>();
}
inline void scani(int& x){
scanf("%d",&x);
}
//end of macro
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#define endl '\n'
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(10);
return 0;
}