#P14663. [KenOI 2025] 倍数题

    ID: 14527 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 1 上传者: 标签>数学洛谷原创O2优化洛谷比赛

[KenOI 2025] 倍数题

Description

Given TT queries, each contains a positive integer nn. Find the all of the integer mm that satisfy the following conditions:

  • 1mn1 \le m \le n
  • mm is a perfect square number
  • mm is a multiple of 33

Find the quantity of mm.

Input Format

Each test case contains multiple data sets. You will only receive the score for a test case if you pass all its data sets.

The first line contains an integer TT.

The next TT lines each contains an integer nn.

Output Format

TT lines, the quantity of mm.

3
9
50
100
1
2
3

Hint

Example explanation

There are a total of three queries.

  • For the first query, mm is 99;

  • For the second query, all mm are 9,369, 36;

  • For the third query, all mm are 9,36,819, 36, 81.

Data Volume and Conventions

This problem is divided into subtasks. Your score in a subtask is the minimum score across all its test cases.

This problem uses subtask dependencies. You will not receive the score for a subtask unless you achieve full points on all its dependent subtasks.

Subtask nn \le Score Dependencies
11 3×1053 \times 10^5 2020 none
22 101410^{14} 3030 11
33 101810^{18} 5050 1,21,2

For all of the cases, 1T3×105,1n10181 \le T \le 3 \times 10^5,1 \le n \le 10^{18}.