贴一个有趣的板子,考试懒得码了(有可能有错)
#include<bits/stdc++.h>
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef double lf;
typedef long double llf;
typedef std::pair<int,int> pii;
#define xx first
#define yy second
template<typename T> inline T max(T a,T b){return a>b?a:b;}
template<typename T> inline T min(T a,T b){return a<b?a:b;}
template<typename T> inline T abs(T a){return a>0?a:-a;}
template<typename T> inline T gcd(T a,T b){T t;if(a<b){while(a){t=a;a=b%a;b=t;}return b;}else{while(b){t=b;b=a%b;a=t;}return a;}}
template<typename T> inline T sqr(T x){return x*x;}
#define mpr(a,b) std::make_pair(a,b)
#define pb push_back
#define I inline
#define mset(a,b) memset(a,b,sizeof(a))
#define mcpy(a,b) memset(a,b,sizeof(a))
#define f0(i,s,t) for(int i=s,i##end=t;i<i##end;++i)
#define f1(i,s,t) for(int i=s,i##end=t;i<=i##end;++i)
#define f2(i,t,s) for(int i=t;i##end=s;i>=i##end;--i)
#define f3(i,t,s) for(int i=t;i##end=s;i>i##end;--i)
#define gc getchar()
#define pc(x) putchar((x))
#define OP operator
#define RT return *this
#define uc unsigned char
#define rd x=0;uc ch=gc;while((ch<'0'||ch>'9')&&ch!='-')ch=gc;bool f=0;if(ch=='-')ch=gc,f=1;\
x=ch-'0';for(ch=gc;ch>='0'&&ch<='9';ch=gc)x=(x<<1)+(x<<3)+(ch^48);if(f)x=-x
#define wt(S) if(x){if(x<0)pc('-'),x=-x;uc s[(S)],c=0;while(x)s[c++]=x%10+'0',x/=10;while(c--)pc(s[c]);}else pc('0')
I void read(int&x){rd;}
I void write(int x){wt(10);std::cout<<'\n';}
I void read(ll&x){rd;}
I void write(ll x){wt(20);std::cout<<'\n';}
using namespace std;