View Code of Problem 64

#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;
int main( )
{
    int n;
    int k;
    int l;
    int r=0;
    
    while(cin >> n>> k>> l)
    {
        int ki=k/2;
        if(n==0&&k==0&&l==0)
        {
            break;
        }
        else
        {
            while(n)
            {
                r=k-(k/2)+ki;
                if((ki-ki/2+ki)>l)
                {
                    break;
                }
            }
        }
        cout << r<< endl;
    }

    return 0;
}

Double click to view unformatted code.


Back to problem 64