알고리즘
[알고리즘] 백준 16673 - 고려대학교에는 공식 와인이 있다 (C++)
blueberrysoda
2024. 12. 6. 22:54
[문제 링크] : https://www.acmicpc.net/problem/16673
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int C, K, P, Ans = 0;
cin >> C >> K >> P;
for(int i=1; i<=C; i++){
Ans += K * i + P * i * i;
}
cout << Ans << "\n";
return 0;
}