Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .

0 like 0 dislike

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 (32,020 points)
...