본문 바로가기

Programming [Python]/백준 알고리즘 솔루션

#244 백준 파이썬 [16673] 고려대학교에는 공식 와인이 있다

https://www.acmicpc.net/problem/16673

 

Python Code

C,K,P = map(int, input().split())
answer = 0

for i in range(1, C + 1):    
    answer += K*i + P*(i**2)
    
print(answer)