UVA-1587 - Box

  • UVa Online Judge 解題結果請於 Submit 後,參閱 uHunt
  • 如果你有任何建議與指教,歡迎於下方留言一起討論喔!
  • 本題選為「20161004 大學程式能力檢定 CPE」題目。

題意概要

本題給定六個平面個別的長度與寬度,試問可否由該六個平面組合出一個立方體?


Input

Input file contains several test cases. Each of them consists of six lines. Each line describes one pallet and contains two integer numbers and () — width and height of the pallet in millimeters respectively.


Output

For each test case, print one output line. Write a single word POSSIBLE to the output file if it is possible to make a box using six given pallets for its sides. Write a single word IMPOSSIBLE if it is not possible to do so.


Sample Input

1345 2584
2584 683
2584 1345
683 1345
683 1345
2584 683
1234 4567
1234 4567
4567 4321
4322 4567
4321 1234
4321 1234

Sample Output

POSSIBLE
IMPOSSIBLE
profile-image
David Lu
Hello, I'm David Lu. I am a graduate student in Department of Computer Science at National Chiao Tung University, Taiwan. I am in the Networking and Sensing Systems (NSS) Lab at NCTU. If you have any question, please feel free to contact with me.
comments powered by Disqus