esently you get Baby Ehab's first words: "Given an integer n, track down the longest aftereffect of [1,2,… ,n−1] whose item is 1 modulo n." Please take care of the issue. A succession b is an aftereffect of a cluster an if b can be gotten from a by erasing a few (conceivably all) components. The result of an unfilled aftereffect is equivalent to 1.
Correct answer will be upvoted else downvoted. Computer science.
Presently you get Baby Ehab's first words: "Given an integer n, track down the longest aftereffect of [1,2,… ,n−1] whose item is 1 modulo n." Please take care of the issue.
A succession b is an aftereffect of a cluster an if b can be gotten from a by erasing a few (conceivably all) components. The result of an unfilled aftereffect is equivalent to 1.
Input
The main line contains the integer n (2≤n≤105).
Output
The primary line ought to contain a solitary integer, the length of the longest aftereffect.
The subsequent line ought to contain the components of the aftereffect, in expanding request.
In case there are numerous arrangements, you can print any
Step by step
Solved in 3 steps with 1 images