atcoder#AGC003D. [AGC003D] Anticube
[AGC003D] Anticube
Score : points
Problem Statement
Snuke got positive integers from his mother, as a birthday present. There may be duplicate elements.
He will circle some of these integers. Since he dislikes cubic numbers, he wants to ensure that if both and are circled, the product is not cubic. For example, when , it is not possible to circle both and at the same time. It is not possible to circle both and at the same time, either.
Find the maximum number of integers that Snuke can circle.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
:
Output
Print the maximum number of integers that Snuke can circle.
8
1
2
3
4
5
6
7
8
6
Snuke can circle .
6
2
4
8
16
32
64
3
10
1
10
100
1000000007
10000000000
1000000009
999999999
999
999
999
9