CF1619B.Squares and Cubes

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Polycarp likes squares and cubes of positive integers. Here is the beginning of the sequence of numbers he likes: 11 , 44 , 88 , 99 , ....

For a given number nn , count the number of integers from 11 to nn that Polycarp likes. In other words, find the number of such xx that xx is a square of a positive integer number or a cube of a positive integer number (or both a square and a cube simultaneously).

输入格式

The first line contains an integer tt ( 1t201 \le t \le 20 ) — the number of test cases.

Then tt lines contain the test cases, one per line. Each of the lines contains one integer nn ( 1n1091 \le n \le 10^9 ).

输出格式

For each test case, print the answer you are looking for — the number of integers from 11 to nn that Polycarp likes.

输入输出样例

  • 输入#1

    6
    10
    1
    25
    1000000000
    999999999
    500000000

    输出#1

    4
    1
    6
    32591
    32590
    23125
首页