time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output A soldier wants to buy w bananas in the shop. He has to pay k dollars for the first banana, 2k dollars for the second one and so on (in other wor…