#C9730. Consecutive Trail Sum

    ID: 53856 Type: Default 1000ms 256MiB

Consecutive Trail Sum

Consecutive Trail Sum

You are given a list of trails, where each trail is represented by its length in meters. Your task is to determine whether it is possible to select one or more consecutive trails such that their sum is exactly equal to a given target value \(K\) meters.

For each test case, you will be given an integer \(n\) denoting the number of trails, followed by an integer \(K\) which is the target sum. The next line contains \(n\) space-separated positive integers representing trail lengths.

If there exists a consecutive segment whose sum equals \(K\), output POSSIBLE; otherwise, output IMPOSSIBLE.

Example:

Input:
1
5 15
1 2 3 4 5

Output: POSSIBLE

</p>

inputFormat

The first line of the input contains an integer \(T\) representing the number of test cases. Then for each test case:

  • The first line contains two integers \(n\) and \(K\) where \(n\) is the number of trails and \(K\) is the target sum.
  • The second line contains \(n\) space-separated integers representing the lengths of the trails.

It is guaranteed that all the trail lengths are positive integers.

outputFormat

For each test case, output a single line containing either POSSIBLE if there exists one or more consecutive trails with a total length equal to \(K\), or IMPOSSIBLE otherwise.

## sample
1
5 15
1 2 3 4 5
POSSIBLE

</p>