http://acm.hust.edu.cn/vjudge/problem/35178 Floor problem
In this problem, we have f(n,x)=Floor[n/x]. Here Floor[x] is the biggest integer such that no larger than x. For example, Floor[1.1]=Floor[1.9]=1, Floor[2.0]=2.
You are given 3 positive integers n, L and R. Print the result of f(n,L)+f(n,L+1)+...+f(n,R), please.
Input
The first line of the input contains an integer T (T≤100), indicating the number of test cases.
Then T cases, for any case, only 3 integers n, L and R (1≤n, L, R≤10,000, L≤R).
Output
Sample Input
Sample Output
#include<stdio.h>
int main()
{
int T,n,L,R;
scanf("%d",&T);
while(T--)
{
int sum=0;
scanf("%d%d%d",&n,&L,&R);
for(int i=L;i<=R;i++)
{
sum=sum+n/i;
}
printf("%d\n",sum);
}
return 0;
}
这是一个我都能说水题的题你说它有多水!!!!!交几份对几份!!!!大水题啊!!!!