← RoseCode

ROSECODE 144

Equilateral triangles 2

sinan · Math ·

Assume a D point on the AB side of an ABC equilateral triangle with AD=x, BD=y, CD=z; 0 < x < y < z and x,y,z are all integers.

Let the sides of the ABC triangle be equal to s=x+y.

Find all such triangles for s<10^8.

Input format: cnt,sum of z's,sum of s's

Example: 35,1853,2081 for s<100

[My timing: <10s]