#pragma GCC optimize(3)
#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
#pragma GCC optimize("-foptimize-sibling-calls")
namespace fast_IO {
#define IOSIZE (1<<20)
char ibuf[IOSIZE],obuf[IOSIZE];
char *p1=ibuf,*p2=ibuf,*p3=obuf;
#define getchar() ((p1==p2)&&(p2=(p1=ibuf)+fread(ibuf,1,IOSIZE,stdin),p1==p2)?EOF:*p1++)
#define putchar(x) ((p3==obuf+IOSIZE)&&(fwrite(obuf,p3-obuf,1,stdout),p3=obuf),*p3++ =x)
#define isdigit(ch) (ch>47&&ch<58)
#define isspace(ch) (ch<33)
template<typename T>inline T read(){T s=0;int w=1;char ch;while(ch=getchar(),!isdigit(ch)&&(ch!=EOF))if(ch=='-')w=-1;if(ch==EOF)return false;while(isdigit(ch))s=s*10+ch-48,ch=getchar();return s*w;}
template<typename T>inline bool read(T &s){s=0;int w=1;char ch;while(ch=getchar(),!isdigit(ch)&&(ch!=EOF))if(ch=='-')w=-1;if(ch==EOF)return false;while(isdigit(ch))s=s*10+ch-48,ch=getchar();s*=w;return true;}
template<typename T>inline void print(T x){if(x<0)putchar('-'),x=-x;if(x>9)print(x/10);putchar(x%10+48);}
template<>inline void print(int x){if (x<0)putchar('-'),x=-x;static char buf[16];int n=0;do{buf[n++]=x%10+48;x/=10;}while(x);while(n--)putchar(buf[n]);}
template<>inline void print(long long x){if (x<0)putchar('-'),x=-x;static char buf[24];int n=0;do{buf[n++]=x%10+48;x/=10;}while(x);while(n--)putchar(buf[n]);}
inline bool read(char &s){while(s=getchar(),isspace(s));return true;}
inline bool read(char *s){char ch;while(ch=getchar(),isspace(ch));if(ch==EOF)return false;while(!isspace(ch))*s++ =ch,ch=getchar();*s='\0';return true;}
inline void print(char x){putchar(x);}
inline void print(char *x){while (*x)putchar(*x++);}
inline void print(const char *x){for(int i=0;x[i];i++)putchar(x[i]);}
inline bool read(std::string &s){s="";char ch;while(ch=getchar(),isspace(ch));if(ch==EOF)return false;while(!isspace(ch))s+=ch,ch=getchar();return true;}
inline void print(std::string x){for(int i=0,n=x.size();i<n;i++)putchar(x[i]);}
inline bool read(bool &b){char ch;while (ch=getchar(),isspace(ch));b=(ch!='0'&&ch!='f');return true;}
inline void print(bool b){putchar(b?'1':'0');}
template<typename T, typename... T1>inline int read(T& a, T1&... other){return read(a)+read(other...);}
template<typename T, typename... T1>inline void print(T a,T1... other){print(a);print(other...);}
struct Fast_IO {~Fast_IO(){fwrite(obuf,p3-obuf,1,stdout);}}io;
template<typename T>Fast_IO&operator>>(Fast_IO &io, T &b){read(b);return io;}
template<typename T>Fast_IO&operator<<(Fast_IO &io, T b){print(b);return io;}
}using namespace fast_IO;
#define cout io
#define cin io
#define endl '\n'火车头-plus
这是 2026年7月22日 存档的第 2 版,不是当前版本。查看当前版本