快读快写模板:
int read(){
int x=0,f=1;
char ch=getchar();
while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
while(isdigit(ch)){x=(x<<3)+(x<<1)+(ch^48);ch=getchar();}
return x*f;
}
void write(int x){
if(x<0)x=-x,putchar('-');
if(x>9)write(x/10);
putchar(x%10+48);
}
//
bool is_ch(char c){return (c>='a'&&c<='z')||(c>='A'&&c<='Z')||isdigit(c);}
string read_str(){
string res="";
char ch=getchar();
while(!is_ch(ch))ch=getchar();
while(is_ch(ch))res+=ch,ch=getchar();
return res;
}
char read_ch(){
char ch=getchar();
while(!is_ch(ch))ch=getchar();
return ch;
}
void write_str(string s){for(char c:s)putchar(c);}