How long haven’t I log in this website? It always brings me back to the old days of bittersweetness.
快读快写模板 Pro Max
namespace QuickIO {
template<typename T> inline void read(T &x) {
x = 0; signed op = 1; char ch = getchar();
for (; !isdigit(ch); ch = getchar()) if (ch == '-') op = -1;
for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
x *= op;
}
template<typename T, typename ...Args> inline void read(T &x, Args &...rest) {
read(x), read(rest...);
}
template<typename T> void write(T x) {
if (x < 0) putchar('-'), x = -x;
if (x > 9) write(x / 10);
putchar(x % 10 + '0');
}
template<> void write<char>(char x) {
putchar(x);
}
template<typename T, typename ...Args> void write(T x, Args ...rest) {
write(x), write(rest...);
}
}