fork(2) download
  1. #include <cmath>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main() {
  6. int H, W, h, w;
  7. cin >> h >> w >> H >> W;
  8. int t = max(H, W);
  9. H = min(H, W);
  10. W = t;
  11. t = max(h, w);
  12. h = min(h, w);
  13. w = t;
  14. int d2 = w * w + h * h;
  15. if (h <= H and w <= W or H * sqrt(d2 - W * W) + W * sqrt(d2 - H * H) <= w * w - h * h)
  16. cout << "Possible";
  17. else cout << "Impossible";
  18. return 0;
  19. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Possible