1004 read a few books

Source: Internet
Author: User

ACM Club member attendee "Algorithmic Competition Primer Classic", everyone is particularly fond of reading this book. Suppose you read page X on the first day, then read M pages more than the day before, and then ask the ACM how many pages they read each time after n days?

Enter X, M, and N.

Output n days after the ACM team each read how many pages

12 6 7


#include "stdio.h"
#include "math.h"
#include "string.h"
int main ()
int x,m,n,sum=0,i;
while (scanf ("%d%d%d", &x,&m,&n)!=eof)
if (n==1)
for (i=1;i<=n;i++)
sum=sum+x+m* (i-1);
printf ("%d\n", sum);
return 0;

1004 read a few books

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.