Hill Climb Racing

면접 대비

시간 제한1초메모리 제한2048 MB

요약
트랙 높이 배열과 차량 가속도 a가 주어질 때, 모든 오르막 구간의 상승 폭이 1미터당 a 이하인지 판정한다.
난이도

쉬움10점 중 3점

유형
구현, 배열, 완전 탐색, 시뮬레이션
정답자
아직 제출이 없습니다

문제

Hill Climb Racing is a 2D mobile game where you drive speeding cars over hilly terrain while avoiding injuring the driver or running out of gas. An ll meter long track can be modeled as a 0-indexed array hh of l+1l+1 integers where h_ih\_i is the height in pixels at the ii-th meter of the track. If the track becomes too steep for the car's acceleration, the car gets stuck on the hill and either flips over or runs out of gas.

Several of Mines' Computer Science undergraduates have been feeling nostalgic and recently began playing Hill Climb Racing again. However, they kept getting stuck on the steep hills in some tracks. Instead of upgrading their vehicles, the undergrads have decided to file bug reports for each track that they can't get over with their vehicles. After sifting through the game's code, they determined that a vehicle with acceleration value aa can ascend at most aa pixels per meter in the track. Note that a vehicle may descend any number of pixels per meter no matter its acceleration.

Your job is to write a program which, given a track, determines if it can be climbed by a vehicle with acceleration aa.

입력

The first line of input consists of 2 integers, ll and aa (1≤l,a≤1051 \leq l, a \leq 10^5)---the length in meters of the track and the acceleration value of the vehicle, respectively.

The second line of input contains l+1l + 1 space separated integers, h_0,h_1,…,h_lh\_0, h\_1, \ldots, h\_l (0≤h_i≤1050 \leq h\_i \leq 10^5)---the heights in pixels of the track.

출력

Output "BUG REPORT" (without quotes) on a single line if it is impossible to pass that track; otherwise, output "POSSIBLE".

예제3

  1. 예제 1

    입력
    4 3
    1 2 5 1 1
    
    예상 출력
    POSSIBLE
    
  2. 예제 2

    입력
    4 3
    0 3 1 5 0
    
    예상 출력
    BUG REPORT
    
  3. 예제 3

    입력
    3 100000
    0 99999 1 100000
    
    예상 출력
    POSSIBLE