CoprCopr
Practice
4.1 (51 votes)
Approved
Easy
Math
Number theory
Open
Primality test
Sieve
Problem
66% Success 5318 Attempts 30 Points 2s Time Limit 256MB Memory 1024 KB Max Code
Link to Russian translation of problem
You are given positive integer N. How many unordered pairs of integers from 1 to N are coprime?
Input
The first line contains one integer T denoting the number of test cases.
The following T lines contain one number each - N and describe each test case.
Output
For each test case output one integer per line - answer for the question.
Constraints
- N <= 107
- T <= 10
Submissions
Please login to view your submissions
Similar Problems
Points:30
1 votes
Tags:
Easy
Editorial