#include <iostream> #include <sstream> #include <vector> using namespace std; vector <pair <long long,long long> > punkty; int main() { int x, y, n; long long a, b, c; int licznik = 0; stringstream ss; cin >> n; while(cin >> x){ cin >> y; punkty.push_back(make_pair(x,y)); } for(int i = 0; i < n-2; i++) for(int j = i + 1; j < n-1; j++) for(int k = j + 1; k < n; k++){ a = (punkty[i].first - punkty[j].first) * (punkty[i].first - punkty[j].first) + (punkty[i].second - punkty[j].second) * (punkty[i].second - punkty[j].second); b = (punkty[i].first - punkty[k].first) * (punkty[i].first - punkty[k].first) + (punkty[i].second - punkty[k].second) * (punkty[i].second - punkty[k].second); c = (punkty[j].first - punkty[k].first) * (punkty[j].first - punkty[k].first) + (punkty[j].second - punkty[k].second) * (punkty[j].second - punkty[k].second); if(a&&b&&c){ if((a == b + c)||(b == a + c)||(c == a + b)){ licznik++; ss << i <<", " << j <<", "<< k << endl; } } } cout << licznik << endl; cout << ss.str(); return 0; }
13 0 0 0 3 2 0 0 6 4 0 4 6 10 1 2 3 -1 0 0 -1 999999 -999999 999999 999999 -999999 999999
28 0, 1, 2 0, 1, 4 0, 1, 7 0, 1, 8 0, 2, 3 0, 2, 7 0, 2, 9 0, 3, 4 0, 3, 5 0, 3, 8 0, 4, 5 0, 4, 9 0, 8, 9 0, 10, 11 0, 11, 12 1, 2, 7 1, 3, 5 1, 3, 7 1, 7, 9 2, 4, 5 2, 4, 7 2, 7, 8 3, 4, 5 3, 5, 9 4, 5, 8 5, 6, 8 7, 8, 9 10, 11, 12