아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Garden

시간 제한2초메모리 제한512 MB

요약
원래 순서를 유지하며 높이가 엄격히 증가하고 볼록한 k개의 식물을 고른다. 임의의 두 선택 식물을 잇는 선분이 사이의 모든 점보다 위에 있어야 하며, 불가능하면 NO를 출력한다.
난이도

보통10점 중 7점

유형
동적 계획법, 기하, 이분 탐색, 그리디
정답자
아직 제출이 없습니다

문제

Farmer Smurf is competing in a contest for most smurfiest garden.  He already bought some plants which he put in a row. Each flower has some height measured in centimeters.  Farmer wants to choose some subsequence of plants that he can put into evenly spaced holes (without changing order) so that all plants are visible from the front (each next plant is strictly higher than previous one).  Since this year is the year of parabolas the contest judges require that the flowers form a convex function (after putting plants into evenly spaced holes each segment connecting the highest points of two plants is strictly above all the plants between them). Help farmer choose plants that fulfill these criteria.

입력

First line of input contains two integers nn and kk (1≤k≤n≤20,0001 \leq k \leq n \leq 20\\,000, 1≤k≤1001 \leq k \leq 100). nn is the number of plants, kk is the number of plants that Farmer wants to choose. Second line of input contains nn integers h_ih\_i (1≤h_i≤7⋅1081 \leq h\_i \leq 7 \cdot 10^8).  h_ih\_i is the height of iith plant bought by Farmer.

출력

On a single line output kk integers a_ia\_i (1≤a_i≤n1 \leq a\_i \leq n) specifying the numbers of plants that Farmer should choose. Don't forget that the plants must be in original order (a_i<a_i+1a\_i < a\_{i+1}). If it is not possible to choose kk plants satisfying all criteria then on a single line output "NO" (without quotes).

예제1

  1. 예제 1

    입력
    6 3
    4 6 5 1 2 4
    
    예상 출력
    4 5 6