Skip to main content
3 of 4
added 71 characters in body
VolAnd
  • 296
  • 3
  • 8

C++, 54 51 bytes

[](int N,int P){int F;for(F=N;P;F-=++N,P--);return F;}

 [](int N,int P){int F=N;while(P--)F-=++N;return F;} 

Test:

#include <iostream> int main(void) { int N, P; std::cin >> N >> P; auto f = [](int N,int P){int F=N;while(P--)F-=++N;return F;}; std::cout << f(N,P) << std::endl; return 0; } 
VolAnd
  • 296
  • 3
  • 8