ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1820. Ural Steaks

C ++ error in test's, but code is correct
Posted by polskyLIDER 5 Mar 2017 13:15
#include "iostream"

using namespace std;
int main()
{
    int a, b, rz;
    cin >> a >> b;
    if (b == 2 && a != 1 || b == 1 && a != 1) {
        rz = 2 * a / b;
    }
    else {
        if (a % b != 0) {
            rz = 2 * (a / b + 1);
        }
        else {
            rz = 2 * a / b;
        }
    }
    cout << rz;
    return 0;
}

i tested it a lot, pleas help may be i am so silly....