样例感觉都给错了…
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll n,x,y;
ios::sync_with_stdio(false);
cin>>n>>x>>y;
ll ans=0;
if(x+y<=n-1)
{
ll p=x+y;
ll pp=((p+1)*p)/2ll;
for(ll i=1; i<=x; i++)
{
ans+=1;
}
ans+=pp;
}
else
{
ll xx=n-x-1;
ll yy=n-y-1;
ans=n*n-1;
ll p=xx+yy;
for(ll i=1; i<=p; i++)
{
ans-=i;
}
for(ll i=1; i<=xx; i++)
{
ans--;
}
} cout<<ans<<endl;
}