P18454 [CodeChef] AKACHOCO
普及
题目描述

There is a girl named ''Akansha''. She is very fond of eating chocolates but she has a weak immune system due to which she gets cold after eating chocolate during morning, evening and night and can only eat at most $x$ number of chocolate each afternoon. A friend of hers gifted her some $n$ number of chocolates that she doesn't want to share with anyone. Those chocolate have to be finished before they expire. (no. of days in which they are going to expire from the day she has been gifted the chocolate is given for each chocolate) $Note:$ Chocolate cannot be consumed on the day it expires.

Help Akansha to know if it is possible for her to finish all the chocolates before they expire or not.

-----Input:-----
- First line will contain $T$, number of test cases. Then the test cases follow.
- First line contains $n$,the number of chocolates gifted to her
- Second line contains $x$,the number of chocolates she can eat each afternoon
- Third line contains $n$ space separated integers $A1,A2...An$,denoting the expiry of each of the $n$ chocolates

-----Output:-----
For each testcase, print $Possible$, if she can complete all the chocolates gifted to her. Otherwise, print $Impossible$, if she can not finish all the chocolates.

-----Constraints-----
- $1 \leq T \leq 100$
- $1 \leq n \leq 1500$
- $1 \leq x \leq 1500$
- $1 \leq Ai \leq 1500$

-----Subtasks-----
- 100 points : $Original Constraints$

-----Sample Input:-----
3

3

5

4 1 2

5

2

4 4 3 2 2

5

1

4 2 3 1 1

-----Sample Output:-----
Impossible

Possible

Impossible

-----EXPLANATION:-----

Example case 1

1st and 3rd chocolate on the 1st afternoon as she can consume at most 5. one chocolate will be wasted.
$Note:$ she cannot eat the 2nd chocolate because chocolates cannot be consumed on the day of expiry.
-
Example case 2

4th and 5th chocolate on 1st afternoon, 3rd and 1st chocolate on 2nd afternoon. And 2nd chocolate on the 3rd afternoon.
It will take a total of 3 days to finish the chocolate.
-
Example case 3

She cannot eat 4th and 5th chocolate as they will expire on the very 1st day, she can eat 2nd chocolate on 1st afternoon, then 3rd chocolate on 2nd afternoon, then 1st chocolate on 3rd afternoon, and 2 chocolates 4th and 5th will expire.

输入格式

见题面

输出格式

见题面

样例输入
['3', '3', '5', '4 1 2', '5', '2', '4 4 3 2 2', '5', '1', '4 2 3 1 1']
样例输出
['Impossible', 'Possible', 'Impossible']