#include<bits/stdc++.h>
#pragma GCC target( "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("Ofast,unroll-loops,fast-math,O3")
using namespace std;
#define int long long
#define y1 cheza
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N=2e5+1000;
const int M=1e4;
const int mod=1e9+7;
const int INF=1e18;
const int dx[]={1,-1,0,0};
const int dy[]={0,0,-1,1};
const long double eps=1e-6;
int n;
int a[N];
int pref[N];
void test(){
    
    
} 


/*
3 1 2 0
*/

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    // cout.tie(nullptr);
    long long t2=1;
     cin>>t2;
    for(int i=1;i<=t2;i++){
        test();
    }
    
    return 0;

}
/*
temmie luck

*/
????????
2.cpp
1 ??
JOJOJO — ???????, ? 14:56
????? ?????? ?? 3 ????? ? ?????? ?????? ????? ?????? ? ????? ?????
???? 1/3
???????? 2/3
? 3/3
?????? ?????? ??? ?? ??????? ????? ?? ????? ??????, ???????, ???????

??? ?????? ?????? ?????????? ????????? ?????????(??????? ????? ????????) ????

??????? ?????? ????? ??? ????? ??????, ??????????? ??? ???????(?? ???? ??????)

??? ?????? ?????? ???????

??????????
 
JOJOJO — ???????, ? 15:11
https://ideone.com/RBOUQY
Ideone.com
Ideone.com
Ideone is something more than a pastebin; it's an online compiler and debugging tool which allows to compile and run code online in more than 40 programming languages.
?????? G
https://ideone.com/Rr3Tbo

A ??????
Ideone.com
Ideone.com
Ideone is something more than a pastebin; it's an online compiler and debugging tool which allows to compile and run code online in more than 40 programming languages.
Nurlybek[Noproblem29] — ???????, ? 15:26
F ????? 
Nurlybek[Noproblem29] — ???????, ? 15:38
C ???? 
#include<bits/stdc++.h>
#pragma GCC target( "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("Ofast,unroll-loops,fast-math,O3")
using namespace std;
#define int long long
#define y1 cheza
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N=2e5+1000;
const int M=1e4;
const int mod=1e9+7;
const int INF=1e18;
const int dx[]={1,-1,0,0};
const int dy[]={0,0,-1,1};
const long double eps=1e-6;
int n,m;
int ans=0;
int dfs(int x,int y){
    if(x==1&&y==1){
        return 1;
    }
    else{
        if(x<y)swap(x,y);
        return dfs(x-1,y)+dfs(1,y)+x*y;
    }
}
void test(){
    cin>>n>>m;
    cout<<dfs(n,m)<<'\n';

}



/*

*/

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    // cout.tie(nullptr);
    long long t2=1;
    //  cin>>t2;
    for(int i=1;i<=t2;i++){
        test();
    }
    
    return 0;

}
????????
2.cpp
1 ??
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define y1 cheza
const int N=2e5+1000;
const int M=1e4;
const int mod=1e9+7;
const int INF=1e18;
const int dx[]={1,-1,0,0};
const int dy[]={0,0,-1,1};
const long double eps=1e-6;
int n,m;
int ans=0;
map<pair<int,int>,int>dp;
int dfs(int x,int y){
    if(dp.count({x,y})){
        return dp[{x,y}];
    }
    if(x==1&&y==1){
        dp[{x,y}]=1;
        return 1;
    }
    else{
        if(x<y)swap(x,y);
        return dp[{x,y}]=(dfs(x-1,y)+dfs(1,y)+x*y);
    }
}
void test(){
    cin>>n>>m;
    cout<<dfs(n,m)<<'\n';

}



/*

*/

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    // cout.tie(nullptr);
    long long t2=1;
    //  cin>>t2;
    for(int i=1;i<=t2;i++){
        test();
    }
    
    return 0;

}
????????
2.cpp
1 ??
https://ideone.com/RgAYHG
Ideone.com
Ideone.com
Ideone is something more than a pastebin; it's an online compiler and debugging tool which allows to compile and run code online in more than 40 programming languages.
Nurlybek[Noproblem29] — ???????, ? 15:55
n*m
n*m
x[1] y[1]<x[2] y[2]
2 2
1 2
1 2 
1 2 = 1 1 /1 1
JOJOJO — ???????, ? 15:56
https://ideone.com/uYzrSi
Ideone.com
Ideone.com
Ideone is something more than a pastebin; it's an online compiler and debugging tool which allows to compile and run code online in more than 40 programming languages.
Nurlybek[Noproblem29] — ???????, ? 16:02
x^y
Nurlybek[Noproblem29] — ???????, ? 16:19
C
#include<bits/stdc++.h>
#pragma GCC target( "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("Ofast,unroll-loops,fast-math,O3")
using namespace std;
#define int long long
#define y1 cheza
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N=2e5+1000;
const int M=1e4;
const int mod=1e9+7;
const int INF=1e18;
const int dx[]={1,-1,0,0};
const int dy[]={0,0,-1,1};
const long double eps=1e-6;
int n,m;
int ans=0;
map<pair<int,int>,int>dp;
int calc(int r){
    if(r==1)return 1;
    if(r==2)return 4;
    int res=(r+1)*(r+2)/2-2;
    return res;
}
void test(){
    cin>>n>>m;
    int ans=0;
    while(n!=0||m!=0){
        if(n<m)swap(n,m);
        ans+=n*m;
        n--;
        ans+=calc(m);
    }
    cout<<ans<<'\n';
}


/*
1=1
2=4
4
3=8
5
4=13
6
5=19
6=26
*/

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    // cout.tie(nullptr);
    long long t2=1;
    //  cin>>t2;
    for(int i=1;i<=t2;i++){
        test();
    }
    
    return 0;

}
