#include "triangles.h"
#include <algorithm>
#include <vector>

std::vector<std::vector<int>> solve(int n) {
    Triangle bst = {0, 1, 2};
    for (int i = 3; i < n; ++i) {
        Triangle cur{0, 1, i};
        if (compare({cur}, {bst}) == 1) {
            bst = cur;
        }
    }
    for (int i = 0; i < n; ++i) {
        if (i == bst.i or i == bst.k) continue;
        Triangle cur{0, i, bst.k};
        if (compare({cur}, {bst}) == 1) {
            bst = cur;
        }
    }
    for (int i = 0; i < n; ++i) {
        if (i == bst.j or i == bst.k) continue;
        Triangle cur{i, cur.j, cur.k};
        if (compare({cur}, {bst}) == 1) {
            bst = cur;
        }
    }
    return {{bst.i, bst.j, bst.k}};
}
