Codeforces Round 304 (Div. 2)
翻译中…
A soldier wants to buy $*w*$ bananas in the shop. He has to pay $*k*$ dollars for the first banana, $2*k*$ dollars for the second one and so on (in other words, he has to pay $*i*·*k*$ dollars for the $*i*$-th banana).
翻译中…
He has $*n*$ dollars. How many dollars does he have to borrow from his friend soldier to buy $*w*$ bananas?
翻译中…
Input
翻译中…
The first line contains three positive integers $*k*, *n*, *w*$ ($1 ≤ *k*, *w* ≤ 1000$, $0 ≤ *n* ≤ 10^{9}$), the cost of the first banana, initial number of dollars the soldier has and number of bananas he wants.
翻译中…
Output
翻译中…
Output one integer — the amount of dollars that the soldier must borrow from his friend. If he doesn't have to borrow money, output $0$.
翻译中…
样例
Input #1
3 17 4
Output #1
13
InputCopy
OutputCopy
题目信息
标签
暴力
模拟
数学
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。