oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

indivisibility Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

indivisibility.html

Problem Description

You have an array of Q integers.

Dae Koon sees your array of integers and wonders, for each integer in the array Ai, how many integers from 1 to Ai (inclusive) are not divisible by any integer from 2 to 10 (inclusive)?

Input

The first line of input contains a single integer Q.

The next line contains Q integers, the ith integer is the value of Ai.

Output

Output Q lines, with one integer on each line.

The integer on the ith line should be the answer to Dae Koon's question for Ai.

Limits

Subtask 1 (100%): 1 ≤ Q ≤ 106. 2 ≤ Ai ≤ 1018.

Subtask 2 (0%): Sample Testcases

Sample Testcase 1

Input

1
12

Output

2

Tags

Math

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
110051s4MBMinimum
2011s4MBMinimum

Judge Compile Command

g++-8 ans.cpp -o indivisibility -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.