Rt
Code:
namespace Mashiro {
template<typename T>inline void read(T& x) {
x=0;int f=1;
char ch=getchar();
while(!isdigit(ch)){if(ch=='-')f=~f+1;ch=getchar();}
while (isdigit (ch)) {x=(x<<3)+(x<<1)+(ch^48);ch=getchar();}
x*=f;
}
template <typename T,typename... Args> inline void read(T& x, Args&... args) {
read(x);
read(args...);
}
template<typename T>inline void write(T x) {
static int buf[40],top=0;
if(x<0)putchar('-'),x=~x+1;
while(x)buf[++top]=x%10,x/=10;
if(top==0)buf[++top]=0;
while (top) putchar(buf[top--]^48);
putchar(' ');
}
template <typename T,typename... Args> inline void write(T x, Args... args) {
write(x);
write(args...);
}
}