P1067 pyramid

Title Description

Cc Cong Cong and the same table is a good relationship, one day, Sissy feel like cotton candy clouds in the sky, like, it should be good to eat, but out of reach, she was very upset.
In order to help resolve their problem Cc Cong Cong, we decided to help him off the clouds in the sky to make cotton candy for her to eat.
But Cong Cong out of reach. So he bought a \ (n \) th AI3403 super robot to help him pick sky and white clouds.
These robots can take the way of the pyramid together, stacked height is the height of these robots and, if one of us that the highest height reached the height of clouds, they can pick the cotton candy clouds to make up.
But there is one problem: Although these robots are the same model, but they make Dr. Lingling in order to show the diversity of the design of the robot so designed different height for each robot, the first \ (i \) the robot is designed to become elevated \ (H_i \) .
Obviously, the more the number of robots in Rohan folded, the more unstable the Ocean. Cong Cong hope so, subject to the clouds to allow Lohan in the number of robots as small as possible. Please help you calculate the required minimum number of Cong Cong robot.

Input Format

The first line contains two positive input \ (n (1 \ le n \ le 10000) \) and \ (B (. 1 \ Le B \ 10 Le ^. 9) \) , respectively, of the robot for later Congcong the number and height of clouds.
Next \ (n-\) lines contains an integer \ (H_i (. 1 \ Le Hi \ 10 Le ^. 5) \) , for indicating the height of the i-th robot.

Output Format

Output an integer representing the number of machines to be able to be a minimum of human white clouds; if all the robots reach clouds are stacked together, outputs "-1."

Guess you like

Origin www.cnblogs.com/problems/p/P1067.html