#P7464. The Silence of the Lamps
The Silence of the Lamps
The Silence of the Lamps
This problem is adapted from [CERC2018](https://contest.felk.cvut.cz/18cerc/) – The Silence of the Lamps.
Initially, if you have never seen a table lamp before, imagine it as a transparent rectangular box (i.e. a box whose faces are rectangles) filled with gas. All of its edge lengths are positive integers. In a bizarre twist of fate, one lecturer was once sentenced for vandalizing street lamps because he believed that some of them screamed at him.
According to his peculiar behavior, he would only recognize and destroy those lamps that satisfy both of the following criteria:
- The lamp has at least one face that is not a square. Since a cuboid has three distinct face types – with dimensions \(a \times b\), \(a \times c\), and \(b \times c\) – note that a lamp with \(a = b = c\) (a cube) has all faces square, whereas any non-cube has at least one rectangular (non-square) face.
- The volume of the lamp is at most \(N\), i.e. \(a \times b \times c \le N\).
Your task is to count all possible lamps (i.e. rectangular boxes with positive integer dimensions) that meet the lecturer’s conditions. When counting, two lamps are considered the same if their dimensions are the same regardless of ordering; hence, you should consider only triples \((a, b, c)\) with \(a \le b \le c\). In other words, do not count cubes (\(a = b = c\)) even if their volume is within the limit.
inputFormat
The input consists of a single integer \(N\) (where \(1 \le N\le 10^9\) for example), the maximum allowed volume of a lamp.
outputFormat
Output a single integer: the number of possible lamps (rectangular boxes with integer edge lengths and \(a \le b \le c\)) that have a volume of at most \(N\) and are not cubes (i.e. not all three edges equal).
sample
1
0