提交时间:2023-10-04 10:24:54

运行 ID: 104862

#include<bits/stdc++.h> using namespace std; #define int unsigned long long int a[1010],n,p; signed main() { cin>>n>>p; int l=p,ans=2*n; for(int i=1;i<=n-p;++i) ans+=l-1, l++; cout<<ans; return 0; }