102. Coprimes

来源:互联网 发布:苹果电脑降价规律知乎 编辑:程序博客网 时间:2024/05/16 03:42


102. Coprimes

time limit per test: 0.25 sec.
memory limit per test: 4096 KB

For given integer N (1<=N<=104) find amount of positive numbers not greater than N that coprime with N. Let us call two positive integers (say, A and B, for example) coprime if (and only if) their greatest common divisor is 1. (i.e. A and B are coprime iff gcd(A,B) = 1).

Input

Input file contains integer N.

Output

Write answer in output file.

Sample Input

9

Sample Output

6输出大于等于1且小于等于N的与N互质的数的个数

暴力可解

正解:欧拉函数



0 0
原创粉丝点击