Dotcpp  >  编程题库  >  m and n
题目 1422:

m and n

时间限制: 2s 内存限制: 192MB 提交: 62 解决: 8

题目描述

S(m,n) = { k1, k2, k3, ..., kx }, Each ki can meet n % ki + m % ki >= ki. Now output the sum of phi(ki) , (1<= i <=x) which stands for the number of ki's relatively prime which are smaller than ki .

输入格式

Input contains multiple test cases, no more than 100. Each has a line contains two integer m , n (1<=m,n<108).

输出格式

For each test cases, output the sum of phi(ki) (1<=i<=x).

样例输入

2 3

样例输出

6

提示

零基础的同学可以先学习基础,教程见:  C语言教程C++教程编译器教程数据结构教程Python教程单片机教程

视频教学见视频网课

标签