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