#include <iostream>
#include <vector>
#include <cmath>
#include <math.h>
#include <limits>
usingnamespace std;
int main()
{
cout << "h" << endl;
// insert code here...
int x;
int a = 1;
int b = 2;
int c = 3;
int d = 0;
int total;
vector<int>v;
for (;c < 1000; c++)
{
double root = sqrt(double(c));
if(int(root + 0.5) * int(root + 0.5) == c) // is root integer?
v.push_back(c);
}
for (; b < 1000; b++)
{
for (int i = 0; i <= v.size(); i++)
{
d = v.[i];
if ((a * a) + (b * b) == d * d)
{if ( a + b + d == 1000)// checks if the pythagorean triplet adds up to 1k.
cout << a * b * d; }
}
if (b == 998)
{
b = 2;
a++;
}
}
return 0;
}