#include #include #include #include #include #include #include using namespace std; struct Xy { int x; int y; }; int main() { clock_t t1 = clock(); ifstream inp; inp.open("block.in"); int N, a, b, c, d, e, f; inp>>N>>a>>b>>c>>d>>e>>f; std::vector result; int stride = 6; int i = 0, j = 0; while (true) { c = (c^a)+b; f = (f^d)+e; int c5 = c%5; int f4 = f%4; Xy xy = {}; if (j+stride>=N) { i += stride; j=0; } if (i+stride>=N) { break; } if (c5<2) { xy.x = i+2; xy.y = j+2; j+=4; } else if (c5==3) { xy.x = i+3; xy.y = j+3; j+=stride; } else { xy.x = i+3; xy.y = j+3; j+=5; } result.push_back(xy); } ofstream out; out.open("block.out"); out<