def rightangletriangles(i):
    """genearate all the possible right angle triangles with integer edge
    for the given integer perimeter i
    list of tuple: [(longest, secondlong, shortest), ..] 
    """
    lmin=int(i/(1+2**0.5))
    lmax=int(i/2)
    lt=[]
    for l in range(lmin, lmax):
        #
        for s in range( int((i-l)/(2**0.5)) ,l):
            t=i-l-s
            if l*l==s*s+t*t:
                lt.append((l,s,t))
        #
    if lt: print(i,lt)
    return lt