#include #include"testlib.h" using namespace std; using ll = long long; const ll HWmin = 1, HWmax = 1'000'000; int main(){ registerValidation(); ll H = inf.readLong(HWmin,HWmax); inf.readSpace(); ll W = inf.readLong(HWmin,HWmax); inf.readEoln(); inf.ensuref(H*W <= HWmax,"H x W > 1'000'000"); for (ll i = 0; i < H; i++){ string s = inf.readString(); inf.ensuref((ll)(s.size()) == W, "S[i] size is not W"); for (auto c : s){ inf.ensuref(c == '#' || c == '.', "S[i][j] must be '#' or '.'"); } } inf.readEof(); }