/* -*- coding: utf-8 -*- * * 821.cc: No.821 Making Integers - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ /* typedef */ typedef long long ll; /* global variables */ /* subroutines */ /* main */ int main() { ll n, k; scanf("%lld%lld", &n, &k); printf("%lld\n", (n + n - (k - 1)) * k / 2 + 1); return 0; }