report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
GCD 2 - MarisaOJ: Marisa Online Judge

GCD 2

Time limit: 1000 ms
Memory limit: 256 MB
Count the number of integer pairs $1 \le x, y \le n$ such that $\text{gcd}(x, y)$ is a prime number. ### Input - A single line containing an integer $n$. ### Output - Print a single integer, which is the number of pairs that satisfy the condition. ### Constraints - $1 \le n \le 2 \times 10^6$. ### Example Input: ``` 4 ``` Output: ``` 4 ```
Additional Problems (Level 5)
GCD 2
Brewing potion 9
Amusement park
Growing mushrooms III
Queries on tree 3
Division problem
Watering II
Growing mushrooms II
Squid game
The last Ballade...
Sum of weights
Mushroom harvesting II
Flip
Pairs' value
Sorting queries
Microsoft Paint
Gene bank
Card games
Sequence
Topic
Math
Rating 1500
Solution (0) Solution