Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
in Online Assessments by Expert (35,210 points) | 1,682 views

1 Answer

0 like 0 dislike

Ouestion 1:
The end game
You are playing a game that consists of N pawns. Each pawns has some power. The ith pawns power is repersented as Pi.
The game also has a king whose power is S.


Your task is to determine the minimum number of moves within which the king can be defeated. If there is no such number, print Impossible.


Sample input


3 20 5
5 7 3


Sample output





by Expert (35,210 points)