text: If there are multiple figures consistent with sensor data, describe any of them.For your convenience, the sample output is formatted as follows: there are n separate sections for blocks having x = 1, x = 2, ..., x = n; each section consists of m lines containing k integers each.Note that this type of output is acceptable, but you may print the integers with any other formatting instead (even all integers on the same line), only their order matters.Examples Input 4 3 2 1 4 3 2 6 5 1 4 3 2 6 7 1 4 1 4 0 0 0 7 6 5 6 5 0 0 0 7 1 3 6 1 3 6 0 0 0 0 0 7 4 3 5 4 2 5 0 0 0 0 0 7 Output 1 4 3 0 6 5 1 4 3 2 6 5 0 0 0 0 0 0 0 0 0 0 0 7 Input 1 1 1 0 0 0 0 0 0 Output 0 Input 1 1 1 0 0 1337 0 0 0 Output -1 Input 1 1 1 1337 1337 1337 1337 1337 1337 Output 1337 # Solution #include <bits/stdc++.h> using namespace std; template <class T> istream& operator>>(istream& is, vector<T>& v) { for (T& x : v) is >> x; return is; } template <class T> ostream& operator<<(ostream& os, const vector<T>& v) { if (!v.empty()) { os << v.front(); for (int x = 1; x < v.size(); ++x) os << ' ' << v[x]; } return os; } void gg() { cout << "-1\n"; exit(0); } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, m, k; cin >> n >> m >> k; vector<vector<vector<int>>> ans(n, vector<vector<int>>(m, vector<int>(k, -1))); vector<vector<int>> xp(m, vector<int>(k)), xn(m, vector<int>(k)), yp(n, vector<int>(k)), yn(n, vector<int>(k)), zp(n, vector<int>(m)), zn(n, vector<int>(m)), pxp(m, vector<int>(k)), pxn(m, vector<int>(k, n - 1)), pyp(n, vector<int>(k)), pyn(n, vector<int>(k, m - 1)), pzp(n, vector<int>(m)), pzn(n, vector<int>(m, k - 1)); cin >> xp >> xn >> yp >> yn >> zp >> zn; queue<tuple<int, int, int>> q; for (int x = 0; x < n; ++x) for (int y = 0; y < m; ++y) for (int z = 0; z < k; ++z) if (!(xp[y][z] && xn[y][z] && yp[x][z] && yn[x][z] && zp[x][y] && zn[x][y])) ans[x][y][z] = 0; function<void(int, int)> exx = [&](int y, int z) { while (pxp[y][z] < n && !