#include <algorithm>
#include <iostream>
#include <limits>
#include <numeric>
#include <vector>
using namespace std;
int main() {
auto func = [](auto x, auto y) {
if constexpr (is_pointer<decltype(x)>::value) {
cout << "x : " << *x << ", y : " << *y << endl;
cout << "midpoint : " << *midpoint(x, y) << endl << endl;
} else {
cout << "x : " << x << ", y : " << y << endl;
cout << "midpoint : " << midpoint(x, y) << endl << endl;
}
};
func(1, 3);
func(1, 6);
func(numeric_limits<int>::max() - 2, numeric_limits<int>::max());
vector<int> v = {1, 2, 3};
func(v.data(), v.data() + v.size() - 1);
return 0;
}