f=lambda n,p:n-p*n-p*-~p/2for n, p in input(): print (n,p),f(n,p)
((2,3),(100,5),(42,0),(0,3),(0,0))
(2, 3) -10 (100, 5) -415 (42, 0) 42 (0, 3) -6 (0, 0) 0
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!