Monday 21 January 2013

Rectangles

4300. Rectangles Problem code: AE00

#include<stdio.h>
int main()
{
    long long int n,i,j,count=0;
    scanf("%lld",&n);
   
    for(i=1;i<=n;i++)
    {
        for (j=i;j<=n;j++)
        {
            if(i*j>n)
                break;
            count++;   
        }
    }
    printf("%lld\n",count);
    return 0;
}

No comments:

Post a Comment