1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| namespace ExtIO { inline void readchar(char& x) { for (x = getchar(); !std::isalpha(x); x = getchar()); }
template<typename _Tp, typename _Tpp> inline void readln(_Tp a[], _Tpp w) { for (reg _Tpp i = 1; i <= w; ++i) read(a[i]); } template<typename _Tp, typename _Tpp> inline void readln(_Tp a[], _Tpp l, _Tpp r) { for (reg _Tpp i = l; i <= r; ++i) read(a[i]); }
template<typename _Tp> inline void writespace(_Tp x) { write(x); putchar(' '); } template<typename _Tp, typename ...Args> inline void writespace(_Tp& x, Args& ...args) { writespace(x), writespace(args...); }
template<typename _Tp> inline void writeln(_Tp x) { write(x); putchar('\n'); } template<typename _Tp, typename ...Args> inline void writeln(_Tp& x, Args& ...args) { writespace(x), writespace(args...), putchar('\n'); } template<typename _Tp, typename _Tpp> inline void writeln(_Tp a[], _Tpp w) { for (reg _Tpp i = 1; i <= w; ++i) writespace(a[i]); putchar('\n'); } template<typename _Tp, typename _Tpp> inline void writeln(_Tp a[], _Tpp l, _Tpp r) { for (reg _Tpp i = l; i <= r; ++i) writespace(a[i]); putchar('\n'); } }; using namespace ExtIO;
|