fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. long long x, y, c;
  6. cin >> x >> y >> c;
  7. if (c - x <= y && c - x >= 0) {
  8. cout << x << " " << c -x << "\n";
  9. } else if (c - y <= x && c - y >= 0) {
  10. cout << c - y << " " << y << "\n";
  11. } else if (x >= c && y >= c) {
  12. cout << c << " " << 0 << "\n";
  13. } else {
  14. cout << "Impossible\n";
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0s 5568KB
stdin
2 7 5
stdout
2 3