Timus Problem 1607 Solution

Timus Problem Solution

#include <stdio.h>

int main()

{

    int a,b,c,d,sum;

    scanf("%d %d %d %d",&a,&b,&c,&d);

    while(a<=c){

    a+=b;



    if(a>c)

        a=c;

        c-=d;

    }

    printf("%d",a);

    return 0;

}

 

0 Comments

You may find interest following article