UVa 386 - Perfect Cubes

Problem Number - Problem Name

 * UVA 386
 * SPOJ CUBES
 * PKU 1543
 * JLU 1611

Summary
Find all instances of four integers, {a, b, c, d}, where a3=b3+c3+d3 and 1 < {a,b,c,d} <= 2000. Sort the list and triplets, and print the entries according to the specified output.

Note: The problem description varies slightly; read the specification for any differences.

Explanation
Explanation of the ideas behind the solution goes here.

Gotchas

 * {a,b,c,d} > 1.

Optimizations

 * Explicit sorting should not be required.

Input
No input, unless otherwise specified by the problem.

Output
Cube = 6, Triple = (3,4,5) Cube = 12, Triple = (6,8,10) Cube = 18, Triple = (2,12,16) Cube = 18, Triple = (9,12,15) Cube = 19, Triple = (3,10,18) Cube = 20, Triple = (7,14,17) Cube = 24, Triple = (12,16,20)