Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
1,682 views
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.

 

Task
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

 

1
3 20 5
5 7 3

 

Sample output

 

5

 

 

by Expert (35,210 points)