#include #include "testlib.h" int main() { registerValidation(); const int N = inf.readInt(1, 2000); inf.readChar('\n'); for (int i = 1; i < N; i++) { inf.readInt(2, 2000); inf.readChar(" \n"[i + 1 == N]); } const std::string M = inf.readString(); inf.readEof(); ensure(1 <= M.size() && M.size() <= 7000); for (const char d : M) ensure('0' <= d && d <= '9'); ensure(M[0] != '0'); }