|
||||||||||
Product of coprimesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1187 Accepted Submission(s): 381 Problem Description You are given a positive integer m. Calculate the product of all positive integers less then or equal to m and coprime with m, and give the answer modulo m. Input There are multiple tests end with EOF, each test contains only a positive integer m ¡Ü 10^9 in a line. The number of tests is no more than 5000. Output In the output file you should write the answer to the task. Sample Input
Sample Output
Source | ||||||||||
|