ZR#1009

解法:

CODE:

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>

using namespace std;

#define LL long long
const int mod = 1e9 + 7;

LL n,m,ans;

inline LL fast_pow(LL a,LL b,LL p) {
    LL ans = 1;
    while(b) {
        if(b & 1) ans = ans * a % p;
        a = a * a % p;
        b >>= 1;
    }
    return ans % p;
}
inline LL calc(LL x) {
    return (x % mod * (x + 1) % mod * (x + 2) % mod + mod) % mod * fast_pow(6,mod-2,mod) % mod;
}

int main() {
    scanf("%lld%lld",&n,&m);
    n %= mod,m %= mod;
    ans = calc(n) % mod * calc(m) % mod;
    printf("%lld\n",ans);
    //system("pause");
    return 0;
}
01-26 10:11