Chef’s Number Puzzle
CodeChefOpen on judge ↗
Chef is very busy now-a-days. So, he has given you a task to find the total count of all the number starting from 1 to n which are co-primes with n . For eg:- if y = 7 then there are 6 numbers which are co-primes with 7 . The numbers are 1, 2, 3, 4, 5, 6 . Note:- a is co-prime with b means gcd (a, b) = 1. ##Constraints: 1 <= t <= 100 1 <= n <= 10^6 ##Input: The first line contains a
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