460A Codeforces - Vasya and socks


460A Codeforces 


Vasya and socks

#include <iostream>

using namespace std;

int main()

{

    int s,e,sol=0;

    cin>>s>>e;

    sol=s;

    while(s>=e){
 
        sol+=s/e;

        s=s/e+s%e;
 
    }

    cout<<sol;

    return 0;

}


Share on Google Plus

About Mohamed Sobhi

My name is Mo.Sobhy ,I study at School excelling high school in Ain Shams ,Cairo
My hobbies is programming ,and web development ,playing chess and writing horror stories.
    Blogger Comment
    Facebook Comment

0 التعليقات:

إرسال تعليق