#GD0000017. Phản ví dụ đổi tiền tham lam (Coin Change Counterexample)

Phản ví dụ đổi tiền tham lam (Coin Change Counterexample)

Coin Change Counterexample

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

Given nn distinct positive coin denominations including 11, and a target VV, with unlimited supply of every coin. The greedy algorithm repeatedly takes the largest coin not exceeding the remaining amount. Compute the greedy coin count and the true optimal coin count, then report whether greedy fails on this instance.

Input

The first line contains n,Vn,V. The second line contains nn distinct denominations.

Output

Line 1 prints the greedy coin count. Line 2 prints the optimal coin count. Line 3 prints FAIL if greedy uses more coins than optimal, otherwise OK.

Subtasks

General constraints:

  • 1≤n≤201 \le n \le 20.

  • 1≤V≤50001 \le V \le 5000.

  • 1≤ci≤50001 \le c_i \le 5000.

  • The cic_i are distinct and one denomination equals 11.

  • Subtask 1 (20 points): n≤6n \le 6, V≤50V \le 50

  • Subtask 2 (30 points): n≤12n \le 12, V≤500V \le 500

  • Subtask 3 (50 points): No additional constraints.

Examples

Input

3 6
1 3 4

Output

3
2
FAIL

Explanation

Greedy uses 4,1,14,1,1, so it needs 33 coins. The optimum is 3,33,3, which uses 22. Since 3>23>2, the result is FAIL.