1512Cross the River

1512   Cross the River

题目描述

  CC’s mom is sick badly. Someone told CC, there are excellent herbs at somewhere in the world, which can cure any disease. After Hong eighty-one hardships, CC find the herbs. The last thing CC need to do is cross the river and get the herbs.

  There is N rocks in the river in a straight line. The distance of ith (1<=i<=n) rock to CC is ai, and the distance of herbs to CC is L. Every time ,CC can jump to a rock not father than J.

  Your task is to answer if CC can get the herbs.

输入格式:

There is a T at the beginning of file, show that there is T case follow.

  For every test case, the first line contain three integers N,L,J.

  The second line contain N integers, the ith integer represent the distance from the ith rock to where CC stand.

0<=N<=1000,1<=L<=1e9,1<=J<=1e9,1<=a[i]<L

  You can assure there are none two rock which have same location.

输出格式:

 For every case, first output "Case #x: " , x mean the number of case.

  If CC can get the herbs, output “Yes”, otherwise output “No”.(without quote)

  See sample for detail.

输入样例 复制
2
1 10 5
5
2 10 5
1 7
输出样例 复制
Case #1: Yes
Case #2: No

说明

33
158
通过提交
时空限制1000ms/64mb
题目来源
评测方式在线评测
题目类型基础入门
难        度