description: Polycarp likes squares and cubes of positive integers. Here is the beginning of the sequence of numbers he likes: 1, 4, 8, 9, ....
  
  For a given number n, count the number of integers from 1 to n that Polycarp likes. In other words, find the number of such x that x is a square of a positive integer number or a cube of a positive integer number (or both a square and a cube simultaneously).
  
  Input
  
  The first line contains an integer t (1 ≤ t ≤ 20) — the number of test cases.
  
  Then t lines contain the test cases, one per line. Each of the lines contains one integer n (1 ≤ n ≤ 10^9).
  
  Output
  
  For each test case, print the answer you are looking for — the number of integers from 1 to n that Polycarp likes.
  
  Example
  
  Input
  
  
  6
  10
  1
  25
  1000000000
  999999999
  500000000
  
  
  Output
  
  
  4
  1
  6
  32591
  32590
  23125
solution: #include <bits/stdc++.h>
  #pragma GCC optimize("Ofast")
  #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
  #pragma GCC optimize("unroll-loops")
  using namespace std;
  long long MOD = 998244353;
  double eps = 1e-12;
  void solve() {}
  long long countSquares(long long a, long long b) {
    return (floor(sqrt(b)) - ceil(sqrt(a)) + 1);
  }
  long long countCubes(long long a, long long b) {
    long long acrt = cbrt(a);
    long long bcrt = cbrt(b);
    long long count = 0;
    for (long long i = acrt; i <= bcrt; i++)
      if (i * i * i >= a && i * i * i <= b) count++;
    return count;
  }
  long long SquareCube(long long int N) {
    long long cnt = 0, i = 1;
    while (long long(pow(i, 6)) <= N) {
      ++cnt;
      ++i;
    }
    return cnt;
  }
  int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    long long t;
    cin >> t;
    for (int it = 1; it <= t; it++) {
      long long n;
      cin >> n;
      long long res = countCubes(1, n) + countSquares(1, n) - SquareCube(n);
      cout << res << endl;
    }
    return 0;
  }
  