快读
template <typename T>
void read(T &x) {
x = 0;
int f = 1;
char ch = getchar();
while(!isdigit(ch)) { //isdigit在<cctype>中
if (ch == '-') {
f = -1;
}
ch = getchar();
}
while(isdigit(ch)) {
x = x * 10 + (ch - 48);
ch = getchar();
}
x *= f;
return;
}
快写
template <typename T>
void write(T x) {
if(x < 0) {
putchar('-');
x = -x;
}
if(x > 9) {
write(x / 10);
}
putchar(x % 10 + '0');
return;
}