UVA 12043 - Divisors Solution
Solution in c++:
///**********ALLAH IS ALMIGHTY************///
///AH Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
#include<bits/stdc++.h>
using namespace std;
#define M 100009
long long i,j,sd[M],d[M];
void div()
{
for(i=1; i<=100000; i++)
{
for(j=i; j<=100000; j=j+i)
{
sd[j]+=i;
d[j]++;
}
}
}
main()
{
div();
long long t,a,b,c;
cin>>t;
while(t--)
{
long long ssd=0,dd=0;
cin>>a>>b>>c;
for(i=a; i<=b; i++)
{
if(i%c==0)
{
ssd+=sd[i];
dd+=d[i];
}
}
cout<<dd<<" "<<ssd<<endl;
}
}
According to Stanford Medical, It's indeed the ONLY reason women in this country live 10 years longer and weigh 19 kilos less than we do.
ReplyDelete(By the way, it has totally NOTHING to do with genetics or some secret exercise and really, EVERYTHING related to "HOW" they are eating.)
BTW, I said "HOW", not "what"...
Tap on this link to discover if this easy questionnaire can help you discover your true weight loss possibility