Rohyoohyun / C

0 stars 0 forks source link

16673 고려대학교에는 공식 와인이 있다. #31

Open Rohyoohyun opened 1 month ago

Rohyoohyun commented 1 month ago
#include <stdio.h>
int main(){
    int c, k, p;
    scanf("%d %d %d", &c, &k, &p);

    int answer=0;
    for(int i=0; i<=c; i++)
        answer += (k*i) + p*(i*i);
    printf("%d", answer);

    return 0;
}