Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save KhaledElshamy/92f6b11ebee0a160902a68cbc9a4a470 to your computer and use it in GitHub Desktop.
Save KhaledElshamy/92f6b11ebee0a160902a68cbc9a4a470 to your computer and use it in GitHub Desktop.
B. Easy Number Challenge (Codeforces)
#include <bits/stdc++.h>
using namespace std ;
#define size 1000001
int main() {
unsigned long long a,b,c,d[1000001]={0},count=0;
for(int i=1;i<size;i++)
for(int j=i;j<size;j+=i)
++d[j];
cin>>a>>b>>c;
for(int i=1;i<=a;i++)
for(int j=1;j<=b;j++)
for(int k=1;k<=c;k++)
count+=d[i*j*k];
cout<<count<<endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment