import java.util.ArrayList;
import java.util.List;
public class Main {
static double area(int x1, int y1, int x2, int y2, int x3, int y3) {
return Math.abs((x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2))/2.0);
}
static boolean isInsideTriangle(int x1, int y1, int x2, int y2, int x3, int y3, int x, int y) {
double A = area(x1, y1, x2, y2, x3, y3);
double A1 = area(x, y, x2, y2, x3, y3);
double A2 = area(x1, y1, x, y, x3, y3);
double A3 = area(x1, y1, x2, y2, x, y);
return A == A1 + A2 + A3;
}
static List<List<Integer>> noPointInsideTriangle(List<List<Integer>> points) {
for (int i = 0; i < points.size(); i++) {
for (int j = i+1; j < points.size(); j++) {
for (int k = j+1; k < points.size(); k++) {
boolean inside = false;
for (int l = 0; l < points.size(); l++) {
if (l != i && l != j && l != k) {
if (isInsideTriangle(points.get(i).get(0), points.get(i).get(1), points.get(j).get(0), points.get(j).get(1), points.get(k).get(0), points.get(k).get(1), points.get(l).get(0), points.get(l).get(1))) {
inside = true;
break;
}
}
}
if (!inside) {
List<List<Integer>> result = new ArrayList<>();
result.add(points.get(i));
result.add(points.get(j));
result.add(points.get(k));
return result;
}
}
}
}
return null;
}
public static void main(String[] args) {
List<List<Integer>> points = new ArrayList<>();
points.add(new ArrayList<Integer>(){{add(0); add(0);}});
points.add(new ArrayList<Integer>(){{add(0); add(2);}});
points.add(new ArrayList<Integer>(){{add(2); add(0);}});
points.add(new ArrayList<Integer>(){{add(2); add(2);}});
points.add(new ArrayList<Integer>(){{add(1); add(1);}});
List<List<Integer>> result = noPointInsideTriangle(points);
if (result != null) {
System.out.println(result);
} else {
System.out.println("No triangle found.");
}
}
}