template<typename T>
inline void read(T& x) {
    x = 0;
    int f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {
        if (ch == '-') f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9') { 
        x = (x << 1) + (x << 3) + (ch ^ 48);
        ch = getchar();
    }
    x *= f;
}

template<typename T, typename ...Args>
inline void read(T& x, Args&... r) {
    read(x);
    read(r...);
}

发表回复