#include "triangles.h"


std::vector<std::vector<int>> solve(int n){
    for (int cen = 1; cen <= n; cen++) {
        std::vector<int> a;
        for (int i = 1; i <= n; i++) if (cen != i) a.push_back(i);
        std::vector<Triangle> left = {Triangle(a[0], a[1], cen), Triangle(a[0], a[2], cen), Triangle(a[1], a[2], cen)};
        std::vector<Triangle> right = {Triangle(a[0], a[1], a[2])};
        if (compare(left, right) == 0) {
            return {{a[0], a[1], cen}, {a[1], a[2], cen}, {a[2], a[0], cen}};
        }
    }

    std::vector<Triangle> left = {Triangle(1, 2, 3), Triangle(2, 3, 4)};
    std::vector<Triangle> right = {Triangle(1, 4, 2), Triangle(1, 4, 3)};
    if (compare(left, right) == 0) {
        return {{1, 2, 3}, {2, 3, 4}};
    }
    
    left = {Triangle(1, 2, 3), Triangle(1, 2, 4)};
    right = {Triangle(3, 4, 2), Triangle(1, 4, 3)};
    if (compare(left, right) == 0) {
        return {{1, 2, 3}, {2, 1, 4}};
    }

    return {{1, 3, 2}, {1, 3, 4}};
}