#include #include #include using namespace atcoder; using mint = modint1000000007; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000000000000 int main(){ vector> xy(5); rep(i,5)cin>>xy[i].first>>xy[i].second; sort(xy.begin(),xy.end()); long long smin = Inf; do{ long long temp = 0; rep(i,5){ int a = i; int b = (i+1)%5; int c = (i+2)%5; temp += (xy[a].first-xy[b].first)*(xy[a].first-xy[b].first) + (xy[a].second-xy[b].second)*(xy[a].second-xy[b].second); } smin = min(smin,temp); //return 0; } while(next_permutation(xy.begin(),xy.end())); //cout<