Khefu and GCD
CodeChefOpen on judge ↗
Khefu is a highschool student from India. She adores maths. In maths, her favorite topic is number theory. Today, she is playing with the GCD function. What she is doing is just randomly picking up a pair of integers (x,y) and computing their GCD. She noticed that many times the GCD(x,y) is 1. Khefu is quite intrigued by these pairs and wanted to count them. Given a upper-bound N, help khefu to c
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start