250pt:
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
#define sqr(x) ( (x) * (x) )
#define eps 1e-9
typedef long long ll;
double dist ( ll x1, ll y1 , ll x2, ll y2) {
return sqrt( sqr(x1-x2) + sqr(y1-y2) ) ;
}
typedef pair<ll,ll> pii;
vector <pii> v1,v2;
class MaxTriangle {
public:
double calculateArea(int, int);
};
double MaxTriangle::calculateArea(int A, int B) {
double a = sqrt(A);
double b = sqrt(B);
v1.clear();
v2.clear();
for ( int x = 0 ; x <= a ; x++ ) {
int y = sqrt ( A - x*x ) ;
if (x*x + y*y == A) {
v1.push_back(make_pair(x,y));
}
}
for ( int x = 0 ; x <= b ; x++) {
int y = sqrt( B - x*x );
if (x*x + y*y == B) {
v2.push_back(make_pair(x,y));
}
}
double ans = -1.0;
double c,p,s;
for (int i = 0 ; i < (int)v1.size() ; i++)
for ( int j = 0 ; j < (int)v2.size() ; j++) {
c = dist( v1[i].first , v1[i].second , v2[j].first , v2[j].second ) ;
p = ( a + b + c ) / 2;
s = sqrt(p*(p-a)*(p-b)*(p-c));
if (s > ans) ans = s;
c = dist( v1[i].first , v1[i].second , -v2[j].first , v2[j].second ) ;
p = ( a + b + c ) / 2;
s = sqrt(p*(p-a)*(p-b)*(p-c));
if (s > ans) ans = s;
c = dist( v1[i].first , v1[i].second , v2[j].first , -v2[j].second ) ;
p = ( a + b + c ) / 2;
s = sqrt(p*(p-a)*(p-b)*(p-c));
if (s > ans) ans = s;
c = dist( v1[i].first , v1[i].second , -v2[j].first , -v2[j].second ) ;
p = ( a + b + c ) / 2;
s = sqrt(p*(p-a)*(p-b)*(p-c));
if (s > ans) ans = s;
}
return ans;
}