/* package whatever; // don't place package name! */
class PythagoreanTriplet {
public static void main
(String[] args
) { int lim=1000/3;
for (int i = 2; i <=lim; i++) {
for (int j = i+1; j <= lim; j++) {
int c = j*j+i*i,
b=j*j-i*i,
a=2*i*j;
if(1000==a
+b
+c
)System.
out.
println("product: "+(a
*b
*c
)); }
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKY2xhc3MgUHl0aGFnb3JlYW5UcmlwbGV0IHsKICAgIAogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAgIGludCBsaW09MTAwMC8zOwogICAgICAgIGZvciAoaW50IGkgPSAyOyBpIDw9bGltOyBpKyspIHsKICAgICAgICAgICAgZm9yIChpbnQgaiA9IGkrMTsgaiA8PSBsaW07IGorKykgewogICAgICAgICAgICAgICAgaW50IGMgPSBqKmoraSppLAogICAgICAgICAgICAgICAgICAgICAgICBiPWoqai1pKmksCiAgICAgICAgICAgICAgICAgICAgICAgIGE9MippKmo7CiAgICAgICAgICAgICAgICBpZigxMDAwPT1hK2IrYylTeXN0ZW0ub3V0LnByaW50bG4oInByb2R1Y3Q6ICIrKGEqYipjKSk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgIAp9