您的位置:首页 > 其它

A. Multiplication Table

2015-09-15 20:46 274 查看
time limit per test
1 second

memory limit per test
256 megabytes

input
standard input

output
standard output

Let's consider a table consisting of n rows and n columns.
The cell located at the intersection of i-th row and j-th
column contains number i × j. The rows and columns are numbered starting from 1.

You are given a positive integer x. Your task is to count the number of cells in a table that contain number x.

Input

The single line contains numbers n and x (1 ≤ n ≤ 105, 1 ≤ x ≤ 109)
— the size of the table and the number that we are looking for in the table.

Output

Print a single number: the number of times x occurs in the table.

Sample test(s)

input
10 5


output
2


input
6 12


output
4


input
5 13


output
0


Note

A table for the second sample test is given below. The occurrences of number 12 are marked bold.



解题说明:此题是一道水题,只需要判断两个数乘积是否为一个指定的数即可。

#include<stdio.h>
#include <string.h>
#include<iostream>
#include<algorithm>
using namespace std;

int main()
{
int a,b,i,count=0;
scanf("%d %d",&a,&b);
for(i=1;i<=a;i++)
{
if(b%i==0)
{
if((b/i)<=a)
{
count++;
}
}
}
printf("%d\n",count);
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: