Sunday, April 24, 2016

UVA 11689: Soda Surpler- Solution

Unknown
#include <stdio.h>
int main()
{
    int n,e,f,c,p,s;
    scanf("%d",&n);
    while (n--)
    {
        scanf("%d%d%d",&e,&f,&c);
        s=0;
        p=e+f;
        while (p>=c)
        {
            s=s+p/c;
            p=p/c+p%c;
        }
        printf("%d\n",s);
    }
    return 0;
}

Unknown

Studying at Shahjalal University of Science and Technology, Sylhet.

0 comments:

Post a Comment

Coprights @ 2016,