题目地址:https://acm.bnu.edu.cn/v3/contest_show.php?cid=8521#problem/A
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
using namespace std;
int p[3][3];
int ans[3];
void solve(int i)
{if(p[1][i]>p[2][i]) swap(p[1][i],p[2][i]);if(p[1][i]<=p[0][i]&&p[2][i]>=p[0][i])ans[i]=p[0][i]; else if(p[0][i]<=p[1][i]) ans[i]=p[1][i];else ans[i]=p[2][i];
}
int main(int argc, char const *argv[])
{for (int i=0;i<3;++i)for(int j=0;j<3;++j)cin>>p[i][j];int a=0;for (int i = 0; i < 3; ++i){solve(i);a+=(ans[i]-p[0][i])*(ans[i]-p[0][i]);}cout<<a<<endl;return 0;
}