https://codeforces.com/problemset/problem/236/B

题解:线性筛

参考文章:https://blog.csdn.net/weixin_43272781/article/details/86584218

/*
*@Author:   STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=300000+10;
const int M=1000000+10;
const int MOD=1073741824;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,q;
ll ans,cnt,flag,temp;
int D[M];
int pre[M];
bool prime[M];
int main()
{
#ifdef DEBUG
	freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
#endif

    D[1]=1;
    prime[0]=prime[1]=1;
    for(int i=2;i<M;i++){
        if(!prime[i]){
            D[i]=2;
            pre[++cnt]=i;
        }
        for(int j=1;j<=cnt&&i*pre[j]<M;j++){
            prime[i*pre[j]]=1;
            D[i*pre[j]]=(D[i]*2)%MOD;
            if(i%pre[j]==0){
                int c=1;
                t=i;
                while(t%pre[j]==0){
                    t/=pre[j];
                    c++;
                }
                D[i*pre[j]]=(D[t]*(c+1))%MOD;
                break;
            }
        }
        //cout<<i<<" "<<D[i]<<endl;
    }
    scanf("%d%d%d",&n,&m,&k);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            for(int l=1;l<=k;l++)
                ans=(ans+D[i*j*l])%MOD;
    cout << ans << endl;
    //cout << "Hello world!" << endl;
    return 0;
}