PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GD0000126. Ổ cắm điện (Sockets)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Ổ cắm điện (Sockets)

Sockets

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

You have kk powered wall sockets, mm devices and nn power strips. Strip ii has aia_i sockets and consumes one socket to plug in. Strips may be chained. Find the minimum number of strips needed to power all devices, or -1 if impossible.

Input

The first line has n,m,kn,m,k. The next line contains nn integers aia_i.

Output

Print the minimum number of strips, or -1.

Subtasks

  • Subtask 1 (20 points): 1≤n,m,k≤81\le n,m,k\le 8; 1≤ai≤501\le a_i\le50.
  • Subtask 2 (30 points): 1≤n,m,k≤251\le n,m,k\le 25; 1≤ai≤501\le a_i\le50.
  • Subtask 3 (50 points): 1≤n,m,k≤501\le n,m,k\le 50; 1≤ai≤501\le a_i\le50.

Examples

Input

3 5 3
3 1 2

Output

1

Explanation

Initially there are three sockets. Plugging in a strip with three outlets creates 3−1+3=53-1+3=5 usable sockets, so one strip suffices; zero strips cannot power five devices.