Artifact 395c6eb44878070252ff0bb48d24b9f642b08ad4:
0000: 0a 2f 2f 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d .//-------------
0010: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0020: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0030: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0040: 0a 2f 2f 20 45 6e 75 6d 65 72 61 74 65 20 63 6f .// Enumerate co
0050: 70 72 69 6d 65 20 70 79 74 68 61 67 6f 72 61 73 prime pythagoras
0060: 20 74 72 69 61 6e 67 6c 65 73 0a 2f 2f 0a 2f 2f triangles.//.//
0070: 20 56 65 72 69 66 69 65 64 20 62 79 0a 2f 2f 20 Verified by.//
0080: 20 20 2d 20 53 52 4d 20 35 39 39 20 44 69 76 31 - SRM 599 Div1
0090: 20 4c 56 32 0a 2f 2f 2d 2d 2d 2d 2d 2d 2d 2d 2d LV2.//---------
00a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
00b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
00c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
00d0: 2d 2d 2d 2d 0a 0a 0a 66 6f 72 28 69 6e 74 20 6d ----...for(int m
00e0: 3d 31 3b 3b 20 2b 2b 6d 29 0a 66 6f 72 28 69 6e =1;; ++m).for(in
00f0: 74 20 6e 3d 31 3b 20 6e 3c 6d 3b 20 2b 2b 6e 29 t n=1; n<m; ++n)
0100: 20 69 66 28 28 28 6d 5e 6e 29 26 31 29 20 26 26 if(((m^n)&1) &&
0110: 20 67 63 64 28 6d 2c 6e 29 3d 3d 31 29 0a 7b 0a gcd(m,n)==1).{.
0120: 09 69 6e 74 20 61 20 3d 20 6d 2a 6d 2d 6e 2a 6e .int a = m*m-n*n
0130: 2c 20 62 20 3d 20 32 2a 6d 2a 6e 2c 20 63 20 3d , b = 2*m*n, c =
0140: 20 6d 2a 6d 2b 6e 2a 6e 3b 0a 09 69 66 28 61 3e m*m+n*n;..if(a>
0150: 62 29 20 73 77 61 70 28 61 2c 62 29 3b 0a 7d 0a b) swap(a,b);.}.