#line 1 "Main.cpp" #line 2 "nachia\\graph\\maximum-independent-set.hpp" #include #include #include namespace nachia{ std::vector MaximumIndependentSet(std::vector> matrix){ int n = matrix.size(); assert(1 <= n && n <= 1000); for(int i=0; i ans, tmp(n), can, idx(n); int tmpsz = 0; for(int i=0; i void { if((int)ans.size() < tmpsz) ans = std::vector(tmp.begin(), tmp.begin() + tmpsz); }; auto dfs = [&](std::vector::iterator subcan, int len, auto& self) -> void { if(ans.size() >= can.size() + len) return; if(len == 0) return registerTmp(); int ty = 0; for(int i=0; i= 3){ ty = 2; } } if(ty){ int p = subcan[0], cnt = 1; for(int i=1; i=1; j--) for(int i=j+1; i vis(len, 0); int cnt = 0; for(int s=0; s int main(){ int S; scanf("%d", &S); long long x = S; auto next = [&]() -> long long { return x = x * 12345 % 1000003; }; int N = next() % 120 + 2; int P = next(); std::vector> G(N, std::vector(N)); for(int i=0; i= P) G[i][j] = G[j][i] = 1; std::vector ans = nachia::MaximumIndependentSet(G); for(int& a : ans) a++; int K = ans.size(); printf("%d\n", K+1); for(int i=0; i