View Code of Problem 64

#include <stdio.h>

int main(void)
{
    int n,t,l;
    while(scanf("%d%d%d",&n,&t,&l) != EOF && (n || t || l))
    {
        int i,index = 0;;
        for(i = 2;i <= n - 1;i++)
        {
            if(t - t / 2 + t > l)
            {
                break;
            }
            else
                t = t - t / 2 + t;
        }
        printf("%d\n",t);
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 64