#include <bits/stdc++.h>
using namespace std;
#define N 210
#define M 40010
int f[N][M * 2];
int n;
int xi[N], yi[N];
double ans;
void solve(int d[])
{
for (int i = 0; i <= n; ++ i)
for (int j = -M; j < M; ++ j)
f[i][j + M] = 0;
f[0][M] = 1;
for (int i = 0; i < n; ++ i)
for (int j = -M; j < M; ++ j)
if (f[i][j + M])
f[i + 1][j + d[i + 1] + M] = f[i + 1][j - d[i + 1] + M] = 1;
for (int i = 0; i < M; ++ i)
if (f[n][M + i] || f[n][M - i])
{
ans += pow(i, 2);
break;
}
}
int main()
{
scanf("%d", &n);
for (int i = 1; i <= n; ++ i)
{
scanf("%d%d", &xi[i], &yi[i]);
ans -= pow(xi[i], 2) + pow(yi[i], 2);
}
solve(xi);
solve(yi);
printf("%.2lf", ans / 2);
}
12711:[Violet 2]After 17
最新推荐文章于 2024-09-04 21:39:45 发布