#include <iostream>
#include <map>
#include <tuple>
#include <vector>

struct Point2f
{
    Point2f(double x, double y) : x(x), y(y) {}
    
    double x;
    double y;
};


std::ostream& operator << (std::ostream& os, const Point2f& pt)
{
    return os << "[" << pt.x << ", " << pt.y << "]";
}

bool operator < (const Point2f& lhs, const Point2f& rhs)
{
    return std::tie(lhs.x, lhs.y) < std::tie(rhs.x, rhs.y);
}

int main()
{
    std::vector<Point2f> points_1, points_2;
    
    points_1.push_back(Point2f(1.0, 2.0));
    points_1.push_back(Point2f(2.0, 2.0));
    points_1.push_back(Point2f(3.0, 2.0));
    points_1.push_back(Point2f(1.0, 2.0));
    points_1.push_back(Point2f(2.0, 2.0));
    points_1.push_back(Point2f(3.0, 2.0));
    points_1.push_back(Point2f(1.0, 2.0));
    
    points_2.push_back(Point2f(1.0, 1.0));
    points_2.push_back(Point2f(1.0, 1.0));
    points_2.push_back(Point2f(1.0, 2.0));
    points_2.push_back(Point2f(1.0, 1.0));
    points_2.push_back(Point2f(1.0, 1.0));
    points_2.push_back(Point2f(1.0, 1.0));
    points_2.push_back(Point2f(1.0, 1.0));

    std::vector<std::pair<Point2f, Point2f>> point_pairs;
    for (size_t i = 0; i < points_1.size(); i++) {
        std::cout << points_1[i] << " " << points_2[i] << std::endl;
        point_pairs.push_back(std::make_pair(points_1[i], points_2[i]));
    }
    
    std::cout << "==========\n";
    
    std::map<std::pair<Point2f, Point2f>, int> counts;
    
    for (const auto& p : point_pairs) {
        ++counts[p];
    }
    
    for (const auto& p : counts) {
        const auto& p1 = p.first.first;
        const auto& p2 = p.first.second;
        int count = p.second;
        std::cout << p1 << " " << p2 << " - " << count << " Occurrence(s)\n";
    }
    
}
