#include <bits/stdc++.h>
#include "vision.h"

using namespace std;

std::vector<int> getVisionPattern1d()
{
    return {2, 1, 1, 3, 1};
}

int getMove1d(std::vector<int> v)
{
    int sz = v.size();
    if(v[sz / 2] == 1) {
        for(int i = 0; i < sz; i++) {
            if(v[i] == 3) {
                return i;
            }
        }
        for(int i = 0; i < sz; i++) {
            if(v[i] == 1 && i != sz / 2) {
                return i;
            }
        }
        assert(0);
    }
    if(v[sz / 2] == 3) {
        if(v == vector<int>{2, 1, 1, 3, 1, 2, 1}) {
            return 5;
        } else {
            return 1;
        }
    }
    if(v[sz / 2] == 2) {
        if(v == vector<int>{3, 1, 2, 1, 1}) {
            return 4;
        } else {
            return 0;
        }
    }
}

std::vector<std::vector<int>> getVisionPattern2d()
{
    return {{1}};
}

std::pair<int, int> getMove2d(std::vector<std::vector<int>> v)
{
    return {0, 0};
}
