All submissions for this problem are available.
Now that the location of the Frigates and the Mother-ship has been determined , it is time to take back the Empire . In the final battle against the invaders , the Empire has the option of using the BIOTELEPORT weapon .
It is prototype and is not perfect .
What the weapon does is , it teleports a given number of targets ( let us say T1 ) to a given location , but since the weapon is not perfect , if MORE SUCH TARGETS ARE PRESENT , it TELEPORTS BACK a certain number of targets (say C1 ) that it had teleported previously , to their original location .
The weapon has two configurations :
First configuration teleports T1 targets and teleports back C1 targets ( T1 > C1 ) .
Second configuration teleports T2 targets and teleports back C2 targets (T2 > C2 ) .
The configurations can be interchanged when ever required .
The weapon also has certain limitations .
It can be used only when a minimum number of targets T1 or T2 , as the case may be , are present .
It needs to be decided whether it is possible to eliminate the enemies completely using the weapon in these two configuration from the galaxy .
n N1 T1 C1 T2 C2 N1 T1 C1 T2 C2 .......... .......... .......... n times
n : Number of test cases
N : Total number of targets .
T1: Teleportation capability of the first configuration of the weapon .
C1: Back Teleportation of the first weapon .
T2 : Teleporttion capability of the second configuration of the weapon .
C2 : Back Teleportation of the second weapon .
All values being integers in between 0 and 1000 .
POSSIBLE or IMPOSSIBLE for each test case on a single line .
Input: 2 25 1 0 17 3 213 99 6 74 22 Output: POSSIBLE IMPOSSIBLE
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, CS2, GO, NODEJS|
Fetching successful submissions
If you are still having problems, see a sample solution here.