#include <bits/stdc++.h>
#include "vision.h"
using namespace std;
void construct_network(int n, int m, int k) {
auto f = [&](int i, int j) {
return i * m + j;
};
set<array<int, 2>> s;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
for (int x = 0; x < n; x++) {
for (int y = 0; y < m; y++) {
if (abs(i - x) + abs(j - y) == k) {
int a = f(i, j), b = f(x, y);
if (!s.count({a, b}) && !s.count({b, a})) {
s.insert({a, b});
}
}
}
}
}
}
vector<int> pos;
int ptr = n * m;
for (auto [x, y] : s) {
add_and({x, y});
pos.push_back(ptr++);
}
add_or(pos);
}