#ifndef ONLINE_JUDGE
#define pia getchar
#else
#define pia nc
#endif
char nc(){
static char buf[1<<25],*p=buf,*q=buf;
if(p==q&&(q=(p=buf)+fread(buf,1,1<<25,stdin),p==q))return EOF;
return *p++;
}
template<class T>void read(T&x){
short f=1;x=0;
char ch=pia();
while(!isdigit(ch)){
if(ch=='-')f=-1;
ch=pia();
}while(isdigit(ch)){
x=(x<<1)+(x<<3)+(ch^48);
ch=pia();
}x*=f;
}
template<class T>void write(T x){
if(x<0)putchar('-'),x=-x;
if(x>=10)write(x/10);
putchar(x%10+48);
}
文件输入里有字符时大概率就不能用了,求dalao解答+修改(如果珂以的话)