提交时间:2023-10-04 09:49:17
运行 ID: 104810
#include <iostream> #include <algorithm> #include <cstdio> #include <cmath> using namespace std; int n, p; int main() { scanf("%d %d", &n, &p); printf("%lld", 2 * n + (n - p) * (p - 1)); return 0; }