#CCBCHBAHAI0000167. Vòng tiếp theo (Next Round)
Vòng tiếp theo (Next Round)
Next Round
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem
contestants have scores in non-increasing order: . A contestant advances iff the score is positive and at least the score of the contestant in place .
With threshold , count the indices satisfying and .
Input
- Line 1: integers .
- Line 2: scores.
Output
Print the number of advancing contestants.
Subtask
Subtask 1 (100 points): ; ; .
Example
Input
8 5
10 9 8 7 7 7 5 5
Output
6
Explanation
The threshold is ; the first six positive scores are at least .