英语翻译There is one friendly number and N unfriendly numbers.We want to find how many numbers are there which exactly divide the friendly number,but does not divide any of the unfriendly numbers.Input Format:The first line of input contains two
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/27 20:10:43
英语翻译There is one friendly number and N unfriendly numbers.We want to find how many numbers are there which exactly divide the friendly number,but does not divide any of the unfriendly numbers.Input Format:The first line of input contains two
英语翻译
There is one friendly number and N unfriendly numbers.We want to find how many numbers are there which exactly divide the friendly number,but does not divide any of the unfriendly numbers.
Input Format:
The first line of input contains two numbers N and K seperated by spaces.N is the number of unfriendly numbers,K is the friendly number.
The second line of input contains N space separated unfriendly numbers.
Output Format:
Output the answer in a single line.
Constraints:
1
英语翻译There is one friendly number and N unfriendly numbers.We want to find how many numbers are there which exactly divide the friendly number,but does not divide any of the unfriendly numbers.Input Format:The first line of input contains two
There is one friendly number and N unfriendly numbers.
有一个友好数和N个非友好数
We want to find how many numbers are there which exactly divide the friendly number,but does not divide any of the unfriendly numbers.
我们想找出有多少数字是友好数的因子,并且不是所有非友好数的因子
Input Format:
输入格式
The first line of input contains two numbers N and K seperated by spaces.
第一行有两个整数N和K,用空格分开.
N is the number of unfriendly numbers,K is the friendly number.
N是非友好数的个数,K是那个友好数
The second line of input contains N space separated unfriendly numbers.
第二行有N个非友好数用空格分开
Output Format:
输出格式
Output the answer in a single line.
输出答案占一行
Divisors of the given friendly number 16,are { 1,2,4,8,16 }
16的因子有{ 1,2,4,8,16 }
and the unfriendly numbers are {2,5,7,4,3,8,3,18}.
非友好数是 {2,5,7,4,3,8,3,18}.
Now 1 divides all unfriendly numbers,
1是所有非友好的数因子
2 divide 2,
2是2的因子
4 divide 4,
4是4的因子
8 divide 8
8是8的因子
but 16 divides none of them.
16不是所有友好数的因子
So only one number exists which divide the friendly number but does not divide any of the unfriendly numbers.
所以只有一个数字是友好数的因子.并且不是所有非友好数的因子
So the answer is 1.
所以答案是1