#include "bits/stdc++.h" #define in std::cin #define out std::cout #define rep(i,N) for(LL i=0;i> N >> K; LL max = N * (N + 1) / 2; LL min = (N - K) * (N - K + 1) - max; out << (max - min) / 2 + 1 << std::endl; }