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 2035. Another Dress Rehearsal

C++ AC
Posted by D4nick 2 Jan 2019 08:00
#include <iostream>
using namespace std;
int main() {
    long x, y, c, a, b, MIN, MAX;
    cin >> x >> y >> c;
    if (x + y < c) {
        cout << "Impossible";
        return 0;
    }
    if (x >= c)
        cout << c << " " << 0;
    else if (y >= c)
        cout << 0 << " " << c;
    else{
        if (x < y)
            cout << x << " " << c - x;
        else
            cout << c - y <<  " " << y ;
    }
}
Re: C++ AC
Posted by Smilodon_am [Obninsk INPE] 2 Jan 2019 12:33
Please, do not publish your accepted solution code on forum. You disable other people to put their mind on the task in such a manner.
Please respect other possibility to solve a task on their own.