#t296. 完美立方
完美立方
Perfect Cubes
Problem Background
Special for beginners, ^_^
Problem Description
An equation of the form is called a perfect cube equation. For example .
Write a program that, for a given positive integer , finds all quadruples such that , where are greater than , less than or equal to , and .
Input Format
A positive integer .
Output Format
Output one perfect cube per line, in the following format:
Cube = a, Triple = (b,c,d)
where are replaced by the actual values of the quadruple.
Output in ascending order of . When two perfect cube equations have the same , output the one with the smaller first; if still equal, the smaller first; if still equal, the smaller first.
Sample Input
24
Sample 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)
Constraints
1s, 1024KiB for each test case.