Airport

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

In EGOI Airport, there are NN runways, numbered from 11 to NN. In this airport, for an airplane, it takes KK minutes to take off, and LL minutes to land. During a takeoff or landing of an airplane, a runway is occupied by the airplane for a duration of KK or LL minutes.

JOI-kun is working at EGOI Airport. His job is to arrange the schedule of takeoffs and landings for a contiguous time slot of TT minutes. The beginning of the time slot is time 00. The time when tt minutes passed after the beginning of the time slot is time tt. The end of the time slot is time TT.

In the time slot, MM airplanes will arrive at EGOI Airport. They are numbered from 11 to MM. The (1iM1 ≤ i ≤ M) will start landing at time A_iA\_i. But the runway used by airplane ii is not yet fixed. It will be fixed by JOI-kun. The schedule for the takeoffs is not fixed at all. JOI-kun will decide the number of airplanes which will take off, the time of a takeoff of each airplane, and the runway used by it.

In summary, the schedule has to obey the following rules.

  • It is not allowed that more than one airplane take off or land at the same time in the same runway. However, it is allowed that an airplane starts taking off or landing, just after another airplane finished taking off or landing in the same runway.
  • All takeoffs and landings should be finished in the time slot of TT minutes. Namely, it is not allowed for an airplane to start taking off or landing before time 00. It is not allowed for an airplane to finish taking off or landing after time TT.

JOI-kun wants to arrange the schedule so that it obeys the above rules, and the number of airplanes which will take off is maximized.

Write a program which, given the number of runways, the number of airplanes which will land, the length of the time slot, the time required for a takeoff, the time required for a landing, and the time when each airplane will start landing, calculates the maximum possible number of airplanes which will take off from EGOI Airport. If it is not possible to arrange the schedule so that it obeys the rules, your program should report it.

입력

Read the following data from the standard input. Given values are all integers.

NN MM TT KK LL

A_1A\_1 A_2A\_2 \cdots A_MA\_M

출력

Write one line to the standard output. The output should contain the maximum possible number of airplanes which will take off from EGOI Airport. If it is not possible to arrange the schedule so that it obeys the rules, output -1.

제한

  • 1N100,0001 ≤ N ≤ 100\\,000.
  • 1M100,0001 ≤ M ≤ 100\\,000.
  • 1T1,000,000,000(=109)1 ≤ T ≤ 1\\,000\\,000\\,000 (= 10^9).
  • 1KT1 ≤ K ≤ T.
  • 1LT1 ≤ L ≤ T.
  • 0A_iTL0 ≤ A\_i ≤ T - L (1iM1 ≤ i ≤ M).