Language: C++

// Created by sz
#include <bits/stdc++.h>
using namespace std;

const int N = 2e5 + 5;
int n,m,k;

using ll = long long;
const int mod = 1e9 + 7;
int fac[N], finv[N];

ll quick_pow(ll a, ll b) {
    ll res = 1;
    a %= mod;
    while (b) {
        if (b & 1) res = res * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return res;
}

void init_fac_mod(){
    //only when mod is prime
    fac[0] = finv[0] = 1;
    for(int i = 1; i <= n; ++i)
        fac[i]=(ll)fac[i-1]*i%mod;
    finv[n] = quick_pow(fac[n], mod-2);
    for(int i = n-1; i; --i)
        finv[i] = (ll)finv[i+1]*(i+1)%mod;
}

int c(int n, int m){
    //n!/(m!(n-m)!)
    return (ll)((ll)fac[n] * finv[m] % mod) * finv[n - m] % mod;
}

int c_2(int n, int m){
    ll res = 1;
    for (int i = 0; i < m; i++){
        (res *= n-i)%=mod;
        (res/= i+1)%=mod;
    }
    return (int)res;
}




int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin>>n>>m>>k;
    
    
    ll d = 0;
    for (int i = 1; i < n; i++){
        d += i*(n-i)%mod*m%mod*m%mod;
        d%= mod;
    }
    
    for (int i = 1; i < m; i++){
        d += i*(m-i)%mod*n%mod*n%mod;
        d %= mod;
    }
    
    cout<<d*c_2(n*m-2, k-2)%mod<<endl;
    
    
    
    
    return 0;
}a// Created by sz
#include <bits/stdc++.h>
using namespace std;

const int N = 2e5 + 5;
int n,m,k;

using ll = long long;
const int mod = 1e9 + 7;
int fac[N], finv[N];

ll quick_pow(ll a, ll b) {
    ll res = 1;
    a %= mod;
    while (b) {
        if (b & 1) res = res * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return res;
}

void init_fac_mod(int n){
    //only when mod is prime
    fac[0] = finv[0] = 1;
    for(int i = 1; i <= n; ++i)
        fac[i]=(ll)fac[i-1]*i%mod;
    finv[n] = quick_pow(fac[n], mod-2);
    for(int i = n-1; i; --i)
        finv[i] = (ll)finv[i+1]*(i+1)%mod;
}

int c(int n, int m){
    //n!/(m!(n-m)!)
    return (ll)((ll)fac[n] * finv[m] % mod) * finv[n - m] % mod;
}

int c_2(int n, int m){
    ll res = 1;
    for (int i = 0; i < m; i++){
        (res *= n-i)%=mod;
        (res/= i+1)%=mod;
    }
    return (int)res;
}




int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin>>n>>m>>k;
    
    
    ll d = 0;
    for (int i = 1; i < n; i++){
        d += i*(n-i)%mod*m%mod*m%mod;
        d%= mod;
    }
    
    for (int i = 1; i < m; i++){
        d += i*(m-i)%mod*n%mod*n%mod;
        d %= mod;
    }
    
    init_fac_mod(2e5);
    cout<<d*c(n*m-2, k-2)%mod<<endl;
    
    
    
    
    return 0;
}





Compiler output:
a.cc:77:2: error: 'a' does not name a type
   77 | }a// Created by sz
      |  ^
a.cc:81:11: error: redefinition of 'const int N'
   81 | const int N = 2e5 + 5;
      |           ^
a.cc:5:11: note: 'const int N' previously defined here
    5 | const int N = 2e5 + 5;
      |           ^
a.cc:82:5: error: redefinition of 'int n'
   82 | int n,m,k;
      |     ^
a.cc:6:5: note: 'int n' previously declared here
    6 | int n,m,k;
      |     ^
a.cc:82:7: error: redefinition of 'int m'
   82 | int n,m,k;
      |       ^
a.cc:6:7: note: 'int m' previously declared here
    6 | int n,m,k;
      |       ^
a.cc:82:9: error: redefinition of 'int k'
   82 | int n,m,k;
      |         ^
a.cc:6:9: note: 'int k' previously declared here
    6 | int n,m,k;
      |         ^
a.cc:85:11: error: redefinition of 'const int mod'
   85 | const int mod = 1e9 + 7;
      |           ^~~
a.cc:9:11: note: 'const int mod' previously defined here
    9 | const int mod = 1e9 + 7;
      |           ^~~
a.cc:86:5: error: redefinition of 'int fac [200005]'
   86 | int fac[N], finv[N];
      |     ^~~
a.cc:10:5: note: 'int fac [200005]' previously declared here
   10 | int fac[N], finv[N];
      |     ^~~
a.cc:86:13: error: redefinition of 'int finv [200005]'
   86 | int fac[N], finv[N];
      |             ^~~~
a.cc:10:13: note: 'int finv [200005]' previously declared here
   10 | int fac[N], finv[N];
      |             ^~~~
a.cc:88:4: error: redefinition of 'll quick_pow(ll, ll)'
   88 | ll quick_pow(ll a, ll b) {
      |    ^~~~~~~~~
a.cc:12:4: note: 'll quick_pow(ll, ll)' previously defined here
   12 | ll quick_pow(ll a, ll b) {
      |    ^~~~~~~~~
a.cc:109:5: error: redefinition of 'int c(int, int)'
  109 | int c(int n, int m){
      |     ^
a.cc:33:5: note: 'int c(int, int)' previously defined here
   33 | int c(int n, int m){
      |     ^
a.cc:114:5: error: redefinition of 'int c_2(int, int)'
  114 | int c_2(int n, int m){
      |     ^~~
a.cc:38:5: note: 'int c_2(int, int)' previously defined here
   38 | int c_2(int n, int m){
      |     ^~~
a.cc:126:5: error: redefinition of 'int main()'
  126 | int main(){
      |     ^~~~
a.cc:50:5: note: 'int main()' previously defined here
   50 | int main(){
      |     ^~~~