#include<bits/stdc++.h>
#include "vision.h"
using namespace std;


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

int getMove1d(vector<int> v)
{
    long long mid=v.size()/2;

    if (v[mid]==1 && v[mid+1]==2)
    {
        return v.size()-1;
    }
    if (v[mid]==2 && v[mid+1]==3)
    {
        return v.size()-1;
    }
    if (v[mid]==3 && v[mid+1]==1)
    {
        return v.size()-1;
    }

    return 0;
}

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

pair<int, int>getMove2d(vector<vector<int>> v)
{
    long long mid=v.size()/2;
    long long firstans=0;
    long long secondans=0;

    if (v[mid][mid]==1 && v[mid][mid+1]==2)
    {
        secondans=v.size()-1;
    }
    if (v[mid][mid]==2 && v[mid][mid+1]==3)
    {
        secondans=v.size()-1;
    }
    if (v[mid][mid]==3 && v[mid][mid+1]==1)
    {
        secondans=v.size()-1;
    }

    if (v[mid][mid]==1 && v[mid+1][mid]==2)
    {
        firstans=v.size()-1;
    }
    if (v[mid][mid]==2 && v[mid+1][mid]==3)
    {
        firstans=v.size()-1;
    }
    if (v[mid][mid]==3 && v[mid+1][mid]==1)
    {
        firstans=v.size()-1;
    }

    return {firstans, secondans};
}
