#include "testlib.h" #include using namespace std; using ll = long long; using pll = pair; #define all(a) begin(a), end(a) #define space inf.readSpace() #define endl inf.readEoln() #define eof inf.readEof() tuple read(ll min, ll max){ ll a = inf.readLong(min, max); endl; return tuple{a}; } template auto read(ll min, ll max, T... t){ ll a = inf.readLong(min, max); space; return tuple_cat(tuple{a}, read(t...)); } string read(string p){ return inf.readLine(p); } vector reads(ll N, ll min, ll max){ auto a = inf.readLongs(N, min, max); endl; return a; } vector read_lines(ll N, string p){ return inf.readLines(N, p); } template auto read_lines(ll N, T... t){ vector a; a.reserve(N); while(N--) a.push_back(read(t...)); return a; } vector> read_matrix(ll H, ll W, ll min, ll max){ vector> ans(H); for(auto& v : ans) v = reads(W, min, max); return ans; } int main(){ registerValidation(); auto [N, M] = read(2, 500, 0, 500 * 500); ensure(M <= N * N); eof; }