#pragma GCC optimize("Ofast") #include using namespace std; using i64=int_fast64_t; using pii=pair; using pll=pair; template constexpr T inf=numeric_limits::max() / (T)2; template using heap=priority_queue; template using minheap=priority_queue,greater>; #define fir first #define sec second #define mkp make_pair #define mkt make_tuple #define emb emplace_back #define emp emplace #define all(v) begin(v),end(v) namespace std { template void hash_combine(size_t &seed, T const &key) { seed ^= hash()(key) + 0x9e3779b9 + (seed << 6) + (seed >> 2); } template struct hash> { size_t operator()(pair const &pr) const { size_t seed = 0; hash_combine(seed,pr.first); hash_combine(seed,pr.second); return seed; } }; } void ios_untie() { ios::sync_with_stdio(false); cin.tie(nullptr); } void file_setup() { if(!freopen("stderr.txt","wt",stderr)) { std::cerr << "Failed to open the stderr file\n"; freopen("CON","wt",stderr); } if(!freopen("stdout.txt","wt",stdout)) { std::cerr << "Failed to open the stdout file\n"; freopen("CON","wt",stdout); } if(!freopen("stdin.txt","rt",stdin)) { std::cerr << "Failed to open the stdin file.\n"; freopen("CON","rt",stdin); } } template void init(A (&array)[N], const T &val) { fill((T*)array,(T*)(array + N),val); } i64 binry(i64 ok, i64 ng, const function &f) { while(abs(ok-ng)>1) { i64 mid=(ok+ng)/2; (f(mid) ? ok : ng) = mid; } return ok; } /*-------------------------------*/ i64 n,k; void solve() { cout<<1+k*(2*n-k+1)/2<<"\n"; } signed main() { //ios_untie(); #ifdef LOCAL file_setup(); #endif cin>>n>>k; solve(); }